diff --git a/README.md b/README.md index 00ddae15..24f53827 100644 --- a/README.md +++ b/README.md @@ -1,190 +1,125 @@ -
- -
+![](https://images-machen.oss-cn-beijing.aliyuncs.com/hippo4j-logo-logoly.png) -

- :fire:   动态线程池(DTP)系统,包含 Server 端及 SpringBoot Client 端需引入的 Starter. -

-

- - - - - - - - - - - +

+ + GitHub + + LICENSE - - - - - - - - - - + + + +

-
- -## 为什么写这个项目? - -[美团线程池文章](https://tech.meituan.com/2020/04/02/java-pooling-pratice-in-meituan.html "美团线程池文章") 介绍中,因为业务对线程池参数没有合理配置,触发过几起生产事故,进而引发了一系列思考。最终决定封装线程池动态参数调整,扩展线程池监控以及消息报警等功能 - -在开源平台找了挺多动态线程池项目,从功能性以及健壮性而言,个人感觉不满足企业级应用 +## Hippo4J -因为对动态线程池比较感兴趣,加上想写一个有意义的项目,所以决定自己来造一个轻量级的轮子 +Hippo4J 基于 **美团动态线程池** 设计理念开发,针对线程池增强 **动态调参、监控、报警功能**。 -想给项目起一个简单易记的名字,类似于 Eureka、Nacos、Redis;后和朋友商量,决定以动物命名:**Hippo** +通过 Web 控制台对线程池参数进行动态调整,支持 **集群内线程池的差异化配置**。内置线程池参数变更通知,以及 **运行过载报警** 功能(支持多通知平台)。 -![](https://user-images.githubusercontent.com/77398366/139575361-87a0a1b5-716a-4c98-b467-f8f130d30163.png) +按照租户、项目、线程池的维度划分,配合系统权限,让不同的开发、管理人员负责自己系统的线程池。 -
+自 1.1.0 版本发布后,Hippo4J 分为两种使用模式,用一张图来说明两者的使用差别。 -## 它解决了什么问题? +![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20220319154626314.png) -线程池在业务系统应该都有使用到,帮助业务流程提升效率以及管理线程,多数场景应用于大量的异步任务处理 +### hippo4j-core -虽然线程池提供了我们许多便利,但也并非尽善尽美,比如下面这些问题就无法很好解决 +**轻量级动态线程池管理**,依赖 Apollo、Nacos 等三方配置中心(任选其一)完成线程池参数动态变更,同样包含运行时报警、监控功能。 -![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20211023160830084.png) +> 监控功能配置详见:[线程池监控](https://hippox.cn/pages/2f67ll) -
+![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-202203271737049821.png) -如果线程池的配置涉及到上述问题,那么就有可能需要发布业务系统来解决;如果发布后参数仍不合理,继续发布...... +### hippo4j-server -Hippo 很好解决了这个问题,它将业务中所有线程池统一管理,遇到上述问题不需要发布系统就可以替换线程池参数 +**部署 hippo4j-server 服务**,通过可视化 Web 界面完成线程池的创建、变更以及查看,不依赖三方中间件。 -![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20211023142726818.png) +相比较 hippo4j-core,功能会更强大,但是也引入了一定的复杂性。需要部署一个 Java 服务,以及 MySQL 数据库。 -
-## 它有什么特性? +### 使用总结 -应用系统中线程池并不容易管理。参考美团的设计,Hippo 按照租户、项目、线程池的维度划分。再加上系统权限,让不同的开发、管理人员负责自己系统的线程池操作 +| | hippo4j-core | hippo4j-server | +| ---- | ---------------------------------------------------- | ------------------------------------------------------------ | +| 依赖 | Nacos、Apollo 等配置中心(任选其一) | 部署 Hippo4J Server(内部无依赖中间件) | +| 使用 | 配置中心补充线程池相关参数 | Hippo4J Server Web 控制台添加线程池记录 | +| 功能 | 包含基础功能:参数动态化、运行时监控、报警等 | 基础功能之外扩展控制台界面、线程池堆栈查看、线程池运行信息实时查看、历史运行信息查看、线程池配置集群个性化等 | -举个例子,小编在一家公司的公共组件团队,团队中负责消息、短链接网关等项目。公共组件是租户,消息或短链接就是项目 +使用建议:根据公司情况选择,如果基本功能可以满足使用,选择 hippo4j-core 使用即可;如果希望更多的功能,可以选择 hippo4j-server。 -
+**两者在进行替换的时候,无需修改业务代码**。 -| 模块 | 模块名称 | 注释 | -| -------------------------------------- | ------------------ | ---------------------------------------- | -| dynamic-threadpool-auth | 用户权限 | - | -| dynamic-threadpool-common | 公共模块 | - | -| dynamic-threadpool-config | 配置中心 | 提供线程池准实时更新功能 | -| dynamic-threadpool-console | 控制台 | 对接前端项目 | -| dynamic-threadpool-discovery | 注册中心 | 提供线程池项目实例注册、续约、下线等功能 | -| dynamic-threadpool-spring-boot-starter | SpringBoot Starter | - | -| dynamic-threadpool-example | 示例项目 | - | -| dynamic-threadpool-server | 服务端 | Server 集成各组件 | -| dynamic-threadpool-tools | 抽象工具类 | GitHub 变更监控、操作日志等组件 | -
+## 解决什么问题 -Hippo 除去动态修改线程池,还包含实时查看线程池运行时指标、负载报警、配置日志管理等 +简单来说,Hippo4J 主要为我们解决了下面这些使用原生线程池存在的问题: +- **原生线程池创建时无法合理评估参数问题**。比如功能使用到线程池,遇到突发流量洪峰,频繁拒绝任务。Hippo4J 提供动态修改参数功能,**避免修改线程池参数后重启线上应用**; +- 当线程池运行过程中无法再接受新的任务,此时你想知道 **线程池内线程都在做什么**?Hippo4J 提供查看线程池堆栈功能; +- 某接口频繁超时,内部依赖线程池执行,想要 **查看过去一段时间线程池运行参数情况**。Hippo4J 提供历史数据图表查看功能; +- **原生线程池无任务报警策略**。Hippo4J 内置四种报警策略,分别是:活跃度报警、队列容量报警、拒绝策略报警和运行时间过长报警。 -![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20211023101844619.png) +## 报警通知 -
- -## 如何运行 Demo? - -目前动态线程池功能已经完成,可以直接把代码拉到本地运行。导入 [Hippo 初始化 SQL 语句](https://github.com/acmenlt/dynamic-threadpool/blob/develop/server/src/main/resources/hippo_manager.sql) - -1. 启动 `dynamic-threadpool-server` 模块下 ServerApplication 应用类 -2. 启动 `dynamic-threadpool-example` 模块下 ExampleApplication 应用类 - -
- -通过接口修改线程池中的配置。HTTP POST 路径:http://localhost:6691/v1/cs/configs ,Body 请求体如下: - -```json -{ - "ignore": "tenantId、itemId、tpId 代表唯一线程池,请不要修改", - "tenantId": "prescription", - "itemId": "dynamic-threadpool-example", - "tpId": "message-produce", - "coreSize": 10, - "maxSize": 15, - "queueType": 9, - "capacity": 100, - "keepAliveTime": 10, - "rejectedType": 3, - "isAlarm": 0, - "capacityAlarm": 81, - "livenessAlarm": 82 -} -``` - -
- -接口调用成功后,观察 dynamic-threadpool-example 控制台日志输出,日志输出包括不限于此信息即为成功 - -```tex -[🔥 MESSAGE-PRODUCE] Changed thread pool. coreSize :: [11=>10], maxSize :: [15=>15], queueType :: [9=>9] -capacity :: [100=>100], keepAliveTime :: [10000=>10000], rejectedType :: [7=>7] -``` - -
- -现阶段已集成钉钉消息推送,后续会持续接入企业微信、邮箱、飞书、短信等通知渠道。可以通过添加钉钉群体验消息推送,群号:31764717 +Hippo4J 已接入钉钉、企业微信以及飞书平台,提供了 **线程池参数变更通知** 和 **运行时报警** 功能。示例如下: - -
+ -
+
配置变更

+ -
+
报警通知

-
+## 快速开始 -项目代码功能还在持续开发,初定发布 1.0.0 RELEASE 完成以下功能。部署了 Server 服务,只需要引入 Starter 组件到业务系统中,即可完成动态修改、监控、报警等特性 +[运行 Hippo4J 自带 Demo 参考文档](https://hippox.cn/pages/793dcb/) -
+[在线体验地址](http://console.hippox.cn:6691/index.html) 用户名密码:hippo4j / hippo4j -## 查看源码能收获什么? +## 联系我 -目前还没有发布 Release 版本,小伙伴可以阅读框架源码,查看框架中好的设计理念或者编码技巧 +对于这个项目,是否有什么不一样看法,同 [作者](https://hippox.cn/pages/dd137d/) 或者创建 [Issues](https://github.com/acmenlt/dynamic-threadpool/issues) 沟通。 -在项目开发过程中,借鉴了 Nacos、Eureka、Seata、ShardingSphere 等中间件项目的优雅设计 -![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20211023143632685.png) +## 公众号 -
+如果大家想要实时关注 Hippo4J 最新动态以及干货分享的话,可以关注我的公众号。 +![](https://images-machen.oss-cn-beijing.aliyuncs.com/43_65f6020ed111b6bb3808ec338576bd6b.png) -## Github Stars 趋势 +## Stars 趋势 -如果小伙伴查看源码设计有所收获,辛苦点个 🚀 Star ,方便后续查看 +[![Stargazers over time](https://starchart.cc/acmenlt/dynamic-threadpool.svg)](https://starchart.cc/acmenlt/dynamic-threadpool) -[![Stargazers over time](https://starchart.cc/acmenlt/dynamic-threadpool.svg)](https://starchart.cc/acmenlt/dynamic-threadpool) -
+## 友情链接 +- [**JavaGuide**](https://github.com/Snailclimb/JavaGuide):「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,首选 JavaGuide! +- [**Guide-Rpc-Framework**](https://github.com/Snailclimb/guide-rpc-framework):A custom RPC framework implemented by Netty+Kyro+Zookeeper.(一款基于 Netty+Kyro+Zookeeper 实现的自定义 RPC 框架-附详细实现过程和相关教程。) +- [**toBeBetterJavaer**](https://github.com/itwanger/toBeBetterJavaer):Java 程序员进阶之路,据说每一个优秀的 Java 程序员都喜欢她,风趣幽默、通俗易懂。内容包括 Java 基础、Java 并发编程、Java 虚拟机、Java 企业级开发、Java 面试等核心知识点 +- [**Austin**](https://github.com/ZhongFuCheng3y/austin):消息推送平台📝 推送下发【邮件】【短信】【微信服务号】【微信小程序】等消息类型。所使用的技术栈包括:SpringBoot、SpringDataJPA、MySQL、Docker、docker-compose、Kafka、Redis、Apollo、prometheus、Grafana、GrayLog、Flink、Xxl-job、Echarts等等 -## 最后 +## 鸣谢 -小编是个有代码洁癖的程序员,项目中的代码开发完全遵守阿里巴巴代码规约,也推荐大家使用,培养好的编码习惯 -对于这个项目,是否有什么不一样看法,欢迎在 Issue 一起沟通交流;或者添加小编微信进交流群 +Hippo4J 项目基于或参考以下项目:[**Nacos**](https://github.com/alibaba/nacos)、[**Eureka**](https://github.com/Netflix/Eureka)、[**Mzt-Biz-Log**](https://github.com/mouzt/mzt-biz-log)、[**Equator**](https://github.com/dadiyang/equator)。 +感谢 JetBrains 提供的免费开源 License: -![](https://user-images.githubusercontent.com/77398366/138920260-e9dd1268-797f-4d42-9abb-62353d08ea6a.png) +

+ 图片引用自lets-mica +

diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/UserServiceImpl.java b/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/UserServiceImpl.java deleted file mode 100644 index dd35567a..00000000 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/UserServiceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.github.dynamic.threadpool.auth.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.crypto.SecureUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.github.dynamic.threadpool.auth.mapper.UserMapper; -import com.github.dynamic.threadpool.auth.model.UserInfo; -import com.github.dynamic.threadpool.auth.model.biz.user.UserQueryPageReqDTO; -import com.github.dynamic.threadpool.auth.model.biz.user.UserRespDTO; -import com.github.dynamic.threadpool.auth.service.UserService; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * User service impl. - * - * @author chen.ma - * @date 2021/10/30 21:40 - */ -@Service -@AllArgsConstructor -public class UserServiceImpl implements UserService { - - private final UserMapper userMapper; - - @Override - public IPage listUser(int pageNo, int pageSize) { - UserQueryPageReqDTO queryPage = new UserQueryPageReqDTO(pageNo, pageSize); - IPage selectPage = userMapper.selectPage(queryPage, null); - - return selectPage.convert(each -> BeanUtil.toBean(each, UserRespDTO.class)); - } - - @Override - public void addUser(String userName, String password) { - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(UserInfo.class) - .eq(UserInfo::getUserName, userName); - UserInfo existUserInfo = userMapper.selectOne(queryWrapper); - if (existUserInfo != null) { - throw new RuntimeException("用户名重复"); - } - - UserInfo insertUser = new UserInfo(); - insertUser.setUserName(userName); - // TODO 暂定为 Md5 加密 - insertUser.setPassword(SecureUtil.md5(password)); - userMapper.insert(insertUser); - } - - @Override - public void updateUser(String userName, String password) { - UserInfo userInfo = new UserInfo(); - userInfo.setUserName(userName); - userInfo.setPassword(SecureUtil.md5(password)); - - LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(UserInfo.class) - .eq(UserInfo::getUserName, userName); - userMapper.update(userInfo, updateWrapper); - } - - @Override - public void deleteUser(String userName) { - LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(UserInfo.class) - .eq(UserInfo::getUserName, userName); - userMapper.delete(updateWrapper); - } - - @Override - public List getUserLikeUsername(String userName) { - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(UserInfo.class) - .like(UserInfo::getUserName, userName) - .select(UserInfo::getUserName); - - List userInfos = userMapper.selectList(queryWrapper); - List userNames = userInfos.stream().map(UserInfo::getUserName).collect(Collectors.toList()); - - return userNames; - } - -} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/GroupKey.java b/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/GroupKey.java deleted file mode 100644 index 53f21d47..00000000 --- a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/GroupKey.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.github.dynamic.threadpool.common.toolkit; - -import org.springframework.util.StringUtils; - -/** - * Group key. - * - * @author chen.ma - * @date 2021/6/24 21:12 - */ -public class GroupKey { - - public static String getKey(String dataId, String group) { - return getKey(dataId, group, ""); - } - - public static String getKey(String dataId, String group, String datumStr) { - return doGetKey(dataId, group, datumStr); - } - - public static String getKeyTenant(String dataId, String group, String tenant) { - return doGetKey(dataId, group, tenant); - } - - private static String doGetKey(String dataId, String group, String datumStr) { - StringBuilder sb = new StringBuilder(); - urlEncode(dataId, sb); - sb.append('+'); - urlEncode(group, sb); - if (!StringUtils.isEmpty(datumStr)) { - sb.append('+'); - urlEncode(datumStr, sb); - } - - return sb.toString(); - } - - public static String[] parseKey(String groupKey) { - StringBuilder sb = new StringBuilder(); - String dataId = null; - String group = null; - String tenant = null; - - for (int i = 0; i < groupKey.length(); ++i) { - char c = groupKey.charAt(i); - if ('+' == c) { - if (null == dataId) { - dataId = sb.toString(); - sb.setLength(0); - } else if (null == group) { - group = sb.toString(); - sb.setLength(0); - } else { - throw new IllegalArgumentException("invalid groupkey:" + groupKey); - } - } else if ('%' == c) { - char next = groupKey.charAt(++i); - char nextnext = groupKey.charAt(++i); - if ('2' == next && 'B' == nextnext) { - sb.append('+'); - } else if ('2' == next && '5' == nextnext) { - sb.append('%'); - } else { - throw new IllegalArgumentException("invalid groupkey:" + groupKey); - } - } else { - sb.append(c); - } - } - - if (StringUtils.isEmpty(group)) { - group = sb.toString(); - if (group.length() == 0) { - throw new IllegalArgumentException("invalid groupkey:" + groupKey); - } - } else { - tenant = sb.toString(); - if (group.length() == 0) { - throw new IllegalArgumentException("invalid groupkey:" + groupKey); - } - } - - return new String[]{dataId, group, tenant}; - } - - public static void urlEncode(String str, StringBuilder sb) { - for (int idx = 0; idx < str.length(); ++idx) { - char c = str.charAt(idx); - if ('+' == c) { - sb.append("%2B"); - } else if ('%' == c) { - sb.append("%25"); - } else { - sb.append(c); - } - } - } - -} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/web/base/Results.java b/common/src/main/java/com/github/dynamic/threadpool/common/web/base/Results.java deleted file mode 100644 index 8191cb5f..00000000 --- a/common/src/main/java/com/github/dynamic/threadpool/common/web/base/Results.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.github.dynamic.threadpool.common.web.base; - -import com.github.dynamic.threadpool.common.web.exception.ErrorCodeEnum; -import com.github.dynamic.threadpool.common.web.exception.ServiceException; - -/** - * Results. - * - * @author chen.ma - * @date 2021/3/19 16:12 - */ -public final class Results { - - public static Result success() { - return new Result() - .setCode(Result.SUCCESS_CODE); - } - - public static Result success(T data) { - return new Result() - .setCode(Result.SUCCESS_CODE) - .setData(data); - } - - public static Result failure(ServiceException serviceException) { - return new Result().setCode(ErrorCodeEnum.SERVICE_ERROR.getCode()) - .setMessage(serviceException.getMessage()); - } - - public static Result failure(String code, String message) { - return new Result() - .setCode(code) - .setMessage(message); - } - - public static Result failure(ErrorCodeEnum errorCode) { - return new Result() - .setCode(errorCode.getCode()) - .setMessage(errorCode.getMessage()); - } - -} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/web/exception/ServiceException.java b/common/src/main/java/com/github/dynamic/threadpool/common/web/exception/ServiceException.java deleted file mode 100644 index 7d0e07dc..00000000 --- a/common/src/main/java/com/github/dynamic/threadpool/common/web/exception/ServiceException.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.github.dynamic.threadpool.common.web.exception; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * Service exception. - * - * @author chen.ma - * @date 2021/3/19 16:14 - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class ServiceException extends RuntimeException { - - private static final long serialVersionUID = -8667394300356618037L; - - private String detail; - - public ServiceException(String message) { - super(message); - } - - public ServiceException(String message, String detail) { - super(message); - this.detail = detail; - } - - public ServiceException(String message, Throwable cause) { - super(message, cause); - this.detail = cause.getMessage(); - } - - public ServiceException(String message, String detail, Throwable cause) { - super(message, cause); - this.detail = detail; - } - - @Override - public String toString() { - return "ServiceException{" + - "message='" + getMessage() + "'," + - "detail='" + getDetail() + "'" + - '}'; - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/config/CommonConfig.java b/config/src/main/java/com/github/dynamic/threadpool/config/config/CommonConfig.java deleted file mode 100644 index 734e67bf..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/config/CommonConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.dynamic.threadpool.config.config; - -import com.github.dynamic.threadpool.common.config.ApplicationContextHolder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * Common config. - * - * @author chen.ma - * @date 2021/7/19 21:03 - */ -@Configuration -public class CommonConfig { - - @Bean - public ApplicationContextHolder simpleApplicationContextHolder() { - return new ApplicationContextHolder(); - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/event/LocalDataChangeEvent.java b/config/src/main/java/com/github/dynamic/threadpool/config/event/LocalDataChangeEvent.java deleted file mode 100644 index de778a02..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/event/LocalDataChangeEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.github.dynamic.threadpool.config.event; - -/** - * Local data change event. - * - * @author chen.ma - * @date 2021/6/23 19:13 - */ -public class LocalDataChangeEvent extends Event { - - public final String groupKey; - - public LocalDataChangeEvent(String groupKey) { - this.groupKey = groupKey; - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/notify/DefaultSharePublisher.java b/config/src/main/java/com/github/dynamic/threadpool/config/notify/DefaultSharePublisher.java deleted file mode 100644 index f641852c..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/notify/DefaultSharePublisher.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.github.dynamic.threadpool.config.notify; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.github.dynamic.threadpool.config.notify.listener.Subscriber; -import com.github.dynamic.threadpool.config.event.Event; -import com.github.dynamic.threadpool.config.event.SlowEvent; - -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -/** - * Default share publisher. - * - * @author chen.ma - * @date 2021/6/23 19:05 - */ -public class DefaultSharePublisher extends DefaultPublisher { - - private final Map, Set> subMappings = new ConcurrentHashMap(); - - protected final ConcurrentHashSet subscribers = new ConcurrentHashSet(); - - private final Lock lock = new ReentrantLock(); - - public void addSubscriber(Subscriber subscriber, Class subscribeType) { - Class subSlowEventType = (Class) subscribeType; - subscribers.add(subscriber); - - lock.lock(); - try { - Set sets = subMappings.get(subSlowEventType); - if (sets == null) { - Set newSet = new ConcurrentHashSet(); - newSet.add(subscriber); - subMappings.put(subSlowEventType, newSet); - return; - } - sets.add(subscriber); - } finally { - lock.unlock(); - } - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/notify/listener/SmartSubscriber.java b/config/src/main/java/com/github/dynamic/threadpool/config/notify/listener/SmartSubscriber.java deleted file mode 100644 index 9d6483a9..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/notify/listener/SmartSubscriber.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.dynamic.threadpool.config.notify.listener; - -import com.github.dynamic.threadpool.config.event.Event; - -import java.util.List; - -/** - * Subscribers to multiple events can be listened to. - * - * @author chen.ma - * @date 2021/6/23 19:02 - */ -public abstract class SmartSubscriber extends Subscriber { - - /** - * Subscribe types. - * - * @return - */ - public abstract List> subscribeTypes(); - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigCacheService.java b/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigCacheService.java deleted file mode 100644 index ca17b838..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigCacheService.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.github.dynamic.threadpool.config.service; - -import com.github.dynamic.threadpool.config.service.biz.ConfigService; -import com.github.dynamic.threadpool.common.config.ApplicationContextHolder; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.toolkit.Md5Util; -import com.github.dynamic.threadpool.config.event.LocalDataChangeEvent; -import com.github.dynamic.threadpool.config.model.CacheItem; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; -import com.github.dynamic.threadpool.config.notify.NotifyCenter; -import org.springframework.util.StringUtils; - -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Config cache service. - * - * @author chen.ma - * @date 2021/6/24 21:19 - */ -public class ConfigCacheService { - - static ConfigService configService = null; - - private static final ConcurrentHashMap CACHE = new ConcurrentHashMap(); - - public static boolean isUpdateData(String groupKey, String md5, String ip) { - String contentMd5 = ConfigCacheService.getContentMd5IsNullPut(groupKey, ip); - return Objects.equals(contentMd5, md5); - } - - /** - * Get Md5. - * TODO:Add IP, different IP thread pool rewrite - * TODO:groupKey && Md5 Cache - * - * @param groupKey - * @param ip - * @return - */ - private static String getContentMd5IsNullPut(String groupKey, String ip) { - CacheItem cacheItem = CACHE.get(groupKey); - if (cacheItem != null) { - return cacheItem.md5; - } - - if (configService == null) { - configService = ApplicationContextHolder.getBean(ConfigService.class); - } - String[] split = groupKey.split("\\+"); - - ConfigAllInfo config = configService.findConfigAllInfo(split[0], split[1], split[2]); - if (config != null && !StringUtils.isEmpty(config.getTpId())) { - String md5 = Md5Util.getTpContentMd5(config); - cacheItem = new CacheItem(groupKey, md5); - CACHE.put(groupKey, cacheItem); - } - return (cacheItem != null) ? cacheItem.md5 : Constants.NULL; - } - - public static String getContentMd5(String groupKey) { - if (configService == null) { - configService = ApplicationContextHolder.getBean(ConfigService.class); - } - - String[] split = groupKey.split("\\+"); - ConfigAllInfo config = configService.findConfigAllInfo(split[0], split[1], split[2]); - if (config == null || StringUtils.isEmpty(config.getTpId())) { - String errorMessage = String.format("config is null. tpId :: %s, itemId :: %s, tenantId :: %s", split[0], split[1], split[2]); - throw new RuntimeException(errorMessage); - } - - return Md5Util.getTpContentMd5(config); - } - - public static void updateMd5(String groupKey, String md5, long lastModifiedTs) { - CacheItem cache = makeSure(groupKey); - if (cache.md5 == null || !cache.md5.equals(md5)) { - cache.md5 = md5; - cache.lastModifiedTs = lastModifiedTs; - NotifyCenter.publishEvent(new LocalDataChangeEvent(groupKey)); - } - } - - static CacheItem makeSure(final String groupKey) { - CacheItem item = CACHE.get(groupKey); - if (null != item) { - return item; - } - CacheItem tmp = new CacheItem(groupKey); - item = CACHE.putIfAbsent(groupKey, tmp); - return (null == item) ? tmp : item; - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigServletInner.java b/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigServletInner.java deleted file mode 100644 index f4748b2e..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigServletInner.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.github.dynamic.threadpool.config.service; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Map; - -/** - * Config servlet inner. - * - * @author chen.ma - * @date 2021/6/22 23:13 - */ -@Service -public class ConfigServletInner { - - @Autowired - private LongPollingService longPollingService; - - public String doPollingConfig(HttpServletRequest request, HttpServletResponse response, Map clientMd5Map, int probeRequestSize) { - if (LongPollingService.isSupportLongPolling(request)) { - longPollingService.addLongPollingClient(request, response, clientMd5Map, probeRequestSize); - return HttpServletResponse.SC_OK + ""; - } - return HttpServletResponse.SC_OK + ""; - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ConfigServiceImpl.java b/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ConfigServiceImpl.java deleted file mode 100644 index 3812493e..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ConfigServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.github.dynamic.threadpool.config.service.biz.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; -import com.github.dynamic.threadpool.common.toolkit.ContentUtil; -import com.github.dynamic.threadpool.common.toolkit.Md5Util; -import com.github.dynamic.threadpool.config.event.LocalDataChangeEvent; -import com.github.dynamic.threadpool.config.mapper.ConfigInfoMapper; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; -import com.github.dynamic.threadpool.config.service.ConfigChangePublisher; -import com.github.dynamic.threadpool.config.service.biz.ConfigService; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -/** - * Config service impl. - * - * @author chen.ma - * @date 2021/6/20 15:21 - */ -@Slf4j -@Service -@AllArgsConstructor -public class ConfigServiceImpl implements ConfigService { - - private final ConfigInfoMapper configInfoMapper; - - @Override - public ConfigAllInfo findConfigAllInfo(String tpId, String itemId, String tenantId) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) - .eq(!StringUtils.isBlank(tpId), ConfigAllInfo::getTpId, tpId) - .eq(!StringUtils.isBlank(itemId), ConfigAllInfo::getItemId, itemId) - .eq(!StringUtils.isBlank(tenantId), ConfigAllInfo::getTenantId, tenantId); - ConfigAllInfo configAllInfo = configInfoMapper.selectOne(wrapper); - return configAllInfo; - } - - @Override - public void insertOrUpdate(ConfigAllInfo configAllInfo) { - try { - addConfigInfo(configAllInfo); - } catch (Exception ex) { - updateConfigInfo(configAllInfo); - } - - ConfigChangePublisher.notifyConfigChange(new LocalDataChangeEvent(ContentUtil.getGroupKey(configAllInfo))); - } - - private Integer addConfigInfo(ConfigAllInfo config) { - config.setContent(ContentUtil.getPoolContent(config)); - config.setMd5(Md5Util.getTpContentMd5(config)); - try { - if (SqlHelper.retBool(configInfoMapper.insert(config))) { - return config.getId(); - } - } catch (Exception ex) { - log.error("[db-error] message :: {}", ex.getMessage(), ex); - throw ex; - } - return null; - } - - private void updateConfigInfo(ConfigAllInfo config) { - LambdaUpdateWrapper wrapper = Wrappers.lambdaUpdate(ConfigAllInfo.class) - .eq(ConfigAllInfo::getTpId, config.getTpId()) - .eq(ConfigAllInfo::getItemId, config.getItemId()) - .eq(ConfigAllInfo::getTenantId, config.getTenantId()); - - config.setGmtCreate(null); - config.setContent(ContentUtil.getPoolContent(config)); - config.setMd5(Md5Util.getTpContentMd5(config)); - - try { - configInfoMapper.update(config, wrapper); - } catch (Exception ex) { - log.error("[db-error] message :: {}", ex.getMessage(), ex); - throw ex; - } - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ThreadPoolServiceImpl.java b/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ThreadPoolServiceImpl.java deleted file mode 100644 index 77fc5548..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ThreadPoolServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.github.dynamic.threadpool.config.service.biz.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.github.dynamic.threadpool.config.enums.DelEnum; -import com.github.dynamic.threadpool.config.mapper.ConfigInfoMapper; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolRespDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO; -import com.github.dynamic.threadpool.config.service.biz.ConfigService; -import com.github.dynamic.threadpool.config.service.biz.ThreadPoolService; -import com.github.dynamic.threadpool.config.toolkit.BeanUtil; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Thread pool service impl. - * - * @author chen.ma - * @date 2021/6/30 21:26 - */ -@Service -@AllArgsConstructor -public class ThreadPoolServiceImpl implements ThreadPoolService { - - private final ConfigService configService; - - private final ConfigInfoMapper configInfoMapper; - - @Override - public IPage queryThreadPoolPage(ThreadPoolQueryReqDTO reqDTO) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) - .eq(!StringUtils.isBlank(reqDTO.getTenantId()), ConfigAllInfo::getTenantId, reqDTO.getTenantId()) - .eq(!StringUtils.isBlank(reqDTO.getItemId()), ConfigAllInfo::getItemId, reqDTO.getItemId()) - .eq(!StringUtils.isBlank(reqDTO.getTpId()), ConfigAllInfo::getTpId, reqDTO.getTpId()) - .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL); - return configInfoMapper.selectPage(reqDTO, wrapper).convert(each -> BeanUtil.convert(each, ThreadPoolRespDTO.class)); - } - - @Override - public ThreadPoolRespDTO getThreadPool(ThreadPoolQueryReqDTO reqDTO) { - ConfigAllInfo configAllInfo = configService.findConfigAllInfo(reqDTO.getTpId(), reqDTO.getItemId(), reqDTO.getTenantId()); - return BeanUtil.convert(configAllInfo, ThreadPoolRespDTO.class); - } - - @Override - public List getThreadPoolByItemId(String itemId) { - List selectList = configInfoMapper - .selectList(Wrappers.lambdaUpdate(ConfigAllInfo.class).eq(ConfigAllInfo::getItemId, itemId)); - return BeanUtil.convert(selectList, ThreadPoolRespDTO.class); - } - - @Override - public void saveOrUpdateThreadPoolConfig(ThreadPoolSaveOrUpdateReqDTO reqDTO) { - configService.insertOrUpdate(BeanUtil.convert(reqDTO, ConfigAllInfo.class)); - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/MapUtil.java b/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/MapUtil.java deleted file mode 100644 index 0a2ee3b0..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/MapUtil.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.github.dynamic.threadpool.config.toolkit; - -import java.util.Map; -import java.util.Objects; -import java.util.function.BiFunction; - -/** - * Map util. - * - * @author chen.ma - * @date 2021/6/23 19:09 - */ -public class MapUtil { - - public static Object computeIfAbsent(Map target, Object key, BiFunction mappingFunction, Object param1, Object param2) { - Objects.requireNonNull(target, "target"); - Objects.requireNonNull(key, "key"); - Objects.requireNonNull(mappingFunction, "mappingFunction"); - Objects.requireNonNull(param1, "param1"); - Objects.requireNonNull(param2, "param2"); - - Object val = target.get(key); - if (val == null) { - Object ret = mappingFunction.apply(param1, param2); - target.put(key, ret); - return ret; - } - return val; - } - -} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/RequestUtil.java b/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/RequestUtil.java deleted file mode 100644 index 1c7cd05e..00000000 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/RequestUtil.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.github.dynamic.threadpool.config.toolkit; - -import org.springframework.util.StringUtils; - -import javax.servlet.http.HttpServletRequest; - -/** - * Request util. - * - * @author chen.ma - * @date 2021/6/23 18:28 - */ -public class RequestUtil { - - private static final String X_REAL_IP = "X-Real-IP"; - - private static final String X_FORWARDED_FOR = "X-Forwarded-For"; - - private static final String X_FORWARDED_FOR_SPLIT_SYMBOL = ","; - - public static String getRemoteIp(HttpServletRequest request) { - String xForwardedFor = request.getHeader(X_FORWARDED_FOR); - if (!StringUtils.isEmpty(xForwardedFor)) { - return xForwardedFor.split(X_FORWARDED_FOR_SPLIT_SYMBOL)[0].trim(); - } - String nginxHeader = request.getHeader(X_REAL_IP); - return StringUtils.isEmpty(nginxHeader) ? request.getRemoteAddr() : nginxHeader; - } - -} diff --git a/console/pom.xml b/console/pom.xml deleted file mode 100644 index 0e6591e8..00000000 --- a/console/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - - com.github.dynamic-threadpool - parent - ${revision} - - - console - jar - - ${project.artifactId} - ${project.artifactId} - - - - com.github.dynamic-threadpool - config - - - - com.github.dynamic-threadpool - discovery - - - - com.github.dynamic-threadpool - auth - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java b/console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java deleted file mode 100644 index bfcf526f..00000000 --- a/console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.github.dynamic.threadpool.console.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantRespDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantSaveReqDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantUpdateReqDTO; -import com.github.dynamic.threadpool.config.service.biz.TenantService; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.*; - -/** - * Tenant controller. - * - * @author chen.ma - * @date 2021/6/25 18:31 - */ -@RestController -@AllArgsConstructor -@RequestMapping(Constants.BASE_PATH + "/tenant") -public class TenantController { - - private final TenantService tenantService; - - @PostMapping("/query/page") - public Result> queryNameSpacePage(@RequestBody TenantQueryReqDTO reqDTO) { - return Results.success(tenantService.queryTenantPage(reqDTO)); - } - - @GetMapping("/query/{tenantId}") - public Result queryNameSpace(@PathVariable("tenantId") String tenantId) { - return Results.success(tenantService.getTenantByTenantId(tenantId)); - } - - @PostMapping("/save") - public Result saveNameSpace(@RequestBody TenantSaveReqDTO reqDTO) { - tenantService.saveTenant(reqDTO); - return Results.success(); - } - - @PostMapping("/update") - public Result updateNameSpace(@RequestBody TenantUpdateReqDTO reqDTO) { - tenantService.updateTenant(reqDTO); - return Results.success(); - } - - @DeleteMapping("/delete/{tenantId}") - public Result deleteNameSpace(@PathVariable("tenantId") String tenantId) { - tenantService.deleteTenantById(tenantId); - return Results.success(); - } - -} diff --git a/console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java b/console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java deleted file mode 100644 index d25dabd9..00000000 --- a/console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.github.dynamic.threadpool.console.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolRespDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO; -import com.github.dynamic.threadpool.config.service.biz.ThreadPoolService; -import com.github.dynamic.threadpool.discovery.core.BaseInstanceRegistry; -import com.github.dynamic.threadpool.discovery.core.Lease; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * Thread pool controller. - * - * @author chen.ma - * @date 2021/6/30 20:54 - */ -@RestController -@AllArgsConstructor -@RequestMapping(Constants.BASE_PATH + "/thread") -public class ThreadPoolController { - - private final ThreadPoolService threadPoolService; - - private final BaseInstanceRegistry baseInstanceRegistry; - - @PostMapping("/pool/query/page") - public Result> queryNameSpacePage(@RequestBody ThreadPoolQueryReqDTO reqDTO) { - return Results.success(threadPoolService.queryThreadPoolPage(reqDTO)); - } - - @PostMapping("/pool/query") - public Result queryNameSpace(@RequestBody ThreadPoolQueryReqDTO reqDTO) { - return Results.success(threadPoolService.getThreadPool(reqDTO)); - } - - @PostMapping("/pool/save_or_update") - public Result saveOrUpdateThreadPoolConfig(@RequestBody ThreadPoolSaveOrUpdateReqDTO reqDTO) { - threadPoolService.saveOrUpdateThreadPoolConfig(reqDTO); - return Results.success(); - } - - @GetMapping("/pool/list/instance/{itemId}") - public Result>> listInstance(@PathVariable("itemId") String itemId) { - List> leases = baseInstanceRegistry.listInstance(itemId); - return Results.success(leases); - } - -} diff --git a/console/src/main/java/com/github/dynamic/threadpool/console/controller/UserController.java b/console/src/main/java/com/github/dynamic/threadpool/console/controller/UserController.java deleted file mode 100644 index cb3acd61..00000000 --- a/console/src/main/java/com/github/dynamic/threadpool/console/controller/UserController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.github.dynamic.threadpool.console.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.auth.model.biz.user.UserRespDTO; -import com.github.dynamic.threadpool.auth.service.UserService; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * User controller. - * - * @author chen.ma - * @date 2021/10/30 21:15 - */ -@RestController -@AllArgsConstructor -@RequestMapping({"/v1/auth", "/v1/auth/users"}) -public class UserController { - - private final UserService userService; - - @GetMapping("/{pageNo}/{pageSize}") - public Result> listUser(@PathVariable("pageNo") int pageNo, @PathVariable("pageSize") int pageSize) { - IPage resultUserPage = userService.listUser(pageNo, pageSize); - return Results.success(resultUserPage); - } - - @PostMapping("/{userName}/{password}") - public Result addUser(@PathVariable("userName") String userName, @PathVariable("password") String password) { - userService.addUser(userName, password); - return Results.success(); - } - - @PutMapping("/{userName}/{password}") - public Result updateUser(@PathVariable("userName") String userName, @PathVariable("password") String password) { - userService.updateUser(userName, password); - return Results.success(); - } - - @DeleteMapping("/{userName}") - public Result deleteUser(@PathVariable("userName") String userName) { - userService.deleteUser(userName); - return Results.success(); - } - - @GetMapping("/search/{userName}") - public Result> searchUsersLikeUserName(@PathVariable("userName") String userName) { - List resultUserNames = userService.getUserLikeUsername(userName); - return Results.success(resultUserNames); - } - -} diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/BaseInstanceRegistry.java b/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/BaseInstanceRegistry.java deleted file mode 100644 index 867211c6..00000000 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/BaseInstanceRegistry.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.github.dynamic.threadpool.discovery.core; - -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.common.model.InstanceInfo.InstanceStatus; -import com.google.common.cache.CacheBuilder; -import com.google.common.collect.Lists; -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import static com.github.dynamic.threadpool.common.constant.Constants.EVICTION_INTERVAL_TIMER_IN_MS; -import static com.github.dynamic.threadpool.common.constant.Constants.SCHEDULED_THREAD_CORE_NUM; - -/** - * Base instance registry. - * - * @author chen.ma - * @date 2021/8/8 22:46 - */ -@Slf4j -@Service -public class BaseInstanceRegistry implements InstanceRegistry { - - private final int CONTAINER_SIZE = 1024; - - private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); - - private final Lock read = readWriteLock.readLock(); - - protected final Object lock = new Object(); - - private final ConcurrentHashMap>> registry = new ConcurrentHashMap(CONTAINER_SIZE); - - protected volatile int expectedNumberOfClientsSendingRenews; - - private final CircularQueue> recentRegisteredQueue; - - private final CircularQueue> recentCanceledQueue; - - private ConcurrentLinkedQueue recentlyChangedQueue = new ConcurrentLinkedQueue(); - - protected final ConcurrentMap overriddenInstanceStatusMap = CacheBuilder - .newBuilder().initialCapacity(512) - .expireAfterAccess(1, TimeUnit.HOURS) - .build().asMap(); - - public BaseInstanceRegistry() { - this.recentRegisteredQueue = new CircularQueue(CONTAINER_SIZE); - this.recentCanceledQueue = new CircularQueue(CONTAINER_SIZE); - } - - @Override - public List> listInstance(String appName) { - Map> appNameLeaseMap = registry.get(appName); - if (CollectionUtils.isEmpty(appNameLeaseMap)) { - return Lists.newArrayList(); - } - - List> appNameLeaseList = Lists.newArrayList(); - appNameLeaseMap.values().forEach(each -> appNameLeaseList.add(each)); - return appNameLeaseList; - } - - @Override - public void register(InstanceInfo registrant) { - read.lock(); - try { - Map> registerMap = registry.get(registrant.getAppName()); - if (registerMap == null) { - ConcurrentHashMap> registerNewMap = new ConcurrentHashMap(12); - registerMap = registry.putIfAbsent(registrant.getAppName(), registerNewMap); - if (registerMap == null) { - registerMap = registerNewMap; - } - } - - Lease existingLease = registerMap.get(registrant.getInstanceId()); - if (existingLease != null && (existingLease.getHolder() != null)) { - Long existingLastDirtyTimestamp = existingLease.getHolder().getLastDirtyTimestamp(); - Long registrationLastDirtyTimestamp = registrant.getLastDirtyTimestamp(); - - if (existingLastDirtyTimestamp > registrationLastDirtyTimestamp) { - registrant = existingLease.getHolder(); - } - } - - Lease lease = new Lease(registrant); - if (existingLease != null) { - lease.setServiceUpTimestamp(existingLease.getServiceUpTimestamp()); - } - registerMap.put(registrant.getInstanceId(), lease); - - recentRegisteredQueue.add(new Pair( - System.currentTimeMillis(), - registrant.getAppName() + "(" + registrant.getInstanceId() + ")")); - - InstanceStatus overriddenStatusFromMap = overriddenInstanceStatusMap.get(registrant.getInstanceId()); - if (overriddenStatusFromMap != null) { - log.info("Storing overridden status :: {} from map", overriddenStatusFromMap); - registrant.setOverriddenStatus(overriddenStatusFromMap); - } - - if (InstanceStatus.UP.equals(registrant.getStatus())) { - lease.serviceUp(); - } - - registrant.setActionType(InstanceInfo.ActionType.ADDED); - recentlyChangedQueue.add(new RecentlyChangedItem(lease)); - registrant.setLastUpdatedTimestamp(); - } finally { - read.unlock(); - } - } - - @Override - public boolean renew(InstanceInfo.InstanceRenew instanceRenew) { - String appName = instanceRenew.getAppName(); - String instanceId = instanceRenew.getInstanceId(); - - Map> registryMap = registry.get(appName); - Lease leaseToRenew = null; - if (registryMap == null || (leaseToRenew = registryMap.get(instanceId)) == null) { - return false; - } - - leaseToRenew.renew(); - return true; - } - - static class CircularQueue extends AbstractQueue { - - private final ArrayBlockingQueue delegate; - - public CircularQueue(int capacity) { - this.delegate = new ArrayBlockingQueue(capacity); - } - - @Override - public Iterator iterator() { - return delegate.iterator(); - } - - @Override - public int size() { - return delegate.size(); - } - - @Override - public boolean offer(E e) { - while (!delegate.offer(e)) { - delegate.poll(); - } - return true; - } - - @Override - public E poll() { - return delegate.poll(); - } - - @Override - public E peek() { - return delegate.peek(); - } - - @Override - public void clear() { - delegate.clear(); - } - - @Override - public Object[] toArray() { - return delegate.toArray(); - } - - } - - private static final class RecentlyChangedItem { - private long lastUpdateTime; - - private Lease leaseInfo; - - public RecentlyChangedItem(Lease lease) { - this.leaseInfo = lease; - lastUpdateTime = System.currentTimeMillis(); - } - - public long getLastUpdateTime() { - return this.lastUpdateTime; - } - - public Lease getLeaseInfo() { - return this.leaseInfo; - } - } - - public void evict(long additionalLeaseMs) { - List> expiredLeases = new ArrayList(); - for (Map.Entry>> groupEntry : registry.entrySet()) { - Map> leaseMap = groupEntry.getValue(); - if (leaseMap != null) { - for (Map.Entry> leaseEntry : leaseMap.entrySet()) { - Lease lease = leaseEntry.getValue(); - if (lease.isExpired(additionalLeaseMs) && lease.getHolder() != null) { - expiredLeases.add(lease); - } - } - } - } - - for (Lease expiredLease : expiredLeases) { - String appName = expiredLease.getHolder().getAppName(); - String id = expiredLease.getHolder().getInstanceId(); - internalCancel(appName, id, false); - } - } - - protected boolean internalCancel(String appName, String id, boolean isReplication) { - read.lock(); - try { - Map> registerMap = registry.get(appName); - if (!CollectionUtils.isEmpty(registerMap)) { - registerMap.remove(id); - } - } finally { - read.unlock(); - } - - return true; - } - - public class EvictionTask extends TimerTask { - - private final AtomicLong lastExecutionNanosRef = new AtomicLong(0L); - - @Override - public void run() { - try { - long compensationTimeMs = getCompensationTimeMs(); - log.info("Running the evict task with compensationTime {} ms", compensationTimeMs); - evict(compensationTimeMs); - } catch (Throwable e) { - log.error("Could not run the evict task", e); - } - } - - long getCompensationTimeMs() { - long currNanos = getCurrentTimeNano(); - long lastNanos = lastExecutionNanosRef.getAndSet(currNanos); - if (lastNanos == 0L) { - return 0L; - } - - long elapsedMs = TimeUnit.NANOSECONDS.toMillis(currNanos - lastNanos); - long compensationTime = elapsedMs - EVICTION_INTERVAL_TIMER_IN_MS; - return compensationTime <= 0L ? 0L : compensationTime; - } - - long getCurrentTimeNano() { - return System.nanoTime(); - } - } - - private final ScheduledExecutorService scheduledExecutorService = - new ScheduledThreadPoolExecutor( - SCHEDULED_THREAD_CORE_NUM, - new ThreadFactoryBuilder() - .setNameFormat("registry-eviction") - .setDaemon(true) - .build() - ); - - private final AtomicReference evictionTaskRef = new AtomicReference(); - - public void postInit() { - evictionTaskRef.set(new BaseInstanceRegistry.EvictionTask()); - scheduledExecutorService.scheduleWithFixedDelay(evictionTaskRef.get(), - EVICTION_INTERVAL_TIMER_IN_MS, EVICTION_INTERVAL_TIMER_IN_MS, TimeUnit.MILLISECONDS); - } - -} diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/Pair.java b/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/Pair.java deleted file mode 100644 index 56027014..00000000 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/Pair.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.dynamic.threadpool.discovery.core; - -/** - * Pair. - * - * @author chen.ma - * @date 2021/8/8 23:04 - */ -public class Pair { - - public E1 first() { - return first; - } - - public void setFirst(E1 first) { - this.first = first; - } - - public E2 second() { - return second; - } - - public void setSecond(E2 second) { - this.second = second; - } - - private E1 first; - - private E2 second; - - public Pair(E1 first, E2 second) { - this.first = first; - this.second = second; - } - -} diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/StatusOverrideResult.java b/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/StatusOverrideResult.java deleted file mode 100644 index 09b7e5d1..00000000 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/StatusOverrideResult.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.dynamic.threadpool.discovery.core; - -import com.github.dynamic.threadpool.common.model.InstanceInfo.InstanceStatus; - -/** - * Status override result. - * - * @author chen.ma - * @date 2021/8/8 23:11 - */ -public class StatusOverrideResult { - - public static StatusOverrideResult NO_MATCH = new StatusOverrideResult(false, null); - - public static StatusOverrideResult matchingStatus(InstanceStatus status) { - return new StatusOverrideResult(true, status); - } - - private final boolean matches; - - private final InstanceStatus status; - - private StatusOverrideResult(boolean matches, InstanceStatus status) { - this.matches = matches; - this.status = status; - } - - public boolean matches() { - return matches; - } - - public InstanceStatus status() { - return status; - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/AlarmControlHandler.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/AlarmControlHandler.java deleted file mode 100644 index 859ca372..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/AlarmControlHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.StrUtil; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; - -import java.util.concurrent.TimeUnit; - -/** - * 报警控制组件. - * - * @author chen.ma - * @date 2021/10/28 21:24 - */ -public class AlarmControlHandler { - - private final Cache cache; - - public AlarmControlHandler(long alarmInterval) { - cache = CacheBuilder.newBuilder() - .expireAfterWrite(alarmInterval, TimeUnit.MINUTES) - .build(); - } - - /** - * 控制消息推送报警频率. - * - * @param alarmControl - * @return - */ - public boolean isSend(AlarmControlDTO alarmControl) { - String pkId = cache.getIfPresent(alarmControl.buildPk()); - - if (StrUtil.isBlank(pkId)) { - // val 无意义 - cache.put(alarmControl.buildPk(), IdUtil.simpleUUID()); - return true; - } - - return false; - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/BaseSendMessageService.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/BaseSendMessageService.java deleted file mode 100644 index fd97161a..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/BaseSendMessageService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import com.github.dynamic.threadpool.common.config.ApplicationContextHolder; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.InitializingBean; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Base send message service. - * - * @author chen.ma - * @date 2021/8/15 15:34 - */ -@Slf4j -@RequiredArgsConstructor -public class BaseSendMessageService implements InitializingBean, SendMessageService { - - @NonNull - private final List notifyConfigs; - - private final List sendMessageHandlers = new ArrayList(4); - - @Override - public void sendAlarmMessage(CustomThreadPoolExecutor threadPoolExecutor) { - for (SendMessageHandler messageHandler : sendMessageHandlers) { - try { - messageHandler.sendAlarmMessage(notifyConfigs, threadPoolExecutor); - } catch (Exception ex) { - log.warn("Failed to send thread pool alarm notification.", ex); - } - } - } - - @Override - public void sendChangeMessage(PoolParameterInfo parameter) { - for (SendMessageHandler messageHandler : sendMessageHandlers) { - try { - messageHandler.sendChangeMessage(notifyConfigs, parameter); - } catch (Exception ex) { - log.warn("Failed to send thread pool change notification.", ex); - } - } - } - - @Override - public void afterPropertiesSet() { - Map sendMessageHandlerMap = - ApplicationContextHolder.getBeansOfType(SendMessageHandler.class); - sendMessageHandlerMap.values().forEach(each -> sendMessageHandlers.add(each)); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/DingSendMessageHandler.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/DingSendMessageHandler.java deleted file mode 100644 index dddd52c5..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/DingSendMessageHandler.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.StrUtil; -import com.dingtalk.api.DefaultDingTalkClient; -import com.dingtalk.api.DingTalkClient; -import com.dingtalk.api.request.OapiRobotSendRequest; -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.starter.core.GlobalThreadPoolManage; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import com.github.dynamic.threadpool.starter.toolkit.thread.QueueTypeEnum; -import com.github.dynamic.threadpool.starter.toolkit.thread.RejectedTypeEnum; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; -import com.google.common.base.Joiner; -import com.taobao.api.ApiException; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.TimeUnit; - -/** - * Send ding notification message. - * - * @author chen.ma - * @date 2021/8/15 15:49 - */ -@Slf4j -@AllArgsConstructor -public class DingSendMessageHandler implements SendMessageHandler { - - private String active; - - private Long alarmInterval; - - private InstanceInfo instanceInfo; - - @Override - public String getType() { - return SendMessageEnum.DING.name(); - } - - @Override - public void sendAlarmMessage(List notifyConfigs, CustomThreadPoolExecutor pool) { - Optional notifyConfigOptional = notifyConfigs.stream() - .filter(each -> Objects.equals(each.getType(), getType())) - .findFirst(); - notifyConfigOptional.ifPresent(each -> dingAlarmSendMessage(each, pool)); - } - - @Override - public void sendChangeMessage(List notifyConfigs, PoolParameterInfo parameter) { - Optional changeConfigOptional = notifyConfigs.stream() - .filter(each -> Objects.equals(each.getType(), getType())) - .findFirst(); - changeConfigOptional.ifPresent(each -> dingChangeSendMessage(each, parameter)); - } - - private void dingAlarmSendMessage(NotifyConfig notifyConfig, CustomThreadPoolExecutor pool) { - List receives = StrUtil.split(notifyConfig.getReceives(), ','); - String afterReceives = Joiner.on(", @").join(receives); - - BlockingQueue queue = pool.getQueue(); - String text = String.format( - "[警报] %s - 动态线程池运行告警 \n\n" + - " --- \n\n " + - "线程池ID:%s \n\n " + - "应用实例:%s \n\n " + - " --- \n\n " + - "核心线程数:%d \n\n " + - "最大线程数:%d \n\n " + - "当前线程数:%d \n\n " + - "活跃线程数:%d \n\n " + - "最大线程数:%d \n\n " + - "线程池任务总量:%d \n\n " + - " --- \n\n " + - "队列类型:%s \n\n " + - "队列容量:%d \n\n " + - "队列元素个数:%d \n\n " + - "队列剩余个数:%d \n\n " + - " --- \n\n " + - "拒绝策略:%s \n\n" + - "拒绝策略执行次数:%d \n\n " + - "OWNER:@%s \n\n" + - "提示:%d 分钟内此线程池不会重复告警(可配置) \n\n" + - " --- \n\n " + - "**播报时间:%s**", - - // 环境 - active.toUpperCase(), - // 线程池ID - pool.getThreadPoolId(), - // 节点信息 - instanceInfo.getIpApplicationName(), - // 核心线程数 - pool.getCorePoolSize(), - // 最大线程数 - pool.getMaximumPoolSize(), - // 当前线程数 - pool.getPoolSize(), - // 活跃线程数 - pool.getActiveCount(), - // 最大任务数 - pool.getLargestPoolSize(), - // 线程池任务总量 - pool.getCompletedTaskCount(), - // 队列类型名称 - queue.getClass().getSimpleName(), - // 队列容量 - queue.size() + queue.remainingCapacity(), - // 队列元素个数 - queue.size(), - // 队列剩余个数 - queue.remainingCapacity(), - // 拒绝策略名称 - pool.getRejectedExecutionHandler().getClass().getSimpleName(), - // 拒绝策略次数 - pool.getRejectCount(), - // 告警手机号 - afterReceives, - // 报警频率 - alarmInterval, - // 当前时间 - DateUtil.now() - ); - - execute(notifyConfig, "动态线程池告警", text, receives); - } - - private void dingChangeSendMessage(NotifyConfig notifyConfig, PoolParameterInfo parameter) { - String threadPoolId = parameter.getTpId(); - DynamicThreadPoolWrap poolWrap = GlobalThreadPoolManage.getExecutorService(threadPoolId); - if (poolWrap == null) { - log.warn("Thread pool is empty when sending change notification, threadPoolId :: {}", threadPoolId); - return; - } - - List receives = StrUtil.split(notifyConfig.getReceives(), ','); - String afterReceives = Joiner.on(", @").join(receives); - - CustomThreadPoolExecutor customPool = poolWrap.getPool(); - /** - * hesitant e.g. ➲ ➜ ⇨ ➪ - */ - String text = String.format( - "[通知] %s - 动态线程池参数变更 \n\n" + - " --- \n\n " + - "线程池ID:%s \n\n " + - "应用实例:%s \n\n " + - " --- \n\n " + - "核心线程数:%s \n\n " + - "最大线程数:%s \n\n " + - "线程存活时间:%s / SECONDS \n\n" + - " --- \n\n " + - "队列类型:%s \n\n " + - "队列容量:%s \n\n " + - " --- \n\n " + - "AGO 拒绝策略:%s \n\n" + - "NOW 拒绝策略:%s \n\n" + - " --- \n\n " + - "提示:动态线程池配置变更实时通知(无限制) \n\n" + - "OWNER:@%s \n\n" + - " --- \n\n " + - "**播报时间:%s**", - // 环境 - active.toUpperCase(), - // 线程池名称 - threadPoolId, - // 节点信息 - instanceInfo.getIpApplicationName(), - // 核心线程数 - customPool.getCorePoolSize() + " ➲ " + parameter.getCoreSize(), - // 最大线程数 - customPool.getMaximumPoolSize() + " ➲ " + parameter.getMaxSize(), - // 线程存活时间 - customPool.getKeepAliveTime(TimeUnit.SECONDS) + " ➲ " + parameter.getKeepAliveTime(), - // 阻塞队列 - QueueTypeEnum.getBlockingQueueNameByType(parameter.getQueueType()), - // 阻塞队列容量 - (customPool.getQueue().size() + customPool.getQueue().remainingCapacity()) + " ➲ " + parameter.getCapacity(), - // 拒绝策略 - customPool.getRejectedExecutionHandler().getClass().getSimpleName(), - RejectedTypeEnum.getRejectedNameByType(parameter.getRejectedType()), - // 告警手机号 - afterReceives, - // 当前时间 - DateUtil.now() - ); - - execute(notifyConfig, "动态线程池通知", text, receives); - } - - private void execute(NotifyConfig notifyConfigs, String title, String text, List mobiles) { - String serverUrl = notifyConfigs.getUrl() + notifyConfigs.getToken(); - DingTalkClient dingTalkClient = new DefaultDingTalkClient(serverUrl); - OapiRobotSendRequest request = new OapiRobotSendRequest(); - request.setMsgtype("markdown"); - - OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); - markdown.setTitle(title); - markdown.setText(text); - - OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); - at.setAtMobiles(mobiles); - - request.setAt(at); - request.setMarkdown(markdown); - - try { - dingTalkClient.execute(request); - } catch (ApiException ex) { - log.error("Ding failed to send message", ex.getMessage()); - } - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/MessageTypeEnum.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/MessageTypeEnum.java deleted file mode 100644 index e39d1f1a..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/MessageTypeEnum.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -/** - * Message type enum. - * - * @author chen.ma - * @date 2021/8/16 20:50 - */ -public enum MessageTypeEnum { - - /** - * 通知类型 - */ - CHANGE, - - /** - * 容量报警 - */ - CAPACITY, - - /** - * 活跃度报警 - */ - LIVENESS, - - /** - * 拒绝策略报警 - */ - REJECT - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/NotifyConfig.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/NotifyConfig.java deleted file mode 100644 index e9eda103..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/NotifyConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import lombok.Data; - -/** - * Alarm config. - * - * @author chen.ma - * @date 2021/8/15 16:09 - */ -@Data -public class NotifyConfig { - - /** - * type - */ - private String type; - - /** - * url - */ - private String url; - - /** - * token - */ - private String token; - - /** - * receives - */ - private String receives; - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageEnum.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageEnum.java deleted file mode 100644 index 10a072bf..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageEnum.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -/** - * Send message enum. - * - * @author chen.ma - * @date 2021/8/15 15:50 - */ -public enum SendMessageEnum { - - DING - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageHandler.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageHandler.java deleted file mode 100644 index a056d4c0..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; - -import java.util.List; - -/** - * Send message handler. - * - * @author chen.ma - * @date 2021/8/15 15:44 - */ -public interface SendMessageHandler { - - /** - * Get type. - * - * @return - */ - String getType(); - - /** - * Send alarm message. - * - * @param notifyConfigs - * @param threadPoolExecutor - */ - void sendAlarmMessage(List notifyConfigs, CustomThreadPoolExecutor threadPoolExecutor); - - /** - * Send change message. - * - * @param notifyConfigs - * @param parameter - */ - void sendChangeMessage(List notifyConfigs, PoolParameterInfo parameter); - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageService.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageService.java deleted file mode 100644 index 71462d0d..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/SendMessageService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; - -/** - * Send msg. - * - * @author chen.ma - * @date 2021/8/15 15:31 - */ -public interface SendMessageService { - - /** - * Send alarm message. - * - * @param threadPoolExecutor - */ - void sendAlarmMessage(CustomThreadPoolExecutor threadPoolExecutor); - - /** - * Send change message. - * - * @param parameter - */ - void sendChangeMessage(PoolParameterInfo parameter); - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/ThreadPoolAlarm.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/ThreadPoolAlarm.java deleted file mode 100644 index b7a7820a..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/ThreadPoolAlarm.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * Thread pool alarm. - * - * @author chen.ma - * @date 2021/8/15 13:13 - */ -@Data -@AllArgsConstructor -public class ThreadPoolAlarm { - - /** - * isAlarm - */ - private Boolean isAlarm; - - /** - * livenessAlarm - */ - private Integer livenessAlarm; - - /** - * capacityAlarm - */ - private Integer capacityAlarm; - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/ThreadPoolAlarmManage.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/ThreadPoolAlarmManage.java deleted file mode 100644 index 5b7950ad..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/ThreadPoolAlarmManage.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.github.dynamic.threadpool.starter.alarm; - -import com.github.dynamic.threadpool.common.config.ApplicationContextHolder; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.starter.config.MessageAlarmConfig; -import com.github.dynamic.threadpool.starter.toolkit.CalculateUtil; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import com.github.dynamic.threadpool.starter.toolkit.thread.ResizableCapacityLinkedBlockIngQueue; -import lombok.extern.slf4j.Slf4j; - -import java.util.Optional; - -/** - * Alarm manage. - * - * @author chen.ma - * @date 2021/8/15 14:13 - */ -@Slf4j -public class ThreadPoolAlarmManage { - - /** - * 发送消息 - */ - private static final SendMessageService SEND_MESSAGE_SERVICE; - - /** - * 报警间隔控制 - */ - private static final AlarmControlHandler ALARM_CONTROL_HANDLER; - - static { - SEND_MESSAGE_SERVICE = Optional.ofNullable(ApplicationContextHolder.getInstance()) - .map(each -> each.getBean(MessageAlarmConfig.SEND_MESSAGE_BEAN_NAME, SendMessageService.class)) - .orElse(null); - - ALARM_CONTROL_HANDLER = Optional.ofNullable(ApplicationContextHolder.getInstance()) - .map(each -> each.getBean(AlarmControlHandler.class)) - .orElse(null); - } - - /** - * Check thread pool capacity alarm. - * - * @param threadPoolExecutor - */ - public static void checkPoolCapacityAlarm(CustomThreadPoolExecutor threadPoolExecutor) { - if (SEND_MESSAGE_SERVICE == null) { - return; - } - ThreadPoolAlarm threadPoolAlarm = threadPoolExecutor.getThreadPoolAlarm(); - ResizableCapacityLinkedBlockIngQueue blockIngQueue = - (ResizableCapacityLinkedBlockIngQueue) threadPoolExecutor.getQueue(); - - int queueSize = blockIngQueue.size(); - int capacity = queueSize + blockIngQueue.remainingCapacity(); - int divide = CalculateUtil.divide(queueSize, capacity); - boolean isSend = divide > threadPoolAlarm.getCapacityAlarm() - && isSendMessage(threadPoolExecutor, MessageTypeEnum.CAPACITY); - if (isSend) { - SEND_MESSAGE_SERVICE.sendAlarmMessage(threadPoolExecutor); - } - } - - /** - * Check thread pool activity alarm. - * - * @param isCore - * @param threadPoolExecutor - */ - public static void checkPoolLivenessAlarm(boolean isCore, CustomThreadPoolExecutor threadPoolExecutor) { - if (isCore || SEND_MESSAGE_SERVICE == null || !isSendMessage(threadPoolExecutor, MessageTypeEnum.LIVENESS)) { - return; - } - int activeCount = threadPoolExecutor.getActiveCount(); - int maximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); - int divide = CalculateUtil.divide(activeCount, maximumPoolSize); - - boolean isSend = divide > threadPoolExecutor.getThreadPoolAlarm().getLivenessAlarm() - && isSendMessage(threadPoolExecutor, MessageTypeEnum.CAPACITY); - if (isSend) { - SEND_MESSAGE_SERVICE.sendAlarmMessage(threadPoolExecutor); - } - } - - /** - * Check thread pool reject policy alarm. - * - * @param threadPoolExecutor - */ - public static void checkPoolRejectAlarm(CustomThreadPoolExecutor threadPoolExecutor) { - if (SEND_MESSAGE_SERVICE == null) { - return; - } - - if (isSendMessage(threadPoolExecutor, MessageTypeEnum.REJECT)) { - SEND_MESSAGE_SERVICE.sendAlarmMessage(threadPoolExecutor); - } - } - - /** - * Send thread pool configuration change message. - * - * @param parameter - */ - public static void sendPoolConfigChange(PoolParameterInfo parameter) { - if (SEND_MESSAGE_SERVICE == null) { - return; - } - - SEND_MESSAGE_SERVICE.sendChangeMessage(parameter); - } - - /** - * Is send message. - * - * @param threadPoolExecutor - * @param typeEnum - * @return - */ - private static boolean isSendMessage(CustomThreadPoolExecutor threadPoolExecutor, MessageTypeEnum typeEnum) { - AlarmControlDTO alarmControl = AlarmControlDTO.builder() - .threadPool(threadPoolExecutor.getThreadPoolId()) - .typeEnum(typeEnum) - .build(); - return ALARM_CONTROL_HANDLER.isSend(alarmControl); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/common/CommonThreadPool.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/common/CommonThreadPool.java deleted file mode 100644 index 76a80e34..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/common/CommonThreadPool.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.github.dynamic.threadpool.starter.common; - -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import com.github.dynamic.threadpool.starter.toolkit.thread.QueueTypeEnum; -import com.github.dynamic.threadpool.starter.toolkit.thread.RejectedPolicies; -import com.github.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; - -import java.util.concurrent.TimeUnit; - -/** - * Common threadPool. - * - * @author chen.ma - * @date 2021/6/16 22:35 - */ -public class CommonThreadPool { - - public static CustomThreadPoolExecutor getInstance(String threadPoolId) { - CustomThreadPoolExecutor poolExecutor = (CustomThreadPoolExecutor) ThreadPoolBuilder.builder() - .isCustomPool(true) - .threadPoolId(threadPoolId) - .threadFactory(threadPoolId) - .poolThreadSize(3, 5) - .keepAliveTime(1000L, TimeUnit.SECONDS) - .rejected(RejectedPolicies.runsOldestTaskPolicy()) - .alarmConfig(1, 80, 80) - .workQueue(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE, 512) - .build(); - return poolExecutor; - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/BootstrapProperties.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/BootstrapProperties.java deleted file mode 100644 index 0a9ea398..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/BootstrapProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.github.dynamic.threadpool.starter.config; - -import com.github.dynamic.threadpool.starter.alarm.NotifyConfig; -import lombok.Getter; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.util.List; - -/** - * Bootstrap properties. - * - * @author chen.ma - * @date 2021/6/22 09:14 - */ -@Slf4j -@Getter -@Setter -@ConfigurationProperties(prefix = BootstrapProperties.PREFIX) -public class BootstrapProperties { - - public static final String PREFIX = "spring.dynamic.thread-pool"; - - /** - * serverAddr - */ - private String serverAddr; - - /** - * namespace - */ - private String namespace; - - /** - * itemId - */ - private String itemId; - - /** - * Enable banner - */ - private boolean banner = true; - - /** - * Alarm interval - */ - private Long alarmInterval; - - /** - * notifys - */ - private List notifys; - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/DiscoveryConfig.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/DiscoveryConfig.java deleted file mode 100644 index 4e2f6950..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/DiscoveryConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.github.dynamic.threadpool.starter.config; - -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.starter.core.DiscoveryClient; -import com.github.dynamic.threadpool.starter.remote.HttpAgent; -import lombok.AllArgsConstructor; -import lombok.SneakyThrows; -import org.springframework.context.annotation.Bean; -import org.springframework.core.env.ConfigurableEnvironment; - -import java.net.InetAddress; - -import static com.github.dynamic.threadpool.starter.toolkit.CloudCommonIdUtil.getDefaultInstanceId; -import static com.github.dynamic.threadpool.starter.toolkit.CloudCommonIdUtil.getIpApplicationName; - -/** - * Dynamic threadPool discovery config. - * - * @author chen.ma - * @date 2021/8/6 21:35 - */ -@AllArgsConstructor -public class DiscoveryConfig { - - private ConfigurableEnvironment environment; - - @Bean - @SneakyThrows - public InstanceInfo instanceConfig() { - InstanceInfo instanceInfo = new InstanceInfo(); - instanceInfo.setInstanceId(getDefaultInstanceId(environment)) - .setIpApplicationName(getIpApplicationName(environment)) - .setHostName(InetAddress.getLocalHost().getHostAddress()) - .setAppName(environment.getProperty("spring.application.name")) - .setClientBasePath(environment.getProperty("server.servlet.context-path")); - String callBackUrl = new StringBuilder().append(instanceInfo.getHostName()).append(":") - .append(environment.getProperty("server.port")).append(instanceInfo.getClientBasePath()) - .toString(); - instanceInfo.setCallBackUrl(callBackUrl); - - return instanceInfo; - } - - @Bean - public DiscoveryClient discoveryClient(HttpAgent httpAgent, InstanceInfo instanceInfo) { - return new DiscoveryClient(httpAgent, instanceInfo); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java deleted file mode 100644 index a1c5b7e4..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.github.dynamic.threadpool.starter.config; - -import com.github.dynamic.threadpool.common.config.ApplicationContextHolder; -import com.github.dynamic.threadpool.starter.controller.PoolRunStateController; -import com.github.dynamic.threadpool.starter.core.*; -import com.github.dynamic.threadpool.starter.enable.MarkerConfiguration; -import com.github.dynamic.threadpool.starter.handler.DynamicThreadPoolBannerHandler; -import com.github.dynamic.threadpool.starter.remote.HttpAgent; -import lombok.AllArgsConstructor; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; - -/** - * DynamicTp auto configuration. - * - * @author chen.ma - * @date 2021/6/22 09:20 - */ -@Configuration -@AllArgsConstructor -@ConditionalOnBean(MarkerConfiguration.Marker.class) -@EnableConfigurationProperties(BootstrapProperties.class) -@ImportAutoConfiguration({HttpClientConfig.class, DiscoveryConfig.class, MessageAlarmConfig.class}) -public class DynamicThreadPoolAutoConfiguration { - - private final BootstrapProperties properties; - - @Bean - public DynamicThreadPoolBannerHandler threadPoolBannerHandler() { - return new DynamicThreadPoolBannerHandler(properties); - } - - @Bean - @Order(Ordered.HIGHEST_PRECEDENCE) - public ApplicationContextHolder applicationContextHolder() { - return new ApplicationContextHolder(); - } - - @Bean - @SuppressWarnings("all") - public ConfigService configService(HttpAgent httpAgent) { - return new ThreadPoolConfigService(httpAgent); - } - - @Bean - public ThreadPoolOperation threadPoolOperation(ConfigService configService) { - return new ThreadPoolOperation(properties, configService); - } - - @Bean - @SuppressWarnings("all") - public DynamicThreadPoolPostProcessor threadPoolBeanPostProcessor(HttpAgent httpAgent, ThreadPoolOperation threadPoolOperation, - ApplicationContextHolder applicationContextHolder) { - return new DynamicThreadPoolPostProcessor(properties, httpAgent, threadPoolOperation); - } - - @Bean - public PoolRunStateController poolRunStateController() { - return new PoolRunStateController(); - } - -} - - diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/MessageAlarmConfig.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/MessageAlarmConfig.java deleted file mode 100644 index 30d98d42..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/MessageAlarmConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.github.dynamic.threadpool.starter.config; - -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.starter.alarm.*; -import lombok.AllArgsConstructor; -import org.apache.logging.log4j.util.Strings; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.DependsOn; -import org.springframework.core.env.ConfigurableEnvironment; - -import java.util.Optional; - -/** - * Message alarm config. - * - * @author chen.ma - * @date 2021/8/15 15:39 - */ -@AllArgsConstructor -public class MessageAlarmConfig { - - private final BootstrapProperties properties; - - private final InstanceInfo instanceInfo; - - private ConfigurableEnvironment environment; - - public static final String SEND_MESSAGE_BEAN_NAME = "sendMessageService"; - - @DependsOn("applicationContextHolder") - @Bean(MessageAlarmConfig.SEND_MESSAGE_BEAN_NAME) - public SendMessageService sendMessageService() { - return new BaseSendMessageService(properties.getNotifys()); - } - - @Bean - public SendMessageHandler dingSendMessageHandler() { - String active = environment.getProperty("spring.profiles.active", Strings.EMPTY); - Long alarmInterval = Optional.ofNullable(properties.getAlarmInterval()).orElse(5L); - return new DingSendMessageHandler(active, alarmInterval, instanceInfo); - } - - @Bean - public AlarmControlHandler alarmControlHandler() { - Long alarmInterval = properties.getAlarmInterval(); - return new AlarmControlHandler(alarmInterval); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/controller/PoolRunStateController.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/controller/PoolRunStateController.java deleted file mode 100644 index bf5c1d7a..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/controller/PoolRunStateController.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.github.dynamic.threadpool.starter.controller; - -import com.github.dynamic.threadpool.starter.handler.ThreadPoolRunStateHandler; -import com.github.dynamic.threadpool.common.model.PoolRunStateInfo; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RestController; - -/** - * Pool run state controller. - * - * @author chen.ma - * @date 2021/7/7 21:34 - */ -@RestController -public class PoolRunStateController { - - @GetMapping("/run/state/{tpId}") - public Result getPoolRunState(@PathVariable("tpId") String tpId) { - PoolRunStateInfo poolRunState = ThreadPoolRunStateHandler.getPoolRunState(tpId); - return Results.success(poolRunState); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ConfigAdapter.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ConfigAdapter.java deleted file mode 100644 index 965b9137..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ConfigAdapter.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.github.dynamic.threadpool.starter.core; - -/** - * Config adapter. - * - * @author chen.ma - * @date 2021/6/22 21:29 - */ -public class ConfigAdapter { - - /** - * Callback Config. - * - * @param config - */ - public void callbackConfig(String config) { - ThreadPoolDynamicRefresh.refreshDynamicPool(config); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DynamicThreadPoolPostProcessor.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DynamicThreadPoolPostProcessor.java deleted file mode 100644 index 9b3a416c..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DynamicThreadPoolPostProcessor.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.github.dynamic.threadpool.starter.core; - -import com.alibaba.fastjson.JSON; -import com.github.dynamic.threadpool.common.config.ApplicationContextHolder; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.starter.common.CommonThreadPool; -import com.github.dynamic.threadpool.starter.config.BootstrapProperties; -import com.github.dynamic.threadpool.starter.remote.HttpAgent; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import com.github.dynamic.threadpool.starter.toolkit.thread.QueueTypeEnum; -import com.github.dynamic.threadpool.starter.toolkit.thread.RejectedTypeEnum; -import com.github.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import lombok.var; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import static com.github.dynamic.threadpool.common.constant.Constants.*; - -/** - * Dynamic threadPool post processor. - * - * @author chen.ma - * @date 2021/8/2 20:40 - */ -@Slf4j -@AllArgsConstructor -public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { - - private final BootstrapProperties properties; - - private final HttpAgent httpAgent; - - private final ThreadPoolOperation threadPoolOperation; - - private final ExecutorService executorService = ThreadPoolBuilder.builder() - .poolThreadSize(2, 4) - .keepAliveTime(0L, TimeUnit.MILLISECONDS) - .workQueue(QueueTypeEnum.ARRAY_BLOCKING_QUEUE, 1) - .threadFactory("dynamic-threadPool-config") - .rejected(new ThreadPoolExecutor.DiscardOldestPolicy()) - .build(); - - @Override - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - if (bean instanceof CustomThreadPoolExecutor) { - var dynamicThreadPool = ApplicationContextHolder.findAnnotationOnBean(beanName, DynamicThreadPool.class); - if (Objects.isNull(dynamicThreadPool)) { - return bean; - } - var customExecutor = (CustomThreadPoolExecutor) bean; - var wrap = new DynamicThreadPoolWrap(customExecutor.getThreadPoolId(), customExecutor); - CustomThreadPoolExecutor remoteExecutor = fillPoolAndRegister(wrap); - subscribeConfig(wrap); - return remoteExecutor; - } else if (bean instanceof DynamicThreadPoolWrap) { - var wrap = (DynamicThreadPoolWrap) bean; - registerAndSubscribe(wrap); - } - - return bean; - } - - /** - * Register and subscribe. - * - * @param dynamicThreadPoolWrap - */ - protected void registerAndSubscribe(DynamicThreadPoolWrap dynamicThreadPoolWrap) { - fillPoolAndRegister(dynamicThreadPoolWrap); - subscribeConfig(dynamicThreadPoolWrap); - } - - /** - * Fill the thread pool and register. - * - * @param dynamicThreadPoolWrap - */ - protected CustomThreadPoolExecutor fillPoolAndRegister(DynamicThreadPoolWrap dynamicThreadPoolWrap) { - String tpId = dynamicThreadPoolWrap.getTpId(); - Map queryStrMap = new HashMap(3); - queryStrMap.put(TP_ID, tpId); - queryStrMap.put(ITEM_ID, properties.getItemId()); - queryStrMap.put(NAMESPACE, properties.getNamespace()); - - Result result; - boolean isSubscribe = false; - CustomThreadPoolExecutor poolExecutor = null; - PoolParameterInfo ppi = new PoolParameterInfo(); - - try { - result = httpAgent.httpGetByConfig(Constants.CONFIG_CONTROLLER_PATH, null, queryStrMap, 3000L); - if (result.isSuccess() && result.getData() != null && (ppi = JSON.toJavaObject((JSON) result.getData(), PoolParameterInfo.class)) != null) { - // 使用相关参数创建线程池 - BlockingQueue workQueue = QueueTypeEnum.createBlockingQueue(ppi.getQueueType(), ppi.getCapacity()); - poolExecutor = (CustomThreadPoolExecutor) ThreadPoolBuilder.builder() - .isCustomPool(true) - .workQueue(workQueue) - .threadPoolId(tpId) - .threadFactory(tpId) - .poolThreadSize(ppi.getCoreSize(), ppi.getMaxSize()) - .keepAliveTime(ppi.getKeepAliveTime(), TimeUnit.SECONDS) - .rejected(RejectedTypeEnum.createPolicy(ppi.getRejectedType())) - .alarmConfig(ppi.getIsAlarm(), ppi.getCapacityAlarm(), ppi.getLivenessAlarm()) - .build(); - - dynamicThreadPoolWrap.setPool(poolExecutor); - isSubscribe = true; - } - } catch (Exception ex) { - poolExecutor = dynamicThreadPoolWrap.getPool() != null ? dynamicThreadPoolWrap.getPool() : CommonThreadPool.getInstance(tpId); - dynamicThreadPoolWrap.setPool(poolExecutor); - - log.error("[Init pool] Failed to initialize thread pool configuration. error message :: {}", ex.getMessage()); - } finally { - if (Objects.isNull(dynamicThreadPoolWrap.getPool())) { - dynamicThreadPoolWrap.setPool(CommonThreadPool.getInstance(tpId)); - } - - // 设置是否订阅远端线程池配置 - dynamicThreadPoolWrap.setSubscribeFlag(isSubscribe); - } - - GlobalThreadPoolManage.register(dynamicThreadPoolWrap.getTpId(), ppi, dynamicThreadPoolWrap); - return poolExecutor; - } - - protected void subscribeConfig(DynamicThreadPoolWrap dynamicThreadPoolWrap) { - if (dynamicThreadPoolWrap.isSubscribeFlag()) { - threadPoolOperation.subscribeConfig(dynamicThreadPoolWrap.getTpId(), executorService, config -> ThreadPoolDynamicRefresh.refreshDynamicPool(config)); - } - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/GlobalThreadPoolManage.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/GlobalThreadPoolManage.java deleted file mode 100644 index 9f3670ba..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/GlobalThreadPoolManage.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.github.dynamic.threadpool.starter.core; - -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; -import com.github.dynamic.threadpool.common.model.PoolParameter; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Global threadPool manage. - * - * @author chen.ma - * @date 2021/6/20 15:57 - */ -public class GlobalThreadPoolManage { - - private static final Map POOL_PARAMETER = new ConcurrentHashMap(); - - private static final Map EXECUTOR_MAP = new ConcurrentHashMap(); - - public static DynamicThreadPoolWrap getExecutorService(String tpId) { - return EXECUTOR_MAP.get(tpId); - } - - public static PoolParameter getPoolParameter(String tpId) { - return POOL_PARAMETER.get(tpId); - } - - public static void register(String tpId, PoolParameter poolParameter, DynamicThreadPoolWrap executor) { - registerPool(tpId, executor); - registerPoolParameter(tpId, poolParameter); - } - - public static void registerPool(String tpId, DynamicThreadPoolWrap executor) { - EXECUTOR_MAP.put(tpId, executor); - } - - public static void registerPoolParameter(String tpId, PoolParameter poolParameter) { - POOL_PARAMETER.put(tpId, poolParameter); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolConfigService.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolConfigService.java deleted file mode 100644 index 1f840cad..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolConfigService.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.github.dynamic.threadpool.starter.core; - -import com.github.dynamic.threadpool.starter.remote.HttpAgent; - -import java.util.Arrays; - -/** - * ThreadPool config service. - * - * @author chen.ma - * @date 2021/6/21 21:50 - */ -public class ThreadPoolConfigService implements ConfigService { - - private final HttpAgent httpAgent; - - private final ClientWorker clientWorker; - - public ThreadPoolConfigService(HttpAgent httpAgent) { - this.httpAgent = httpAgent; - clientWorker = new ClientWorker(httpAgent); - } - - @Override - public void addListener(String tenantId, String itemId, String tpId, Listener listener) { - clientWorker.addTenantListeners(tenantId, itemId, tpId, Arrays.asList(listener)); - } - - @Override - public String getServerStatus() { - if (clientWorker.isHealthServer()) { - return "UP"; - } else { - return "DOWN"; - } - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java deleted file mode 100644 index 7fafb7fe..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolDynamicRefresh.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.github.dynamic.threadpool.starter.core; - -import com.alibaba.fastjson.JSON; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.starter.alarm.ThreadPoolAlarmManage; -import com.github.dynamic.threadpool.starter.toolkit.thread.QueueTypeEnum; -import com.github.dynamic.threadpool.starter.toolkit.thread.RejectedTypeEnum; -import com.github.dynamic.threadpool.starter.toolkit.thread.ResizableCapacityLinkedBlockIngQueue; -import lombok.extern.slf4j.Slf4j; - -import java.util.Objects; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * ThreadPool dynamic refresh. - * - * @author chen.ma - * @date 2021/6/20 15:51 - */ -@Slf4j -public class ThreadPoolDynamicRefresh { - - public static void refreshDynamicPool(String content) { - PoolParameterInfo parameter = JSON.parseObject(content, PoolParameterInfo.class); - ThreadPoolAlarmManage.sendPoolConfigChange(parameter); - ThreadPoolDynamicRefresh.refreshDynamicPool(parameter); - } - - public static void refreshDynamicPool(PoolParameterInfo parameter) { - String threadPoolId = parameter.getTpId(); - ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getPool(); - - int originalCoreSize = executor.getCorePoolSize(); - int originalMaximumPoolSize = executor.getMaximumPoolSize(); - int originalQueryType = parameter.getQueueType(); - int originalCapacity = executor.getQueue().remainingCapacity() + executor.getQueue().size(); - long originalKeepAliveTime = executor.getKeepAliveTime(TimeUnit.MILLISECONDS); - int originalRejectedType = parameter.getRejectedType(); - - changePoolInfo(executor, parameter); - ThreadPoolExecutor afterExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getPool(); - - log.info("[🔥 {}] Changed thread pool. coreSize :: [{}], maxSize :: [{}], queueType :: [{}], capacity :: [{}], keepAliveTime :: [{}], rejectedType :: [{}]", - threadPoolId.toUpperCase(), - String.format("%s=>%s", originalCoreSize, afterExecutor.getCorePoolSize()), - String.format("%s=>%s", originalMaximumPoolSize, afterExecutor.getMaximumPoolSize()), - String.format("%s=>%s", originalQueryType, parameter.getQueueType()), - String.format("%s=>%s", originalCapacity, - (afterExecutor.getQueue().remainingCapacity() + afterExecutor.getQueue().size())), - String.format("%s=>%s", originalKeepAliveTime, afterExecutor.getKeepAliveTime(TimeUnit.MILLISECONDS)), - String.format("%s=>%s", originalRejectedType, parameter.getRejectedType())); - } - - public static void changePoolInfo(ThreadPoolExecutor executor, PoolParameterInfo parameter) { - if (parameter.getCoreSize() != null) { - executor.setCorePoolSize(parameter.getCoreSize()); - } - - if (parameter.getMaxSize() != null) { - executor.setMaximumPoolSize(parameter.getMaxSize()); - } - - if (parameter.getCapacity() != null - && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.type, parameter.getQueueType())) { - if (executor.getQueue() instanceof ResizableCapacityLinkedBlockIngQueue) { - ResizableCapacityLinkedBlockIngQueue queue = (ResizableCapacityLinkedBlockIngQueue) executor.getQueue(); - queue.setCapacity(parameter.getCapacity()); - } else { - log.warn("[Pool change] The queue length cannot be modified. Queue type mismatch. Current queue type :: {}", executor.getQueue().getClass().getSimpleName()); - } - } - - if (parameter.getKeepAliveTime() != null) { - executor.setKeepAliveTime(parameter.getKeepAliveTime(), TimeUnit.SECONDS); - } - - if (parameter.getRejectedType() != null) { - executor.setRejectedExecutionHandler(RejectedTypeEnum.createPolicy(parameter.getRejectedType())); - } - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/handler/ThreadPoolRunStateHandler.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/handler/ThreadPoolRunStateHandler.java deleted file mode 100644 index 09637ffc..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/handler/ThreadPoolRunStateHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.github.dynamic.threadpool.starter.handler; - -import com.github.dynamic.threadpool.common.model.PoolRunStateInfo; -import com.github.dynamic.threadpool.starter.core.GlobalThreadPoolManage; -import com.github.dynamic.threadpool.starter.toolkit.CalculateUtil; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; -import lombok.extern.slf4j.Slf4j; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * Thread pool run state service. - * - * @author chen.ma - * @date 2021/7/12 21:25 - */ -@Slf4j -public class ThreadPoolRunStateHandler { - - private static InetAddress INET_ADDRESS; - - static { - try { - INET_ADDRESS = InetAddress.getLocalHost(); - } catch (UnknownHostException ex) { - log.error("Local IP acquisition failed.", ex); - } - } - - public static PoolRunStateInfo getPoolRunState(String tpId) { - DynamicThreadPoolWrap executorService = GlobalThreadPoolManage.getExecutorService(tpId); - ThreadPoolExecutor pool = executorService.getPool(); - - // 核心线程数 - int corePoolSize = pool.getCorePoolSize(); - // 最大线程数 - int maximumPoolSize = pool.getMaximumPoolSize(); - // 线程池当前线程数 - int poolSize = pool.getPoolSize(); - // 活跃线程数 - int activeCount = pool.getActiveCount(); - // 同时进入池中的最大线程数 - int largestPoolSize = pool.getLargestPoolSize(); - // 线程池中执行任务总数量 - long completedTaskCount = pool.getCompletedTaskCount(); - // 当前负载 - String currentLoad = CalculateUtil.divide(activeCount, maximumPoolSize) + "%"; - // 峰值负载 - String peakLoad = CalculateUtil.divide(largestPoolSize, maximumPoolSize) + "%"; - - BlockingQueue queue = pool.getQueue(); - // 队列类型 - String queueType = queue.getClass().getSimpleName(); - // 队列元素个数 - int queueSize = queue.size(); - // 队列剩余容量 - int remainingCapacity = queue.remainingCapacity(); - // 队列容量 - int queueCapacity = queueSize + remainingCapacity; - - PoolRunStateInfo stateInfo = new PoolRunStateInfo(); - stateInfo.setCoreSize(corePoolSize); - stateInfo.setMaximumSize(maximumPoolSize); - stateInfo.setPoolSize(poolSize); - stateInfo.setActiveSize(activeCount); - stateInfo.setCurrentLoad(currentLoad); - stateInfo.setPeakLoad(peakLoad); - stateInfo.setQueueType(queueType); - stateInfo.setQueueSize(queueSize); - stateInfo.setQueueRemainingCapacity(remainingCapacity); - stateInfo.setQueueCapacity(queueCapacity); - stateInfo.setLargestPoolSize(largestPoolSize); - stateInfo.setCompletedTaskCount(completedTaskCount); - stateInfo.setHost(INET_ADDRESS.getHostAddress()); - stateInfo.setTpId(tpId); - - int rejectCount = pool instanceof CustomThreadPoolExecutor - ? ((CustomThreadPoolExecutor) pool).getRejectCount() - : -1; - stateInfo.setRejectCount(rejectCount); - - return stateInfo; - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/ServerHttpAgent.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/ServerHttpAgent.java deleted file mode 100644 index 1adf2021..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/ServerHttpAgent.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.github.dynamic.threadpool.starter.remote; - -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.starter.config.BootstrapProperties; -import com.github.dynamic.threadpool.starter.toolkit.HttpClientUtil; - -import java.util.Map; - -/** - * Server http agent. - * - * @author chen.ma - * @date 2021/6/23 20:50 - */ -public class ServerHttpAgent implements HttpAgent { - - private final BootstrapProperties dynamicThreadPoolProperties; - - private final ServerListManager serverListManager; - - private final HttpClientUtil httpClientUtil; - - public ServerHttpAgent(BootstrapProperties properties, HttpClientUtil httpClientUtil) { - this.dynamicThreadPoolProperties = properties; - this.httpClientUtil = httpClientUtil; - this.serverListManager = new ServerListManager(dynamicThreadPoolProperties); - } - - @Override - public void start() { - - } - - @Override - public String getTenantId() { - return dynamicThreadPoolProperties.getNamespace(); - } - - @Override - public String getEncode() { - return null; - } - - @Override - public Result httpPostByDiscovery(String path, Object body) { - return httpClientUtil.restApiPost(buildUrl(path), body, Result.class); - } - - @Override - public Result httpGetByConfig(String path, Map headers, Map paramValues, long readTimeoutMs) { - return httpClientUtil.restApiGetByThreadPool(buildUrl(path), headers, paramValues, readTimeoutMs, Result.class); - } - - @Override - public Result httpPostByConfig(String path, Map headers, Map paramValues, long readTimeoutMs) { - return httpClientUtil.restApiPostByThreadPool(buildUrl(path), headers, paramValues, readTimeoutMs, Result.class); - } - - @Override - public Result httpDeleteByConfig(String path, Map headers, Map paramValues, long readTimeoutMs) { - return null; - } - - private String buildUrl(String path) { - return serverListManager.getCurrentServerAddr() + path; - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/AbstractBuildThreadPoolTemplate.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/AbstractBuildThreadPoolTemplate.java deleted file mode 100644 index 38a775ff..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/AbstractBuildThreadPoolTemplate.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; - -import com.github.dynamic.threadpool.common.toolkit.Assert; -import com.github.dynamic.threadpool.starter.alarm.ThreadPoolAlarm; -import lombok.Data; -import lombok.experimental.Accessors; -import lombok.extern.slf4j.Slf4j; - -import java.util.concurrent.*; -import java.util.concurrent.locks.AbstractQueuedSynchronizer; - -/** - * Abstract build threadPool template. - * - * @author chen.ma - * @date 2021/7/5 21:45 - */ -@Slf4j -public class AbstractBuildThreadPoolTemplate { - - /** - * 线程池构建初始化参数 - *

- * 此处本身是模版设计方法, 但是考虑创建简洁性, 移除 abstract - * 异常参考 {@link AbstractQueuedSynchronizer#tryAcquire} - * - * @return - */ - protected static ThreadPoolInitParam initParam() { - throw new UnsupportedOperationException(); - } - - /** - * 构建线程池 - * - * @return - */ - public static ThreadPoolExecutor buildPool() { - ThreadPoolInitParam initParam = initParam(); - return buildPool(initParam); - } - - /** - * 构建线程池 - * - * @return - */ - public static ThreadPoolExecutor buildPool(ThreadPoolInitParam initParam) { - Assert.notNull(initParam); - ThreadPoolExecutor executorService = - new ThreadPoolExecutorTemplate(initParam.getCorePoolNum(), - initParam.getMaxPoolNum(), - initParam.getKeepAliveTime(), - initParam.getTimeUnit(), - initParam.getWorkQueue(), - initParam.getThreadFactory(), - initParam.rejectedExecutionHandler); - return executorService; - } - - /** - * 构建快速执行线程池 - * - * @return - */ - public static ThreadPoolExecutor buildFastPool() { - ThreadPoolInitParam initParam = initParam(); - return buildFastPool(initParam); - } - - /** - * 构建快速执行线程池 - * - * @return - */ - public static ThreadPoolExecutor buildFastPool(ThreadPoolInitParam initParam) { - TaskQueue taskQueue = new TaskQueue(initParam.getCapacity()); - FastThreadPoolExecutor fastThreadPoolExecutor = - new FastThreadPoolExecutor(initParam.getCorePoolNum(), - initParam.getMaxPoolNum(), - initParam.getKeepAliveTime(), - initParam.getTimeUnit(), - taskQueue, - initParam.getThreadFactory(), - initParam.rejectedExecutionHandler); - taskQueue.setExecutor(fastThreadPoolExecutor); - return fastThreadPoolExecutor; - } - - /** - * 构建自定义线程池 - * - * @param initParam - * @return - */ - public static CustomThreadPoolExecutor buildCustomPool(ThreadPoolInitParam initParam) { - Assert.notNull(initParam); - CustomThreadPoolExecutor executorService = - new CustomThreadPoolExecutor(initParam.getCorePoolNum(), - initParam.getMaxPoolNum(), - initParam.getKeepAliveTime(), - initParam.getTimeUnit(), - initParam.getWorkQueue(), - initParam.getThreadPoolId(), - initParam.getThreadFactory(), - initParam.getThreadPoolAlarm(), - initParam.getRejectedExecutionHandler()); - return executorService; - } - - @Data - @Accessors(chain = true) - public static class ThreadPoolInitParam { - - /** - * 核心线程数量 - */ - private Integer corePoolNum; - - /** - * 最大线程数量 - */ - private Integer maxPoolNum; - - /** - * 线程存活时间 - */ - private Long keepAliveTime; - - /** - * 线程存活时间单位 - */ - private TimeUnit timeUnit; - - /** - * 队列最大容量 - */ - private Integer capacity; - - /** - * 阻塞队列 - */ - private BlockingQueue workQueue; - - /** - * 线程池任务满时拒绝任务策略 - */ - private RejectedExecutionHandler rejectedExecutionHandler; - - /** - * 创建线程工厂 - */ - private ThreadFactory threadFactory; - - /** - * 线程 ID - */ - private String threadPoolId; - - /** - * 报警策略 - */ - private ThreadPoolAlarm threadPoolAlarm; - - public ThreadPoolInitParam(String threadNamePrefix, boolean isDaemon) { - this.threadPoolId = threadNamePrefix; - this.threadFactory = ThreadFactoryBuilder.builder() - .prefix(threadNamePrefix) - .daemon(isDaemon) - .build(); - } - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/CustomThreadPoolExecutor.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/CustomThreadPoolExecutor.java deleted file mode 100644 index a770c361..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/CustomThreadPoolExecutor.java +++ /dev/null @@ -1,954 +0,0 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; - -import com.github.dynamic.threadpool.starter.alarm.ThreadPoolAlarm; -import com.github.dynamic.threadpool.starter.alarm.ThreadPoolAlarmManage; -import lombok.NoArgsConstructor; -import lombok.NonNull; - -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.locks.AbstractQueuedSynchronizer; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; - -import static com.github.dynamic.threadpool.common.constant.Constants.MAP_INITIAL_CAPACITY; - -/** - * Custom threadPool wrap. - * - * @author chen.ma - * @date 2021/7/8 21:47 - */ -public final class CustomThreadPoolExecutor extends ThreadPoolExecutor { - - private final AtomicInteger rejectCount = new AtomicInteger(); - private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0)); - - private static final int COUNT_BITS = Integer.SIZE - 3; - private static final int CAPACITY = (1 << COUNT_BITS) - 1; - - private static final int RUNNING = -1 << COUNT_BITS; - private static final int SHUTDOWN = 0 << COUNT_BITS; - private static final int STOP = 1 << COUNT_BITS; - private static final int TIDYING = 2 << COUNT_BITS; - private static final int TERMINATED = 3 << COUNT_BITS; - - private final BlockingQueue workQueue; - private final ReentrantLock mainLock = new ReentrantLock(); - private final HashSet workers = new HashSet(); - private final Condition termination = mainLock.newCondition(); - - private int largestPoolSize; - private long completedTaskCount; - private volatile long keepAliveTime; - private volatile boolean allowCoreThreadTimeOut; - private volatile int corePoolSize; - private volatile int maximumPoolSize; - private String threadPoolId; - - private final AccessControlContext acc; - private volatile ThreadPoolAlarm threadPoolAlarm; - private volatile ThreadFactory threadFactory; - private volatile RejectedExecutionHandler handler; - - private static final RejectedExecutionHandler DEFAULT_HANDLER = new ThreadPoolExecutor.AbortPolicy(); - private static final RuntimePermission SHUTDOWN_PERM = new RuntimePermission("modifyThread"); - - public CustomThreadPoolExecutor(int corePoolSize, - int maximumPoolSize, - long keepAliveTime, - TimeUnit unit, - @NonNull BlockingQueue workQueue, - @NonNull String threadPoolId, - @NonNull ThreadFactory threadFactory, - @NonNull ThreadPoolAlarm threadPoolAlarm, - @NonNull RejectedExecutionHandler handler) { - super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler); - - if (corePoolSize < 0 || - maximumPoolSize <= 0 || - maximumPoolSize < corePoolSize || - keepAliveTime < 0) { - throw new IllegalArgumentException(); - } - - this.corePoolSize = corePoolSize; - this.maximumPoolSize = maximumPoolSize; - this.workQueue = workQueue; - this.threadPoolId = threadPoolId; - this.keepAliveTime = unit.toNanos(keepAliveTime); - this.threadFactory = threadFactory; - this.handler = handler; - this.threadPoolAlarm = threadPoolAlarm; - this.acc = System.getSecurityManager() == null ? null : AccessController.getContext(); - } - - private static int runStateOf(int c) { - return c & ~CAPACITY; - } - - private static int workerCountOf(int c) { - return c & CAPACITY; - } - - private static int ctlOf(int rs, int wc) { - return rs | wc; - } - - private static boolean runStateLessThan(int c, int s) { - return c < s; - } - - private static boolean runStateAtLeast(int c, int s) { - return c >= s; - } - - private static boolean isRunning(int c) { - return c < SHUTDOWN; - } - - private boolean compareAndIncrementWorkerCount(int expect) { - return ctl.compareAndSet(expect, expect + 1); - } - - private boolean compareAndDecrementWorkerCount(int expect) { - return ctl.compareAndSet(expect, expect - 1); - } - - private void decrementWorkerCount() { - do { - } while (!compareAndDecrementWorkerCount(ctl.get())); - } - - public Integer getRejectCount() { - return rejectCount.get(); - } - - public ThreadPoolAlarm getThreadPoolAlarm() { - return this.threadPoolAlarm; - } - - public void setThreadPoolAlarm(ThreadPoolAlarm threadPoolAlarm) { - this.threadPoolAlarm = threadPoolAlarm; - } - - public String getThreadPoolId() { - return this.threadPoolId; - } - - private final class Worker - extends AbstractQueuedSynchronizer - implements Runnable { - - private static final long serialVersionUID = 6138294804551838833L; - - final Thread thread; - Runnable firstTask; - volatile long completedTasks; - - Worker(Runnable firstTask) { - setState(-1); - this.firstTask = firstTask; - this.thread = getThreadFactory().newThread(this); - } - - @Override - public void run() { - runWorker(this); - } - - @Override - protected boolean isHeldExclusively() { - return getState() != 0; - } - - @Override - protected boolean tryAcquire(int unused) { - if (compareAndSetState(0, 1)) { - setExclusiveOwnerThread(Thread.currentThread()); - return true; - } - return false; - } - - @Override - protected boolean tryRelease(int unused) { - setExclusiveOwnerThread(null); - setState(0); - return true; - } - - public void lock() { - acquire(1); - } - - public boolean tryLock() { - return tryAcquire(1); - } - - public void unlock() { - release(1); - } - - public boolean isLocked() { - return isHeldExclusively(); - } - - void interruptIfStarted() { - Thread t; - if (getState() >= 0 && (t = thread) != null && !t.isInterrupted()) { - try { - t.interrupt(); - } catch (SecurityException ignore) { - } - } - } - } - - private void advanceRunState(int targetState) { - for (; ; ) { - int c = ctl.get(); - if (runStateAtLeast(c, targetState) || - ctl.compareAndSet(c, ctlOf(targetState, workerCountOf(c)))) { - break; - } - } - } - - final void tryTerminate() { - for (; ; ) { - int c = ctl.get(); - if (isRunning(c) - || runStateAtLeast(c, TIDYING) - || (runStateOf(c) == SHUTDOWN && !workQueue.isEmpty())) { - return; - } - if (workerCountOf(c) != 0) { - interruptIdleWorkers(ONLY_ONE); - return; - } - - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - if (ctl.compareAndSet(c, ctlOf(TIDYING, 0))) { - try { - terminated(); - } finally { - ctl.set(ctlOf(TERMINATED, 0)); - termination.signalAll(); - } - return; - } - } finally { - mainLock.unlock(); - } - } - } - - private void checkShutdownAccess() { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - security.checkPermission(SHUTDOWN_PERM); - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - for (Worker w : workers) { - security.checkAccess(w.thread); - } - } finally { - mainLock.unlock(); - } - } - } - - private void interruptWorkers() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - for (Worker w : workers) { - w.interruptIfStarted(); - } - } finally { - mainLock.unlock(); - } - } - - private void interruptIdleWorkers(boolean onlyOne) { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - for (Worker w : workers) { - Thread t = w.thread; - if (!t.isInterrupted() && w.tryLock()) { - try { - t.interrupt(); - } catch (SecurityException ignore) { - } finally { - w.unlock(); - } - } - if (onlyOne) { - break; - } - } - } finally { - mainLock.unlock(); - } - } - - private void interruptIdleWorkers() { - interruptIdleWorkers(false); - } - - private static final boolean ONLY_ONE = true; - - final void reject(Runnable command) { - rejectCount.incrementAndGet(); - ThreadPoolAlarmManage.checkPoolRejectAlarm(this); - handler.rejectedExecution(command, this); - } - - void onShutdown() { - } - - final boolean isRunningOrShutdown(boolean shutdownOk) { - int rs = runStateOf(ctl.get()); - return rs == RUNNING || (rs == SHUTDOWN && shutdownOk); - } - - private List drainQueue() { - BlockingQueue q = workQueue; - ArrayList taskList = new ArrayList(); - q.drainTo(taskList); - if (!q.isEmpty()) { - for (Runnable r : q.toArray(new Runnable[0])) { - if (q.remove(r)) { - taskList.add(r); - } - } - } - return taskList; - } - - private boolean addWorker(Runnable firstTask, boolean core) { - retry: - for (; ; ) { - int c = ctl.get(); - int rs = runStateOf(c); - - // Check if queue empty only if necessary. - if (rs >= SHUTDOWN && !(rs == SHUTDOWN && firstTask == null && !workQueue.isEmpty())) { - return false; - } - - for (; ; ) { - int wc = workerCountOf(c); - if (wc >= CAPACITY || - wc >= (core ? corePoolSize : maximumPoolSize)) { - return false; - } - if (compareAndIncrementWorkerCount(c)) { - break retry; - } - c = ctl.get(); - if (runStateOf(c) != rs) { - continue retry; - } - } - } - - ThreadPoolAlarmManage.checkPoolLivenessAlarm(core, this); - - boolean workerStarted = false; - boolean workerAdded = false; - Worker w = null; - try { - w = new Worker(firstTask); - final Thread t = w.thread; - if (t != null) { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - int rs = runStateOf(ctl.get()); - - if (rs < SHUTDOWN || (rs == SHUTDOWN && firstTask == null)) { - if (t.isAlive()) { - throw new IllegalThreadStateException(); - } - workers.add(w); - int s = workers.size(); - if (s > largestPoolSize) { - largestPoolSize = s; - } - workerAdded = true; - } - } finally { - mainLock.unlock(); - } - if (workerAdded) { - t.start(); - workerStarted = true; - } - } - } finally { - if (!workerStarted) { - addWorkerFailed(w); - } - } - return workerStarted; - } - - private void addWorkerFailed(Worker w) { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - if (w != null) { - workers.remove(w); - } - decrementWorkerCount(); - tryTerminate(); - } finally { - mainLock.unlock(); - } - } - - private void processWorkerExit(Worker w, boolean completedAbruptly) { - if (completedAbruptly) { - decrementWorkerCount(); - } - - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - completedTaskCount += w.completedTasks; - workers.remove(w); - } finally { - mainLock.unlock(); - } - - tryTerminate(); - - int c = ctl.get(); - if (runStateLessThan(c, STOP)) { - if (!completedAbruptly) { - int min = allowCoreThreadTimeOut ? 0 : corePoolSize; - if (min == 0 && !workQueue.isEmpty()) { - min = 1; - } - if (workerCountOf(c) >= min) { - return; - } - } - addWorker(null, false); - } - } - - private Runnable getTask() { - boolean timedOut = false; - - for (; ; ) { - int c = ctl.get(); - int rs = runStateOf(c); - - if (rs >= SHUTDOWN && (rs >= STOP || workQueue.isEmpty())) { - decrementWorkerCount(); - return null; - } - - int wc = workerCountOf(c); - - boolean timed = allowCoreThreadTimeOut || wc > corePoolSize; - - if ((wc > maximumPoolSize || (timed && timedOut)) && (wc > 1 || workQueue.isEmpty())) { - if (compareAndDecrementWorkerCount(c)) { - return null; - } - continue; - } - - try { - Runnable r = timed ? - workQueue.poll(keepAliveTime, TimeUnit.NANOSECONDS) : - workQueue.take(); - if (r != null) { - return r; - } - timedOut = true; - } catch (InterruptedException retry) { - timedOut = false; - } - } - } - - final void runWorker(Worker w) { - Thread wt = Thread.currentThread(); - Runnable task = w.firstTask; - w.firstTask = null; - w.unlock(); - boolean completedAbruptly = true; - try { - while (task != null || (task = getTask()) != null) { - w.lock(); - if ((runStateAtLeast(ctl.get(), STOP) - || (Thread.interrupted() && runStateAtLeast(ctl.get(), STOP))) - && !wt.isInterrupted()) { - wt.interrupt(); - } - try { - beforeExecute(wt, task); - Throwable thrown = null; - try { - task.run(); - } catch (RuntimeException x) { - thrown = x; - throw x; - } catch (Error x) { - thrown = x; - throw x; - } catch (Throwable x) { - thrown = x; - throw new Error(x); - } finally { - afterExecute(task, thrown); - } - } finally { - task = null; - w.completedTasks++; - w.unlock(); - } - } - completedAbruptly = false; - } finally { - processWorkerExit(w, completedAbruptly); - } - } - - @Override - public void execute(@NonNull Runnable command) { - int c = ctl.get(); - if (workerCountOf(c) < corePoolSize) { - if (addWorker(command, true)) { - return; - } - c = ctl.get(); - } - if (isRunning(c) && workQueue.offer(command)) { - ThreadPoolAlarmManage.checkPoolCapacityAlarm(this); - int recheck = ctl.get(); - if (!isRunning(recheck) && remove(command)) { - reject(command); - } else if (workerCountOf(recheck) == 0) { - addWorker(null, false); - } - } else if (!addWorker(command, false)) { - reject(command); - } - } - - @Override - public void shutdown() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - checkShutdownAccess(); - advanceRunState(SHUTDOWN); - interruptIdleWorkers(); - onShutdown(); - } finally { - mainLock.unlock(); - } - tryTerminate(); - } - - @Override - public List shutdownNow() { - List tasks; - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - checkShutdownAccess(); - advanceRunState(STOP); - interruptWorkers(); - tasks = drainQueue(); - } finally { - mainLock.unlock(); - } - tryTerminate(); - return tasks; - } - - @Override - public boolean isShutdown() { - return !isRunning(ctl.get()); - } - - @Override - public boolean isTerminating() { - int c = ctl.get(); - return !isRunning(c) && runStateLessThan(c, TERMINATED); - } - - @Override - public boolean isTerminated() { - return runStateAtLeast(ctl.get(), TERMINATED); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) - throws InterruptedException { - long nanos = unit.toNanos(timeout); - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - for (; ; ) { - if (runStateAtLeast(ctl.get(), TERMINATED)) { - return true; - } - if (nanos <= 0) { - return false; - } - nanos = termination.awaitNanos(nanos); - } - } finally { - mainLock.unlock(); - } - } - - @Override - protected void finalize() { - SecurityManager sm = System.getSecurityManager(); - if (sm == null || acc == null) { - shutdown(); - } else { - PrivilegedAction pa = () -> { - shutdown(); - return null; - }; - AccessController.doPrivileged(pa, acc); - } - } - - @Override - public void setThreadFactory(@NonNull ThreadFactory threadFactory) { - this.threadFactory = threadFactory; - } - - @Override - public ThreadFactory getThreadFactory() { - return threadFactory; - } - - @Override - public void setRejectedExecutionHandler(@NonNull RejectedExecutionHandler handler) { - this.handler = handler; - } - - @Override - public RejectedExecutionHandler getRejectedExecutionHandler() { - return handler; - } - - @Override - public void setCorePoolSize(int corePoolSize) { - if (corePoolSize < 0) { - throw new IllegalArgumentException(); - } - int delta = corePoolSize - this.corePoolSize; - this.corePoolSize = corePoolSize; - if (workerCountOf(ctl.get()) > corePoolSize) { - interruptIdleWorkers(); - } else if (delta > 0) { - int k = Math.min(delta, workQueue.size()); - while (k-- > 0 && addWorker(null, true)) { - if (workQueue.isEmpty()) { - break; - } - } - } - } - - @Override - public int getCorePoolSize() { - return corePoolSize; - } - - @Override - public boolean prestartCoreThread() { - return workerCountOf(ctl.get()) < corePoolSize && - addWorker(null, true); - } - - void ensurePrestart() { - int wc = workerCountOf(ctl.get()); - if (wc < corePoolSize) { - addWorker(null, true); - } else if (wc == 0) { - addWorker(null, false); - } - } - - @Override - public int prestartAllCoreThreads() { - int n = 0; - while (addWorker(null, true)) { - ++n; - } - return n; - } - - @Override - public boolean allowsCoreThreadTimeOut() { - return allowCoreThreadTimeOut; - } - - @Override - public void allowCoreThreadTimeOut(boolean value) { - if (value && keepAliveTime <= 0) { - throw new IllegalArgumentException("Core threads must have nonzero keep alive times"); - } - if (value != allowCoreThreadTimeOut) { - allowCoreThreadTimeOut = value; - if (value) { - interruptIdleWorkers(); - } - } - } - - @Override - public void setMaximumPoolSize(int maximumPoolSize) { - if (maximumPoolSize <= 0 || maximumPoolSize < corePoolSize) { - throw new IllegalArgumentException(); - } - this.maximumPoolSize = maximumPoolSize; - if (workerCountOf(ctl.get()) > maximumPoolSize) { - interruptIdleWorkers(); - } - } - - @Override - public int getMaximumPoolSize() { - return maximumPoolSize; - } - - @Override - public void setKeepAliveTime(long time, TimeUnit unit) { - if (time < 0) { - throw new IllegalArgumentException(); - } - if (time == 0 && allowsCoreThreadTimeOut()) { - throw new IllegalArgumentException("Core threads must have nonzero keep alive times"); - } - long keepAliveTime = unit.toNanos(time); - long delta = keepAliveTime - this.keepAliveTime; - this.keepAliveTime = keepAliveTime; - if (delta < 0) { - interruptIdleWorkers(); - } - } - - @Override - public long getKeepAliveTime(TimeUnit unit) { - return unit.convert(keepAliveTime, TimeUnit.NANOSECONDS); - } - - @Override - public BlockingQueue getQueue() { - return workQueue; - } - - @Override - public boolean remove(Runnable task) { - boolean removed = workQueue.remove(task); - tryTerminate(); - return removed; - } - - @Override - public void purge() { - final BlockingQueue q = workQueue; - try { - Iterator it = q.iterator(); - while (it.hasNext()) { - Runnable r = it.next(); - if (r instanceof Future && ((Future) r).isCancelled()) { - it.remove(); - } - } - } catch (ConcurrentModificationException fallThrough) { - for (Object r : q.toArray()) { - if (r instanceof Future && ((Future) r).isCancelled()) { - q.remove(r); - } - } - } - - tryTerminate(); - } - - @Override - public int getPoolSize() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - return runStateAtLeast(ctl.get(), TIDYING) ? 0 : workers.size(); - } finally { - mainLock.unlock(); - } - } - - @Override - public int getActiveCount() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - int n = 0; - for (Worker w : workers) { - if (w.isLocked()) { - ++n; - } - } - return n; - } finally { - mainLock.unlock(); - } - } - - @Override - public int getLargestPoolSize() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - return largestPoolSize; - } finally { - mainLock.unlock(); - } - } - - @Override - public long getTaskCount() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - long n = completedTaskCount; - for (Worker w : workers) { - n += w.completedTasks; - if (w.isLocked()) { - ++n; - } - } - return n + workQueue.size(); - } finally { - mainLock.unlock(); - } - } - - @Override - public long getCompletedTaskCount() { - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - long n = completedTaskCount; - for (Worker w : workers) { - n += w.completedTasks; - } - return n; - } finally { - mainLock.unlock(); - } - } - - @Override - public String toString() { - long ncompleted; - int nworkers, nactive; - final ReentrantLock mainLock = this.mainLock; - mainLock.lock(); - try { - ncompleted = completedTaskCount; - nactive = 0; - nworkers = workers.size(); - for (Worker w : workers) { - ncompleted += w.completedTasks; - if (w.isLocked()) { - ++nactive; - } - } - } finally { - mainLock.unlock(); - } - int c = ctl.get(); - String rs = (runStateLessThan(c, SHUTDOWN) ? "Running" : - (runStateAtLeast(c, TERMINATED) ? "Terminated" : - "Shutting down")); - return super.toString() + - "[" + rs + - ", pool size = " + nworkers + - ", active threads = " + nactive + - ", queued tasks = " + workQueue.size() + - ", completed tasks = " + ncompleted + - "]"; - } - - private ConcurrentHashMap statisticsTime = new ConcurrentHashMap(MAP_INITIAL_CAPACITY); - - @Override - protected void beforeExecute(Thread t, Runnable r) { - statisticsTime.put(String.valueOf(r.hashCode()), new Date()); - } - - @Override - protected void afterExecute(Runnable r, Throwable t) { - Date startDate = statisticsTime.remove(String.valueOf(r.hashCode())); - Date finishDate = new Date(); - long diff = finishDate.getTime() - startDate.getTime(); - - } - - @Override - protected void terminated() { - } - - @NoArgsConstructor - public static class CallerRunsPolicy implements RejectedExecutionHandler { - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { - if (!e.isShutdown()) { - r.run(); - } - } - } - - @NoArgsConstructor - public static class AbortPolicy implements RejectedExecutionHandler { - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { - throw new RejectedExecutionException("Task " + r.toString() + - " rejected from " + - e.toString()); - } - } - - @NoArgsConstructor - public static class DiscardPolicy implements RejectedExecutionHandler { - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { - } - } - - @NoArgsConstructor - public static class DiscardOldestPolicy implements RejectedExecutionHandler { - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { - if (!e.isShutdown()) { - e.getQueue().poll(); - e.execute(r); - } - } - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/RejectedTypeEnum.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/RejectedTypeEnum.java deleted file mode 100644 index 2781c98c..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/RejectedTypeEnum.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; - -import com.github.dynamic.threadpool.starter.spi.CustomRejectedExecutionHandler; -import com.github.dynamic.threadpool.starter.spi.DynamicTpServiceLoader; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.RejectedExecutionHandler; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.stream.Stream; - -/** - * Reject policy type Enum. - * - * @author chen.ma - * @date 2021/7/10 23:16 - */ -public enum RejectedTypeEnum { - - /** - * 被拒绝任务的程序由主线程执行 - */ - CALLER_RUNS_POLICY(1, new ThreadPoolExecutor.CallerRunsPolicy()), - - /** - * 被拒绝任务的处理程序, 抛出异常 - */ - ABORT_POLICY(2, new ThreadPoolExecutor.AbortPolicy()), - - /** - * 被拒绝任务的处理程序, 默默地丢弃被拒绝的任务。 - */ - DISCARD_POLICY(3, new ThreadPoolExecutor.DiscardPolicy()), - - /** - * 被拒绝任务的处理程序, 它丢弃最早的未处理请求, 然后重试 - */ - DISCARD_OLDEST_POLICY(4, new ThreadPoolExecutor.DiscardOldestPolicy()), - - /** - * 发生拒绝事件时, 添加新任务并运行最早的任务 - */ - RUNS_OLDEST_TASK_POLICY(5, RejectedPolicies.runsOldestTaskPolicy()), - - /** - * 使用阻塞方法将拒绝任务添加队列, 可保证任务不丢失 - */ - SYNC_PUT_QUEUE_POLICY(6, RejectedPolicies.syncPutQueuePolicy()); - - /** - * 类型 - */ - public Integer type; - - /** - * 线程池拒绝策略 - */ - public RejectedExecutionHandler rejectedHandler; - - RejectedTypeEnum(Integer type, RejectedExecutionHandler rejectedHandler) { - this.type = type; - this.rejectedHandler = rejectedHandler; - } - - static { - DynamicTpServiceLoader.register(CustomRejectedExecutionHandler.class); - } - - public static RejectedExecutionHandler createPolicy(int type) { - Optional rejectedTypeEnum = Stream.of(RejectedTypeEnum.values()) - .filter(each -> Objects.equals(type, each.type)) - .map(each -> each.rejectedHandler) - .findFirst(); - - // 使用 SPI 匹配拒绝策略 - RejectedExecutionHandler resultRejected = rejectedTypeEnum.orElseGet(() -> { - Collection customRejectedExecutionHandlers = DynamicTpServiceLoader - .getSingletonServiceInstances(CustomRejectedExecutionHandler.class); - Optional customRejected = customRejectedExecutionHandlers.stream() - .filter(each -> Objects.equals(type, each.getType())) - .map(each -> each.generateRejected()) - .findFirst(); - - return customRejected.orElse(ABORT_POLICY.rejectedHandler); - }); - - return resultRejected; - } - - public static String getRejectedNameByType(int type) { - Optional rejectedTypeEnum = Arrays.stream(RejectedTypeEnum.values()) - .filter(each -> each.type == type).findFirst(); - - return rejectedTypeEnum.map(each -> each.rejectedHandler.getClass().getSimpleName()).orElse(""); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/wrap/DynamicThreadPoolWrap.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/wrap/DynamicThreadPoolWrap.java deleted file mode 100644 index 571b4679..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/wrap/DynamicThreadPoolWrap.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.github.dynamic.threadpool.starter.wrap; - -import com.github.dynamic.threadpool.starter.common.CommonThreadPool; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import lombok.Data; - -import java.util.concurrent.Callable; -import java.util.concurrent.Future; - -/** - * Dynamic threadPool wrap. - * - * @author chen.ma - * @date 2021/6/20 16:55 - */ -@Data -public class DynamicThreadPoolWrap { - - private String tenantId; - - private String itemId; - - private String tpId; - - private boolean subscribeFlag; - - private CustomThreadPoolExecutor pool; - - /** - * 首选服务端线程池, 为空使用默认线程池 {@link CommonThreadPool#getInstance(String)} - * - * @param threadPoolId - */ - public DynamicThreadPoolWrap(String threadPoolId) { - this(threadPoolId, CommonThreadPool.getInstance(threadPoolId)); - } - - /** - * 首选服务端线程池, 为空使用 threadPoolExecutor - * - * @param threadPoolId - * @param threadPoolExecutor - */ - public DynamicThreadPoolWrap(String threadPoolId, CustomThreadPoolExecutor threadPoolExecutor) { - this.tpId = threadPoolId; - this.pool = threadPoolExecutor; - } - - /** - * 提交任务 - * - * @param command - */ - public void execute(Runnable command) { - pool.execute(command); - } - - /** - * 提交任务 - * - * @param task - * @return - */ - public Future submit(Runnable task) { - return pool.submit(task); - } - - /** - * 提交任务 - * - * @param task - * @param - * @return - */ - public Future submit(Callable task) { - return pool.submit(task); - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/wrap/ManagerListenerWrap.java b/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/wrap/ManagerListenerWrap.java deleted file mode 100644 index 2b35b07d..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/wrap/ManagerListenerWrap.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.github.dynamic.threadpool.starter.wrap; - -import com.github.dynamic.threadpool.starter.core.Listener; -import lombok.Getter; -import lombok.Setter; - -/** - * Manager listener wrap. - * - * @author chen.ma - * @date 2021/6/22 17:47 - */ -@Getter -@Setter -public class ManagerListenerWrap { - - private String lastCallMd5; - - final Listener listener; - - public ManagerListenerWrap(String md5, Listener listener) { - this.lastCallMd5 = md5; - this.listener = listener; - } - -} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/resources/META-INF/spring.factories b/dynamic-threadpool-spring-boot-starter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 797fc7f9..00000000 --- a/dynamic-threadpool-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.github.dynamic.threadpool.starter.config.DynamicThreadPoolAutoConfiguration diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/ExampleApplication.java b/example/src/main/java/com/github/dynamic/threadpool/example/ExampleApplication.java deleted file mode 100644 index 57e79924..00000000 --- a/example/src/main/java/com/github/dynamic/threadpool/example/ExampleApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.github.dynamic.threadpool.example; - -import com.github.dynamic.threadpool.starter.enable.EnableDynamicThreadPool; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -@EnableDynamicThreadPool -public class ExampleApplication { - - public static void main(String[] args) { - SpringApplication.run(ExampleApplication.class, args); - } - -} diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java b/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java deleted file mode 100644 index 6d3ec6c6..00000000 --- a/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.github.dynamic.threadpool.example.config; - -import com.github.dynamic.threadpool.starter.core.DynamicThreadPool; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; -import com.github.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.concurrent.ThreadPoolExecutor; - -import static com.github.dynamic.threadpool.example.constant.GlobalTestConstant.*; - -/** - * Thread pool config. - * - * @author chen.ma - * @date 2021/6/20 17:16 - */ -@Slf4j -@Configuration -public class ThreadPoolConfig { - - /** - * {@link DynamicThreadPoolWrap} 完成 Server 端订阅配置功能. - * - * @return - */ - @Bean - public DynamicThreadPoolWrap messageCenterConsumeThreadPool() { - return new DynamicThreadPoolWrap(MESSAGE_CONSUME); - } - - /** - * 通过 {@link DynamicThreadPool} 修饰 {@link CustomThreadPoolExecutor} 完成 Server 端订阅配置功能. - *

- * 由动态线程池注解修饰后, IOC 容器中保存的是 {@link CustomThreadPoolExecutor} - * - * @return - */ - @Bean - @DynamicThreadPool - public ThreadPoolExecutor customThreadPoolExecutor() { - return ThreadPoolBuilder.builder().threadFactory(MESSAGE_PRODUCE).isCustomPool(true).build(); - } - -} diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java b/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java deleted file mode 100644 index 85d49c9b..00000000 --- a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.github.dynamic.threadpool.example.inittest; - -import com.github.dynamic.threadpool.starter.core.GlobalThreadPoolManage; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import java.util.Random; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import static com.github.dynamic.threadpool.example.constant.GlobalTestConstant.MESSAGE_PRODUCE; - -/** - * Test run time metrics. - * - * @author chen.ma - * @date 2021/8/15 21:00 - */ -@Slf4j -@Component -public class RunStateHandlerTest { - - // @PostConstruct - @SuppressWarnings("all") - public void runStateHandlerTest() { - log.info("Test thread pool runtime state interface, The rejection policy will be triggered after 30s..."); - - ScheduledExecutorService scheduledThreadPool = Executors.newSingleThreadScheduledExecutor(); - scheduledThreadPool.scheduleAtFixedRate(() -> { - DynamicThreadPoolWrap executorService = GlobalThreadPoolManage.getExecutorService(MESSAGE_PRODUCE); - ThreadPoolExecutor pool = executorService.getPool(); - try { - pool.execute(() -> { - log.info("Thread pool name :: {}, Executing incoming blocking...", Thread.currentThread().getName()); - try { - int maxRandom = 10; - int temp = 2; - Random random = new Random(); - // Assignment thread pool completedTaskCount - if (random.nextInt(maxRandom) % temp == 0) { - Thread.sleep(10241024); - } else { - Thread.sleep(3000); - } - } catch (InterruptedException e) { - // ignore - } - }); - } catch (Exception ex) { - // ignore - } - - }, 5, 2, TimeUnit.SECONDS); - } - -} diff --git a/example/src/main/resources/application.yaml b/example/src/main/resources/application.yaml deleted file mode 100644 index aa2f581a..00000000 --- a/example/src/main/resources/application.yaml +++ /dev/null @@ -1,21 +0,0 @@ -server: - port: 8088 - servlet: - context-path: /example - -spring: - profiles: - active: dev - application: - name: dynamic-threadpool-example - dynamic: - thread-pool: - notifys: - - type: DING - url: https://oapi.dingtalk.com/robot/send?access_token= - token: 4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae - receives: '15601166691' - alarm-interval: 5 - server-addr: http://localhost:6691 - namespace: prescription - item-id: ${spring.application.name} diff --git a/auth/.gitignore b/hippo4j-auth/.gitignore similarity index 100% rename from auth/.gitignore rename to hippo4j-auth/.gitignore diff --git a/auth/pom.xml b/hippo4j-auth/pom.xml similarity index 68% rename from auth/pom.xml rename to hippo4j-auth/pom.xml index 354daee7..69d59712 100644 --- a/auth/pom.xml +++ b/hippo4j-auth/pom.xml @@ -4,14 +4,18 @@ 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} - auth + hippo4j-auth jar + + true + + org.springframework.boot @@ -49,6 +53,22 @@ cn.hutool hutool-all + + + org.springframework.boot + spring-boot-starter-security + + + + io.jsonwebtoken + jjwt + ${jjwt.version} + + + + cn.hippo4j + hippo4j-common + diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/config/GlobalSecurityConfig.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/config/GlobalSecurityConfig.java new file mode 100644 index 00000000..25b364a1 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/config/GlobalSecurityConfig.java @@ -0,0 +1,95 @@ +package cn.hippo4j.auth.config; + +import cn.hippo4j.auth.constant.Constants; +import cn.hippo4j.auth.filter.JWTAuthenticationFilter; +import cn.hippo4j.auth.filter.JWTAuthorizationFilter; +import cn.hippo4j.auth.security.JwtTokenManager; +import cn.hippo4j.auth.service.impl.UserDetailsServiceImpl; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.BeanIds; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.builders.WebSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; + +import javax.annotation.Resource; +import java.util.stream.Stream; + +/** + * 安全配置. + * + * @author chen.ma + * @date 2021/11/9 21:10 + */ +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class GlobalSecurityConfig extends WebSecurityConfigurerAdapter { + + @Resource + private UserDetailsService userDetailsService; + + @Resource + private JwtTokenManager tokenManager; + + @Bean + public UserDetailsService customUserService() { + return new UserDetailsServiceImpl(); + } + + @Bean + public BCryptPasswordEncoder bCryptPasswordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Bean(name = BeanIds.AUTHENTICATION_MANAGER) + @Override + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + @Bean + public CorsConfigurationSource corsConfigurationSource() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + config.addAllowedMethod(Constants.SPLIT_STAR); + config.applyPermitDefaultValues(); + source.registerCorsConfiguration("/**", config); + return source; + } + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.cors().and().csrf().disable() + .authorizeRequests() + .antMatchers("/static/**", "/index.html", "/favicon.ico", "/avatar.jpg").permitAll() + .antMatchers("/doc.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs").anonymous() + .anyRequest().authenticated() + .and() + .addFilter(new JWTAuthenticationFilter(authenticationManager())) + .addFilter(new JWTAuthorizationFilter(tokenManager, authenticationManager())) + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); + } + + @Override + public void configure(WebSecurity web) throws Exception { + String[] ignores = Stream.of("/hippo4j/v1/cs/auth/users/apply/token/**", "/hippo4j/v1/cs/configs/**").toArray(String[]::new); + web.ignoring().antMatchers(ignores); + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/constant/Constants.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/constant/Constants.java new file mode 100644 index 00000000..739752d0 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/constant/Constants.java @@ -0,0 +1,17 @@ +package cn.hippo4j.auth.constant; + +/** + * Constants. + * + * @author chen.ma + * @date 2021/11/9 22:24 + */ +public class Constants { + + public static final String SPLIT_STAR = "*"; + + public static final String SPLIT_COMMA = ","; + + public static final long TOKEN_VALIDITY_IN_SECONDS = 18000L; + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/filter/JWTAuthenticationFilter.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/filter/JWTAuthenticationFilter.java new file mode 100644 index 00000000..b7d52472 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/filter/JWTAuthenticationFilter.java @@ -0,0 +1,99 @@ +package cn.hippo4j.auth.filter; + +import cn.hippo4j.auth.model.biz.user.JwtUser; +import cn.hippo4j.auth.model.biz.user.LoginUser; +import cn.hippo4j.auth.toolkit.JwtTokenUtil; +import cn.hippo4j.auth.toolkit.ReturnT; +import cn.hippo4j.common.web.base.Results; +import cn.hutool.json.JSONUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import static cn.hippo4j.auth.constant.Constants.SPLIT_COMMA; +import static cn.hippo4j.common.constant.Constants.BASE_PATH; +import static cn.hippo4j.common.constant.Constants.MAP_INITIAL_CAPACITY; + +/** + * JWT authentication filter. + * + * @author chen.ma + * @date 2021/11/9 22:21 + */ +@Slf4j +public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { + + private final AuthenticationManager authenticationManager; + + private final ThreadLocal rememberMe = new ThreadLocal(); + + public JWTAuthenticationFilter(AuthenticationManager authenticationManager) { + this.authenticationManager = authenticationManager; + super.setFilterProcessesUrl(BASE_PATH + "/auth/login"); + } + + @Override + public Authentication attemptAuthentication(HttpServletRequest request, + HttpServletResponse response) throws AuthenticationException { + // 从输入流中获取到登录的信息 + try { + LoginUser loginUser = new ObjectMapper().readValue(request.getInputStream(), LoginUser.class); + rememberMe.set(loginUser.getRememberMe()); + return authenticationManager.authenticate( + new UsernamePasswordAuthenticationToken(loginUser.getUsername(), loginUser.getPassword(), new ArrayList()) + ); + } catch (IOException e) { + logger.error("attemptAuthentication error :{}", e); + return null; + } + } + + @Override + protected void successfulAuthentication(HttpServletRequest request, + HttpServletResponse response, + FilterChain chain, + Authentication authResult) throws IOException { + try { + JwtUser jwtUser = (JwtUser) authResult.getPrincipal(); + boolean isRemember = rememberMe.get() == 1; + + String role = ""; + Collection authorities = jwtUser.getAuthorities(); + for (GrantedAuthority authority : authorities) { + role = authority.getAuthority(); + } + + String token = JwtTokenUtil.createToken(jwtUser.getId(), jwtUser.getUsername(), role, isRemember); + response.setHeader("token", JwtTokenUtil.TOKEN_PREFIX + token); + response.setCharacterEncoding("UTF-8"); + Map maps = new HashMap(MAP_INITIAL_CAPACITY); + maps.put("data", JwtTokenUtil.TOKEN_PREFIX + token); + maps.put("roles", role.split(SPLIT_COMMA)); + response.getWriter().write(JSONUtil.toJsonStr(Results.success(maps))); + } finally { + rememberMe.remove(); + } + } + + @Override + protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { + response.setCharacterEncoding("UTF-8"); + response.getWriter().write(JSONUtil.toJsonStr(new ReturnT(-1, "Server Error"))); + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/filter/JWTAuthorizationFilter.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/filter/JWTAuthorizationFilter.java new file mode 100644 index 00000000..a303ab6a --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/filter/JWTAuthorizationFilter.java @@ -0,0 +1,118 @@ +package cn.hippo4j.auth.filter; + +import cn.hippo4j.auth.security.JwtTokenManager; +import cn.hippo4j.auth.toolkit.JwtTokenUtil; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.toolkit.UserContext; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.common.web.exception.ServiceException; +import cn.hutool.core.util.StrUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Collections; + +import static cn.hippo4j.common.constant.Constants.ACCESS_TOKEN; +import static cn.hippo4j.common.web.exception.ErrorCodeEnum.LOGIN_TIMEOUT; + +/** + * JWT authorization filter. + * + * @author chen.ma + * @date 2021/11/9 22:21 + */ +@Slf4j +public class JWTAuthorizationFilter extends BasicAuthenticationFilter { + + private final JwtTokenManager tokenManager; + + public JWTAuthorizationFilter(JwtTokenManager tokenManager, AuthenticationManager authenticationManager) { + super(authenticationManager); + this.tokenManager = tokenManager; + } + + @Override + protected void doFilterInternal(HttpServletRequest request, + HttpServletResponse response, + FilterChain chain) throws IOException, ServletException { + // 验证客户端交互时 Token + String accessToken = request.getParameter(ACCESS_TOKEN); + if (StrUtil.isNotBlank(accessToken)) { + tokenManager.validateToken(accessToken); + + Authentication authentication = this.tokenManager.getAuthentication(accessToken); + SecurityContextHolder.getContext().setAuthentication(authentication); + + chain.doFilter(request, response); + return; + } + + // 如果请求头中没有 Authorization 信息则直接放行 + String tokenHeader = request.getHeader(JwtTokenUtil.TOKEN_HEADER); + if (tokenHeader == null || !tokenHeader.startsWith(JwtTokenUtil.TOKEN_PREFIX)) { + chain.doFilter(request, response); + return; + } + + // 如果请求头中有 Token, 则进行解析, 并且设置认证信息 + try { + SecurityContextHolder.getContext().setAuthentication(getAuthentication(tokenHeader)); + } catch (Exception ex) { + // 返回 Json 形式的错误信息 + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/json; charset=utf-8"); + String resultStatus = "-1"; + if (ex instanceof ServiceException) { + ServiceException serviceException = (ServiceException) ex; + resultStatus = serviceException.errorCode.getCode(); + } + response.getWriter().write(JSONUtil.toJSONString(Results.failure(resultStatus, ex.getMessage()))); + response.getWriter().flush(); + return; + } + + try { + super.doFilterInternal(request, response, chain); + } finally { + UserContext.clear(); + } + } + + /** + * Token 中获取用户信息并新建一个 Token. + * + * @param tokenHeader + * @return + */ + private UsernamePasswordAuthenticationToken getAuthentication(String tokenHeader) { + String token = tokenHeader.replace(JwtTokenUtil.TOKEN_PREFIX, ""); + boolean expiration = JwtTokenUtil.isExpiration(token); + if (expiration) { + throw new ServiceException(LOGIN_TIMEOUT); + } + + String username = JwtTokenUtil.getUsername(token); + String userRole = JwtTokenUtil.getUserRole(token); + UserContext.setUserInfo(username, userRole); + + String role = JwtTokenUtil.getUserRole(token); + if (username != null) { + return new UsernamePasswordAuthenticationToken(username, null, + Collections.singleton(new SimpleGrantedAuthority(role)) + ); + } + + return null; + } + +} diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/PermissionMapper.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/PermissionMapper.java similarity index 69% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/PermissionMapper.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/PermissionMapper.java index 67fb2c59..f0977313 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/PermissionMapper.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/PermissionMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.auth.mapper; +package cn.hippo4j.auth.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.auth.model.PermissionInfo; +import cn.hippo4j.auth.model.PermissionInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/RoleMapper.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/RoleMapper.java similarity index 69% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/RoleMapper.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/RoleMapper.java index bed36fe7..0286d0cc 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/RoleMapper.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/RoleMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.auth.mapper; +package cn.hippo4j.auth.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.auth.model.RoleInfo; +import cn.hippo4j.auth.model.RoleInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/UserMapper.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/UserMapper.java similarity index 69% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/UserMapper.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/UserMapper.java index 28dc0361..317c6023 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/mapper/UserMapper.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/mapper/UserMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.auth.mapper; +package cn.hippo4j.auth.mapper; +import cn.hippo4j.auth.model.UserInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.auth.model.UserInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/PermissionInfo.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/PermissionInfo.java similarity index 92% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/PermissionInfo.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/PermissionInfo.java index f938e18e..2c8faaaa 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/PermissionInfo.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/PermissionInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model; +package cn.hippo4j.auth.model; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; @@ -18,7 +18,7 @@ public class PermissionInfo { /** * id */ - @TableId + @TableId(type = IdType.AUTO) private Long id; /** diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/RoleInfo.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/RoleInfo.java similarity index 91% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/RoleInfo.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/RoleInfo.java index b1f7ff46..f3bca4a4 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/RoleInfo.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/RoleInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model; +package cn.hippo4j.auth.model; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; @@ -18,7 +18,7 @@ public class RoleInfo { /** * id */ - @TableId + @TableId(type = IdType.AUTO) private Long id; /** diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/UserInfo.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/UserInfo.java similarity index 85% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/UserInfo.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/UserInfo.java index a472849d..0c4cba74 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/UserInfo.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/UserInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model; +package cn.hippo4j.auth.model; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; @@ -18,7 +18,7 @@ public class UserInfo { /** * id */ - @TableId + @TableId(type = IdType.AUTO) private Long id; /** @@ -31,6 +31,11 @@ public class UserInfo { */ private String password; + /** + * role + */ + private String role; + /** * gmtCreate */ diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/permission/PermissionQueryPageReqDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/permission/PermissionQueryPageReqDTO.java similarity index 83% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/permission/PermissionQueryPageReqDTO.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/permission/PermissionQueryPageReqDTO.java index c87d65b8..30e0b42c 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/permission/PermissionQueryPageReqDTO.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/permission/PermissionQueryPageReqDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model.biz.permission; +package cn.hippo4j.auth.model.biz.permission; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/permission/PermissionRespDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/permission/PermissionRespDTO.java similarity index 82% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/permission/PermissionRespDTO.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/permission/PermissionRespDTO.java index 67d9a930..4d0bc92b 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/permission/PermissionRespDTO.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/permission/PermissionRespDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model.biz.permission; +package cn.hippo4j.auth.model.biz.permission; import lombok.Data; diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/role/RoleQueryPageReqDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/role/RoleQueryPageReqDTO.java similarity index 84% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/role/RoleQueryPageReqDTO.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/role/RoleQueryPageReqDTO.java index 783ecf80..ae93f7e1 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/role/RoleQueryPageReqDTO.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/role/RoleQueryPageReqDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model.biz.role; +package cn.hippo4j.auth.model.biz.role; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/role/RoleRespDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/role/RoleRespDTO.java similarity index 80% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/role/RoleRespDTO.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/role/RoleRespDTO.java index e6269a5d..2adffbcb 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/role/RoleRespDTO.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/role/RoleRespDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model.biz.role; +package cn.hippo4j.auth.model.biz.role; import lombok.Data; diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/JwtUser.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/JwtUser.java new file mode 100644 index 00000000..d2b655d2 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/JwtUser.java @@ -0,0 +1,58 @@ +package cn.hippo4j.auth.model.biz.user; + +import lombok.Data; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Collection; + +/** + * Jwt user. + * + * @author chen.ma + * @date 2021/11/9 22:34 + */ +@Data +public class JwtUser implements UserDetails { + + /** + * id + */ + private Long id; + + /** + * userName + */ + private String username; + + /** + * password + */ + private String password; + + /** + * authorities + */ + private Collection authorities; + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return true; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return true; + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/LoginUser.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/LoginUser.java new file mode 100644 index 00000000..ad2184a8 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/LoginUser.java @@ -0,0 +1,29 @@ +package cn.hippo4j.auth.model.biz.user; + +import lombok.Data; + +/** + * Login user. + * + * @author chen.ma + * @date 2021/11/9 22:41 + */ +@Data +public class LoginUser { + + /** + * username + */ + private String username; + + /** + * password + */ + private String password; + + /** + * rememberMe + */ + private Integer rememberMe; + +} diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/user/UserQueryPageReqDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserQueryPageReqDTO.java similarity index 57% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/user/UserQueryPageReqDTO.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserQueryPageReqDTO.java index 50c708bf..472e5b36 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/user/UserQueryPageReqDTO.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserQueryPageReqDTO.java @@ -1,7 +1,8 @@ -package com.github.dynamic.threadpool.auth.model.biz.user; +package cn.hippo4j.auth.model.biz.user; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; +import lombok.experimental.Accessors; /** * User query page. @@ -10,10 +11,12 @@ import lombok.Data; * @date 2021/10/30 21:47 */ @Data +@Accessors(chain = true) public class UserQueryPageReqDTO extends Page { - public UserQueryPageReqDTO(long current, long size) { - super(current, size); - } + /** + * userName + */ + private String userName; } diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserReqDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserReqDTO.java new file mode 100644 index 00000000..b84529d7 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserReqDTO.java @@ -0,0 +1,32 @@ +package cn.hippo4j.auth.model.biz.user; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * User req dto. + * + * @author chen.ma + * @date 2021/11/11 20:30 + */ +@Data +@Accessors(chain = true) +public class UserReqDTO extends Page { + + /** + * userName + */ + private String userName; + + /** + * password + */ + private String password; + + /** + * role + */ + private String role; + +} diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/user/UserRespDTO.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserRespDTO.java similarity index 84% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/user/UserRespDTO.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserRespDTO.java index 790cdadd..a82f68f3 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/model/biz/user/UserRespDTO.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/model/biz/user/UserRespDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.auth.model.biz.user; +package cn.hippo4j.auth.model.biz.user; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -20,9 +20,9 @@ public class UserRespDTO { private String userName; /** - * password + * role */ - private String password; + private String role; /** * gmtCreate diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/security/AuthManager.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/security/AuthManager.java new file mode 100644 index 00000000..fdfbcdd1 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/security/AuthManager.java @@ -0,0 +1,46 @@ +package cn.hippo4j.auth.security; + +import lombok.AllArgsConstructor; +import lombok.SneakyThrows; +import org.springframework.expression.AccessException; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.AuthenticationException; +import org.springframework.stereotype.Component; + +/** + * Auth manager + * + * @author chen.ma + * @date 2021/12/20 20:34 + */ +@Component +@AllArgsConstructor +public class AuthManager { + + private final JwtTokenManager jwtTokenManager; + + private final AuthenticationManager authenticationManager; + + /** + * Resolve token from user. + * + * @param userName + * @param rawPassword + * @return + * @throws AccessException + */ + @SneakyThrows + public String resolveTokenFromUser(String userName, String rawPassword) { + try { + UsernamePasswordAuthenticationToken authenticationToken = + new UsernamePasswordAuthenticationToken(userName, rawPassword); + authenticationManager.authenticate(authenticationToken); + } catch (AuthenticationException e) { + throw new AccessException("Unknown user."); + } + + return jwtTokenManager.createToken(userName); + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/security/JwtTokenManager.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/security/JwtTokenManager.java new file mode 100644 index 00000000..157a9f66 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/security/JwtTokenManager.java @@ -0,0 +1,61 @@ +package cn.hippo4j.auth.security; + +import cn.hutool.core.util.StrUtil; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.AuthorityUtils; +import org.springframework.security.core.userdetails.User; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.List; + +import static cn.hippo4j.auth.constant.Constants.TOKEN_VALIDITY_IN_SECONDS; +import static cn.hippo4j.auth.toolkit.JwtTokenUtil.SECRET; +import static cn.hippo4j.common.constant.Constants.AUTHORITIES_KEY; + +/** + * Jwt token manager. + * + * @author chen.ma + * @date 2021/12/20 20:36 + */ +@Component +public class JwtTokenManager { + + public String createToken(String userName) { + long now = System.currentTimeMillis(); + + Date validity; + validity = new Date(now + TOKEN_VALIDITY_IN_SECONDS * 1000L); + + Claims claims = Jwts.claims().setSubject(userName); + return Jwts.builder().setClaims(claims).setExpiration(validity) + .signWith(SignatureAlgorithm.HS512, SECRET).compact(); + } + + public void validateToken(String token) { + Jwts.parser().setSigningKey(SECRET).parseClaimsJws(token); + } + + /** + * Get auth Info. + * + * @param token token + * @return auth info + */ + public Authentication getAuthentication(String token) { + Claims claims = Jwts.parser().setSigningKey(SECRET).parseClaimsJws(token).getBody(); + + List authorities = AuthorityUtils + .commaSeparatedStringToAuthorityList((String) claims.get(AUTHORITIES_KEY)); + + User principal = new User(claims.getSubject(), StrUtil.EMPTY, authorities); + return new UsernamePasswordAuthenticationToken(principal, StrUtil.EMPTY, authorities); + } + +} diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/PermissionService.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/PermissionService.java similarity index 84% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/service/PermissionService.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/service/PermissionService.java index eec92f4e..922c0576 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/PermissionService.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/PermissionService.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.auth.service; +package cn.hippo4j.auth.service; +import cn.hippo4j.auth.model.biz.permission.PermissionRespDTO; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.auth.model.biz.permission.PermissionRespDTO; /** * Permission service. diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/RoleService.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/RoleService.java similarity index 86% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/service/RoleService.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/service/RoleService.java index 399e8fff..2b212e4c 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/RoleService.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/RoleService.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.auth.service; +package cn.hippo4j.auth.service; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.auth.model.biz.role.RoleRespDTO; +import cn.hippo4j.auth.model.biz.role.RoleRespDTO; import java.util.List; diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/UserService.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/UserService.java similarity index 53% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/service/UserService.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/service/UserService.java index d98a294b..bbbffba5 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/UserService.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/UserService.java @@ -1,7 +1,9 @@ -package com.github.dynamic.threadpool.auth.service; +package cn.hippo4j.auth.service; +import cn.hippo4j.auth.model.biz.user.UserQueryPageReqDTO; +import cn.hippo4j.auth.model.biz.user.UserRespDTO; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.auth.model.biz.user.UserRespDTO; +import cn.hippo4j.auth.model.biz.user.UserReqDTO; import java.util.List; @@ -16,27 +18,24 @@ public interface UserService { /** * 分页查询用户列表. * - * @param pageNo - * @param pageSize + * @param reqDTO * @return */ - IPage listUser(int pageNo, int pageSize); + IPage listUser(UserQueryPageReqDTO reqDTO); /** * 新增用户. * - * @param userName - * @param password + * @param reqDTO */ - void addUser(String userName, String password); + void addUser(UserReqDTO reqDTO); /** * 修改用户. * - * @param userName - * @param password + * @param reqDTO */ - void updateUser(String userName, String password); + void updateUser(UserReqDTO reqDTO); /** * 删除用户. @@ -53,4 +52,12 @@ public interface UserService { */ List getUserLikeUsername(String userName); + /** + * 获取用户详情. + * + * @param reqDTO + * @return + */ + UserRespDTO getUser(UserReqDTO reqDTO); + } diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/PermissionServiceImpl.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/PermissionServiceImpl.java similarity index 77% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/PermissionServiceImpl.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/PermissionServiceImpl.java index 2a7bd176..ddbf36f4 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/PermissionServiceImpl.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/PermissionServiceImpl.java @@ -1,15 +1,16 @@ -package com.github.dynamic.threadpool.auth.service.impl; +package cn.hippo4j.auth.service.impl; +import cn.hippo4j.auth.mapper.PermissionMapper; +import cn.hippo4j.auth.model.biz.permission.PermissionQueryPageReqDTO; +import cn.hippo4j.auth.model.biz.permission.PermissionRespDTO; +import cn.hippo4j.auth.service.PermissionService; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.github.dynamic.threadpool.auth.mapper.PermissionMapper; -import com.github.dynamic.threadpool.auth.model.PermissionInfo; -import com.github.dynamic.threadpool.auth.model.biz.permission.PermissionQueryPageReqDTO; -import com.github.dynamic.threadpool.auth.model.biz.permission.PermissionRespDTO; -import com.github.dynamic.threadpool.auth.service.PermissionService; +import cn.hippo4j.auth.model.PermissionInfo; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -54,9 +55,9 @@ public class PermissionServiceImpl implements PermissionService { @Override public void deletePermission(String role, String resource, String action) { LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(PermissionInfo.class) - .eq(PermissionInfo::getRole, role) - .eq(PermissionInfo::getResource, resource) - .eq(PermissionInfo::getAction, action); + .eq(StrUtil.isNotBlank(role), PermissionInfo::getRole, role) + .eq(StrUtil.isNotBlank(resource), PermissionInfo::getResource, resource) + .eq(StrUtil.isNotBlank(action), PermissionInfo::getAction, action); permissionMapper.delete(updateWrapper); } diff --git a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/RoleServiceImpl.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/RoleServiceImpl.java similarity index 67% rename from auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/RoleServiceImpl.java rename to hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/RoleServiceImpl.java index 4f15664b..04b7b59a 100644 --- a/auth/src/main/java/com/github/dynamic/threadpool/auth/service/impl/RoleServiceImpl.java +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/RoleServiceImpl.java @@ -1,15 +1,18 @@ -package com.github.dynamic.threadpool.auth.service.impl; +package cn.hippo4j.auth.service.impl; +import cn.hippo4j.auth.mapper.RoleMapper; +import cn.hippo4j.auth.model.biz.role.RoleQueryPageReqDTO; +import cn.hippo4j.auth.model.biz.role.RoleRespDTO; +import cn.hippo4j.auth.service.PermissionService; +import cn.hippo4j.auth.service.RoleService; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.github.dynamic.threadpool.auth.mapper.RoleMapper; -import com.github.dynamic.threadpool.auth.model.RoleInfo; -import com.github.dynamic.threadpool.auth.model.biz.role.RoleQueryPageReqDTO; -import com.github.dynamic.threadpool.auth.model.biz.role.RoleRespDTO; -import com.github.dynamic.threadpool.auth.service.RoleService; +import cn.hippo4j.auth.model.RoleInfo; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -28,6 +31,8 @@ public class RoleServiceImpl implements RoleService { private final RoleMapper roleMapper; + private final PermissionService permissionService; + @Override public IPage listRole(int pageNo, int pageSize) { RoleQueryPageReqDTO queryPage = new RoleQueryPageReqDTO(pageNo, pageSize); @@ -53,10 +58,18 @@ public class RoleServiceImpl implements RoleService { @Override public void deleteRole(String role, String userName) { + List roleStrList = CollUtil.toList(role); + if (StrUtil.isBlank(role)) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(RoleInfo.class).eq(RoleInfo::getUserName, userName); + roleStrList = roleMapper.selectList(queryWrapper).stream().map(RoleInfo::getRole).collect(Collectors.toList()); + } + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(RoleInfo.class) - .eq(RoleInfo::getRole, role) - .eq(RoleInfo::getUserName, userName); + .eq(StrUtil.isNotBlank(role), RoleInfo::getRole, role) + .eq(StrUtil.isNotBlank(userName), RoleInfo::getUserName, userName); roleMapper.delete(updateWrapper); + + roleStrList.forEach(each -> permissionService.deletePermission(each, "", "")); } @Override diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/UserDetailsServiceImpl.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/UserDetailsServiceImpl.java new file mode 100644 index 00000000..5a1c1fc9 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/UserDetailsServiceImpl.java @@ -0,0 +1,42 @@ +package cn.hippo4j.auth.service.impl; + +import cn.hippo4j.auth.mapper.UserMapper; +import cn.hippo4j.auth.model.UserInfo; +import cn.hippo4j.auth.model.biz.user.JwtUser; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Set; + +/** + * User details service impl. + * + * @author chen.ma + * @date 2021/11/9 22:26 + */ +public class UserDetailsServiceImpl implements UserDetailsService { + + @Resource + private UserMapper userMapper; + + @Override + public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException { + UserInfo userInfo = userMapper.selectOne(Wrappers.lambdaQuery(UserInfo.class).eq(UserInfo::getUserName, userName)); + + JwtUser jwtUser = new JwtUser(); + jwtUser.setId(userInfo.getId()); + jwtUser.setUsername(userName); + jwtUser.setPassword(userInfo.getPassword()); + + Set authorities = Collections.singleton(new SimpleGrantedAuthority(userInfo.getRole() + "")); + jwtUser.setAuthorities(authorities); + + return jwtUser; + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/UserServiceImpl.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/UserServiceImpl.java new file mode 100644 index 00000000..6b0470fa --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/service/impl/UserServiceImpl.java @@ -0,0 +1,109 @@ +package cn.hippo4j.auth.service.impl; + +import cn.hippo4j.auth.mapper.UserMapper; +import cn.hippo4j.auth.model.UserInfo; +import cn.hippo4j.auth.model.biz.user.UserQueryPageReqDTO; +import cn.hippo4j.auth.model.biz.user.UserReqDTO; +import cn.hippo4j.auth.model.biz.user.UserRespDTO; +import cn.hippo4j.auth.service.RoleService; +import cn.hippo4j.auth.service.UserService; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.common.web.exception.ServiceException; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.AllArgsConstructor; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * User service impl. + * + * @author chen.ma + * @date 2021/10/30 21:40 + */ +@Service +@AllArgsConstructor +public class UserServiceImpl implements UserService { + + private final UserMapper userMapper; + + private final RoleService roleService; + + private final BCryptPasswordEncoder bCryptPasswordEncoder; + + @Override + public IPage listUser(UserQueryPageReqDTO reqDTO) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(UserInfo.class) + .eq(StringUtil.isNotBlank(reqDTO.getUserName()), UserInfo::getUserName, reqDTO.getUserName()); + IPage selectPage = userMapper.selectPage(reqDTO, queryWrapper); + + return selectPage.convert(each -> BeanUtil.toBean(each, UserRespDTO.class)); + } + + @Override + public void addUser(UserReqDTO reqDTO) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(UserInfo.class) + .eq(UserInfo::getUserName, reqDTO.getUserName()); + UserInfo existUserInfo = userMapper.selectOne(queryWrapper); + if (existUserInfo != null) { + throw new RuntimeException("用户名重复"); + } + + reqDTO.setPassword(bCryptPasswordEncoder.encode(reqDTO.getPassword())); + UserInfo insertUser = BeanUtil.toBean(reqDTO, UserInfo.class); + userMapper.insert(insertUser); + } + + @Override + public void updateUser(UserReqDTO reqDTO) { + if (StrUtil.isNotBlank(reqDTO.getPassword())) { + reqDTO.setPassword(bCryptPasswordEncoder.encode(reqDTO.getPassword())); + } + UserInfo updateUser = BeanUtil.toBean(reqDTO, UserInfo.class); + + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(UserInfo.class) + .eq(UserInfo::getUserName, reqDTO.getUserName()); + userMapper.update(updateUser, updateWrapper); + } + + @Override + public void deleteUser(String userName) { + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(UserInfo.class) + .eq(UserInfo::getUserName, userName); + userMapper.delete(updateWrapper); + // roleService.deleteRole("", userName); + } + + @Override + public List getUserLikeUsername(String userName) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(UserInfo.class) + .like(UserInfo::getUserName, userName) + .select(UserInfo::getUserName); + + List userInfos = userMapper.selectList(queryWrapper); + List userNames = userInfos.stream().map(UserInfo::getUserName).collect(Collectors.toList()); + + return userNames; + } + + @Override + public UserRespDTO getUser(UserReqDTO reqDTO) { + Wrapper queryWrapper = Wrappers.lambdaQuery(UserInfo.class).eq(UserInfo::getUserName, reqDTO.getUserName()); + UserInfo userInfo = userMapper.selectOne(queryWrapper); + + UserRespDTO respUser = Optional.ofNullable(userInfo) + .map(each -> BeanUtil.toBean(each, UserRespDTO.class)) + .orElseThrow(() -> new ServiceException("查询无此用户, 可以尝试清空缓存或退出登录.")); + return respUser; + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/toolkit/JwtTokenUtil.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/toolkit/JwtTokenUtil.java new file mode 100644 index 00000000..bdcaa95d --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/toolkit/JwtTokenUtil.java @@ -0,0 +1,118 @@ +package cn.hippo4j.auth.toolkit; + +import cn.hippo4j.auth.constant.Constants; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.ExpiredJwtException; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; + +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import static cn.hippo4j.common.constant.Constants.MAP_INITIAL_CAPACITY; + +/** + * Jwt token util. + * + * @author chen.ma + * @date 2021/11/9 22:43 + */ +public class JwtTokenUtil { + + public static final String TOKEN_HEADER = "Authorization"; + public static final String TOKEN_PREFIX = "Bearer "; + + public static final String SECRET = "SecretKey039245678901232039487623456783092349288901402967890140939827"; + public static final String ISS = "admin"; + + /** + * 角色的 Key + */ + private static final String ROLE_CLAIMS = "rol"; + + /** + * 过期时间是 3600 秒, 既 24 小时 + */ + private static final long EXPIRATION = 86400L; + + /** + * 选择了记住我之后的过期时间为 7 天 + */ + private static final long EXPIRATION_REMEMBER = 7 * EXPIRATION; + + /** + * 创建 Token. + * + * @param id + * @param username + * @param role + * @param isRememberMe + * @return + */ + public static String createToken(Long id, String username, String role, boolean isRememberMe) { + long expiration = isRememberMe ? EXPIRATION_REMEMBER : EXPIRATION; + HashMap map = new HashMap(MAP_INITIAL_CAPACITY); + map.put(ROLE_CLAIMS, role); + return Jwts.builder() + .signWith(SignatureAlgorithm.HS512, SECRET) + .setClaims(map) + .setIssuer(ISS) + .setSubject(id + Constants.SPLIT_COMMA + username) + .setIssuedAt(new Date()) + .setExpiration(new Date(System.currentTimeMillis() + expiration * 1000)) + .compact(); + } + + /** + * Token 中获取用户名. + * + * @param token + * @return + */ + public static String getUsername(String token) { + List userInfo = Arrays.asList(getTokenBody(token).getSubject().split(Constants.SPLIT_COMMA)); + return userInfo.get(1); + } + + /** + * Token 中获取用户名. + * + * @param token + * @return + */ + public static Integer getUserId(String token) { + List userInfo = Arrays.asList(getTokenBody(token).getSubject().split(Constants.SPLIT_COMMA)); + return Integer.parseInt(userInfo.get(0)); + } + + /** + * 获取用户角色. + * + * @param token + * @return + */ + public static String getUserRole(String token) { + return (String) getTokenBody(token).get(ROLE_CLAIMS); + } + + /** + * 是否已过期. + * + * @param token + * @return + */ + public static boolean isExpiration(String token) { + try { + return getTokenBody(token).getExpiration().before(new Date()); + } catch (ExpiredJwtException e) { + return true; + } + } + + private static Claims getTokenBody(String token) { + return Jwts.parser().setSigningKey(SECRET).parseClaimsJws(token).getBody(); + } + +} diff --git a/hippo4j-auth/src/main/java/cn/hippo4j/auth/toolkit/ReturnT.java b/hippo4j-auth/src/main/java/cn/hippo4j/auth/toolkit/ReturnT.java new file mode 100644 index 00000000..f46e4de8 --- /dev/null +++ b/hippo4j-auth/src/main/java/cn/hippo4j/auth/toolkit/ReturnT.java @@ -0,0 +1,40 @@ +package cn.hippo4j.auth.toolkit; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * ReturnT. + * + * @author chen.ma + * @date 2021/11/10 00:00 + */ +@Data +@NoArgsConstructor +public class ReturnT implements Serializable { + + public static final long serialVersionUID = 42L; + + public static final int SUCCESS_CODE = 200; + public static final int FAIL_CODE = 500; + + public static final ReturnT SUCCESS = new ReturnT<>(null); + public static final ReturnT FAIL = new ReturnT<>(FAIL_CODE, null); + + private int code; + private String msg; + private T content; + + public ReturnT(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public ReturnT(T content) { + this.code = SUCCESS_CODE; + this.content = content; + } + +} diff --git a/common/.gitignore b/hippo4j-common/.gitignore similarity index 100% rename from common/.gitignore rename to hippo4j-common/.gitignore diff --git a/dynamic-threadpool-spring-boot-starter/pom.xml b/hippo4j-common/pom.xml similarity index 67% rename from dynamic-threadpool-spring-boot-starter/pom.xml rename to hippo4j-common/pom.xml index a5bef1b2..2564b9e0 100644 --- a/dynamic-threadpool-spring-boot-starter/pom.xml +++ b/hippo4j-common/pom.xml @@ -4,16 +4,16 @@ 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} - dynamic-threadpool-spring-boot-starter + hippo4j-common jar ${project.artifactId} - ${project.artifactId} + HIPPO4J、HIPPO4J-CORE 公共代码库. @@ -22,49 +22,36 @@ - org.springframework.boot - spring-boot-starter-web - - - - cn.hutool - hutool-all - - - - com.squareup.okhttp3 - logging-interceptor - - - - com.alibaba - fastjson + org.projectlombok + lombok - com.github.dynamic-threadpool - common + org.springframework.boot + spring-boot-starter-json - org.springframework.boot - spring-boot-configuration-processor - true + com.google.guava + guava - org.projectlombok - lombok + cn.hutool + hutool-all com.aliyun alibaba-dingtalk-service-sdk - - - - com.google.guava - guava + + + + log4j + log4j + + + true @@ -84,6 +71,19 @@ + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + + jar + + + + diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/ClientCloseHookExecute.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ClientCloseHookExecute.java new file mode 100644 index 00000000..05746360 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ClientCloseHookExecute.java @@ -0,0 +1,42 @@ +package cn.hippo4j.common.api; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * Client close hook execute. + * + * @author chen.ma + * @date 2022/1/6 22:14 + */ +public interface ClientCloseHookExecute { + + /** + * Client close hook function execution. + * + * @param req + */ + void closeHook(ClientCloseHookReq req); + + @Data + @Accessors(chain = true) + class ClientCloseHookReq { + + /** + * appName + */ + private String appName; + + /** + * instanceId + */ + private String instanceId; + + /** + * groupKey + */ + private String groupKey; + + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/JsonFacade.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/JsonFacade.java new file mode 100644 index 00000000..566bbb71 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/JsonFacade.java @@ -0,0 +1,41 @@ +package cn.hippo4j.common.api; + +import java.util.List; + +/** + * Json facade. + * + * @author chen.ma + * @date 2021/12/13 20:01 + */ +public interface JsonFacade { + + /** + * To JSON string. + * + * @param object + * @return + */ + String toJSONString(Object object); + + /** + * Parse object. + * + * @param text + * @param clazz + * @param + * @return + */ + T parseObject(String text, Class clazz); + + /** + * Parse array. + * + * @param text + * @param clazz + * @param + * @return + */ + List parseArray(String text, Class clazz); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/NotifyConfigBuilder.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/NotifyConfigBuilder.java new file mode 100644 index 00000000..951b91b0 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/NotifyConfigBuilder.java @@ -0,0 +1,23 @@ +package cn.hippo4j.common.api; + +import cn.hippo4j.common.notify.NotifyConfigDTO; + +import java.util.List; +import java.util.Map; + +/** + * Notify config builder. + * + * @author chen.ma + * @date 2022/2/24 19:50 + */ +public interface NotifyConfigBuilder { + + /** + * Build notify. + * + * @return + */ + Map> buildNotify(); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadDetailState.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadDetailState.java new file mode 100644 index 00000000..a6bb2523 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadDetailState.java @@ -0,0 +1,32 @@ +package cn.hippo4j.common.api; + +import cn.hippo4j.common.model.ThreadDetailStateInfo; + +import java.util.List; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * Get thread status in thread pool. + * + * @author chen.ma + * @date 2022/1/9 12:47 + */ +public interface ThreadDetailState { + + /** + * Get thread status in thread pool. + * + * @param threadPoolId + * @return + */ + List getThreadDetailStateInfo(String threadPoolId); + + /** + * Get thread status in thread pool. + * + * @param threadPoolExecutor + * @return + */ + List getThreadDetailStateInfo(ThreadPoolExecutor threadPoolExecutor); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java new file mode 100644 index 00000000..0f2733da --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java @@ -0,0 +1,18 @@ +package cn.hippo4j.common.api; + +/** + * Thread pool dynamic refresh. + * + * @author chen.ma + * @date 2022/2/26 12:26 + */ +public interface ThreadPoolDynamicRefresh { + + /** + * Dynamic refresh. + * + * @param content + */ + void dynamicRefresh(String content); + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/config/ApplicationContextHolder.java b/hippo4j-common/src/main/java/cn/hippo4j/common/config/ApplicationContextHolder.java similarity index 97% rename from common/src/main/java/com/github/dynamic/threadpool/common/config/ApplicationContextHolder.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/config/ApplicationContextHolder.java index f12df7e4..574366ec 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/config/ApplicationContextHolder.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/config/ApplicationContextHolder.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.config; +package cn.hippo4j.common.config; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/constant/Constants.java b/hippo4j-common/src/main/java/cn/hippo4j/common/constant/Constants.java similarity index 54% rename from common/src/main/java/com/github/dynamic/threadpool/common/constant/Constants.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/constant/Constants.java index cc40c294..1b482c4e 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/constant/Constants.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/constant/Constants.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.constant; +package cn.hippo4j.common.constant; /** * Constants. @@ -14,10 +14,20 @@ public class Constants { public static final String NAMESPACE = "namespace"; + public static final String GROUP_KEY = "groupKey"; + + public static final String AUTHORITIES_KEY = "auth"; + + public static final String ACCESS_TOKEN = "accessToken"; + + public static final String TOKEN_TTL = "tokenTtl"; + public static final String DEFAULT_NAMESPACE_ID = "public"; public static final String NULL = ""; + public static final String UP = "UP"; + public static final String ENCODE = "UTF-8"; public static final int CONFIG_LONG_POLL_TIMEOUT = 30000; @@ -28,28 +38,52 @@ public class Constants { public static final String GENERAL_SPLIT_SYMBOL = ","; + public static final String IDENTIFY_SLICER_SYMBOL = "_"; + public static final String LONG_POLLING_LINE_SEPARATOR = "\r\n"; - public static final String BASE_PATH = "/v1/cs"; + public static final String BASE_PATH = "/hippo4j/v1/cs"; public static final String CONFIG_CONTROLLER_PATH = BASE_PATH + "/configs"; public static final String LISTENER_PATH = CONFIG_CONTROLLER_PATH + "/listener"; + public static final String MONITOR_PATH = BASE_PATH + "/monitor"; + + public static final String HEALTH_CHECK_PATH = BASE_PATH + "/health/check"; + public static final String PROBE_MODIFY_REQUEST = "Listening-Configs"; public static final String LONG_PULLING_TIMEOUT = "Long-Pulling-Timeout"; public static final String LONG_PULLING_TIMEOUT_NO_HANGUP = "Long-Pulling-Timeout-No-Hangup"; + public static final String LONG_PULLING_CLIENT_IDENTIFICATION = "Long-Pulling-Client-Identification"; + public static final String LISTENING_CONFIGS = "Listening-Configs"; + public static final String WEIGHT_CONFIGS = "Weight-Configs"; + public static final String GROUP_KEY_DELIMITER = "+"; + public static final String GROUP_KEY_DELIMITER_TRANSLATION = "\\+"; + public static final long EVICTION_INTERVAL_TIMER_IN_MS = 60 * 1000; public static final int SCHEDULED_THREAD_CORE_NUM = 1; public static final int MAP_INITIAL_CAPACITY = 16; + public static final int HEALTH_CHECK_INTERVAL = 5; + + public static final int AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors(); + + public static final String DEFAULT_GROUP = "default group"; + + public static final String UNKNOWN = "unknown"; + + public static final String EXECUTE_TIMEOUT_TRACE = "executeTimeoutTrace"; + + public static final int HTTP_EXECUTE_TIMEOUT = 5000; + } diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/Builder.java b/hippo4j-common/src/main/java/cn/hippo4j/common/design/builder/Builder.java similarity index 80% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/Builder.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/design/builder/Builder.java index 6f78b19e..d787ef53 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/Builder.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/design/builder/Builder.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.common.design.builder; import java.io.Serializable; diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/AbstractSubjectCenter.java b/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/AbstractSubjectCenter.java new file mode 100644 index 00000000..7c176edb --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/AbstractSubjectCenter.java @@ -0,0 +1,134 @@ +package cn.hippo4j.common.design.observer; + +import cn.hippo4j.common.toolkit.CollectionUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Send observer notification. + * + * @author chen.ma + * @date 2021/12/25 19:47 + */ +@Slf4j +public class AbstractSubjectCenter { + + private static final Map> OBSERVERS_MAP = new ConcurrentHashMap(); + + /** + * Register observer. + * + * @param observer + */ + public static void register(Observer observer) { + register(SubjectType.SPRING_CONTENT_REFRESHED.name(), observer); + } + + /** + * Register observer. + * + * @param subjectType + * @param observer + */ + public static void register(SubjectType subjectType, Observer observer) { + register(subjectType.name(), observer); + } + + /** + * Register observer. + * + * @param subject + * @param observer + */ + public static void register(String subject, Observer observer) { + if (StringUtil.isBlank(subject) || observer == null) { + log.warn("Register observer. A string whose subject or observer is empty or empty."); + return; + } + + List observers = OBSERVERS_MAP.get(subject); + if (CollectionUtil.isEmpty(observers)) { + observers = new ArrayList(); + } + + observers.add(observer); + OBSERVERS_MAP.put(subject, observers); + } + + /** + * Remove observer. + * + * @param observer + */ + public static void remove(Observer observer) { + remove(SubjectType.SPRING_CONTENT_REFRESHED.name(), observer); + } + + /** + * Remove observer. + * + * @param subject + * @param observer + */ + public static void remove(String subject, Observer observer) { + List observers; + if (StringUtil.isBlank(subject) || CollectionUtil.isEmpty((observers = OBSERVERS_MAP.get(subject))) || observer == null) { + log.warn("Remove observer. A string whose subject or observer is empty or empty."); + return; + } + + observers.remove(observer); + } + + /** + * Notify. + * + * @param subjectType + * @param observerMessage + */ + public static void notify(SubjectType subjectType, ObserverMessage observerMessage) { + notify(subjectType.name(), observerMessage); + } + + /** + * Notify. + * + * @param subject + * @param observerMessage + */ + public static void notify(String subject, ObserverMessage observerMessage) { + List observers = OBSERVERS_MAP.get(subject); + if (CollectionUtil.isEmpty(observers)) { + log.warn("Under the subject, there is no observer group."); + return; + } + + observers.parallelStream().forEach(each -> { + try { + each.accept(observerMessage); + } catch (Exception ex) { + log.error("Notification subject :: {} observer exception", subject); + } + }); + } + + public enum SubjectType { + + /** + * Spring content refreshed. + */ + SPRING_CONTENT_REFRESHED, + + /** + * Clear config cache. + */ + CLEAR_CONFIG_CACHE + + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/Observer.java b/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/Observer.java new file mode 100644 index 00000000..a8dbc17f --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/Observer.java @@ -0,0 +1,18 @@ +package cn.hippo4j.common.design.observer; + +/** + * Observer. + * + * @author chen.ma + * @date 2021/12/25 19:46 + */ +public interface Observer { + + /** + * Receive notification. + * + * @param observerMessage + */ + void accept(ObserverMessage observerMessage); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/ObserverMessage.java b/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/ObserverMessage.java new file mode 100644 index 00000000..9e9895b5 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/design/observer/ObserverMessage.java @@ -0,0 +1,18 @@ +package cn.hippo4j.common.design.observer; + +/** + * Message notifying observer. + * + * @author chen.ma + * @date 2021/12/25 19:54 + */ +public interface ObserverMessage { + + /** + * Message. + * + * @return + */ + T message(); + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/enums/DelEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/enums/DelEnum.java similarity index 91% rename from config/src/main/java/com/github/dynamic/threadpool/config/enums/DelEnum.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/enums/DelEnum.java index b6250841..7e6848c7 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/enums/DelEnum.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/enums/DelEnum.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.enums; +package cn.hippo4j.common.enums; /** * Del enum. diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/enums/EnableEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/enums/EnableEnum.java new file mode 100644 index 00000000..81c1b1c4 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/enums/EnableEnum.java @@ -0,0 +1,46 @@ +package cn.hippo4j.common.enums; + +import java.util.Objects; + +/** + * Enable enum. + * + * @author chen.ma + * @date 2021/12/21 20:34 + */ +public enum EnableEnum { + + /** + * True. + */ + YES("1"), + + /** + * False. + */ + NO("0"); + + private final String statusCode; + + EnableEnum(String statusCode) { + this.statusCode = statusCode; + } + + public String getCode() { + return this.statusCode; + } + + public Integer getIntCode() { + return Integer.parseInt(this.statusCode); + } + + @Override + public String toString() { + return statusCode; + } + + public static boolean getBool(Integer intStatusCode) { + return Objects.equals(intStatusCode, EnableEnum.YES.getIntCode()) ? true : false; + } + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/executor/ExecutorFactory.java b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/ExecutorFactory.java similarity index 93% rename from common/src/main/java/com/github/dynamic/threadpool/common/executor/ExecutorFactory.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/executor/ExecutorFactory.java index 7f5ef744..cebe8a40 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/executor/ExecutorFactory.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/ExecutorFactory.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.executor; +package cn.hippo4j.common.executor; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/executor/ThreadPoolManager.java b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/ThreadPoolManager.java similarity index 96% rename from common/src/main/java/com/github/dynamic/threadpool/common/executor/ThreadPoolManager.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/executor/ThreadPoolManager.java index d2262a39..0670aa95 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/executor/ThreadPoolManager.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/ThreadPoolManager.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.executor; +package cn.hippo4j.common.executor; import java.util.HashMap; import java.util.HashSet; diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/function/Matcher.java b/hippo4j-common/src/main/java/cn/hippo4j/common/function/Matcher.java new file mode 100644 index 00000000..92810bfa --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/function/Matcher.java @@ -0,0 +1,20 @@ +package cn.hippo4j.common.function; + +/** + * Matcher. + * + * @author chen.ma + * @date 2022/1/9 13:29 + */ +@FunctionalInterface +public interface Matcher { + + /** + * Match. + * + * @param t + * @return + */ + boolean match(T t); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/function/NoArgsConsumer.java b/hippo4j-common/src/main/java/cn/hippo4j/common/function/NoArgsConsumer.java new file mode 100644 index 00000000..c8fe64ae --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/function/NoArgsConsumer.java @@ -0,0 +1,17 @@ +package cn.hippo4j.common.function; + +/** + * 无参消费者. + * + * @author chen.ma + * @date 2021/11/9 00:06 + */ +@FunctionalInterface +public interface NoArgsConsumer { + + /** + * 方法执行 + */ + void accept(); + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/model/GlobalRemotePoolInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/GlobalRemotePoolInfo.java similarity index 95% rename from common/src/main/java/com/github/dynamic/threadpool/common/model/GlobalRemotePoolInfo.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/model/GlobalRemotePoolInfo.java index ef20d99a..a9f64620 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/model/GlobalRemotePoolInfo.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/GlobalRemotePoolInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.model; +package cn.hippo4j.common.model; import lombok.Getter; import lombok.Setter; diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/InstanceInfo.java similarity index 86% rename from common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/model/InstanceInfo.java index 88cb054d..d5d7e526 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/model/InstanceInfo.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/InstanceInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.model; +package cn.hippo4j.common.model; import lombok.Data; import lombok.Getter; @@ -24,6 +24,8 @@ public class InstanceInfo { private String hostName; + private String groupKey; + private String port; private String instanceId; @@ -34,6 +36,10 @@ public class InstanceInfo { private String callBackUrl; + private String identify; + + private String active; + private volatile String vipAddress; private volatile String secureVipAddress; @@ -95,14 +101,29 @@ public class InstanceInfo { public enum InstanceStatus { + /** + * UP + */ UP, + /** + * DOWN + */ DOWN, + /** + * STARTING + */ STARTING, + /** + * OUT_OF_SERVICE + */ OUT_OF_SERVICE, + /** + * UNKNOWN + */ UNKNOWN; public static InstanceStatus toEnum(String s) { @@ -119,10 +140,19 @@ public class InstanceInfo { } public enum ActionType { + /** + * ADDED + */ ADDED, + /** + * MODIFIED + */ MODIFIED, + /** + * DELETED + */ DELETED } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/model/ManyPoolRunStateInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/ManyPoolRunStateInfo.java new file mode 100644 index 00000000..76f205ed --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/ManyPoolRunStateInfo.java @@ -0,0 +1,29 @@ +package cn.hippo4j.common.model; + +import lombok.Data; + +/** + * Many pool run state info. + * + * @author chen.ma + * @date 2022/1/8 12:54 + */ +@Data +public class ManyPoolRunStateInfo extends PoolRunStateInfo { + + /** + * identify + */ + private String identify; + + /** + * active + */ + private String active; + + /** + * state + */ + private String state; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolBaseInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolBaseInfo.java new file mode 100644 index 00000000..9217821a --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolBaseInfo.java @@ -0,0 +1,46 @@ +package cn.hippo4j.common.model; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * Pool base info. + * + * @author chen.ma + * @date 2022/1/22 12:10 + */ +@Data +@Accessors(chain = true) +public class PoolBaseInfo { + + /** + * coreSize + */ + private Integer coreSize; + + /** + * maximumSize + */ + private Integer maximumSize; + + /** + * queueType + */ + private String queueType; + + /** + * queueCapacity + */ + private Integer queueCapacity; + + /** + * rejectedName + */ + private String rejectedName; + + /** + * keepAliveTime + */ + private Long keepAliveTime; + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/model/PoolParameter.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolParameter.java similarity index 88% rename from common/src/main/java/com/github/dynamic/threadpool/common/model/PoolParameter.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolParameter.java index e46e4504..c21e380d 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/model/PoolParameter.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolParameter.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.model; +package cn.hippo4j.common.model; /** * Pool parameter. @@ -92,4 +92,11 @@ public interface PoolParameter { */ Integer getLivenessAlarm(); + /** + * allowCoreThreadTimeOut + * + * @return + */ + Integer getAllowCoreThreadTimeOut(); + } diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/model/PoolParameterInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolParameterInfo.java similarity index 90% rename from common/src/main/java/com/github/dynamic/threadpool/common/model/PoolParameterInfo.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolParameterInfo.java index 18e5a354..5eaf0020 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/model/PoolParameterInfo.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolParameterInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.model; +package cn.hippo4j.common.model; import lombok.Data; import lombok.experimental.Accessors; @@ -82,4 +82,9 @@ public class PoolParameterInfo implements PoolParameter, Serializable { */ private Integer livenessAlarm; + /** + * allowCoreThreadTimeOut + */ + private Integer allowCoreThreadTimeOut; + } diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/model/PoolRunStateInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolRunStateInfo.java similarity index 60% rename from common/src/main/java/com/github/dynamic/threadpool/common/model/PoolRunStateInfo.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolRunStateInfo.java index f2915c93..b29bcb2b 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/model/PoolRunStateInfo.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/PoolRunStateInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.model; +package cn.hippo4j.common.model; import lombok.Getter; import lombok.Setter; @@ -13,7 +13,7 @@ import java.io.Serializable; */ @Getter @Setter -public class PoolRunStateInfo implements Serializable { +public class PoolRunStateInfo extends PoolBaseInfo implements Serializable { /** * currentLoad @@ -31,14 +31,9 @@ public class PoolRunStateInfo implements Serializable { private String tpId; /** - * coreSize + * activeCount */ - private Integer coreSize; - - /** - * maximumSize - */ - private Integer maximumSize; + private Integer activeCount; /** * poolSize @@ -55,16 +50,6 @@ public class PoolRunStateInfo implements Serializable { */ private Integer largestPoolSize; - /** - * queueType - */ - private String queueType; - - /** - * queueCapacity - */ - private Integer queueCapacity; - /** * queueSize */ @@ -83,11 +68,39 @@ public class PoolRunStateInfo implements Serializable { /** * rejectCount */ - private Integer rejectCount; + private Long rejectCount; /** * host */ private String host; + /** + * memoryProportion + */ + private String memoryProportion; + + /** + * freeMemory + */ + private String freeMemory; + + /** + * clientLastRefreshTime + */ + private String clientLastRefreshTime; + + /** + * timestamp + */ + private Long timestamp; + + public Integer getSimpleCurrentLoad() { + return Integer.parseInt(getCurrentLoad().replace("%", "")); + } + + public Integer getSimplePeakLoad() { + return Integer.parseInt(getPeakLoad().replace("%", "")); + } + } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/model/ThreadDetailStateInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/ThreadDetailStateInfo.java new file mode 100644 index 00000000..72663bd9 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/ThreadDetailStateInfo.java @@ -0,0 +1,38 @@ +package cn.hippo4j.common.model; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * Thread detail state info. + * + * @author chen.ma + * @date 2022/1/9 12:36 + */ +@Data +@Accessors(chain = true) +public class ThreadDetailStateInfo { + + /** + * threadId + */ + private Long threadId; + + /** + * threadName + */ + private String threadName; + + /** + * threadStatus + */ + private String threadStatus; + + /** + * threadStack + */ + private List threadStack; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/model/TokenInfo.java b/hippo4j-common/src/main/java/cn/hippo4j/common/model/TokenInfo.java new file mode 100644 index 00000000..81a2a2eb --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/model/TokenInfo.java @@ -0,0 +1,28 @@ +package cn.hippo4j.common.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Token info. + * + * @author chen.ma + * @date 2021/12/20 20:02 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class TokenInfo { + + /** + * accessToken + */ + private String accessToken; + + /** + * tokenTtl + */ + private Long tokenTtl; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/AbstractMessage.java b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/AbstractMessage.java new file mode 100644 index 00000000..201c48da --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/AbstractMessage.java @@ -0,0 +1,33 @@ +package cn.hippo4j.common.monitor; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * Base message. + * + * @author chen.ma + * @date 2021/12/7 20:31 + */ +@Data +@NoArgsConstructor +public abstract class AbstractMessage implements Message { + + /** + * groupKey: tenant + item + tpId + identify + */ + private String groupKey; + + /** + * messageTypeEnum + */ + private MessageTypeEnum messageType; + + /** + * message + */ + private List messages; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/Message.java b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/Message.java new file mode 100644 index 00000000..70de9bdd --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/Message.java @@ -0,0 +1,35 @@ +package cn.hippo4j.common.monitor; + +import java.io.Serializable; +import java.util.List; + +/** + * Abstract message monitoring interface. + * + * @author chen.ma + * @date 2021/12/6 20:16 + */ +public interface Message extends Serializable { + + /** + * Get groupKey. + * + * @return + */ + String getGroupKey(); + + /** + * Get message type. + * + * @return + */ + MessageTypeEnum getMessageType(); + + /** + * Get messages. + * + * @return + */ + List getMessages(); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageRequest.java new file mode 100644 index 00000000..8ca09d64 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageRequest.java @@ -0,0 +1,35 @@ +package cn.hippo4j.common.monitor; + +import java.util.List; +import java.util.Map; + +/** + * Message request. + * + * @author chen.ma + * @date 2021/12/10 21:17 + */ +public interface MessageRequest { + + /** + * Get content params. + * + * @return + */ + List> getContentParams(); + + /** + * Get response class. + * + * @return + */ + Class getResponseClass(); + + /** + * Get message type. + * + * @return + */ + MessageTypeEnum getMessageType(); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageTypeEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageTypeEnum.java new file mode 100644 index 00000000..e4546a53 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageTypeEnum.java @@ -0,0 +1,21 @@ +package cn.hippo4j.common.monitor; + +/** + * Message type enum. + * + * @author chen.ma + * @date 2021/12/7 19:34 + */ +public enum MessageTypeEnum { + + /** + * RUNTIME + */ + RUNTIME, + + /** + * DEFAULT + */ + DEFAULT + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageWrapper.java b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageWrapper.java new file mode 100644 index 00000000..3acb1258 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/MessageWrapper.java @@ -0,0 +1,51 @@ +package cn.hippo4j.common.monitor; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * Message wrapper. + * + * @author chen.ma + * @date 2021/12/7 22:42 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class MessageWrapper implements MessageRequest { + + /** + * contentParams + */ + private List> contentParams; + + /** + * responseClass + */ + private Class responseClass; + + /** + * getMessageType + */ + private MessageTypeEnum messageType; + + @Override + public List> getContentParams() { + return contentParams; + } + + @Override + public Class getResponseClass() { + return responseClass; + } + + @Override + public MessageTypeEnum getMessageType() { + return messageType; + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/RuntimeMessage.java b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/RuntimeMessage.java new file mode 100644 index 00000000..058e38db --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/monitor/RuntimeMessage.java @@ -0,0 +1,71 @@ +package cn.hippo4j.common.monitor; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Dynamic thread pool runtime data. + * + * @author chen.ma + * @date 2021/12/6 18:18 + */ +@Data +@NoArgsConstructor +public class RuntimeMessage extends AbstractMessage { + + /** + * currentLoad + */ + private String currentLoad; + + /** + * peakLoad + */ + private String peakLoad; + + /** + * poolSize + */ + private Integer poolSize; + + /** + * The maximum number of threads that enter the thread pool at the same time + */ + private Integer largestPoolSize; + + /** + * activeSize + */ + private String activeSize; + + /** + * queueCapacity + */ + private Integer queueCapacity; + + /** + * queueSize + */ + private Integer queueSize; + + /** + * queueRemainingCapacity + */ + private String queueRemainingCapacity; + + /** + * completedTaskCount + */ + private Long completedTaskCount; + + /** + * rejectCount + */ + private Integer rejectCount; + + /** + * timestamp + */ + private Long timestamp; + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/AlarmControlDTO.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/AlarmControlDTO.java similarity index 61% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/AlarmControlDTO.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/notify/AlarmControlDTO.java index ae2b8d3a..3bca8893 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/alarm/AlarmControlDTO.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/AlarmControlDTO.java @@ -1,5 +1,6 @@ -package com.github.dynamic.threadpool.starter.alarm; +package cn.hippo4j.common.notify; +import cn.hutool.core.util.StrUtil; import lombok.Builder; import lombok.Data; @@ -18,10 +19,15 @@ public class AlarmControlDTO { */ private String threadPool; + /** + * 推送报警平台 + */ + private String platform; + /** * 推送报警类型 */ - private MessageTypeEnum typeEnum; + private NotifyTypeEnum typeEnum; /** * 构建线程池报警标识 @@ -29,7 +35,7 @@ public class AlarmControlDTO { * @return */ public String buildPk() { - return threadPool + "_" + typeEnum; + return StrUtil.builder(threadPool, "+", platform).toString(); } } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/AlarmControlHandler.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/AlarmControlHandler.java new file mode 100644 index 00000000..019af2f9 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/AlarmControlHandler.java @@ -0,0 +1,77 @@ +package cn.hippo4j.common.notify; + +import cn.hippo4j.common.constant.Constants; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.Maps; + +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; + +/** + * Alarm control assembly. + * + * @author chen.ma + * @date 2021/10/28 21:24 + */ +public class AlarmControlHandler { + + private final Map threadPoolLock = Maps.newHashMap(); + + private final Map> threadPoolAlarmCache = Maps.newConcurrentMap(); + + /** + * Control message push alarm frequency. + * + * @param alarmControl + * @return + */ + public boolean isSendAlarm(AlarmControlDTO alarmControl) { + String threadPoolKey = alarmControl.buildPk(); + Cache cache = threadPoolAlarmCache.get(threadPoolKey); + if (cache == null) { + return false; + } + + String pkId = cache.getIfPresent(alarmControl.getTypeEnum().name()); + if (StrUtil.isBlank(pkId)) { + ReentrantLock lock = threadPoolLock.get(threadPoolKey); + lock.lock(); + try { + pkId = cache.getIfPresent(alarmControl.getTypeEnum().name()); + if (StrUtil.isBlank(pkId)) { + // Val meaningless. + cache.put(alarmControl.getTypeEnum().name(), IdUtil.simpleUUID()); + return true; + } + } finally { + lock.unlock(); + } + } + + return false; + } + + /** + * Init cache and lock. + * + * @param threadPoolId + * @param platform + * @param interval + */ + public void initCacheAndLock(String threadPoolId, String platform, Integer interval) { + String threadPoolKey = StrUtil.builder(threadPoolId, Constants.GROUP_KEY_DELIMITER, platform).toString(); + Cache cache = CacheBuilder.newBuilder() + .expireAfterWrite(interval, TimeUnit.MINUTES) + .build(); + threadPoolAlarmCache.put(threadPoolKey, cache); + + // Set the lock to prevent false sending of alarm information. + ReentrantLock reentrantLock = new ReentrantLock(); + threadPoolLock.put(threadPoolKey, reentrantLock); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/HippoBaseSendMessageService.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/HippoBaseSendMessageService.java new file mode 100644 index 00000000..0eaf2012 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/HippoBaseSendMessageService.java @@ -0,0 +1,124 @@ +package cn.hippo4j.common.notify; + +import cn.hippo4j.common.api.NotifyConfigBuilder; +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.notify.request.AlarmNotifyRequest; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Maps; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.CommandLineRunner; + +import java.util.List; +import java.util.Map; + +/** + * Base send message service impl. + * + * @author chen.ma + * @date 2022/2/22 21:32 + */ +@Slf4j +@RequiredArgsConstructor +public class HippoBaseSendMessageService implements HippoSendMessageService, CommandLineRunner { + + private final NotifyConfigBuilder notifyConfigBuilder; + + private final AlarmControlHandler alarmControlHandler; + + private final Map> notifyConfigs = Maps.newHashMap(); + + private final Map sendMessageHandlers = Maps.newHashMap(); + + @Override + public void sendAlarmMessage(NotifyTypeEnum typeEnum, AlarmNotifyRequest alarmNotifyRequest) { + String threadPoolId = alarmNotifyRequest.getThreadPoolId(); + String buildKey = StrUtil.builder(threadPoolId, "+", "ALARM").toString(); + List notifyList = notifyConfigs.get(buildKey); + if (CollUtil.isEmpty(notifyList)) { + return; + } + + notifyList.forEach(each -> { + try { + SendMessageHandler messageHandler = sendMessageHandlers.get(each.getPlatform()); + if (messageHandler == null) { + log.warn("Please configure alarm notification on the server. key :: [{}]", threadPoolId); + return; + } + + if (isSendAlarm(each.getTpId(), each.getPlatform(), typeEnum)) { + alarmNotifyRequest.setNotifyTypeEnum(typeEnum); + messageHandler.sendAlarmMessage(each, alarmNotifyRequest); + } + } catch (Exception ex) { + log.warn("Failed to send thread pool alarm notification. key :: [{}]", threadPoolId, ex); + } + }); + } + + @Override + public void sendChangeMessage(ChangeParameterNotifyRequest changeParameterNotifyRequest) { + String threadPoolId = changeParameterNotifyRequest.getThreadPoolId(); + String buildKey = StrUtil.builder(threadPoolId, "+", "CONFIG").toString(); + List notifyList = notifyConfigs.get(buildKey); + if (CollUtil.isEmpty(notifyList)) { + log.warn("Please configure alarm notification on the server. key :: [{}]", threadPoolId); + return; + } + + notifyList.forEach(each -> { + try { + SendMessageHandler messageHandler = sendMessageHandlers.get(each.getPlatform()); + if (messageHandler == null) { + log.warn("Please configure alarm notification on the server. key :: [{}]", threadPoolId); + return; + } + + messageHandler.sendChangeMessage(each, changeParameterNotifyRequest); + } catch (Exception ex) { + log.warn("Failed to send thread pool change notification. key :: [{}]", threadPoolId, ex); + } + }); + } + + /** + * Is send alarm. + * + * @param threadPoolId + * @param platform + * @param typeEnum + * @return + */ + private boolean isSendAlarm(String threadPoolId, String platform, NotifyTypeEnum typeEnum) { + AlarmControlDTO alarmControl = AlarmControlDTO.builder() + .threadPool(threadPoolId) + .platform(platform) + .typeEnum(typeEnum) + .build(); + + return alarmControlHandler.isSendAlarm(alarmControl); + } + + @Override + public void run(String... args) throws Exception { + Map sendMessageHandlerMap = + ApplicationContextHolder.getBeansOfType(SendMessageHandler.class); + sendMessageHandlerMap.values().forEach(each -> sendMessageHandlers.put(each.getType(), each)); + + Map> buildNotify = notifyConfigBuilder.buildNotify(); + notifyConfigs.putAll(buildNotify); + } + + /** + * Put platform. + * + * @param notifyConfigs + */ + public synchronized void putPlatform(Map> notifyConfigs) { + this.notifyConfigs.putAll(notifyConfigs); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/HippoSendMessageService.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/HippoSendMessageService.java new file mode 100644 index 00000000..158d07fd --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/HippoSendMessageService.java @@ -0,0 +1,29 @@ +package cn.hippo4j.common.notify; + +import cn.hippo4j.common.notify.request.AlarmNotifyRequest; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; + +/** + * Send message service. + * + * @author chen.ma + * @date 2022/2/22 19:56 + */ +public interface HippoSendMessageService { + + /** + * Send alarm message. + * + * @param typeEnum + * @param alarmNotifyRequest + */ + void sendAlarmMessage(NotifyTypeEnum typeEnum, AlarmNotifyRequest alarmNotifyRequest); + + /** + * Send change message. + * + * @param changeParameterNotifyRequest + */ + void sendChangeMessage(ChangeParameterNotifyRequest changeParameterNotifyRequest); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyConfigDTO.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyConfigDTO.java new file mode 100644 index 00000000..84d5e48c --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyConfigDTO.java @@ -0,0 +1,61 @@ +package cn.hippo4j.common.notify; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 通知实体. + * + * @author chen.ma + * @date 2021/11/17 22:12 + */ +@Data +@Accessors(chain = true) +public class NotifyConfigDTO { + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 通知平台 + */ + private String platform; + + /** + * 通知类型 + */ + private String type; + + /** + * 密钥 + */ + private String secretKey; + + /** + * 报警间隔 + */ + private Integer interval; + + /** + * 接收者 + */ + private String receives; + + /** + * 报警类型 + */ + private NotifyTypeEnum typeEnum; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyPlatformEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyPlatformEnum.java new file mode 100644 index 00000000..3d2e65b4 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyPlatformEnum.java @@ -0,0 +1,26 @@ +package cn.hippo4j.common.notify; + +/** + * Notify platform enum. + * + * @author chen.ma + * @date 2021/8/15 15:50 + */ +public enum NotifyPlatformEnum { + + /** + * DING + */ + DING, + + /** + * LARK + */ + LARK, + + /** + * WECHAT + */ + WECHAT + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyTypeEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyTypeEnum.java new file mode 100644 index 00000000..14ce2685 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/NotifyTypeEnum.java @@ -0,0 +1,36 @@ +package cn.hippo4j.common.notify; + +/** + * Notify type enum. + * + * @author chen.ma + * @date 2022/2/22 19:44 + */ +public enum NotifyTypeEnum { + + /** + * CHANGE + */ + CHANGE, + + /** + * CAPACITY + */ + CAPACITY, + + /** + * ACTIVITY + */ + ACTIVITY, + + /** + * REJECT + */ + REJECT, + + /** + * TIMEOUT + */ + TIMEOUT + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/SendMessageHandler.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/SendMessageHandler.java new file mode 100644 index 00000000..13a8a961 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/SendMessageHandler.java @@ -0,0 +1,36 @@ +package cn.hippo4j.common.notify; + +import cn.hippo4j.common.notify.request.base.NotifyRequest; + +/** + * Send message handler. + * + * @author chen.ma + * @date 2021/8/15 15:44 + */ +public interface SendMessageHandler { + + /** + * Get type. + * + * @return + */ + String getType(); + + /** + * Send alarm message. + * + * @param notifyConfig + * @param alarmNotifyRequest + */ + void sendAlarmMessage(NotifyConfigDTO notifyConfig, T alarmNotifyRequest); + + /** + * Send change message. + * + * @param notifyConfig + * @param changeParameterNotifyRequest + */ + void sendChangeMessage(NotifyConfigDTO notifyConfig, R changeParameterNotifyRequest); + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/ThreadPoolNotifyAlarm.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/ThreadPoolNotifyAlarm.java new file mode 100644 index 00000000..0936ed85 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/ThreadPoolNotifyAlarm.java @@ -0,0 +1,56 @@ +package cn.hippo4j.common.notify; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; + +import java.util.Map; + +/** + * Thread pool notify alarm. + * + * @author chen.ma + * @date 2021/8/15 19:13 + */ +@Data +@NoArgsConstructor +@RequiredArgsConstructor +public class ThreadPoolNotifyAlarm { + + /** + * isAlarm + */ + @NonNull + private Boolean isAlarm; + + /** + * activeAlarm + */ + @NonNull + private Integer activeAlarm; + + /** + * capacityAlarm + */ + @NonNull + private Integer capacityAlarm; + + /** + * interval + */ + private Integer interval; + + /** + * receive + */ + private String receive; + + /** + * receives + * ps:暂不启用该配置,后续如果开发邮箱时或许有用 + */ + @Deprecated + private Map receives; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/ThreadPoolNotifyDTO.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/ThreadPoolNotifyDTO.java new file mode 100644 index 00000000..f864cd26 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/ThreadPoolNotifyDTO.java @@ -0,0 +1,26 @@ +package cn.hippo4j.common.notify; + +import lombok.Data; + +import java.util.List; + +/** + * Thread pool notify DTO. + * + * @author chen.ma + * @date 2022/2/24 19:08 + */ +@Data +public class ThreadPoolNotifyDTO { + + /** + * notifyKey + */ + private String notifyKey; + + /** + * notifyList + */ + private List notifyList; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/DingAlarmConstants.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/DingAlarmConstants.java new file mode 100644 index 00000000..380d4b9a --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/DingAlarmConstants.java @@ -0,0 +1,97 @@ +package cn.hippo4j.common.notify.platform; + +/** + * Ding alarm constants. + * + * @author chen.ma + * @date 2021/11/26 20:03 + */ +public class DingAlarmConstants { + + /** + * 钉钉机器人 Url + */ + public static final String DING_ROBOT_SERVER_URL = "https://oapi.dingtalk.com/robot/send?access_token="; + + /** + * 线程池报警通知标题 + */ + public static final String DING_ALARM_TITLE = "动态线程池告警"; + + /** + * 线程池参数变更通知标题 + */ + public static final String DING_NOTICE_TITLE = "动态线程池通知"; + + /** + * Trace 信息 + */ + public static final String DING_ALARM_TIMOUT_TRACE_REPLACE_TXT = "链路信息:%s \n\n"; + + /** + * 替换任务超时模板 + */ + public static final String DING_ALARM_TIMOUT_REPLACE_TXT = + "任务执行时间:%d / ms \n\n" + + "超时时间:%d / ms \n\n" + + DING_ALARM_TIMOUT_TRACE_REPLACE_TXT + + " --- \n\n "; + + /** + * 线程池报警通知文本 + */ + public static final String DING_ALARM_TXT = + "**[警报] %s - 动态线程池运行告警(%s)** \n\n" + + " --- \n\n " + + "线程池ID:%s \n\n " + + "应用名称:%s \n\n " + + "应用实例:%s \n\n " + + "实例标识:%s \n\n " + + " --- \n\n " + + "核心线程数:%d \n\n " + + "最大线程数:%d \n\n " + + "当前线程数:%d \n\n " + + "活跃线程数:%d \n\n " + + "最大任务数:%d \n\n " + + "线程池任务总量:%d \n\n " + + " --- \n\n " + + "队列类型:%s \n\n " + + "队列容量:%d \n\n " + + "队列元素个数:%d \n\n " + + "队列剩余个数:%d \n\n " + + " --- \n\n " + + DING_ALARM_TIMOUT_REPLACE_TXT + + "拒绝策略:%s \n\n" + + "拒绝策略执行次数:%d \n\n " + + "OWNER:@%s \n\n" + + "提示:%d 分钟内此线程池不会重复告警(可配置) \n\n" + + " --- \n\n " + + "**播报时间:%s**"; + + /** + * 线程池参数变更通知文本 + */ + public static final String DING_NOTICE_TXT = + "**[通知] %s - 动态线程池参数变更** \n\n" + + " --- \n\n " + + "线程池ID:%s \n\n " + + "应用名称:%s \n\n " + + "应用实例:%s \n\n " + + " --- \n\n " + + "核心线程数:%s \n\n " + + "最大线程数:%s \n\n " + + "核心线程超时:%s \n\n " + + "线程存活时间:%s \n\n" + + "执行超时时间:%s \n\n" + + " --- \n\n " + + "队列类型:%s \n\n " + + "队列容量:%s \n\n " + + "AGO 拒绝策略:%s \n\n" + + "NOW 拒绝策略:%s \n\n" + + " --- \n\n " + + "提示:动态线程池配置变更实时通知(无限制) \n\n" + + "OWNER:@%s \n\n" + + " --- \n\n " + + "**播报时间:%s**"; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/DingSendMessageHandler.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/DingSendMessageHandler.java new file mode 100644 index 00000000..52f77d9a --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/DingSendMessageHandler.java @@ -0,0 +1,177 @@ +package cn.hippo4j.common.notify.platform; + +import cn.hippo4j.common.notify.*; +import cn.hippo4j.common.notify.request.AlarmNotifyRequest; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.taobao.api.ApiException; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; +import java.util.Objects; + +import static cn.hippo4j.common.notify.platform.DingAlarmConstants.*; + +/** + * Send ding notification message. + * + * @author chen.ma + * @date 2021/8/15 15:49 + */ +@Slf4j +public class DingSendMessageHandler implements SendMessageHandler { + + @Override + public String getType() { + return NotifyPlatformEnum.DING.name(); + } + + @Override + public void sendAlarmMessage(NotifyConfigDTO notifyConfig, AlarmNotifyRequest alarmNotifyRequest) { + String[] receives = notifyConfig.getReceives().split(","); + String afterReceives = Joiner.on(", @").join(receives); + + String dingAlarmTxt; + String dingAlarmTimoutReplaceTxt; + if (Objects.equals(alarmNotifyRequest.getNotifyTypeEnum(), NotifyTypeEnum.TIMEOUT)) { + String executeTimeoutTrace = alarmNotifyRequest.getExecuteTimeoutTrace(); + if (StringUtil.isNotBlank(executeTimeoutTrace)) { + String dingAlarmTimoutTraceReplaceTxt = String.format(DING_ALARM_TIMOUT_TRACE_REPLACE_TXT, executeTimeoutTrace); + dingAlarmTimoutReplaceTxt = StrUtil.replace(DING_ALARM_TIMOUT_REPLACE_TXT, DING_ALARM_TIMOUT_TRACE_REPLACE_TXT, dingAlarmTimoutTraceReplaceTxt); + } else { + dingAlarmTimoutReplaceTxt = StrUtil.replace(DING_ALARM_TIMOUT_REPLACE_TXT, DING_ALARM_TIMOUT_TRACE_REPLACE_TXT, ""); + } + + dingAlarmTimoutReplaceTxt = String.format(dingAlarmTimoutReplaceTxt, alarmNotifyRequest.getExecuteTime(), alarmNotifyRequest.getExecuteTimeOut()); + dingAlarmTxt = StrUtil.replace(DING_ALARM_TXT, DING_ALARM_TIMOUT_REPLACE_TXT, dingAlarmTimoutReplaceTxt); + } else { + dingAlarmTxt = StrUtil.replace(DING_ALARM_TXT, DING_ALARM_TIMOUT_REPLACE_TXT, ""); + } + + String[] strings = alarmNotifyRequest.getIdentify().split("_"); + String text = String.format( + dingAlarmTxt, + // 环境 + alarmNotifyRequest.getActive(), + // 报警类型 + alarmNotifyRequest.getNotifyTypeEnum(), + // 线程池ID + alarmNotifyRequest.getThreadPoolId(), + // 应用名称 + alarmNotifyRequest.getAppName(), + // Host + strings[0], + // 实例ID + strings[1], + // 核心线程数 + alarmNotifyRequest.getCorePoolSize(), + // 最大线程数 + alarmNotifyRequest.getMaximumPoolSize(), + // 当前线程数 + alarmNotifyRequest.getPoolSize(), + // 活跃线程数 + alarmNotifyRequest.getActiveCount(), + // 最大任务数 + alarmNotifyRequest.getLargestPoolSize(), + // 线程池任务总量 + alarmNotifyRequest.getCompletedTaskCount(), + // 队列类型名称 + alarmNotifyRequest.getQueueName(), + // 队列容量 + alarmNotifyRequest.getCapacity(), + // 队列元素个数 + alarmNotifyRequest.getQueueSize(), + // 队列剩余个数 + alarmNotifyRequest.getRemainingCapacity(), + // 拒绝策略名称 + alarmNotifyRequest.getRejectedExecutionHandlerName(), + // 拒绝策略次数 + alarmNotifyRequest.getRejectCountNum(), + // 告警手机号 + afterReceives, + // 报警频率 + notifyConfig.getInterval(), + // 当前时间 + DateUtil.now() + ); + + execute(notifyConfig.getSecretKey(), DingAlarmConstants.DING_ALARM_TITLE, text, Lists.newArrayList(receives)); + } + + @Override + public void sendChangeMessage(NotifyConfigDTO notifyConfig, ChangeParameterNotifyRequest changeParameterNotifyRequest) { + String threadPoolId = changeParameterNotifyRequest.getThreadPoolId(); + + String[] receives = notifyConfig.getReceives().split(","); + String afterReceives = Joiner.on(", @").join(receives); + + /** + * hesitant e.g. ➲ ➜ ⇨ ➪ + */ + String text = String.format( + DING_NOTICE_TXT, + // 环境 + changeParameterNotifyRequest.getActive(), + // 线程池名称 + threadPoolId, + // 应用名称 + changeParameterNotifyRequest.getAppName(), + // 实例信息 + changeParameterNotifyRequest.getIdentify(), + // 核心线程数 + changeParameterNotifyRequest.getBeforeCorePoolSize() + " ➲ " + changeParameterNotifyRequest.getNowCorePoolSize(), + // 最大线程数 + changeParameterNotifyRequest.getBeforeMaximumPoolSize() + " ➲ " + changeParameterNotifyRequest.getNowMaximumPoolSize(), + // 核心线程超时 + changeParameterNotifyRequest.getBeforeAllowsCoreThreadTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowAllowsCoreThreadTimeOut(), + // 线程存活时间 + changeParameterNotifyRequest.getBeforeKeepAliveTime() + " ➲ " + changeParameterNotifyRequest.getNowKeepAliveTime(), + // 执行超时时间 + changeParameterNotifyRequest.getBeforeExecuteTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowExecuteTimeOut(), + // 阻塞队列 + changeParameterNotifyRequest.getBlockingQueueName(), + // 阻塞队列容量 + changeParameterNotifyRequest.getBeforeQueueCapacity() + " ➲ " + changeParameterNotifyRequest.getNowQueueCapacity(), + // 拒绝策略 + changeParameterNotifyRequest.getBeforeRejectedName(), + changeParameterNotifyRequest.getNowRejectedName(), + // 告警手机号 + afterReceives, + // 当前时间 + DateUtil.now() + ); + + execute(notifyConfig.getSecretKey(), DingAlarmConstants.DING_NOTICE_TITLE, text, Lists.newArrayList(receives)); + } + + private void execute(String secretKey, String title, String text, List mobiles) { + String serverUrl = DingAlarmConstants.DING_ROBOT_SERVER_URL + secretKey; + DingTalkClient dingTalkClient = new DefaultDingTalkClient(serverUrl); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("markdown"); + + OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); + markdown.setTitle(title); + markdown.setText(text); + + OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); + at.setAtMobiles(mobiles); + + request.setAt(at); + request.setMarkdown(markdown); + + try { + dingTalkClient.execute(request); + } catch (ApiException ex) { + log.error("Ding failed to send message", ex); + } + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/LarkAlarmConstants.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/LarkAlarmConstants.java new file mode 100644 index 00000000..eab0552d --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/LarkAlarmConstants.java @@ -0,0 +1,56 @@ +package cn.hippo4j.common.notify.platform; + +/** + * lark alarm constants. + * + * @author imyzt + * @date 2021-11-23 19:29 + */ +public class LarkAlarmConstants { + + /** + * lark bot url + */ + public static final String LARK_BOT_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/"; + + /** + * lark at format. openid + * 当配置openid时,机器人可以@人 + */ + public static final String LARK_AT_FORMAT_OPENID = ""; + + /** + * lark at format. username + * 当配置username时,只能蓝色字体展示@username,被@人无@提醒 + */ + public static final String LARK_AT_FORMAT_USERNAME = "%s"; + + /** + * lark openid prefix + */ + public static final String LARK_OPENID_PREFIX = "ou_"; + + /** + * Trace 信息 + */ + public static final String LARK_ALARM_TIMOUT_TRACE_REPLACE_TXT = ",{\"is_short\":true,\"text\":{\"content\":\"** 链路信息:** %s\",\"tag\":\"lark_md\"}}"; + + /** + * 替换任务超时模板 + */ + public static final String LARK_ALARM_TIMOUT_REPLACE_TXT = + "{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 任务执行时间:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 超时时间:** %s\",\"tag\":\"lark_md\"}}" + + LARK_ALARM_TIMOUT_TRACE_REPLACE_TXT + + "],\"tag\":\"div\"},{\"tag\":\"hr\"},"; + + /** + * lark alarm json str + */ + public static final String LARK_ALARM_JSON_STR = "{\"msg_type\":\"interactive\",\"card\":{\"config\":{\"wide_screen_mode\":true},\"header\":{\"template\":\"red\",\"title\":{\"content\":\"[\uD83D\uDD25警报] %s 动态线程池运行告警(%s)\",\"tag\":\"plain_text\"}},\"elements\":[{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 线程池ID:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 应用名称:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 应用实例:** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 核心线程数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 最大线程数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 当前线程数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 活跃线程数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 最大任务数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 线程池任务总量:** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 队列类型:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 队列容量:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 队列元素个数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 队列剩余个数:** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"}," + LARK_ALARM_TIMOUT_REPLACE_TXT + "{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 拒绝策略:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 拒绝策略执行次数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** OWNER:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 播报时间: ** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"tag\":\"note\",\"elements\":[{\"tag\":\"plain_text\",\"content\":\"提示: %s 分钟内此线程池不会重复告警(可配置)\"}]}]}}"; + + /** + * lark notice json str + */ + public static final String LARK_NOTICE_JSON_STR = "{\"msg_type\":\"interactive\",\"card\":{\"config\":{\"wide_screen_mode\":true},\"header\":{\"template\":\"greed\",\"title\":{\"content\":\"[通知] %s 动态线程池参数变更\",\"tag\":\"plain_text\"}},\"elements\":[{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 线程池ID:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 应用名称:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 应用实例:** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 核心线程数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 最大线程数:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 核心线程超时:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 线程存活时间:** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** 队列类型:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 队列容量:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 执行超时时间:** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"fields\":[{\"is_short\":true,\"text\":{\"content\":\"** AGO 拒绝策略:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** NOW 拒绝策略:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** OWNER:** %s\",\"tag\":\"lark_md\"}},{\"is_short\":true,\"text\":{\"content\":\"** 播报时间: ** %s\",\"tag\":\"lark_md\"}}],\"tag\":\"div\"},{\"tag\":\"hr\"},{\"tag\":\"note\",\"elements\":[{\"tag\":\"plain_text\",\"content\":\"提示:动态线程池配置变更实时通知(无限制)\"}]}]}}"; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/LarkSendMessageHandler.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/LarkSendMessageHandler.java new file mode 100644 index 00000000..7ce64163 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/LarkSendMessageHandler.java @@ -0,0 +1,171 @@ +package cn.hippo4j.common.notify.platform; + +import cn.hippo4j.common.notify.NotifyConfigDTO; +import cn.hippo4j.common.notify.NotifyPlatformEnum; +import cn.hippo4j.common.notify.NotifyTypeEnum; +import cn.hippo4j.common.notify.SendMessageHandler; +import cn.hippo4j.common.notify.request.AlarmNotifyRequest; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import lombok.AllArgsConstructor; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; + +import java.util.Arrays; +import java.util.Objects; +import java.util.stream.Collectors; + +import static cn.hippo4j.common.notify.platform.LarkAlarmConstants.*; + +/** + * Send lark notification message. + * + * @author imyzt + * @date 2021/11/22 21:12 + */ +@Slf4j +@AllArgsConstructor +public class LarkSendMessageHandler implements SendMessageHandler { + + @Override + public String getType() { + return NotifyPlatformEnum.LARK.name(); + } + + @Override + @SneakyThrows + public void sendAlarmMessage(NotifyConfigDTO notifyConfig, AlarmNotifyRequest alarmNotifyRequest) { + String afterReceives = getReceives(notifyConfig.getReceives()); + + String larkAlarmTxt; + String larkAlarmTimoutReplaceTxt; + if (Objects.equals(alarmNotifyRequest.getNotifyTypeEnum(), NotifyTypeEnum.TIMEOUT)) { + String executeTimeoutTrace = alarmNotifyRequest.getExecuteTimeoutTrace(); + if (StringUtil.isNotBlank(executeTimeoutTrace)) { + String larkAlarmTimoutTraceReplaceTxt = String.format(LARK_ALARM_TIMOUT_TRACE_REPLACE_TXT, executeTimeoutTrace); + larkAlarmTimoutReplaceTxt = StrUtil.replace(LARK_ALARM_TIMOUT_REPLACE_TXT, LARK_ALARM_TIMOUT_TRACE_REPLACE_TXT, larkAlarmTimoutTraceReplaceTxt); + } else { + larkAlarmTimoutReplaceTxt = StrUtil.replace(LARK_ALARM_TIMOUT_REPLACE_TXT, LARK_ALARM_TIMOUT_TRACE_REPLACE_TXT, ""); + } + + larkAlarmTimoutReplaceTxt = String.format(larkAlarmTimoutReplaceTxt, alarmNotifyRequest.getExecuteTime(), alarmNotifyRequest.getExecuteTimeOut()); + larkAlarmTxt = StrUtil.replace(LARK_ALARM_JSON_STR, LARK_ALARM_TIMOUT_REPLACE_TXT, larkAlarmTimoutReplaceTxt); + } else { + larkAlarmTxt = StrUtil.replace(LARK_ALARM_JSON_STR, LARK_ALARM_TIMOUT_REPLACE_TXT, ""); + } + + String text = String.format(larkAlarmTxt, + // 环境 + alarmNotifyRequest.getActive(), + // 报警类型 + alarmNotifyRequest.getNotifyTypeEnum(), + // 线程池ID + alarmNotifyRequest.getThreadPoolId(), + // 应用名称 + alarmNotifyRequest.getAppName(), + // 实例信息 + alarmNotifyRequest.getIdentify(), + // 核心线程数 + alarmNotifyRequest.getCorePoolSize(), + // 最大线程数 + alarmNotifyRequest.getMaximumPoolSize(), + // 当前线程数 + alarmNotifyRequest.getPoolSize(), + // 活跃线程数 + alarmNotifyRequest.getActiveCount(), + // 最大任务数 + alarmNotifyRequest.getLargestPoolSize(), + // 线程池任务总量 + alarmNotifyRequest.getCompletedTaskCount(), + // 队列类型名称 + alarmNotifyRequest.getQueueName(), + // 队列容量 + alarmNotifyRequest.getCapacity(), + // 队列元素个数 + alarmNotifyRequest.getQueueSize(), + // 队列剩余个数 + alarmNotifyRequest.getRemainingCapacity(), + // 拒绝策略名称 + alarmNotifyRequest.getRejectedExecutionHandlerName(), + // 拒绝策略次数 + alarmNotifyRequest.getRejectCountNum(), + // 告警手机号 + afterReceives, + // 当前时间 + DateUtil.now(), + // 报警频率 + notifyConfig.getInterval() + ); + + execute(notifyConfig.getSecretKey(), text); + } + + @Override + @SneakyThrows + public void sendChangeMessage(NotifyConfigDTO notifyConfig, ChangeParameterNotifyRequest changeParameterNotifyRequest) { + String threadPoolId = changeParameterNotifyRequest.getThreadPoolId(); + String afterReceives = getReceives(notifyConfig.getReceives()); + String larkNoticeJson = LARK_NOTICE_JSON_STR; + + /** + * hesitant e.g. ➲ ➜ ⇨ ➪ + */ + String text = String.format(larkNoticeJson, + // 环境 + changeParameterNotifyRequest.getActive(), + // 线程池名称 + threadPoolId, + // 应用名称 + changeParameterNotifyRequest.getAppName(), + // 实例信息 + changeParameterNotifyRequest.getIdentify(), + // 核心线程数 + changeParameterNotifyRequest.getBeforeCorePoolSize() + " ➲ " + changeParameterNotifyRequest.getNowCorePoolSize(), + // 最大线程数 + changeParameterNotifyRequest.getBeforeMaximumPoolSize() + " ➲ " + changeParameterNotifyRequest.getNowMaximumPoolSize(), + // 核心线程超时 + changeParameterNotifyRequest.getBeforeAllowsCoreThreadTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowAllowsCoreThreadTimeOut(), + // 线程存活时间 + changeParameterNotifyRequest.getBeforeKeepAliveTime() + " ➲ " + changeParameterNotifyRequest.getNowKeepAliveTime(), + // 阻塞队列 + changeParameterNotifyRequest.getBlockingQueueName(), + // 阻塞队列容量 + changeParameterNotifyRequest.getBeforeQueueCapacity() + " ➲ " + changeParameterNotifyRequest.getNowQueueCapacity(), + // 执行超时时间 + changeParameterNotifyRequest.getBeforeExecuteTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowExecuteTimeOut(), + // 拒绝策略 + changeParameterNotifyRequest.getBeforeRejectedName(), + changeParameterNotifyRequest.getNowRejectedName(), + // 告警手机号 + afterReceives, + // 当前时间 + DateUtil.now() + ); + + execute(notifyConfig.getSecretKey(), text); + } + + private String getReceives(String receives) { + if (StringUtil.isBlank(receives)) { + return ""; + } + return Arrays.stream(receives.split(",")) + .map(receive -> StrUtil.startWith(receive, LARK_OPENID_PREFIX) ? + String.format(LARK_AT_FORMAT_OPENID, receive) : String.format(LARK_AT_FORMAT_USERNAME, receive)) + .collect(Collectors.joining(" ")); + } + + private void execute(String secretKey, String text) { + String serverUrl = LARK_BOT_URL + secretKey; + + try { + HttpRequest.post(serverUrl).body(text).execute(); + } catch (Exception ex) { + log.error("Lark failed to send message", ex); + } + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/WeChatAlarmConstants.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/WeChatAlarmConstants.java new file mode 100644 index 00000000..c5f60646 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/WeChatAlarmConstants.java @@ -0,0 +1,75 @@ +package cn.hippo4j.common.notify.platform; + +/** + * We chat alarm constants. + * + * @author chen.ma + * @date 2021/11/26 20:03 + */ +public class WeChatAlarmConstants { + + /** + * 企微机器人 Url + */ + public static final String WE_CHAT_SERVER_URL = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="; + + /** + * Trace 信息 + */ + public static final String WE_CHAT_ALARM_TIMOUT_TRACE_REPLACE_TXT = "> 链路信息:%s \n"; + + /** + * 替换任务超时模板 + */ + public static final String WE_CHAT_ALARM_TIMOUT_REPLACE_TXT = + "> 任务执行时间:%s / ms \n" + + "> 超时时间:%s / ms \n" + + WE_CHAT_ALARM_TIMOUT_TRACE_REPLACE_TXT; + + /** + * 线程池报警通知文本 + */ + public static final String WE_CHAT_ALARM_TXT = + "### [警报] %s - 动态线程池运行告警(%s) \n" + + "> 线程池ID:%s \n" + + "> 应用名称:%s \n" + + "> 应用实例:%s \n" + + "> 核心线程数:%s \n" + + "> 最大线程数:%s \n" + + "> 当前线程数:%s \n" + + "> 活跃线程数:%s \n" + + "> 最大任务数:%s \n" + + "> 线程池任务总量:%s \n" + + "> 队列类型:%s \n" + + "> 队列容量:%s \n" + + "> 队列元素个数:%s \n" + + "> 队列剩余个数:%s \n" + + "> 拒绝策略:%s \n" + + "> 拒绝策略执行次数:%s \n" + + WE_CHAT_ALARM_TIMOUT_REPLACE_TXT + + "> OWNER:<@%s> \n" + + "> 提示:%d 分钟内此线程池不会重复告警(可配置) \n\n" + + "**播报时间:%s**"; + + /** + * 线程池参数变更通知文本 + */ + public static final String WE_CHAT_NOTICE_TXT = + "### [通知] %s - 动态线程池参数变更 \n" + + "> 线程池ID:%s \n" + + "> 应用名称:%s \n" + + "> 应用实例:%s \n" + + "> 核心线程数:%s \n" + + "> 最大线程数:%s \n" + + "> 核心线程超时:%s \n" + + "> 线程存活时间:%s \n" + + "> 执行超时时间:%s \n" + + "> 队列类型:%s \n" + + "> 队列容量:%s \n" + + "> AGO 拒绝策略:%s \n" + + "> NOW 拒绝策略:%s \n" + + "> OWNER:<@%s> \n" + + "> 提示:动态线程池配置变更实时通知(无限制) \n\n" + + "**播报时间:%s**"; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/WeChatSendMessageHandler.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/WeChatSendMessageHandler.java new file mode 100644 index 00000000..3260a4f1 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/platform/WeChatSendMessageHandler.java @@ -0,0 +1,194 @@ +package cn.hippo4j.common.notify.platform; + +import cn.hippo4j.common.notify.*; +import cn.hippo4j.common.notify.request.AlarmNotifyRequest; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.google.common.base.Joiner; +import lombok.Data; +import lombok.experimental.Accessors; +import lombok.extern.slf4j.Slf4j; + +import java.util.Objects; + +import static cn.hippo4j.common.notify.platform.WeChatAlarmConstants.*; + +/** + * WeChat send message handler. + * + * @author chen.ma + * @date 2021/11/26 20:06 + */ +@Slf4j +public class WeChatSendMessageHandler implements SendMessageHandler { + + @Override + public String getType() { + return NotifyPlatformEnum.WECHAT.name(); + } + + @Override + public void sendAlarmMessage(NotifyConfigDTO notifyConfig, AlarmNotifyRequest alarmNotifyRequest) { + String[] receives = notifyConfig.getReceives().split(","); + String afterReceives = Joiner.on("><@").join(receives); + + String weChatAlarmTxt; + String weChatAlarmTimoutReplaceTxt; + if (Objects.equals(alarmNotifyRequest.getNotifyTypeEnum(), NotifyTypeEnum.TIMEOUT)) { + String executeTimeoutTrace = alarmNotifyRequest.getExecuteTimeoutTrace(); + if (StringUtil.isNotBlank(executeTimeoutTrace)) { + String weChatAlarmTimoutTraceReplaceTxt = String.format(WE_CHAT_ALARM_TIMOUT_TRACE_REPLACE_TXT, executeTimeoutTrace); + weChatAlarmTimoutReplaceTxt = StrUtil.replace(WE_CHAT_ALARM_TIMOUT_REPLACE_TXT, WE_CHAT_ALARM_TIMOUT_TRACE_REPLACE_TXT, weChatAlarmTimoutTraceReplaceTxt); + } else { + weChatAlarmTimoutReplaceTxt = StrUtil.replace(WE_CHAT_ALARM_TIMOUT_REPLACE_TXT, WE_CHAT_ALARM_TIMOUT_TRACE_REPLACE_TXT, ""); + } + + weChatAlarmTimoutReplaceTxt = String.format(weChatAlarmTimoutReplaceTxt, alarmNotifyRequest.getExecuteTime(), alarmNotifyRequest.getExecuteTimeOut()); + weChatAlarmTxt = StrUtil.replace(WE_CHAT_ALARM_TXT, WE_CHAT_ALARM_TIMOUT_REPLACE_TXT, weChatAlarmTimoutReplaceTxt); + } else { + weChatAlarmTxt = StrUtil.replace(WE_CHAT_ALARM_TXT, WE_CHAT_ALARM_TIMOUT_REPLACE_TXT, ""); + } + + String text = String.format( + weChatAlarmTxt, + // 环境 + alarmNotifyRequest.getActive(), + // 报警类型 + alarmNotifyRequest.getNotifyTypeEnum(), + // 线程池ID + alarmNotifyRequest.getThreadPoolId(), + // 应用名称 + alarmNotifyRequest.getAppName(), + // 实例信息 + alarmNotifyRequest.getIdentify(), + // 核心线程数 + alarmNotifyRequest.getCorePoolSize(), + // 最大线程数 + alarmNotifyRequest.getMaximumPoolSize(), + // 当前线程数 + alarmNotifyRequest.getPoolSize(), + // 活跃线程数 + alarmNotifyRequest.getActiveCount(), + // 最大任务数 + alarmNotifyRequest.getLargestPoolSize(), + // 线程池任务总量 + alarmNotifyRequest.getCompletedTaskCount(), + // 队列类型名称 + alarmNotifyRequest.getQueueName(), + // 队列容量 + alarmNotifyRequest.getCapacity(), + // 队列元素个数 + alarmNotifyRequest.getQueueSize(), + // 队列剩余个数 + alarmNotifyRequest.getRemainingCapacity(), + // 拒绝策略名称 + alarmNotifyRequest.getRejectedExecutionHandlerName(), + // 拒绝策略次数 + alarmNotifyRequest.getRejectCountNum(), + // 告警手机号 + afterReceives, + // 报警频率 + notifyConfig.getInterval(), + // 当前时间 + DateUtil.now() + ); + execute(notifyConfig.getSecretKey(), text); + } + + @Override + public void sendChangeMessage(NotifyConfigDTO notifyConfig, ChangeParameterNotifyRequest changeParameterNotifyRequest) { + String threadPoolId = changeParameterNotifyRequest.getThreadPoolId(); + + String[] receives = notifyConfig.getReceives().split(","); + String afterReceives = Joiner.on("><@").join(receives); + + String text = String.format( + WE_CHAT_NOTICE_TXT, + // 环境 + changeParameterNotifyRequest.getActive(), + // 线程池名称 + threadPoolId, + // 应用名称 + changeParameterNotifyRequest.getAppName(), + // 实例信息 + changeParameterNotifyRequest.getIdentify(), + // 核心线程数 + changeParameterNotifyRequest.getBeforeCorePoolSize() + " ➲ " + changeParameterNotifyRequest.getNowCorePoolSize(), + // 最大线程数 + changeParameterNotifyRequest.getBeforeMaximumPoolSize() + " ➲ " + changeParameterNotifyRequest.getNowMaximumPoolSize(), + // 核心线程超时 + changeParameterNotifyRequest.getBeforeAllowsCoreThreadTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowAllowsCoreThreadTimeOut(), + // 线程存活时间 + changeParameterNotifyRequest.getBeforeKeepAliveTime() + " ➲ " + changeParameterNotifyRequest.getNowKeepAliveTime(), + // 执行超时时间 + changeParameterNotifyRequest.getBeforeExecuteTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowExecuteTimeOut(), + // 阻塞队列 + changeParameterNotifyRequest.getBlockingQueueName(), + // 阻塞队列容量 + changeParameterNotifyRequest.getBeforeQueueCapacity() + " ➲ " + changeParameterNotifyRequest.getNowQueueCapacity(), + // 拒绝策略 + changeParameterNotifyRequest.getBeforeRejectedName(), + changeParameterNotifyRequest.getNowRejectedName(), + // 告警手机号 + afterReceives, + // 当前时间 + DateUtil.now() + ); + + execute(notifyConfig.getSecretKey(), text); + } + + /** + * Execute. + * + * @param secretKey + * @param text + */ + private void execute(String secretKey, String text) { + String serverUrl = WE_CHAT_SERVER_URL + secretKey; + + try { + WeChatReqDTO weChatReq = new WeChatReqDTO(); + weChatReq.setMsgtype("markdown"); + + Markdown markdown = new Markdown(); + markdown.setContent(text); + weChatReq.setMarkdown(markdown); + + HttpRequest.post(serverUrl).body(JSONUtil.toJSONString(weChatReq)).execute(); + } catch (Exception ex) { + log.error("WeChat failed to send message", ex); + } + } + + @Data + @Accessors(chain = true) + public static class WeChatReqDTO { + + /** + * msgType + */ + private String msgtype; + + /** + * markdown + */ + private Markdown markdown; + + } + + @Data + public static class Markdown { + + /** + * content + */ + private String content; + + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/AlarmNotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/AlarmNotifyRequest.java new file mode 100644 index 00000000..b28faca6 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/AlarmNotifyRequest.java @@ -0,0 +1,118 @@ +package cn.hippo4j.common.notify.request; + +import cn.hippo4j.common.notify.NotifyTypeEnum; +import cn.hippo4j.common.notify.request.base.BaseNotifyRequest; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * Alarm notify request. + * + * @author chen.ma + * @date 2022/2/22 19:41 + */ +@Data +@Accessors(chain = true) +public class AlarmNotifyRequest extends BaseNotifyRequest { + + /** + * interval + */ + private Integer interval; + + /** + * notifyTypeEnum + */ + private NotifyTypeEnum notifyTypeEnum; + + /** + * active + */ + private String active; + + /** + * appName + */ + private String appName; + + /** + * identify + */ + private String identify; + + /** + * corePoolSize + */ + private Integer corePoolSize; + + /** + * maximumPoolSize + */ + private Integer maximumPoolSize; + + /** + * poolSize + */ + private Integer poolSize; + + /** + * activeCount + */ + private Integer activeCount; + + /** + * largestPoolSize + */ + private Integer largestPoolSize; + + /** + * completedTaskCount + */ + private Long completedTaskCount; + + /** + * queueName + */ + private String queueName; + + /** + * capacity + */ + private Integer capacity; + + /** + * queueSize + */ + private Integer queueSize; + + /** + * remainingCapacity + */ + private Integer remainingCapacity; + + /** + * rejectedExecutionHandlerName + */ + private String rejectedExecutionHandlerName; + + /** + * rejectCountNum + */ + private Long rejectCountNum; + + /** + * executeTime + */ + private Long executeTime; + + /** + * executeTimeOut + */ + private Long executeTimeOut; + + /** + * executeTimeoutTrace + */ + private String executeTimeoutTrace; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/ChangeParameterNotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/ChangeParameterNotifyRequest.java new file mode 100644 index 00000000..2386bf32 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/ChangeParameterNotifyRequest.java @@ -0,0 +1,51 @@ +package cn.hippo4j.common.notify.request; + +import cn.hippo4j.common.notify.request.base.BaseNotifyRequest; +import lombok.Data; + +/** + * Change parameter notify request. + * + * @author chen.ma + * @date 2022/2/22 20:22 + */ +@Data +public class ChangeParameterNotifyRequest extends BaseNotifyRequest { + + private String active; + + private String appName; + + private String identify; + + private Integer beforeCorePoolSize; + + private Integer nowCorePoolSize; + + private Integer beforeMaximumPoolSize; + + private Integer nowMaximumPoolSize; + + private Boolean beforeAllowsCoreThreadTimeOut; + + private Boolean nowAllowsCoreThreadTimeOut; + + private Long beforeKeepAliveTime; + + private Long nowKeepAliveTime; + + private Long beforeExecuteTimeOut; + + private Long nowExecuteTimeOut; + + private String blockingQueueName; + + private Integer beforeQueueCapacity; + + private Integer nowQueueCapacity; + + private String beforeRejectedName; + + private String nowRejectedName; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/RobotAlarmNotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/RobotAlarmNotifyRequest.java new file mode 100644 index 00000000..24a8de80 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/RobotAlarmNotifyRequest.java @@ -0,0 +1,19 @@ +package cn.hippo4j.common.notify.request; + +import lombok.Data; + +/** + * Robot alarm notify request. + * + * @author chen.ma + * @date 2022/2/22 21:50 + */ +@Data +public class RobotAlarmNotifyRequest extends AlarmNotifyRequest { + + /** + * secretKey + */ + private String secretKey; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/RobotChangeParameterNotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/RobotChangeParameterNotifyRequest.java new file mode 100644 index 00000000..a0f66942 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/RobotChangeParameterNotifyRequest.java @@ -0,0 +1,19 @@ +package cn.hippo4j.common.notify.request; + +import lombok.Data; + +/** + * Robot change parameter notify request. + * + * @author chen.ma + * @date 2022/2/22 21:03 + */ +@Data +public class RobotChangeParameterNotifyRequest extends ChangeParameterNotifyRequest { + + /** + * secretKey + */ + private String secretKey; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/ThreadPoolNotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/ThreadPoolNotifyRequest.java new file mode 100644 index 00000000..3f09b15c --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/ThreadPoolNotifyRequest.java @@ -0,0 +1,23 @@ +package cn.hippo4j.common.notify.request; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.util.List; + +/** + * Thread pool notify request. + * + * @author chen.ma + * @date 2022/2/24 19:06 + */ +@Data +@AllArgsConstructor +public class ThreadPoolNotifyRequest { + + /** + * groupKeys + */ + private List groupKeys; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/base/BaseNotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/base/BaseNotifyRequest.java new file mode 100644 index 00000000..455e07d3 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/base/BaseNotifyRequest.java @@ -0,0 +1,44 @@ +package cn.hippo4j.common.notify.request.base; + +import lombok.Data; + +/** + * Base notify request. + * + * @author chen.ma + * @date 2022/2/22 19:35 + */ +@Data +public class BaseNotifyRequest implements NotifyRequest { + + /** + * tenantId + */ + private String tenantId; + + /** + * itemId + */ + private String itemId; + + /** + * threadPoolId + */ + private String threadPoolId; + + /** + * platform + */ + private String platform; + + /** + * type + */ + private String type; + + /** + * receives + */ + private String receives; + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/base/NotifyRequest.java b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/base/NotifyRequest.java new file mode 100644 index 00000000..5e42abe7 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/notify/request/base/NotifyRequest.java @@ -0,0 +1,10 @@ +package cn.hippo4j.common.notify.request.base; + +/** + * Notify request. + * + * @author chen.ma + * @date 2022/2/22 19:38 + */ +public interface NotifyRequest { +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/ArrayUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ArrayUtil.java similarity index 53% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/ArrayUtil.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ArrayUtil.java index f0d8e002..db1f6440 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/ArrayUtil.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ArrayUtil.java @@ -1,4 +1,6 @@ -package com.github.dynamic.threadpool.starter.toolkit; +package cn.hippo4j.common.toolkit; + +import cn.hippo4j.common.function.Matcher; import java.lang.reflect.Array; @@ -6,10 +8,61 @@ import java.lang.reflect.Array; * Array util. * * @author chen.ma - * @date 2021/7/5 21:54 + * @date 2021/12/30 21:42 */ public class ArrayUtil { + /** + * Is empty. + * + * @param array + * @param + * @return + */ + public static boolean isEmpty(T[] array) { + return array == null || array.length == 0; + } + + /** + * Is not empty. + * + * @param array + * @param + * @return + */ + public static boolean isNotEmpty(T[] array) { + return !isEmpty(array); + } + + + /** + * First match. + * + * @param matcher + * @param array + * @param + * @return + */ + public static T firstMatch(Matcher matcher, T... array) { + if (!isEmpty(array)) { + for (final T val : array) { + if (matcher.match(val)) { + return val; + } + } + } + + return null; + } + + /** + * Add all. + * + * @param array1 + * @param array2 + * @param + * @return + */ public static T[] addAll(final T[] array1, @SuppressWarnings("unchecked") final T... array2) { if (array1 == null) { return clone(array2); @@ -32,6 +85,13 @@ public class ArrayUtil { return joinedArray; } + /** + * Clone. + * + * @param array + * @param + * @return + */ public static T[] clone(final T[] array) { if (array == null) { return null; diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/Assert.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/Assert.java similarity index 98% rename from common/src/main/java/com/github/dynamic/threadpool/common/toolkit/Assert.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/Assert.java index 8bd43dd1..5ce48ec9 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/Assert.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/Assert.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.toolkit; +package cn.hippo4j.common.toolkit; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ByteConvertUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ByteConvertUtil.java new file mode 100644 index 00000000..117cbcba --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ByteConvertUtil.java @@ -0,0 +1,38 @@ +package cn.hippo4j.common.toolkit; + +/** + * 字节转换工具类. + * + * @author chen.ma + * @date 2021/11/20 12:21 + */ +public class ByteConvertUtil { + + /** + * 字节转换. + * + * @param size + * @return + */ + public static String getPrintSize(long size) { + long covertNum = 1024; + if (size < covertNum) { + return size + "B"; + } else { + size = size / covertNum; + } + if (size < covertNum) { + return size + "KB"; + } else { + size = size / covertNum; + } + if (size < covertNum) { + size = size * 100; + return (size / 100) + "." + (size % 100) + "MB"; + } else { + size = size * 100 / covertNum; + return (size / 100) + "." + (size % 100) + "GB"; + } + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/CollectionUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/CollectionUtil.java new file mode 100644 index 00000000..a43c3452 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/CollectionUtil.java @@ -0,0 +1,113 @@ +package cn.hippo4j.common.toolkit; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Collection util. + * + * @author chen.ma + * @date 2021/12/22 20:43 + */ +public class CollectionUtil { + + /** + * Get first. + * + * @param iterable + * @param + * @return + */ + public static T getFirst(Iterable iterable) { + Iterator iterator; + if (iterable != null && (iterator = iterable.iterator()) != null && iterator.hasNext()) { + return iterator.next(); + } + + return null; + } + + /** + * Is empty. + * + * @param list + * @return + */ + public static boolean isEmpty(List list) { + return list == null || list.isEmpty(); + } + + /** + * Is not empty. + * + * @param list + * @return + */ + public static boolean isNotEmpty(List list) { + return !isEmpty(list); + } + + + /** + * Is empty. + * + * @param map + * @return + */ + public static boolean isEmpty(Map map) { + return map == null || map.isEmpty(); + } + + /** + * Is not empty. + * + * @param map + * @return + */ + public static boolean isNotEmpty(Map map) { + return !isEmpty(map); + } + + /** + * Is empty. + * + * @param iterator + * @return + */ + public static boolean isEmpty(Iterator iterator) { + return null == iterator || false == iterator.hasNext(); + } + + /** + * Is not empty. + * + * @param iterator + * @return + */ + public static boolean isNotEmpty(Iterator iterator) { + return !isEmpty(iterator); + } + + /** + * Is empty. + * + * @param collection + * @return + */ + public static boolean isEmpty(Collection collection) { + return collection == null || collection.isEmpty(); + } + + /** + * Is not empty. + * + * @param collection + * @return + */ + public static boolean isNotEmpty(Collection collection) { + return !isEmpty(collection); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ConditionUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ConditionUtil.java new file mode 100644 index 00000000..da44380a --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ConditionUtil.java @@ -0,0 +1,21 @@ +package cn.hippo4j.common.toolkit; + +import cn.hippo4j.common.function.NoArgsConsumer; + +/** + * Condition util. + * + * @author chen.ma + * @date 2021/11/6 22:40 + */ +public class ConditionUtil { + + public static void condition(boolean condition, NoArgsConsumer trueConsumer, NoArgsConsumer falseConsumer) { + if (condition) { + trueConsumer.accept(); + } else { + falseConsumer.accept(); + } + } + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ContentUtil.java similarity index 68% rename from common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ContentUtil.java index 2ad70a79..4120ca56 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/ContentUtil.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ContentUtil.java @@ -1,9 +1,8 @@ -package com.github.dynamic.threadpool.common.toolkit; +package cn.hippo4j.common.toolkit; -import com.alibaba.fastjson.JSON; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.model.PoolParameter; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; /** * Content util. @@ -26,8 +25,9 @@ public class ContentUtil { .setIsAlarm(parameter.getIsAlarm()) .setCapacityAlarm(parameter.getCapacityAlarm()) .setLivenessAlarm(parameter.getLivenessAlarm()) + .setAllowCoreThreadTimeOut(parameter.getAllowCoreThreadTimeOut()) .setRejectedType(parameter.getRejectedType()); - return JSON.toJSONString(poolInfo); + return JSONUtil.toJSONString(poolInfo); } public static String getGroupKey(PoolParameter parameter) { @@ -41,4 +41,17 @@ public class ContentUtil { return resultStr; } + public static String getGroupKey(String... parameters) { + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < parameters.length; i++) { + stringBuilder.append(parameters[i]); + + if (i < parameters.length - 1) { + stringBuilder.append(Constants.GROUP_KEY_DELIMITER); + } + } + + return stringBuilder.toString(); + } + } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java new file mode 100644 index 00000000..1d3ceb20 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java @@ -0,0 +1,70 @@ +package cn.hippo4j.common.toolkit; + +import cn.hippo4j.common.constant.Constants; +import org.springframework.util.StringUtils; + +import static cn.hippo4j.common.constant.Constants.GROUP_KEY_DELIMITER; + +/** + * Group key. + * + * @author chen.ma + * @date 2021/6/24 21:12 + */ +public class GroupKey { + + public static String getKey(String dataId, String group) { + return getKey(dataId, group, ""); + } + + public static String getKey(String dataId, String group, String datumStr) { + return doGetKey(dataId, group, datumStr); + } + + public static String getKey(String... params) { + StringBuilder groupKey = new StringBuilder(); + groupKey.append(params[0]).append(GROUP_KEY_DELIMITER); + + for (int i = 1; i < params.length - 1; i++) { + groupKey.append(params[i]).append(GROUP_KEY_DELIMITER); + } + + groupKey.append(params[params.length]); + return groupKey.toString(); + } + + public static String getKeyTenant(String dataId, String group, String tenant) { + return doGetKey(dataId, group, tenant); + } + + private static String doGetKey(String dataId, String group, String datumStr) { + StringBuilder sb = new StringBuilder(); + urlEncode(dataId, sb); + sb.append(GROUP_KEY_DELIMITER); + urlEncode(group, sb); + if (!StringUtils.isEmpty(datumStr)) { + sb.append(GROUP_KEY_DELIMITER); + urlEncode(datumStr, sb); + } + + return sb.toString(); + } + + public static String[] parseKey(String groupKey) { + return groupKey.split(Constants.GROUP_KEY_DELIMITER_TRANSLATION); + } + + public static void urlEncode(String str, StringBuilder sb) { + for (int idx = 0; idx < str.length(); ++idx) { + char c = str.charAt(idx); + if ('+' == c) { + sb.append("%2B"); + } else if ('%' == c) { + sb.append("%25"); + } else { + sb.append(c); + } + } + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/JSONUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/JSONUtil.java new file mode 100644 index 00000000..c576851a --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/JSONUtil.java @@ -0,0 +1,41 @@ +package cn.hippo4j.common.toolkit; + +import cn.hippo4j.common.api.JsonFacade; + +import java.util.List; + +/** + * JSON util. + * + * @author chen.ma + * @date 2021/12/13 20:27 + */ +public class JSONUtil { + + private static final JsonFacade JSON_FACADE = new JacksonHandler(); + + public static String toJSONString(Object object) { + if (object == null) { + return null; + } + + return JSON_FACADE.toJSONString(object); + } + + public static T parseObject(String text, Class clazz) { + if (StringUtil.isBlank(text)) { + return null; + } + + return JSON_FACADE.parseObject(text, clazz); + } + + public static List parseArray(String text, Class clazz) { + if (StringUtil.isBlank(text)) { + return null; + } + + return JSON_FACADE.parseArray(text, clazz); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/JacksonHandler.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/JacksonHandler.java new file mode 100644 index 00000000..a230a72f --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/JacksonHandler.java @@ -0,0 +1,57 @@ +package cn.hippo4j.common.toolkit; + +import cn.hippo4j.common.api.JsonFacade; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.type.CollectionType; +import lombok.SneakyThrows; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +/** + * Jackson util. + * + * @author chen.ma + * @date 2021/12/13 20:02 + */ +public class JacksonHandler implements JsonFacade { + + private static ObjectMapper MAPPER = new ObjectMapper(); + + static { + MAPPER.enable(JsonGenerator.Feature.IGNORE_UNKNOWN); + String dateTimeFormat = "yyyy-MM-dd HH:mm:ss"; + MAPPER.setDateFormat(new SimpleDateFormat(dateTimeFormat)); + MAPPER.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); + MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + } + + @Override + @SneakyThrows + public String toJSONString(Object object) { + return MAPPER.writeValueAsString(object); + } + + @Override + @SneakyThrows + public T parseObject(String text, Class clazz) { + JavaType javaType = MAPPER.getTypeFactory().constructType(clazz); + return MAPPER.readValue(text, javaType); + } + + @Override + @SneakyThrows + public List parseArray(String text, Class clazz) { + CollectionType collectionType = MAPPER.getTypeFactory().constructCollectionType(ArrayList.class, clazz); + return MAPPER.readValue(text, collectionType); + } + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/Md5Util.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/Md5Util.java similarity index 83% rename from common/src/main/java/com/github/dynamic/threadpool/common/toolkit/Md5Util.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/Md5Util.java index a3563751..e263e822 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/toolkit/Md5Util.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/Md5Util.java @@ -1,8 +1,7 @@ -package com.github.dynamic.threadpool.common.toolkit; +package cn.hippo4j.common.toolkit; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.model.PoolParameter; -import org.springframework.util.StringUtils; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.model.PoolParameter; import java.io.IOException; import java.net.URLEncoder; @@ -10,8 +9,6 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.List; -import static com.github.dynamic.threadpool.common.constant.Constants.WORD_SEPARATOR; - /** * MD5 util. * @@ -76,12 +73,17 @@ public class Md5Util { for (String groupKey : changedGroupKeys) { String[] dataIdGroupId = GroupKey.parseKey(groupKey); sb.append(dataIdGroupId[0]); - sb.append(WORD_SEPARATOR); + sb.append(Constants.WORD_SEPARATOR); sb.append(dataIdGroupId[1]); // if have tenant, then set it if (dataIdGroupId.length == 3) { - if (!StringUtils.isEmpty(dataIdGroupId[2])) { - sb.append(WORD_SEPARATOR); + if (StringUtil.isNotBlank(dataIdGroupId[2])) { + sb.append(Constants.WORD_SEPARATOR); + sb.append(dataIdGroupId[2]); + } + } else if (dataIdGroupId.length == 4) { + if (StringUtil.isNotBlank(dataIdGroupId[2])) { + sb.append(Constants.WORD_SEPARATOR); sb.append(dataIdGroupId[2]); } } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java new file mode 100644 index 00000000..ae7d85e9 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java @@ -0,0 +1,66 @@ +package cn.hippo4j.common.toolkit; + +import cn.hippo4j.common.monitor.AbstractMessage; +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.MessageWrapper; +import lombok.SneakyThrows; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Message convert. + * + * @author chen.ma + * @date 2021/12/10 21:27 + */ +public class MessageConvert { + + /** + * {@link Message} to {@link MessageWrapper}. + * + * @param message + * @return + */ + public static MessageWrapper convert(Message message) { + MessageWrapper wrapper = new MessageWrapper(); + wrapper.setResponseClass(message.getClass()); + wrapper.setMessageType(message.getMessageType()); + + List> messageMapList = new ArrayList(); + List messages = message.getMessages(); + messages.forEach(each -> { + String eachVal = JSONUtil.toJSONString(each); + Map mapObj = JSONUtil.parseObject(eachVal, Map.class); + messageMapList.add(mapObj); + }); + + wrapper.setContentParams(messageMapList); + return wrapper; + } + + /** + * {@link MessageWrapper} to {@link Message}. + * + * @param messageWrapper + * @return + */ + @SneakyThrows + public static Message convert(MessageWrapper messageWrapper) { + AbstractMessage message = (AbstractMessage) messageWrapper.getResponseClass().newInstance(); + List> contentParams = messageWrapper.getContentParams(); + + List messages = new ArrayList(); + contentParams.forEach(each -> { + String eachVal = JSONUtil.toJSONString(each); + Message messageObj = JSONUtil.parseObject(eachVal, messageWrapper.getResponseClass()); + messages.add(messageObj); + }); + + message.setMessages(messages); + message.setMessageType(messageWrapper.getMessageType()); + return message; + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java new file mode 100644 index 00000000..3de7caf2 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ReflectUtil.java @@ -0,0 +1,102 @@ +package cn.hippo4j.common.toolkit; + +import java.lang.reflect.AccessibleObject; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Reflect util. + * + * @author chen.ma + * @date 2022/1/9 13:16 + */ +public class ReflectUtil { + + private static final Map, Field[]> FIELDS_CACHE = new ConcurrentHashMap(); + + public static Object getFieldValue(Object obj, String fieldName) { + if (null == obj || StringUtil.isBlank(fieldName)) { + return null; + } + + Field field = getField(obj instanceof Class ? (Class) obj : obj.getClass(), fieldName); + return getFieldValue(obj, field); + } + + public static Object getFieldValue(Object obj, Field field) { + if (null == field) { + return null; + } + if (obj instanceof Class) { + obj = null; + } + + setAccessible(field); + Object result; + try { + result = field.get(obj); + } catch (IllegalAccessException e) { + String exceptionMsg = String.format("IllegalAccess for %s.%s", field.getDeclaringClass(), field.getName()); + throw new RuntimeException(exceptionMsg, e); + } + + return result; + } + + public static T setAccessible(T accessibleObject) { + if (null != accessibleObject && false == accessibleObject.isAccessible()) { + accessibleObject.setAccessible(true); + } + return accessibleObject; + } + + public static Field getField(Class beanClass, String name) throws SecurityException { + final Field[] fields = getFields(beanClass); + return ArrayUtil.firstMatch((field) -> name.equals(getFieldName(field)), fields); + } + + public static Field[] getFields(Class beanClass) throws SecurityException { + Field[] allFields = FIELDS_CACHE.get(beanClass); + if (null != allFields) { + return allFields; + } + + allFields = getFieldsDirectly(beanClass, true); + FIELDS_CACHE.put(beanClass, allFields); + return allFields; + } + + public static Field[] getFieldsDirectly(Class beanClass, boolean withSuperClassFields) throws SecurityException { + Assert.notNull(beanClass); + + Field[] allFields = null; + Class searchType = beanClass; + Field[] declaredFields; + while (searchType != null) { + declaredFields = searchType.getDeclaredFields(); + if (null == allFields) { + allFields = declaredFields; + } else { + int length = allFields.length; + allFields = Arrays.copyOf(allFields, length + declaredFields.length); + for (int i = 1; i < declaredFields.length; i++) { + allFields[length + i] = declaredFields[i - 1]; + } + } + searchType = withSuperClassFields ? searchType.getSuperclass() : null; + } + + return allFields; + } + + public static String getFieldName(Field field) { + if (null == field) { + return null; + } + + return field.getName(); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/StringUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/StringUtil.java new file mode 100644 index 00000000..2d1e5074 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/StringUtil.java @@ -0,0 +1,153 @@ +package cn.hippo4j.common.toolkit; + +/** + * String util. + * + * @author chen.ma + * @date 2021/12/22 20:58 + */ +public class StringUtil { + + public static final String EMPTY = ""; + + public static final char UNDERLINE = '_'; + + /** + * Is blank. + * + * @param str + * @return + */ + public static boolean isBlank(CharSequence str) { + int length; + + if ((str == null) || ((length = str.length()) == 0)) { + return true; + } + + for (int i = 0; i < length; i++) { + char c = str.charAt(i); + + boolean charNotBlank = Character.isWhitespace(c) || Character.isSpaceChar(c) || c == '\ufeff' || c == '\u202a'; + if (charNotBlank == false) { + return false; + } + } + + return true; + } + + /** + * Is empty. + * + * @param str + * @return + */ + public static boolean isEmpty(CharSequence str) { + return str == null || str.length() == 0; + } + + /** + * Is not empty. + * + * @param str + * @return + */ + public static boolean isNotEmpty(CharSequence str) { + return !isEmpty(str); + } + + /** + * Is not blank. + * + * @param str + * @return + */ + public static boolean isNotBlank(CharSequence str) { + return isBlank(str) == false; + } + + /** + * Is all not empty. + * + * @param args + * @return + */ + public static boolean isAllNotEmpty(CharSequence... args) { + return false == hasEmpty(args); + } + + /** + * Has empty. + * + * @param strList + * @return + */ + public static boolean hasEmpty(CharSequence... strList) { + if (ArrayUtil.isEmpty(strList)) { + return true; + } + + for (CharSequence str : strList) { + if (isEmpty(str)) { + return true; + } + } + return false; + } + + /** + * To underline case. + * + * @param str + * @return + */ + public static String toUnderlineCase(CharSequence str) { + return toSymbolCase(str, UNDERLINE); + } + + /** + * To symbol case. + * + * @param str + * @param symbol + * @return + */ + public static String toSymbolCase(CharSequence str, char symbol) { + if (str == null) { + return null; + } + + final int length = str.length(); + final StringBuilder sb = new StringBuilder(); + char c; + for (int i = 0; i < length; i++) { + c = str.charAt(i); + final Character preChar = (i > 0) ? str.charAt(i - 1) : null; + if (Character.isUpperCase(c)) { + final Character nextChar = (i < str.length() - 1) ? str.charAt(i + 1) : null; + if (null != preChar && Character.isUpperCase(preChar)) { + sb.append(c); + } else if (null != nextChar && Character.isUpperCase(nextChar)) { + if (null != preChar && symbol != preChar) { + sb.append(symbol); + } + sb.append(c); + } else { + if (null != preChar && symbol != preChar) { + sb.append(symbol); + } + sb.append(Character.toLowerCase(c)); + } + } else { + if (sb.length() > 0 && Character.isUpperCase(sb.charAt(sb.length() - 1)) && symbol != c) { + sb.append(symbol); + } + sb.append(c); + } + } + + return sb.toString(); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ThreadUtil.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ThreadUtil.java new file mode 100644 index 00000000..0c524ee2 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/ThreadUtil.java @@ -0,0 +1,43 @@ +package cn.hippo4j.common.toolkit; + +/** + * Thread util. + * + * @author chen.ma + * @date 2021/12/6 23:34 + */ +public class ThreadUtil { + + /** + * 创建新线程. + * + * @param runnable {@link Runnable} + * @param name 线程名 + * @param isDaemon 是否守护线程 + * @return {@link Thread} + */ + public static Thread newThread(Runnable runnable, String name, boolean isDaemon) { + Thread t = new Thread(null, runnable, name); + t.setDaemon(isDaemon); + return t; + } + + /** + * 挂起当前线程. + * + * @param millis 毫秒 + * @return + */ + public static boolean sleep(long millis) { + if (millis > 0) { + try { + Thread.sleep(millis); + } catch (InterruptedException e) { + return false; + } + } + + return true; + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/UserContext.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/UserContext.java new file mode 100644 index 00000000..f4f2bd01 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/UserContext.java @@ -0,0 +1,46 @@ +package cn.hippo4j.common.toolkit; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Optional; + +/** + * User context (Transition scheme). + * + * @author chen.ma + * @date 2021/11/17 21:13 + */ +public class UserContext { + + private static final ThreadLocal USER_THREAD_LOCAL = new ThreadLocal(); + + public static void setUserInfo(String username, String userRole) { + USER_THREAD_LOCAL.set(new User(username, userRole)); + } + + public static String getUserName() { + return Optional.ofNullable(USER_THREAD_LOCAL.get()).map(User::getUsername).orElse(""); + } + + public static String getUserRole() { + return Optional.ofNullable(USER_THREAD_LOCAL.get()).map(User::getUserRole).orElse(""); + } + + public static void clear() { + USER_THREAD_LOCAL.remove(); + } + + @Data + @NoArgsConstructor + @AllArgsConstructor + static class User { + + private String username; + + private String userRole; + + } + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/web/base/Result.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/base/Result.java similarity index 68% rename from common/src/main/java/com/github/dynamic/threadpool/common/web/base/Result.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/web/base/Result.java index 6c7fd7ad..5b3383c1 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/web/base/Result.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/web/base/Result.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.web.base; +package cn.hippo4j.common.web.base; import lombok.Data; import lombok.experimental.Accessors; @@ -17,14 +17,31 @@ public class Result implements Serializable { private static final long serialVersionUID = -4408341719434417427L; + /** + * Correct return code. + */ public static final String SUCCESS_CODE = "0"; + /** + * Return code. + */ private String code; + /** + * Message. + */ private String message; + /** + * Response data. + */ private T data; + /** + * Is success. + * + * @return + */ public boolean isSuccess() { return SUCCESS_CODE.equals(code); } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/web/base/Results.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/base/Results.java new file mode 100644 index 00000000..1bee4c2c --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/web/base/Results.java @@ -0,0 +1,98 @@ +package cn.hippo4j.common.web.base; + +import cn.hippo4j.common.web.exception.AbstractException; +import cn.hippo4j.common.web.exception.ErrorCode; +import cn.hippo4j.common.web.exception.ErrorCodeEnum; + +import java.util.Optional; + +/** + * Results. + * + * @author chen.ma + * @date 2021/3/19 16:12 + */ +public final class Results { + + /** + * 成功. + * + * @return + */ + public static Result success() { + return new Result() + .setCode(Result.SUCCESS_CODE); + } + + /** + * 成功. + * + * @param data 并设置 DATA 参数 + * @param 对应 DATA 字段的数据类型 + * @return + */ + public static Result success(T data) { + return new Result() + .setCode(Result.SUCCESS_CODE) + .setData(data); + } + + /** + * 返回失败信息. + * + * @return + */ + public static Result failure() { + return failure(ErrorCodeEnum.SERVICE_ERROR.getCode(), ErrorCodeEnum.SERVICE_ERROR.getMessage()); + } + + /** + * 框架定义抽象异常拦截. + * + * @param abstractException 框架自定义抽象异常 + * @return + */ + public static Result failure(AbstractException abstractException) { + String errorCode = Optional.ofNullable(abstractException.getErrorCode()) + .map(ErrorCode::getCode) + .orElse(ErrorCodeEnum.SERVICE_ERROR.getCode()); + + return new Result().setCode(errorCode) + .setMessage(abstractException.getMessage()); + } + + /** + * 未知异常. + * + * @param throwable 未知异常 + * @return + */ + public static Result failure(Throwable throwable) { + return new Result().setCode(ErrorCodeEnum.SERVICE_ERROR.getCode()) + .setMessage(throwable.getMessage()); + } + + /** + * 返回失败信息. + * + * @param errorCode 错误编码、错误信息 + * @return + */ + public static Result failure(ErrorCode errorCode) { + return failure(errorCode.getCode(), errorCode.getMessage()); + } + + /** + * 返回失败信息. + * + * @param code 错误编码. + * @param message 错误信息. + * @return + */ + public static Result failure(String code, String message) { + return new Result() + .setCode(code) + .setMessage(message); + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/AbstractException.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/AbstractException.java new file mode 100644 index 00000000..fe8cdf35 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/AbstractException.java @@ -0,0 +1,21 @@ +package cn.hippo4j.common.web.exception; + +import lombok.Getter; + +/** + * Abstract exception. + * + * @author chen.ma + * @date 2022/3/2 20:01 + */ +public class AbstractException extends RuntimeException { + + @Getter + public final ErrorCode errorCode; + + public AbstractException(String message, Throwable throwable, ErrorCode errorCode) { + super(message, throwable); + this.errorCode = errorCode; + } + +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCode.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCode.java new file mode 100644 index 00000000..aeddd28e --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCode.java @@ -0,0 +1,25 @@ +package cn.hippo4j.common.web.exception; + +/** + * 错误码抽象接口. + * + * @author chen.ma + * @date 2021/9/16 15:39 + */ +public interface ErrorCode { + + /** + * 错误码. + * + * @return + */ + String getCode(); + + /** + * 错误信息. + * + * @return + */ + String getMessage(); + +} diff --git a/common/src/main/java/com/github/dynamic/threadpool/common/web/exception/ErrorCodeEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCodeEnum.java similarity index 63% rename from common/src/main/java/com/github/dynamic/threadpool/common/web/exception/ErrorCodeEnum.java rename to hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCodeEnum.java index 51f4bcfa..a14573c2 100644 --- a/common/src/main/java/com/github/dynamic/threadpool/common/web/exception/ErrorCodeEnum.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCodeEnum.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.common.web.exception; +package cn.hippo4j.common.web.exception; /** * Error code enum. @@ -6,8 +6,11 @@ package com.github.dynamic.threadpool.common.web.exception; * @author chen.ma * @date 2021/3/19 16:07 */ -public enum ErrorCodeEnum { +public enum ErrorCodeEnum implements ErrorCode { + /** + * UNKNOWN_ERROR + */ UNKNOWN_ERROR { @Override public String getCode() { @@ -20,6 +23,9 @@ public enum ErrorCodeEnum { } }, + /** + * VALIDATION_ERROR + */ VALIDATION_ERROR { @Override public String getCode() { @@ -32,6 +38,9 @@ public enum ErrorCodeEnum { } }, + /** + * SERVICE_ERROR + */ SERVICE_ERROR { @Override public String getCode() { @@ -44,6 +53,9 @@ public enum ErrorCodeEnum { } }, + /** + * NOT_FOUND + */ NOT_FOUND { @Override public String getCode() { @@ -54,10 +66,21 @@ public enum ErrorCodeEnum { public String getMessage() { return "NOT_FOUND"; } - }; + }, - public abstract String getCode(); + /** + * LOGIN_TIMEOUT + */ + LOGIN_TIMEOUT { + @Override + public String getCode() { + return "A000004"; + } - public abstract String getMessage(); + @Override + public String getMessage() { + return "登录时间过长, 请退出重新登录"; + } + } } diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ServiceException.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ServiceException.java new file mode 100644 index 00000000..c6e77d88 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ServiceException.java @@ -0,0 +1,98 @@ +package cn.hippo4j.common.web.exception; + +import lombok.EqualsAndHashCode; + +/** + * Service exception. + * + * @author chen.ma + * @date 2021/3/19 16:14 + */ +@EqualsAndHashCode(callSuper = true) +public class ServiceException extends AbstractException { + + /** + * 无指定错误码. + */ + public ServiceException() { + this(ErrorCodeEnum.SERVICE_ERROR); + } + + /** + * 指定错误码. + * + * @param errorCode + */ + public ServiceException(ErrorCode errorCode) { + this(errorCode.getMessage(), null, errorCode); + } + + /** + * 指定报错信息. + * + * @param message + */ + public ServiceException(String message) { + this(message, null, ErrorCodeEnum.SERVICE_ERROR); + } + + /** + * 异常抛出. + * + * @param cause + */ + public ServiceException(Throwable cause) { + this(cause, cause.getMessage()); + } + + /** + * 异常抛出并指定错误信息. + * + * @param message + * @param cause + */ + public ServiceException(String message, Throwable cause) { + this(message, cause, ErrorCodeEnum.SERVICE_ERROR); + } + + /** + * 异常抛出并指定错误信息. + * + * @param cause + * @param message + */ + public ServiceException(Throwable cause, String message) { + this(message, cause, ErrorCodeEnum.SERVICE_ERROR); + } + + /** + * 异常抛出并指定错误码. + * + * @param cause + * @param errorCode + */ + public ServiceException(Throwable cause, ErrorCode errorCode) { + this(errorCode.getMessage(), cause, errorCode); + } + + /** + * 报错信息与错误码同时存在, 并且不一致. + *

以报错信息为主, 进行打印. + * + * @param message + * @param cause + * @param errorCode + */ + public ServiceException(String message, Throwable cause, ErrorCode errorCode) { + super(message, cause, errorCode); + } + + @Override + public String toString() { + return "ServiceException{" + + "code='" + errorCode.getCode() + "'," + + "message='" + errorCode.getMessage() + "'" + + '}'; + } + +} diff --git a/config/.gitignore b/hippo4j-config/.gitignore similarity index 100% rename from config/.gitignore rename to hippo4j-config/.gitignore diff --git a/config/pom.xml b/hippo4j-config/pom.xml similarity index 80% rename from config/pom.xml rename to hippo4j-config/pom.xml index 8b8ff613..b71eeb86 100644 --- a/config/pom.xml +++ b/hippo4j-config/pom.xml @@ -4,17 +4,21 @@ 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} - config + hippo4j-config jar ${project.artifactId} ${project.artifactId} + + true + + org.springframework.boot @@ -43,13 +47,8 @@ - com.github.dynamic-threadpool - common - - - - com.alibaba - fastjson + cn.hippo4j + hippo4j-common @@ -63,7 +62,7 @@ - com.github.dynamic-threadpool + cn.hippo4j log-record-tool diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/config/CommonConfig.java b/hippo4j-config/src/main/java/cn/hippo4j/config/config/CommonConfig.java new file mode 100644 index 00000000..8ccd178f --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/config/CommonConfig.java @@ -0,0 +1,38 @@ +package cn.hippo4j.config.config; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import static cn.hippo4j.common.constant.Constants.AVAILABLE_PROCESSORS; + +/** + * Common config. + * + * @author chen.ma + * @date 2021/7/19 21:03 + */ +@Configuration +public class CommonConfig { + + @Bean + public ApplicationContextHolder simpleApplicationContextHolder() { + return new ApplicationContextHolder(); + } + + @Bean + @Primary + public ThreadPoolTaskExecutor monitorThreadPoolTaskExecutor() { + ThreadPoolTaskExecutor monitorThreadPool = new ThreadPoolTaskExecutor(); + monitorThreadPool.setThreadNamePrefix("server.monitor.executor."); + monitorThreadPool.setCorePoolSize(AVAILABLE_PROCESSORS); + monitorThreadPool.setMaxPoolSize(AVAILABLE_PROCESSORS << 1); + monitorThreadPool.setQueueCapacity(4096); + monitorThreadPool.setAllowCoreThreadTimeOut(true); + monitorThreadPool.setAwaitTerminationMillis(5000); + return monitorThreadPool; + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/config/MyMetaObjectHandler.java b/hippo4j-config/src/main/java/cn/hippo4j/config/config/MyMetaObjectHandler.java similarity index 88% rename from config/src/main/java/com/github/dynamic/threadpool/config/config/MyMetaObjectHandler.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/config/MyMetaObjectHandler.java index c8772ae4..bbecb097 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/config/MyMetaObjectHandler.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/config/MyMetaObjectHandler.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.config; +package cn.hippo4j.config.config; +import cn.hippo4j.common.enums.DelEnum; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; -import com.github.dynamic.threadpool.config.enums.DelEnum; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.reflection.MetaObject; import org.springframework.stereotype.Component; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/config/MybatisPlusConfig.java b/hippo4j-config/src/main/java/cn/hippo4j/config/config/MybatisPlusConfig.java similarity index 93% rename from config/src/main/java/com/github/dynamic/threadpool/config/config/MybatisPlusConfig.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/config/MybatisPlusConfig.java index 40cf4c85..2e7c5b92 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/config/MybatisPlusConfig.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/config/MybatisPlusConfig.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.config; +package cn.hippo4j.config.config; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/config/ServerBootstrapProperties.java b/hippo4j-config/src/main/java/cn/hippo4j/config/config/ServerBootstrapProperties.java new file mode 100644 index 00000000..3e6db115 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/config/ServerBootstrapProperties.java @@ -0,0 +1,34 @@ +package cn.hippo4j.config.config; + +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * Server bootstrap properties. + * + * @author chen.ma + * @date 2021/12/22 08:01 + */ +@Slf4j +@Getter +@Setter +@Configuration +@ConfigurationProperties(prefix = ServerBootstrapProperties.PREFIX) +public class ServerBootstrapProperties { + + public final static String PREFIX = "hippo4j.core"; + + /** + * Whether to start the background task of cleaning up thread pool history data. + */ + private Boolean cleanHistoryDataEnable = Boolean.TRUE; + + /** + * Regularly clean up the historical running data of thread pool. unit: minute. + */ + private Integer cleanHistoryDataPeriod = 30; + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/controller/ConfigController.java b/hippo4j-config/src/main/java/cn/hippo4j/config/controller/ConfigController.java similarity index 50% rename from config/src/main/java/com/github/dynamic/threadpool/config/controller/ConfigController.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/controller/ConfigController.java index 60f99ffd..8c62fc48 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/controller/ConfigController.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/controller/ConfigController.java @@ -1,15 +1,17 @@ -package com.github.dynamic.threadpool.config.controller; +package cn.hippo4j.config.controller; -import com.github.dynamic.threadpool.config.service.biz.ConfigService; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; -import com.github.dynamic.threadpool.config.model.ConfigInfoBase; -import com.github.dynamic.threadpool.config.service.ConfigServletInner; -import com.github.dynamic.threadpool.config.toolkit.Md5ConfigUtil; +import cn.hippo4j.config.model.ConfigAllInfo; +import cn.hippo4j.config.model.ConfigInfoBase; +import cn.hippo4j.config.service.ConfigCacheService; +import cn.hippo4j.config.service.ConfigServletInner; +import cn.hippo4j.config.toolkit.Md5ConfigUtil; +import cn.hippo4j.config.service.biz.ConfigService; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hutool.core.util.StrUtil; +import lombok.AllArgsConstructor; import lombok.SneakyThrows; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; @@ -25,27 +27,28 @@ import java.util.Map; * @date 2021/6/20 13:53 */ @RestController +@AllArgsConstructor @RequestMapping(Constants.CONFIG_CONTROLLER_PATH) public class ConfigController { - @Autowired - private ConfigService configService; + private final ConfigService configService; - @Autowired - private ConfigServletInner configServletInner; + private final ConfigServletInner configServletInner; @GetMapping public Result detailConfigInfo( @RequestParam("tpId") String tpId, @RequestParam("itemId") String itemId, - @RequestParam(value = "namespace") String namespace) { - - return Results.success(configService.findConfigAllInfo(tpId, itemId, namespace)); + @RequestParam("namespace") String namespace, + @RequestParam(value = "instanceId", required = false) String instanceId) { + ConfigAllInfo configAllInfo = configService.findConfigRecentInfo(tpId, itemId, namespace, instanceId); + return Results.success(configAllInfo); } @PostMapping - public Result publishConfig(@RequestBody ConfigAllInfo config) { - configService.insertOrUpdate(config); + public Result publishConfig(@RequestParam(value = "identify", required = false) String identify, + @RequestBody ConfigAllInfo config) { + configService.insertOrUpdate(identify, config); return Results.success(true); } @@ -71,4 +74,14 @@ public class ConfigController { configServletInner.doPollingConfig(request, response, clientMd5Map, probeModify.length()); } + @PostMapping("/remove/config/cache") + public Result removeConfigCache(@RequestBody Map bodyMap) { + String groupKey = bodyMap.get(Constants.GROUP_KEY); + if (StrUtil.isNotBlank(groupKey)) { + ConfigCacheService.removeConfigCache(groupKey); + } + + return Results.success(); + } + } diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/event/Event.java b/hippo4j-config/src/main/java/cn/hippo4j/config/event/AbstractEvent.java similarity index 83% rename from config/src/main/java/com/github/dynamic/threadpool/config/event/Event.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/event/AbstractEvent.java index 82a1c72a..7684d5d4 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/event/Event.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/event/AbstractEvent.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.event; +package cn.hippo4j.config.event; import java.io.Serializable; import java.util.concurrent.atomic.AtomicLong; @@ -9,7 +9,7 @@ import java.util.concurrent.atomic.AtomicLong; * @author chen.ma * @date 2021/6/23 18:59 */ -public abstract class Event implements Serializable { +public abstract class AbstractEvent implements Serializable { private static final AtomicLong SEQUENCE = new AtomicLong(0); diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/event/SlowEvent.java b/hippo4j-config/src/main/java/cn/hippo4j/config/event/AbstractSlowEvent.java similarity index 58% rename from config/src/main/java/com/github/dynamic/threadpool/config/event/SlowEvent.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/event/AbstractSlowEvent.java index 127e9c9f..9334adb5 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/event/SlowEvent.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/event/AbstractSlowEvent.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.event; +package cn.hippo4j.config.event; /** * Slow event. @@ -6,7 +6,7 @@ package com.github.dynamic.threadpool.config.event; * @author chen.ma * @date 2021/6/23 19:05 */ -public abstract class SlowEvent extends Event { +public abstract class AbstractSlowEvent extends AbstractEvent { @Override public long sequence() { diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/event/ConfigDataChangeEvent.java b/hippo4j-config/src/main/java/cn/hippo4j/config/event/ConfigDataChangeEvent.java similarity index 87% rename from config/src/main/java/com/github/dynamic/threadpool/config/event/ConfigDataChangeEvent.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/event/ConfigDataChangeEvent.java index 8e1af218..23ed93cf 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/event/ConfigDataChangeEvent.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/event/ConfigDataChangeEvent.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.event; +package cn.hippo4j.config.event; import org.springframework.util.StringUtils; @@ -8,7 +8,7 @@ import org.springframework.util.StringUtils; * @author chen.ma * @date 2021/6/24 23:35 */ -public class ConfigDataChangeEvent extends Event { +public class ConfigDataChangeEvent extends AbstractEvent { public final String tenantId; diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/event/LocalDataChangeEvent.java b/hippo4j-config/src/main/java/cn/hippo4j/config/event/LocalDataChangeEvent.java new file mode 100644 index 00000000..03bcb6f3 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/event/LocalDataChangeEvent.java @@ -0,0 +1,26 @@ +package cn.hippo4j.config.event; + +/** + * Local data change event. + * + * @author chen.ma + * @date 2021/6/23 19:13 + */ +public class LocalDataChangeEvent extends AbstractEvent { + + /** + * 租户+项目+线程池 + */ + public final String groupKey; + + /** + * 客户端实例唯一标识 + */ + public final String identify; + + public LocalDataChangeEvent(String identify, String groupKey) { + this.identify = identify; + this.groupKey = groupKey; + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/ConfigInfoMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ConfigInfoMapper.java similarity index 68% rename from config/src/main/java/com/github/dynamic/threadpool/config/mapper/ConfigInfoMapper.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ConfigInfoMapper.java index ea33e779..7a319c85 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/ConfigInfoMapper.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ConfigInfoMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.mapper; +package cn.hippo4j.config.mapper; +import cn.hippo4j.config.model.ConfigAllInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ConfigInstanceMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ConfigInstanceMapper.java new file mode 100644 index 00000000..bc9c38c6 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ConfigInstanceMapper.java @@ -0,0 +1,15 @@ +package cn.hippo4j.config.mapper; + +import cn.hippo4j.config.model.ConfigInstanceInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * Config instance mapper. + * + * @author chen.ma + * @date 2021/12/5 19:18 + */ +@Mapper +public interface ConfigInstanceMapper extends BaseMapper { +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/DashboardMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/DashboardMapper.java new file mode 100644 index 00000000..cf3ee996 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/DashboardMapper.java @@ -0,0 +1,14 @@ +package cn.hippo4j.config.mapper; + +import org.apache.ibatis.annotations.Mapper; + +/** + * Dashboard mapper. + * + * @author chen.ma + * @date 2021/12/11 15:16 + */ +@Mapper +public interface DashboardMapper { + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/HisRunDataMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/HisRunDataMapper.java new file mode 100644 index 00000000..573992cc --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/HisRunDataMapper.java @@ -0,0 +1,88 @@ +package cn.hippo4j.config.mapper; + +import cn.hippo4j.config.model.HisRunDataInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import lombok.Data; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * His run data mapper. + * + * @author chen.ma + * @date 2021/12/10 21:33 + */ +@Mapper +public interface HisRunDataMapper extends BaseMapper { + + /** + * Query thread pool task sum ranking. + * + * @param startTime + * @param endTime + * @return + */ + @Select("SELECT " + + "tenant_id, item_id, tp_id, max(completed_task_count) as max_completed_task_count " + + "FROM his_run_data " + + "where timestamp between #{startTime} and #{endTime} " + + "group by tenant_id, item_id, tp_id " + + "order by max_completed_task_count desc " + + "limit 8") + List queryThreadPoolTaskSumRanking(@Param("startTime") Long startTime, @Param("endTime") Long endTime); + + /** + * Query thread pool task sum ranking. + * + * @param startTime + * @param endTime + * @return + */ + @Select("SELECT " + + "tenant_id, item_id, tp_id, max(queue_size) as max_queue_size, max(reject_count) as max_reject_count, max(completed_task_count) as max_completed_task_count " + + "FROM his_run_data " + + "where timestamp between #{startTime} and #{endTime} " + + "group by tenant_id, item_id, tp_id " + + "order by max_completed_task_count desc " + + "limit 4") + List queryThreadPoolMaxRanking(@Param("startTime") Long startTime, @Param("endTime") Long endTime); + + + @Data + class ThreadPoolTaskRanking { + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 执行任务数 + */ + private Long maxCompletedTaskCount; + + /** + * 队列元素 + */ + private Long maxQueueSize; + + /** + * 拒绝次数 + */ + private Long maxRejectCount; + + } +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/ItemInfoMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ItemInfoMapper.java similarity index 69% rename from config/src/main/java/com/github/dynamic/threadpool/config/mapper/ItemInfoMapper.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ItemInfoMapper.java index 4aa0af90..b8915728 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/ItemInfoMapper.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/ItemInfoMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.mapper; +package cn.hippo4j.config.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.config.model.ItemInfo; +import cn.hippo4j.config.model.ItemInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/LogRecordMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/LogRecordMapper.java similarity index 68% rename from config/src/main/java/com/github/dynamic/threadpool/config/mapper/LogRecordMapper.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/mapper/LogRecordMapper.java index 40d62387..e64d6749 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/LogRecordMapper.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/LogRecordMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.mapper; +package cn.hippo4j.config.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.logrecord.model.LogRecordInfo; +import cn.hippo4j.tools.logrecord.model.LogRecordInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/NotifyInfoMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/NotifyInfoMapper.java new file mode 100644 index 00000000..a683848b --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/NotifyInfoMapper.java @@ -0,0 +1,15 @@ +package cn.hippo4j.config.mapper; + +import cn.hippo4j.config.model.NotifyInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * Notify info mapper. + * + * @author chen.ma + * @date 2021/11/17 22:04 + */ +@Mapper +public interface NotifyInfoMapper extends BaseMapper { +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/TenantInfoMapper.java b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/TenantInfoMapper.java similarity index 69% rename from config/src/main/java/com/github/dynamic/threadpool/config/mapper/TenantInfoMapper.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/mapper/TenantInfoMapper.java index e84006f4..ff3cb1e7 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/mapper/TenantInfoMapper.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/mapper/TenantInfoMapper.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.mapper; +package cn.hippo4j.config.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.github.dynamic.threadpool.config.model.TenantInfo; +import cn.hippo4j.config.model.TenantInfo; import org.apache.ibatis.annotations.Mapper; /** diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/CacheItem.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/CacheItem.java similarity index 54% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/CacheItem.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/CacheItem.java index 228ce739..8f7af161 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/CacheItem.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/CacheItem.java @@ -1,8 +1,9 @@ -package com.github.dynamic.threadpool.config.model; +package cn.hippo4j.config.model; -import com.github.dynamic.threadpool.config.toolkit.SimpleReadWriteLock; -import com.github.dynamic.threadpool.config.toolkit.SingletonRepository; -import com.github.dynamic.threadpool.common.constant.Constants; +import cn.hippo4j.common.toolkit.Md5Util; +import cn.hippo4j.config.toolkit.SimpleReadWriteLock; +import cn.hippo4j.config.toolkit.SingletonRepository; +import cn.hippo4j.common.constant.Constants; import lombok.Getter; import lombok.Setter; @@ -22,6 +23,8 @@ public class CacheItem { public volatile long lastModifiedTs; + public volatile ConfigAllInfo configAllInfo; + public SimpleReadWriteLock rwLock = new SimpleReadWriteLock(); public CacheItem(String groupKey) { @@ -33,4 +36,10 @@ public class CacheItem { this.groupKey = SingletonRepository.DataIdGroupIdCache.getSingleton(groupKey); } + public CacheItem(String groupKey, ConfigAllInfo configAllInfo) { + this.configAllInfo = configAllInfo; + this.md5 = Md5Util.getTpContentMd5(configAllInfo); + this.groupKey = SingletonRepository.DataIdGroupIdCache.getSingleton(groupKey); + } + } diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigAllInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigAllInfo.java similarity index 74% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigAllInfo.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigAllInfo.java index 094577c9..970e5ce2 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigAllInfo.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigAllInfo.java @@ -1,11 +1,12 @@ -package com.github.dynamic.threadpool.config.model; +package cn.hippo4j.config.model; -import com.alibaba.fastjson.annotation.JSONField; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.toolkit.JSONUtil; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; -import com.github.dynamic.threadpool.common.model.PoolParameter; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.util.Date; @@ -25,21 +26,21 @@ public class ConfigAllInfo extends ConfigInfo implements PoolParameter { /** * desc */ - @JSONField(serialize = false) + @JsonIgnore @TableField(exist = false, fill = FieldFill.UPDATE) private String desc; /** * gmtCreate */ - @JSONField(serialize = false) + @JsonIgnore @TableField(fill = FieldFill.INSERT) private Date gmtCreate; /** * gmtModified */ - @JSONField(serialize = false) + @JsonIgnore @TableField(fill = FieldFill.INSERT_UPDATE) private Date gmtModified; @@ -47,8 +48,13 @@ public class ConfigAllInfo extends ConfigInfo implements PoolParameter { * delFlag */ @TableLogic - @JSONField(serialize = false) + @JsonIgnore @TableField(fill = FieldFill.INSERT) private Integer delFlag; + @Override + public String toString() { + return JSONUtil.toJSONString(this); + } + } diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInfo.java similarity index 81% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigInfo.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInfo.java index 6a70b23d..df96539e 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigInfo.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model; +package cn.hippo4j.config.model; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigInfoBase.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInfoBase.java similarity index 85% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigInfoBase.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInfoBase.java index 67015c1e..f52eaecb 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/ConfigInfoBase.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInfoBase.java @@ -1,8 +1,8 @@ -package com.github.dynamic.threadpool.config.model; +package cn.hippo4j.config.model; -import com.alibaba.fastjson.annotation.JSONField; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -22,7 +22,7 @@ public class ConfigInfoBase implements Serializable { * ID */ @TableId(type = IdType.AUTO) - private Integer id; + private Long id; /** * tenantId @@ -84,16 +84,21 @@ public class ConfigInfoBase implements Serializable { */ private Integer livenessAlarm; + /** + * allowCoreThreadTimeOut + */ + private Integer allowCoreThreadTimeOut; + /** * MD5 */ - @JSONField(serialize = false) + @JsonIgnore private String md5; /** * content */ - @JSONField(serialize = false) + @JsonIgnore private String content; } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInstanceInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInstanceInfo.java new file mode 100644 index 00000000..d0318c19 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ConfigInstanceInfo.java @@ -0,0 +1,60 @@ +package cn.hippo4j.config.model; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; + +/** + * Config instance info. + * + * @author chen.ma + * @date 2021/12/5 19:19 + */ +@Data +@TableName("inst_config") +public class ConfigInstanceInfo { + + /** + * ID + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * tenantId + */ + private String tenantId; + + /** + * itemId + */ + private String itemId; + + /** + * tpId + */ + private String tpId; + + /** + * instanceId + */ + private String instanceId; + + /** + * MD5 + */ + private String md5; + + /** + * content + */ + private String content; + + /** + * gmtCreate + */ + @TableField(fill = FieldFill.INSERT) + private Date gmtCreate; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/HisRunDataInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/HisRunDataInfo.java new file mode 100644 index 00000000..88ea0f39 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/HisRunDataInfo.java @@ -0,0 +1,106 @@ +package cn.hippo4j.config.model; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; + +/** + * His run data info. + * + * @author chen.ma + * @date 2021/12/10 21:30 + */ +@Data +@TableName("his_run_data") +public class HisRunDataInfo { + + /** + * id + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 实例id + */ + private String instanceId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 当前负载 + */ + private Long currentLoad; + + /** + * 峰值负载 + */ + private Long peakLoad; + + /** + * 线程数 + */ + private Long poolSize; + + /** + * 活跃线程数 + */ + private Long activeSize; + + /** + * 队列容量 + */ + private Long queueCapacity; + + /** + * 队列元素 + */ + private Long queueSize; + + /** + * 队列剩余容量 + */ + private Long queueRemainingCapacity; + + /** + * 已完成任务计数 + */ + private Long completedTaskCount; + + /** + * 拒绝次数 + */ + private Long rejectCount; + + /** + * 时间戳 + */ + private Long timestamp; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date gmtCreate; + + /** + * 修改时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date gmtModified; + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/ItemInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ItemInfo.java similarity index 94% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/ItemInfo.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/ItemInfo.java index 69a913a1..cedb767e 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/ItemInfo.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/ItemInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model; +package cn.hippo4j.config.model; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/NotifyInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/NotifyInfo.java new file mode 100644 index 00000000..69ef6912 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/NotifyInfo.java @@ -0,0 +1,88 @@ +package cn.hippo4j.config.model; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.util.Date; + +/** + * 通知管理. + * + * @author chen.ma + * @date 2021/11/17 22:03 + */ +@Data +@TableName("notify") +public class NotifyInfo { + + /** + * id + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 通知平台 + */ + private String platform; + + /** + * 通知类型 + */ + private String type; + + /** + * 密钥 + */ + private String secretKey; + + /** + * 报警间隔 + */ + @TableField("`interval`") + private Integer interval; + + /** + * 接收者 + */ + private String receives; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date gmtCreate; + + /** + * 修改时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date gmtModified; + + /** + * 是否启用 + */ + private Integer enable; + + /** + * 是否删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/TenantInfo.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/TenantInfo.java similarity index 94% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/TenantInfo.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/TenantInfo.java index ab23fc8d..077df416 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/TenantInfo.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/TenantInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model; +package cn.hippo4j.config.model; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemQueryReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemQueryReqDTO.java similarity index 88% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemQueryReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemQueryReqDTO.java index 0f27e6e8..bec92e4a 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemQueryReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemQueryReqDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.item; +package cn.hippo4j.config.model.biz.item; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemRespDTO.java similarity index 93% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemRespDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemRespDTO.java index 07b03701..303db8ee 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemRespDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemRespDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.item; +package cn.hippo4j.config.model.biz.item; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemSaveReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemSaveReqDTO.java similarity index 61% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemSaveReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemSaveReqDTO.java index 14d30956..03edf4dc 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemSaveReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemSaveReqDTO.java @@ -1,7 +1,10 @@ -package com.github.dynamic.threadpool.config.model.biz.item; +package cn.hippo4j.config.model.biz.item; import lombok.Data; +import javax.validation.constraints.Pattern; + + /** * Item save req dto. * @@ -14,11 +17,13 @@ public class ItemSaveReqDTO { /** * tenantId */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String tenantId; /** * itemId */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String itemId; /** diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemUpdateReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemUpdateReqDTO.java similarity index 82% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemUpdateReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemUpdateReqDTO.java index 8d422d68..455c44d2 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/item/ItemUpdateReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/item/ItemUpdateReqDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.item; +package cn.hippo4j.config.model.biz.item; import lombok.Data; diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/log/LogRecordQueryReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/log/LogRecordQueryReqDTO.java new file mode 100644 index 00000000..2bbb7518 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/log/LogRecordQueryReqDTO.java @@ -0,0 +1,30 @@ +package cn.hippo4j.config.model.biz.log; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; + +/** + * 日志记录查询. + * + * @author chen.ma + * @date 2021/11/17 21:43 + */ +@Data +public class LogRecordQueryReqDTO extends Page { + + /** + * 业务标识 + */ + private String bizNo; + + /** + * 业务类型 + */ + private String category; + + /** + * 操作人 + */ + private String operator; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/log/LogRecordRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/log/LogRecordRespDTO.java new file mode 100644 index 00000000..c904b893 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/log/LogRecordRespDTO.java @@ -0,0 +1,42 @@ +package cn.hippo4j.config.model.biz.log; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 日志记录返回. + * + * @author chen.ma + * @date 2021/11/17 21:37 + */ +@Data +public class LogRecordRespDTO { + + /** + * 业务标识 + */ + private String bizNo; + + /** + * 日志内容 + */ + private String action; + + /** + * 操作人 + */ + private String operator; + + /** + * 业务类型 + */ + private String category; + + /** + * gmtCreate + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorActiveRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorActiveRespDTO.java new file mode 100644 index 00000000..1a509bce --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorActiveRespDTO.java @@ -0,0 +1,65 @@ +package cn.hippo4j.config.model.biz.monitor; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * Monitor active resp dto. + * + * @author chen.ma + * @date 2021/12/12 17:18 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class MonitorActiveRespDTO { + + /** + * times + */ + private List times; + + /** + * poolSizeList + */ + private List poolSizeList; + + /** + * activeSizeList + */ + private List activeSizeList; + + /** + * queueSizeList + */ + private List queueSizeList; + + /** + * completedTaskCountList + */ + private List completedTaskCountList; + + /** + * rejectCountList + */ + private List rejectCountList; + + /** + * queueRemainingCapacityList + */ + private List queueRemainingCapacityList; + + /** + * currentLoadList + */ + private List currentLoadList; + + /** + * queueCapacityList + */ + private List queueCapacityList; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorQueryReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorQueryReqDTO.java new file mode 100644 index 00000000..60eea99d --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorQueryReqDTO.java @@ -0,0 +1,34 @@ +package cn.hippo4j.config.model.biz.monitor; + +import lombok.Data; + +/** + * Monitor query req dto. + * + * @author chen.ma + * @date 2021/12/10 20:18 + */ +@Data +public class MonitorQueryReqDTO { + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 实例id + */ + private String instanceId; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorRespDTO.java new file mode 100644 index 00000000..54359c5f --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/monitor/MonitorRespDTO.java @@ -0,0 +1,79 @@ +package cn.hippo4j.config.model.biz.monitor; + +import lombok.Data; + +/** + * Monitor resp dto. + * + * @author chen.ma + * @date 2021/12/10 20:23 + */ +@Data +public class MonitorRespDTO { + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 实例id + */ + private String instanceId; + + /** + * 已完成任务计数 + */ + private String completedTaskCount; + + /** + * 线程池id + */ + private String tpId; + + /** + * 当前负载 + */ + private String currentLoad; + + /** + * 峰值负载 + */ + private String peakLoad; + + /** + * 线程数 + */ + private String poolSize; + + /** + * 活跃线程数 + */ + private String activeSize; + + /** + * 队列容量 + */ + private String queueCapacity; + + /** + * 队列元素 + */ + private String queueSize; + + /** + * 队列剩余容量 + */ + private String queueRemainingCapacity; + + /** + * 拒绝次数 + */ + private String rejectCount; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyListRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyListRespDTO.java new file mode 100644 index 00000000..ce34d053 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyListRespDTO.java @@ -0,0 +1,29 @@ +package cn.hippo4j.config.model.biz.notify; + +import cn.hippo4j.config.model.NotifyInfo; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.util.List; + +/** + * Notify list resp dto. + * + * @author chen.ma + * @date 2021/11/17 22:53 + */ +@Data +@AllArgsConstructor +public class NotifyListRespDTO { + + /** + * 通知 Key + */ + private String notifyKey; + + /** + * 通知配置 + */ + private List notifyList; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyQueryReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyQueryReqDTO.java new file mode 100644 index 00000000..c9b14954 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyQueryReqDTO.java @@ -0,0 +1,37 @@ +package cn.hippo4j.config.model.biz.notify; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; + +import java.util.List; + +/** + * Notify query req dto. + * + * @author chen.ma + * @date 2021/11/17 22:52 + */ +@Data +public class NotifyQueryReqDTO extends Page { + + /** + * groupKeys + */ + private List groupKeys; + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyReqDTO.java new file mode 100644 index 00000000..f97aa15e --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyReqDTO.java @@ -0,0 +1,64 @@ +package cn.hippo4j.config.model.biz.notify; + +import lombok.Data; + +/** + * 消息通知入参实体. + * + * @author chen.ma + * @date 2021/11/18 20:15 + */ +@Data +public class NotifyReqDTO { + + /** + * id + */ + private String id; + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 通知平台 + */ + private String platform; + + /** + * 通知类型 + */ + private String type; + + /** + * 密钥 + */ + private String secretKey; + + /** + * 报警间隔 + */ + private Integer interval; + + /** + * 接收者 + */ + private String receives; + + /** + * 是否启用 + */ + private Integer enable; + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyRespDTO.java new file mode 100644 index 00000000..c3cf7771 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/notify/NotifyRespDTO.java @@ -0,0 +1,64 @@ +package cn.hippo4j.config.model.biz.notify; + +import lombok.Data; + +/** + * 消息通知返回. + * + * @author chen.ma + * @date 2021/11/18 20:07 + */ +@Data +public class NotifyRespDTO { + + /** + * id + */ + private String id; + + /** + * 租户id + */ + private String tenantId; + + /** + * 项目id + */ + private String itemId; + + /** + * 线程池id + */ + private String tpId; + + /** + * 通知平台 + */ + private String platform; + + /** + * 通知类型 + */ + private String type; + + /** + * 密钥 + */ + private String secretKey; + + /** + * 报警间隔 + */ + private Integer interval; + + /** + * 接收者 + */ + private String receives; + + /** + * 是否启用 + */ + private Integer enable; + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantQueryReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantQueryReqDTO.java similarity index 86% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantQueryReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantQueryReqDTO.java index 84afe27e..bd76dc6c 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantQueryReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantQueryReqDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.tenant; +package cn.hippo4j.config.model.biz.tenant; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantRespDTO.java similarity index 92% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantRespDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantRespDTO.java index 23c78125..0c9982c7 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantRespDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantRespDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.tenant; +package cn.hippo4j.config.model.biz.tenant; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantSaveReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantSaveReqDTO.java similarity index 58% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantSaveReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantSaveReqDTO.java index 5d2bd7f3..47a682d7 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantSaveReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantSaveReqDTO.java @@ -1,7 +1,9 @@ -package com.github.dynamic.threadpool.config.model.biz.tenant; +package cn.hippo4j.config.model.biz.tenant; import lombok.Data; +import javax.validation.constraints.Pattern; + /** * Tenant save req dto. * @@ -14,11 +16,13 @@ public class TenantSaveReqDTO { /** * tenantId */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String tenantId; /** * tenantName */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String tenantName; /** diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantUpdateReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantUpdateReqDTO.java similarity index 70% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantUpdateReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantUpdateReqDTO.java index 9dfc57ec..e4bc3a77 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/tenant/TenantUpdateReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/tenant/TenantUpdateReqDTO.java @@ -1,5 +1,6 @@ -package com.github.dynamic.threadpool.config.model.biz.tenant; +package cn.hippo4j.config.model.biz.tenant; +import cn.hippo4j.common.toolkit.JSONUtil; import lombok.Data; /** @@ -36,4 +37,9 @@ public class TenantUpdateReqDTO { */ private String owner; + @Override + public String toString() { + return JSONUtil.toJSONString(this); + } + } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolDelReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolDelReqDTO.java new file mode 100644 index 00000000..b4e8b18e --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolDelReqDTO.java @@ -0,0 +1,29 @@ +package cn.hippo4j.config.model.biz.threadpool; + +import lombok.Data; + +/** + * ThreadPool del req dto. + * + * @author chen.ma + * @date 2021/11/11 21:40 + */ +@Data +public class ThreadPoolDelReqDTO { + + /** + * tenantId + */ + private String tenantId; + + /** + * itemId + */ + private String itemId; + + /** + * tpId + */ + private String tpId; + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolQueryReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolQueryReqDTO.java similarity index 85% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolQueryReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolQueryReqDTO.java index 7be33ba8..19027869 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolQueryReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolQueryReqDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.threadpool; +package cn.hippo4j.config.model.biz.threadpool; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolRespDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolRespDTO.java similarity index 88% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolRespDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolRespDTO.java index 12f416cc..031c4745 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolRespDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolRespDTO.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.model.biz.threadpool; +package cn.hippo4j.config.model.biz.threadpool; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -14,6 +14,11 @@ import java.util.Date; @Data public class ThreadPoolRespDTO { + /** + * id + */ + private String id; + /** * tenantId */ @@ -29,11 +34,6 @@ public class ThreadPoolRespDTO { */ private String tpId; - /** - * content - */ - private String content; - /** * coreSize */ @@ -84,6 +84,11 @@ public class ThreadPoolRespDTO { */ private Integer rejectedType; + /** + * allowCoreThreadTimeOut + */ + private Integer allowCoreThreadTimeOut; + /** * gmtCreate */ diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolSaveOrUpdateReqDTO.java b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolSaveOrUpdateReqDTO.java similarity index 66% rename from config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolSaveOrUpdateReqDTO.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolSaveOrUpdateReqDTO.java index 3946e59d..831a9930 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/model/biz/threadpool/ThreadPoolSaveOrUpdateReqDTO.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/model/biz/threadpool/ThreadPoolSaveOrUpdateReqDTO.java @@ -1,7 +1,9 @@ -package com.github.dynamic.threadpool.config.model.biz.threadpool; +package cn.hippo4j.config.model.biz.threadpool; import lombok.Data; +import javax.validation.constraints.Pattern; + /** * Thread pool save or update req dto. * @@ -14,16 +16,19 @@ public class ThreadPoolSaveOrUpdateReqDTO { /** * tenantId */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String tenantId; /** * TpId */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String tpId; /** * ItemId */ + @Pattern(regexp = "^((?!\\+).)*$", message = "租户、项目、线程池 ID 包含+号") private String itemId; /** @@ -71,4 +76,9 @@ public class ThreadPoolSaveOrUpdateReqDTO { */ private Integer rejectedType; + /** + * allowCoreThreadTimeOut + */ + private Integer allowCoreThreadTimeOut; + } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/AbstractMonitorDataExecuteStrategy.java b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/AbstractMonitorDataExecuteStrategy.java new file mode 100644 index 00000000..159acbd5 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/AbstractMonitorDataExecuteStrategy.java @@ -0,0 +1,27 @@ +package cn.hippo4j.config.monitor; + +import cn.hippo4j.common.monitor.Message; + +/** + * Abstract monitor data execute strategy. + * + * @author chen.ma + * @date 2021/12/10 20:14 + */ +public abstract class AbstractMonitorDataExecuteStrategy { + + /** + * Mark. + * + * @return + */ + public abstract String mark(); + + /** + * Execute. + * + * @param message + */ + public abstract void execute(T message); + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/DefaultMonitorDataResolver.java b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/DefaultMonitorDataResolver.java new file mode 100644 index 00000000..0e80b421 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/DefaultMonitorDataResolver.java @@ -0,0 +1,28 @@ +package cn.hippo4j.config.monitor; + +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.MessageTypeEnum; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * Default monitor data resolver. + * + * @author chen.ma + * @date 2021/12/10 21:47 + */ +@Slf4j +@Component +public class DefaultMonitorDataResolver extends AbstractMonitorDataExecuteStrategy { + + @Override + public String mark() { + return MessageTypeEnum.DEFAULT.name(); + } + + @Override + public void execute(Message message) { + log.warn("There is no suitable monitoring data storage actuator."); + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/QueryMonitorExecuteChoose.java b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/QueryMonitorExecuteChoose.java new file mode 100644 index 00000000..357fb722 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/QueryMonitorExecuteChoose.java @@ -0,0 +1,69 @@ +package cn.hippo4j.config.monitor; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.MessageTypeEnum; +import com.google.common.collect.Maps; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * Query monitor execute choose. + * + * @author chen.ma + * @date 2021/12/10 20:12 + */ +@Component +public class QueryMonitorExecuteChoose implements CommandLineRunner { + + /** + * Storage monitoring data execution container. + */ + private Map monitorDataExecuteStrategyChooseMap = Maps.newHashMap(); + + /** + * Choose by {@link cn.hippo4j.common.monitor.MessageTypeEnum}. + * + * @param messageTypeEnum {@link cn.hippo4j.common.monitor.MessageTypeEnum} + * @return + */ + public AbstractMonitorDataExecuteStrategy choose(MessageTypeEnum messageTypeEnum) { + return choose(messageTypeEnum.name()); + } + + /** + * Choose by mark type. + * + * @param markType {@link cn.hippo4j.common.monitor.MessageTypeEnum#name()} + * @return + */ + public AbstractMonitorDataExecuteStrategy choose(String markType) { + AbstractMonitorDataExecuteStrategy executeStrategy = monitorDataExecuteStrategyChooseMap.get(markType); + if (executeStrategy == null) { + executeStrategy = monitorDataExecuteStrategyChooseMap.get(MessageTypeEnum.DEFAULT.name()); + } + return executeStrategy; + } + + /** + * Choose and execute. + * + * @param message {@link Message} + */ + public void chooseAndExecute(Message message) { + MessageTypeEnum messageType = message.getMessageType(); + AbstractMonitorDataExecuteStrategy executeStrategy = choose(messageType); + executeStrategy.execute(message); + } + + @Override + public void run(String... args) throws Exception { + Map monitorDataExecuteStrategyMap = + ApplicationContextHolder.getBeansOfType(AbstractMonitorDataExecuteStrategy.class); + + monitorDataExecuteStrategyMap.values().forEach(each -> monitorDataExecuteStrategyChooseMap.put(each.mark(), each)); + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/RuntimeDataResolver.java b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/RuntimeDataResolver.java new file mode 100644 index 00000000..b2dc7804 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/RuntimeDataResolver.java @@ -0,0 +1,33 @@ +package cn.hippo4j.config.monitor; + +import cn.hippo4j.common.monitor.MessageTypeEnum; +import cn.hippo4j.common.monitor.RuntimeMessage; +import cn.hippo4j.config.service.biz.HisRunDataService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * Runtime data resolver. + * + * @author chen.ma + * @date 2021/12/10 20:18 + */ +@Slf4j +@Component +@AllArgsConstructor +public class RuntimeDataResolver extends AbstractMonitorDataExecuteStrategy { + + private final HisRunDataService hisRunDataService; + + @Override + public String mark() { + return MessageTypeEnum.RUNTIME.name(); + } + + @Override + public void execute(RuntimeMessage message) { + hisRunDataService.save(message); + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/TimeCleanHistoryDataTask.java b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/TimeCleanHistoryDataTask.java new file mode 100644 index 00000000..94816ef9 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/monitor/TimeCleanHistoryDataTask.java @@ -0,0 +1,60 @@ +package cn.hippo4j.config.monitor; + +import cn.hippo4j.common.executor.ExecutorFactory; +import cn.hippo4j.config.config.ServerBootstrapProperties; +import cn.hippo4j.config.model.HisRunDataInfo; +import cn.hippo4j.config.service.biz.HisRunDataService; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import static cn.hippo4j.common.constant.Constants.DEFAULT_GROUP; + +/** + * Regularly clean up the historical running data of thread pool. + * + * @author chen.ma + * @date 2021/12/17 20:13 + */ +@Component +@RequiredArgsConstructor +public class TimeCleanHistoryDataTask implements Runnable, InitializingBean { + + @NonNull + private final ServerBootstrapProperties properties; + + @NonNull + private final HisRunDataService hisRunDataService; + + private ScheduledExecutorService cleanHistoryDataExecutor; + + @Override + public void run() { + Date currentDate = new Date(); + DateTime offsetMinuteDateTime = DateUtil.offsetMinute(currentDate, -properties.getCleanHistoryDataPeriod()); + + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(HisRunDataInfo.class) + .le(HisRunDataInfo::getTimestamp, offsetMinuteDateTime.getTime()); + + hisRunDataService.remove(queryWrapper); + } + + @Override + public void afterPropertiesSet() throws Exception { + if (properties.getCleanHistoryDataEnable()) { + cleanHistoryDataExecutor = ExecutorFactory.Managed + .newSingleScheduledExecutorService(DEFAULT_GROUP, r -> new Thread(r, "clean-history-data")); + cleanHistoryDataExecutor.scheduleWithFixedDelay(this, 0, 1, TimeUnit.MINUTES); + } + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/notify/DefaultPublisher.java b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/DefaultPublisher.java similarity index 81% rename from config/src/main/java/com/github/dynamic/threadpool/config/notify/DefaultPublisher.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/notify/DefaultPublisher.java index ec6f2b1b..39a052dd 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/notify/DefaultPublisher.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/DefaultPublisher.java @@ -1,8 +1,8 @@ -package com.github.dynamic.threadpool.config.notify; +package cn.hippo4j.config.notify; +import cn.hippo4j.config.event.AbstractEvent; import cn.hutool.core.collection.ConcurrentHashSet; -import com.github.dynamic.threadpool.config.notify.listener.Subscriber; -import com.github.dynamic.threadpool.config.event.Event; +import cn.hippo4j.config.notify.listener.AbstractSubscriber; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; @@ -20,9 +20,9 @@ import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; @Slf4j public class DefaultPublisher extends Thread implements EventPublisher { - protected final ConcurrentHashSet subscribers = new ConcurrentHashSet(); + protected final ConcurrentHashSet subscribers = new ConcurrentHashSet(); - private BlockingQueue queue; + private BlockingQueue queue; private volatile boolean initialized = false; @@ -36,7 +36,7 @@ public class DefaultPublisher extends Thread implements EventPublisher { .newUpdater(DefaultPublisher.class, Long.class, "lastEventSequence"); @Override - public void init(Class type, int bufferSize) { + public void init(Class type, int bufferSize) { setDaemon(true); setName("dynamic.thread-pool.publisher-" + type.getName()); this.queueMaxSize = bufferSize; @@ -80,7 +80,7 @@ public class DefaultPublisher extends Thread implements EventPublisher { if (shutdown) { break; } - final Event event = queue.take(); + final AbstractEvent event = queue.take(); receiveEvent(event); UPDATER.compareAndSet(this, lastEventSequence, Math.max(lastEventSequence, event.sequence())); } @@ -90,12 +90,12 @@ public class DefaultPublisher extends Thread implements EventPublisher { } @Override - public void addSubscriber(Subscriber subscriber) { + public void addSubscriber(AbstractSubscriber subscriber) { subscribers.add(subscriber); } @Override - public boolean publish(Event event) { + public boolean publish(AbstractEvent event) { boolean success = this.queue.offer(event); if (!success) { log.warn("Unable to plug in due to interruption, synchronize sending time, event :: {}", event); @@ -106,7 +106,7 @@ public class DefaultPublisher extends Thread implements EventPublisher { } @Override - public void notifySubscriber(Subscriber subscriber, Event event) { + public void notifySubscriber(AbstractSubscriber subscriber, AbstractEvent event) { final Runnable job = () -> subscriber.onEvent(event); final Executor executor = subscriber.executor(); @@ -126,9 +126,10 @@ public class DefaultPublisher extends Thread implements EventPublisher { return !CollectionUtils.isEmpty(subscribers); } - void receiveEvent(Event event) { - for (Subscriber subscriber : subscribers) { + void receiveEvent(AbstractEvent event) { + for (AbstractSubscriber subscriber : subscribers) { notifySubscriber(subscriber, event); } } + } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/notify/DefaultSharePublisher.java b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/DefaultSharePublisher.java new file mode 100644 index 00000000..ad408343 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/DefaultSharePublisher.java @@ -0,0 +1,47 @@ +package cn.hippo4j.config.notify; + +import cn.hippo4j.config.event.AbstractEvent; +import cn.hutool.core.collection.ConcurrentHashSet; +import cn.hippo4j.config.notify.listener.AbstractSubscriber; +import cn.hippo4j.config.event.AbstractSlowEvent; + +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +/** + * Default share publisher. + * + * @author chen.ma + * @date 2021/6/23 19:05 + */ +public class DefaultSharePublisher extends DefaultPublisher { + + private final Map, Set> subMappings = new ConcurrentHashMap(); + + protected final ConcurrentHashSet subscribers = new ConcurrentHashSet(); + + private final Lock lock = new ReentrantLock(); + + public void addSubscriber(AbstractSubscriber subscriber, Class subscribeType) { + Class subSlowEventType = (Class) subscribeType; + subscribers.add(subscriber); + + lock.lock(); + try { + Set sets = subMappings.get(subSlowEventType); + if (sets == null) { + Set newSet = new ConcurrentHashSet(); + newSet.add(subscriber); + subMappings.put(subSlowEventType, newSet); + return; + } + sets.add(subscriber); + } finally { + lock.unlock(); + } + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/notify/EventPublisher.java b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/EventPublisher.java similarity index 53% rename from config/src/main/java/com/github/dynamic/threadpool/config/notify/EventPublisher.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/notify/EventPublisher.java index 91275ea1..927cc37f 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/notify/EventPublisher.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/EventPublisher.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.notify; +package cn.hippo4j.config.notify; -import com.github.dynamic.threadpool.config.notify.listener.Subscriber; -import com.github.dynamic.threadpool.config.event.Event; +import cn.hippo4j.config.event.AbstractEvent; +import cn.hippo4j.config.notify.listener.AbstractSubscriber; /** * Event publisher. @@ -17,14 +17,14 @@ public interface EventPublisher { * @param type * @param bufferSize */ - void init(Class type, int bufferSize); + void init(Class type, int bufferSize); /** * Add subscriber. * * @param subscriber */ - void addSubscriber(Subscriber subscriber); + void addSubscriber(AbstractSubscriber subscriber); /** * Publish. @@ -32,7 +32,7 @@ public interface EventPublisher { * @param event * @return */ - boolean publish(Event event); + boolean publish(AbstractEvent event); /** * Notify subscriber. @@ -40,6 +40,6 @@ public interface EventPublisher { * @param subscriber * @param event */ - void notifySubscriber(Subscriber subscriber, Event event); + void notifySubscriber(AbstractSubscriber subscriber, AbstractEvent event); } diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/notify/NotifyCenter.java b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java similarity index 65% rename from config/src/main/java/com/github/dynamic/threadpool/config/notify/NotifyCenter.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java index 1072d99d..e4a98982 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/notify/NotifyCenter.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/NotifyCenter.java @@ -1,11 +1,11 @@ -package com.github.dynamic.threadpool.config.notify; - -import com.github.dynamic.threadpool.config.notify.listener.SmartSubscriber; -import com.github.dynamic.threadpool.config.notify.listener.Subscriber; -import com.github.dynamic.threadpool.config.toolkit.ClassUtil; -import com.github.dynamic.threadpool.config.toolkit.MapUtil; -import com.github.dynamic.threadpool.config.event.Event; -import com.github.dynamic.threadpool.config.event.SlowEvent; +package cn.hippo4j.config.notify; + +import cn.hippo4j.config.event.AbstractEvent; +import cn.hippo4j.config.notify.listener.AbstractSmartSubscriber; +import cn.hippo4j.config.notify.listener.AbstractSubscriber; +import cn.hippo4j.config.toolkit.ClassUtil; +import cn.hippo4j.config.toolkit.MapUtil; +import cn.hippo4j.config.event.AbstractSlowEvent; import lombok.extern.slf4j.Slf4j; import java.util.Map; @@ -33,7 +33,7 @@ public class NotifyCenter { private static EventPublisher eventPublisher = new DefaultPublisher(); - private static BiFunction, Integer, EventPublisher> publisherFactory = null; + private static BiFunction, Integer, EventPublisher> publisherFactory = null; private final Map publisherMap = new ConcurrentHashMap(16); @@ -50,13 +50,13 @@ public class NotifyCenter { }; INSTANCE.sharePublisher = new DefaultSharePublisher(); - INSTANCE.sharePublisher.init(SlowEvent.class, shareBufferSize); + INSTANCE.sharePublisher.init(AbstractSlowEvent.class, shareBufferSize); } - public static void registerSubscriber(final Subscriber consumer) { - if (consumer instanceof SmartSubscriber) { - for (Class subscribeType : ((SmartSubscriber) consumer).subscribeTypes()) { - if (ClassUtil.isAssignableFrom(SlowEvent.class, subscribeType)) { + public static void registerSubscriber(final AbstractSubscriber consumer) { + if (consumer instanceof AbstractSmartSubscriber) { + for (Class subscribeType : ((AbstractSmartSubscriber) consumer).subscribeTypes()) { + if (ClassUtil.isAssignableFrom(AbstractSlowEvent.class, subscribeType)) { INSTANCE.sharePublisher.addSubscriber(consumer, subscribeType); } else { addSubscriber(consumer, subscribeType); @@ -65,8 +65,8 @@ public class NotifyCenter { return; } - final Class subscribeType = consumer.subscribeType(); - if (ClassUtil.isAssignableFrom(SlowEvent.class, subscribeType)) { + final Class subscribeType = consumer.subscribeType(); + if (ClassUtil.isAssignableFrom(AbstractSlowEvent.class, subscribeType)) { INSTANCE.sharePublisher.addSubscriber(consumer, subscribeType); return; } @@ -74,7 +74,7 @@ public class NotifyCenter { addSubscriber(consumer, subscribeType); } - private static void addSubscriber(final Subscriber consumer, Class subscribeType) { + private static void addSubscriber(final AbstractSubscriber consumer, Class subscribeType) { final String topic = ClassUtil.getCanonicalName(subscribeType); synchronized (NotifyCenter.class) { MapUtil.computeIfAbsent(INSTANCE.publisherMap, topic, publisherFactory, subscribeType, ringBufferSize); @@ -83,7 +83,7 @@ public class NotifyCenter { publisher.addSubscriber(consumer); } - public static boolean publishEvent(final Event event) { + public static boolean publishEvent(final AbstractEvent event) { try { return publishEvent(event.getClass(), event); } catch (Throwable ex) { @@ -92,8 +92,8 @@ public class NotifyCenter { } } - private static boolean publishEvent(final Class eventType, final Event event) { - if (ClassUtil.isAssignableFrom(SlowEvent.class, eventType)) { + private static boolean publishEvent(final Class eventType, final AbstractEvent event) { + if (ClassUtil.isAssignableFrom(AbstractSlowEvent.class, eventType)) { return INSTANCE.sharePublisher.publish(event); } @@ -107,8 +107,8 @@ public class NotifyCenter { return false; } - public static EventPublisher registerToPublisher(final Class eventType, final int queueMaxSize) { - if (ClassUtil.isAssignableFrom(SlowEvent.class, eventType)) { + public static EventPublisher registerToPublisher(final Class eventType, final int queueMaxSize) { + if (ClassUtil.isAssignableFrom(AbstractSlowEvent.class, eventType)) { return INSTANCE.sharePublisher; } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/notify/listener/AbstractSmartSubscriber.java b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/listener/AbstractSmartSubscriber.java new file mode 100644 index 00000000..1bcb3990 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/listener/AbstractSmartSubscriber.java @@ -0,0 +1,22 @@ +package cn.hippo4j.config.notify.listener; + +import cn.hippo4j.config.event.AbstractEvent; + +import java.util.List; + +/** + * Subscribers to multiple events can be listened to. + * + * @author chen.ma + * @date 2021/6/23 19:02 + */ +public abstract class AbstractSmartSubscriber extends AbstractSubscriber { + + /** + * Subscribe types. + * + * @return + */ + public abstract List> subscribeTypes(); + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/notify/listener/Subscriber.java b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/listener/AbstractSubscriber.java similarity index 64% rename from config/src/main/java/com/github/dynamic/threadpool/config/notify/listener/Subscriber.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/notify/listener/AbstractSubscriber.java index ccafd671..d746341e 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/notify/listener/Subscriber.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/notify/listener/AbstractSubscriber.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.config.notify.listener; +package cn.hippo4j.config.notify.listener; -import com.github.dynamic.threadpool.config.event.Event; +import cn.hippo4j.config.event.AbstractEvent; import java.util.concurrent.Executor; @@ -10,7 +10,7 @@ import java.util.concurrent.Executor; * @author chen.ma * @date 2021/6/23 19:02 */ -public abstract class Subscriber { +public abstract class AbstractSubscriber { /** * Event callback. @@ -24,7 +24,7 @@ public abstract class Subscriber { * * @return */ - public abstract Class subscribeType(); + public abstract Class subscribeType(); public Executor executor() { return null; diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigCacheService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigCacheService.java new file mode 100644 index 00000000..5744399d --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigCacheService.java @@ -0,0 +1,179 @@ +package cn.hippo4j.config.service; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.design.observer.AbstractSubjectCenter; +import cn.hippo4j.common.design.observer.Observer; +import cn.hippo4j.common.design.observer.ObserverMessage; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.toolkit.Md5Util; +import cn.hippo4j.config.event.LocalDataChangeEvent; +import cn.hippo4j.config.model.CacheItem; +import cn.hippo4j.config.model.ConfigAllInfo; +import cn.hippo4j.config.notify.NotifyCenter; +import cn.hippo4j.config.service.biz.ConfigService; +import cn.hippo4j.config.toolkit.MapUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StringUtils; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Config cache service. + * + * @author chen.ma + * @date 2021/6/24 21:19 + */ +@Slf4j +public class ConfigCacheService { + + private static ConfigService CONFIG_SERVICE; + + static { + AbstractSubjectCenter.register(AbstractSubjectCenter.SubjectType.CLEAR_CONFIG_CACHE, new ClearConfigCache()); + } + + /** + * TODO: 数据结构、客户端停机时 remove 操作待重构 + *

+ * key: message-produce+dynamic-threadpool-example+prescription+192.168.20.227:8088_xxx + * val: + * key: 192.168.20.227:8088_xxx + * val: {@link CacheItem} + */ + private static final ConcurrentHashMap> CLIENT_CONFIG_CACHE = new ConcurrentHashMap(); + + public static boolean isUpdateData(String groupKey, String md5, String clientIdentify) { + String contentMd5 = ConfigCacheService.getContentMd5IsNullPut(groupKey, clientIdentify); + return Objects.equals(contentMd5, md5); + } + + /** + * Get Md5. + * + * @param groupKey + * @param clientIdentify + * @return + */ + private synchronized static String getContentMd5IsNullPut(String groupKey, String clientIdentify) { + Map cacheItemMap = Optional.ofNullable(CLIENT_CONFIG_CACHE.get(groupKey)).orElse(Maps.newHashMap()); + + CacheItem cacheItem = null; + if (CollUtil.isNotEmpty(cacheItemMap) && (cacheItem = cacheItemMap.get(clientIdentify)) != null) { + return cacheItem.md5; + } + + if (CONFIG_SERVICE == null) { + CONFIG_SERVICE = ApplicationContextHolder.getBean(ConfigService.class); + } + String[] params = groupKey.split("\\+"); + ConfigAllInfo config = CONFIG_SERVICE.findConfigRecentInfo(params); + if (config != null && StrUtil.isNotBlank(config.getTpId())) { + cacheItem = new CacheItem(groupKey, config); + cacheItemMap.put(clientIdentify, cacheItem); + CLIENT_CONFIG_CACHE.put(groupKey, cacheItemMap); + } + + return (cacheItem != null) ? cacheItem.md5 : Constants.NULL; + } + + public static String getContentMd5(String groupKey) { + if (CONFIG_SERVICE == null) { + CONFIG_SERVICE = ApplicationContextHolder.getBean(ConfigService.class); + } + + String[] params = groupKey.split("\\+"); + ConfigAllInfo config = CONFIG_SERVICE.findConfigRecentInfo(params); + if (config == null || StringUtils.isEmpty(config.getTpId())) { + String errorMessage = String.format("config is null. tpId :: %s, itemId :: %s, tenantId :: %s", params[0], params[1], params[2]); + throw new RuntimeException(errorMessage); + } + + return Md5Util.getTpContentMd5(config); + } + + public static void updateMd5(String groupKey, String identify, String md5) { + CacheItem cache = makeSure(groupKey, identify); + if (cache.md5 == null || !cache.md5.equals(md5)) { + cache.md5 = md5; + String[] params = groupKey.split("\\+"); + ConfigAllInfo config = CONFIG_SERVICE.findConfigRecentInfo(params); + cache.configAllInfo = config; + cache.lastModifiedTs = System.currentTimeMillis(); + NotifyCenter.publishEvent(new LocalDataChangeEvent(identify, groupKey)); + } + } + + public synchronized static CacheItem makeSure(String groupKey, String ip) { + Map ipCacheItemMap = CLIENT_CONFIG_CACHE.get(groupKey); + CacheItem item; + if (ipCacheItemMap != null && (item = ipCacheItemMap.get(ip)) != null) { + return item; + } + + CacheItem tmp = new CacheItem(groupKey); + Map cacheItemMap = Maps.newHashMap(); + cacheItemMap.put(ip, tmp); + CLIENT_CONFIG_CACHE.putIfAbsent(groupKey, cacheItemMap); + + return tmp; + } + + public static Map getContent(String identification) { + List identificationList = MapUtil.parseMapForFilter(CLIENT_CONFIG_CACHE, identification); + Map returnStrCacheItemMap = Maps.newHashMap(); + identificationList.forEach(each -> returnStrCacheItemMap.putAll(CLIENT_CONFIG_CACHE.get(each))); + return returnStrCacheItemMap; + } + + public static synchronized Integer getTotal() { + AtomicInteger total = new AtomicInteger(); + CLIENT_CONFIG_CACHE.forEach((key, val) -> total.addAndGet(val.values().size())); + return total.get(); + } + + /** + * Remove config cache. + * + * @param groupKey 租户 + 项目 + IP + */ + public static void removeConfigCache(String groupKey) { + coarseRemove(groupKey); + } + + /** + * Coarse remove. + * + * @param coarse + */ + private synchronized static void coarseRemove(String coarse) { + // 模糊搜索 + List identificationList = MapUtil.parseMapForFilter(CLIENT_CONFIG_CACHE, coarse); + for (String cacheMapKey : identificationList) { + Map removeCacheItem = CLIENT_CONFIG_CACHE.remove(cacheMapKey); + log.info("Remove invalidated config cache. config info :: {}", JSONUtil.toJSONString(removeCacheItem)); + } + } + + /** + * This is an observer, clear config cache. + */ + static class ClearConfigCache implements Observer { + + @Override + public void accept(ObserverMessage observerMessage) { + log.info("Clean up the configuration cache. Key :: {}", observerMessage.message()); + coarseRemove(observerMessage.message()); + } + + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigChangePublisher.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigChangePublisher.java similarity index 62% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigChangePublisher.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigChangePublisher.java index 0c52273f..e65a7282 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/ConfigChangePublisher.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigChangePublisher.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.config.service; +package cn.hippo4j.config.service; -import com.github.dynamic.threadpool.config.event.LocalDataChangeEvent; -import com.github.dynamic.threadpool.config.notify.NotifyCenter; +import cn.hippo4j.config.notify.NotifyCenter; +import cn.hippo4j.config.event.LocalDataChangeEvent; /** * Config change publisher. diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigServletInner.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigServletInner.java new file mode 100644 index 00000000..fcd3606d --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/ConfigServletInner.java @@ -0,0 +1,70 @@ +package cn.hippo4j.config.service; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +import static cn.hippo4j.common.constant.Constants.WEIGHT_CONFIGS; + +/** + * Config servlet inner. + * + * @author chen.ma + * @date 2021/6/22 23:13 + */ +@Service +@RequiredArgsConstructor +public class ConfigServletInner { + + @NonNull + private final LongPollingService longPollingService; + + private final Cache deWeightCache = CacheBuilder.newBuilder() + .maximumSize(1024) + .build(); + + /** + * 轮询配置. + * + * @param request + * @param response + * @param clientMd5Map + * @param probeRequestSize + * @return + */ + public String doPollingConfig(HttpServletRequest request, HttpServletResponse response, Map clientMd5Map, int probeRequestSize) { + if (LongPollingService.isSupportLongPolling(request) && weightVerification(request)) { + longPollingService.addLongPollingClient(request, response, clientMd5Map, probeRequestSize); + return HttpServletResponse.SC_OK + ""; + } + + return HttpServletResponse.SC_OK + ""; + } + + /** + * 校验复请求是否重. + *

+ * 有使用者提出在公司环境部署时, 会出现相同的请求重复调用. + * 此问题属于极其个别场景. 由于复现不出, 所以先以这种方式解决问题. + * + * @param request + * @return + */ + private boolean weightVerification(HttpServletRequest request) { + String clientIdentify = request.getParameter(WEIGHT_CONFIGS); + Long timeVal = deWeightCache.getIfPresent(clientIdentify); + if (timeVal == null) { + deWeightCache.put(clientIdentify, System.currentTimeMillis()); + return true; + } + + return false; + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/LongPollingService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/LongPollingService.java similarity index 64% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/LongPollingService.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/LongPollingService.java index 01eb5d58..14fcb070 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/LongPollingService.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/LongPollingService.java @@ -1,18 +1,22 @@ -package com.github.dynamic.threadpool.config.service; - -import com.alibaba.fastjson.JSON; -import com.github.dynamic.threadpool.config.notify.listener.Subscriber; -import com.github.dynamic.threadpool.config.toolkit.ConfigExecutor; -import com.github.dynamic.threadpool.config.toolkit.Md5ConfigUtil; -import com.github.dynamic.threadpool.config.toolkit.RequestUtil; -import com.github.dynamic.threadpool.common.toolkit.Md5Util; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.config.event.Event; -import com.github.dynamic.threadpool.config.event.LocalDataChangeEvent; -import com.github.dynamic.threadpool.config.notify.NotifyCenter; +package cn.hippo4j.config.service; + +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.toolkit.Md5Util; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.event.AbstractEvent; +import cn.hippo4j.config.event.LocalDataChangeEvent; +import cn.hippo4j.config.notify.NotifyCenter; +import cn.hippo4j.config.notify.listener.AbstractSubscriber; +import cn.hippo4j.config.toolkit.ConfigExecutor; +import cn.hippo4j.config.toolkit.MapUtil; +import cn.hippo4j.config.toolkit.Md5ConfigUtil; +import cn.hippo4j.config.toolkit.RequestUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; import javax.servlet.AsyncContext; import javax.servlet.http.HttpServletRequest; @@ -23,6 +27,8 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import static cn.hippo4j.common.constant.Constants.GROUP_KEY_DELIMITER; + /** * Long polling service. * @@ -52,22 +58,22 @@ public class LongPollingService { NotifyCenter.registerToPublisher(LocalDataChangeEvent.class, NotifyCenter.ringBufferSize); - NotifyCenter.registerSubscriber(new Subscriber() { + NotifyCenter.registerSubscriber(new AbstractSubscriber() { @Override - public void onEvent(Event event) { + public void onEvent(AbstractEvent event) { if (isFixedPolling()) { // Ignore. } else { if (event instanceof LocalDataChangeEvent) { LocalDataChangeEvent evt = (LocalDataChangeEvent) event; - ConfigExecutor.executeLongPolling(new DataChangeTask(evt.groupKey)); + ConfigExecutor.executeLongPolling(new DataChangeTask(evt.identify, evt.groupKey)); } } } @Override - public Class subscribeType() { + public Class subscribeType() { return LocalDataChangeEvent.class; } }); @@ -85,9 +91,12 @@ public class LongPollingService { class DataChangeTask implements Runnable { + final String identify; + final String groupKey; - DataChangeTask(String groupKey) { + DataChangeTask(String identify, String groupKey) { + this.identify = identify; this.groupKey = groupKey; } @@ -97,12 +106,20 @@ public class LongPollingService { for (Iterator iter = allSubs.iterator(); iter.hasNext(); ) { ClientLongPolling clientSub = iter.next(); - if (clientSub.clientMd5Map.containsKey(groupKey)) { - getRetainIps().put(clientSub.ip, System.currentTimeMillis()); - ConfigCacheService.updateMd5(groupKey, ConfigCacheService.getContentMd5(groupKey), System.currentTimeMillis()); - iter.remove(); - clientSub.sendResponse(Arrays.asList(groupKey)); + String identity = groupKey + GROUP_KEY_DELIMITER + identify; + List parseMapForFilter = Lists.newArrayList(identity); + if (StrUtil.isBlank(identify)) { + parseMapForFilter = MapUtil.parseMapForFilter(clientSub.clientMd5Map, groupKey); } + + parseMapForFilter.forEach(each -> { + if (clientSub.clientMd5Map.containsKey(each)) { + getRetainIps().put(clientSub.clientIdentify, System.currentTimeMillis()); + ConfigCacheService.updateMd5(each, clientSub.clientIdentify, ConfigCacheService.getContentMd5(each)); + iter.remove(); + clientSub.sendResponse(Arrays.asList(groupKey)); + } + }); } } catch (Exception ex) { log.error("Data change error :: {}", ex.getMessage(), ex); @@ -110,18 +127,14 @@ public class LongPollingService { } } - public static boolean isSupportLongPolling(HttpServletRequest req) { - return null != req.getHeader(LONG_POLLING_HEADER); - } - - private static boolean isFixedPolling() { - return SwitchService.getSwitchBoolean(SwitchService.FIXED_POLLING, false); - } - - private static int getFixedPollingInterval() { - return SwitchService.getSwitchInteger(SwitchService.FIXED_POLLING_INTERVAL, FIXED_POLLING_INTERVAL_MS); - } - + /** + * Add long polling client. + * + * @param req + * @param rsp + * @param clientMd5Map + * @param probeRequestSize + */ public void addLongPollingClient(HttpServletRequest req, HttpServletResponse rsp, Map clientMd5Map, int probeRequestSize) { String str = req.getHeader(LONG_POLLING_HEADER); @@ -143,14 +156,17 @@ public class LongPollingService { } } - String ip = RequestUtil.getRemoteIp(req); + String clientIdentify = RequestUtil.getClientIdentify(req); final AsyncContext asyncContext = req.startAsync(); asyncContext.setTimeout(0L); - ConfigExecutor.executeLongPolling(new ClientLongPolling(asyncContext, clientMd5Map, ip, probeRequestSize, timeout, appName)); + ConfigExecutor.executeLongPolling(new ClientLongPolling(asyncContext, clientMd5Map, clientIdentify, probeRequestSize, timeout - delayTime, appName)); } + /** + * Regularly check the configuration for changes. + */ class ClientLongPolling implements Runnable { final AsyncContext asyncContext; @@ -159,7 +175,7 @@ public class LongPollingService { final long createTime; - final String ip; + final String clientIdentify; final String appName; @@ -169,10 +185,10 @@ public class LongPollingService { Future asyncTimeoutFuture; - public ClientLongPolling(AsyncContext asyncContext, Map clientMd5Map, String ip, int probeRequestSize, long timeout, String appName) { + public ClientLongPolling(AsyncContext asyncContext, Map clientMd5Map, String clientIdentify, int probeRequestSize, long timeout, String appName) { this.asyncContext = asyncContext; this.clientMd5Map = clientMd5Map; - this.ip = ip; + this.clientIdentify = clientIdentify; this.probeRequestSize = probeRequestSize; this.timeoutTime = timeout; this.appName = appName; @@ -183,7 +199,7 @@ public class LongPollingService { public void run() { asyncTimeoutFuture = ConfigExecutor.scheduleLongPolling(() -> { try { - getRetainIps().put(ClientLongPolling.this.ip, System.currentTimeMillis()); + getRetainIps().put(ClientLongPolling.this.clientIdentify, System.currentTimeMillis()); allSubs.remove(ClientLongPolling.this); if (isFixedPolling()) { @@ -205,6 +221,11 @@ public class LongPollingService { allSubs.add(this); } + /** + * Send response. + * + * @param changedGroups Changed thread pool group key + */ private void sendResponse(List changedGroups) { // Cancel time out task. if (null != asyncTimeoutFuture) { @@ -213,6 +234,11 @@ public class LongPollingService { generateResponse(changedGroups); } + /** + * Generate async response. + * + * @param changedGroups Changed thread pool group key + */ private void generateResponse(List changedGroups) { if (null == changedGroups) { // Tell web container to send http response. @@ -223,17 +249,15 @@ public class LongPollingService { HttpServletResponse response = (HttpServletResponse) asyncContext.getResponse(); try { - String respStr = Md5Util.compareMd5ResultString(changedGroups); - String resultStr = JSON.toJSONString(Results.success(respStr)); - + String respStr = buildRespStr(changedGroups); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-cache,no-store"); response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println(resultStr); - asyncContext.complete(); + response.getWriter().println(respStr); } catch (Exception ex) { - log.error(ex.toString(), ex); + log.error("Response client failed to return data.", ex); + } finally { asyncContext.complete(); } } @@ -244,20 +268,66 @@ public class LongPollingService { return retainIps; } + /** + * Generate sync response. + * + * @param response response + * @param changedGroups Changed thread pool group key + */ private void generateResponse(HttpServletResponse response, List changedGroups) { - if (!CollectionUtils.isEmpty(changedGroups)) { + if (CollUtil.isNotEmpty(changedGroups)) { try { - final String changedGroupKeStr = Md5ConfigUtil.compareMd5ResultString(changedGroups); - final String respString = JSON.toJSONString(Results.success(changedGroupKeStr)); + String respStr = buildRespStr(changedGroups); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-cache,no-store"); response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println(respString); + response.getWriter().println(respStr); } catch (Exception ex) { - log.error(ex.toString(), ex); + log.error("Response client failed to return data.", ex); } } } + /** + * Build resp str. + * + * @param changedGroups Changed thread pool group key + * @return + */ + @SneakyThrows + private String buildRespStr(List changedGroups) { + String changedGroupStr = Md5Util.compareMd5ResultString(changedGroups); + String respStr = JSONUtil.toJSONString(Results.success(changedGroupStr)); + return respStr; + } + + /** + * Is support long polling. + * + * @param req + * @return + */ + public static boolean isSupportLongPolling(HttpServletRequest req) { + return null != req.getHeader(LONG_POLLING_HEADER); + } + + /** + * Is fixed polling. + * + * @return + */ + private static boolean isFixedPolling() { + return SwitchService.getSwitchBoolean(SwitchService.FIXED_POLLING, false); + } + + /** + * Get fixed polling interval. + * + * @return + */ + private static int getFixedPollingInterval() { + return SwitchService.getSwitchInteger(SwitchService.FIXED_POLLING_INTERVAL, FIXED_POLLING_INTERVAL_MS); + } + } diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/SwitchService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/SwitchService.java similarity index 96% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/SwitchService.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/SwitchService.java index 3c835a05..d12c240a 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/SwitchService.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/SwitchService.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.service; +package cn.hippo4j.config.service; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ConfigService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ConfigService.java similarity index 57% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ConfigService.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ConfigService.java index b0bf6028..11421384 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ConfigService.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ConfigService.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.config.service.biz; +package cn.hippo4j.config.service.biz; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; +import cn.hippo4j.config.model.ConfigAllInfo; /** * Config service. @@ -20,11 +20,20 @@ public interface ConfigService { */ ConfigAllInfo findConfigAllInfo(String tpId, String itemId, String tenantId); + /** + * Find config recent info. + * + * @param params + * @return + */ + ConfigAllInfo findConfigRecentInfo(String... params); + /** * Insert or update. * + * @param identify * @param configAllInfo */ - void insertOrUpdate(ConfigAllInfo configAllInfo); + void insertOrUpdate(String identify, ConfigAllInfo configAllInfo); } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/HisRunDataService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/HisRunDataService.java new file mode 100644 index 00000000..c90afb67 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/HisRunDataService.java @@ -0,0 +1,51 @@ +package cn.hippo4j.config.service.biz; + +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.config.model.HisRunDataInfo; +import cn.hippo4j.config.model.biz.monitor.MonitorActiveRespDTO; +import cn.hippo4j.config.model.biz.monitor.MonitorQueryReqDTO; +import cn.hippo4j.config.model.biz.monitor.MonitorRespDTO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * His run data service. + * + * @author chen.ma + * @date 2021/12/10 21:28 + */ +public interface HisRunDataService extends IService { + + /** + * Query. + * + * @param reqDTO + * @return + */ + List query(MonitorQueryReqDTO reqDTO); + + /** + * Query active thread pool monitor. + * + * @param reqDTO + * @return + */ + MonitorActiveRespDTO queryInfoThreadPoolMonitor(MonitorQueryReqDTO reqDTO); + + /** + * Query thread pool last task count. + * + * @param reqDTO + * @return + */ + MonitorRespDTO queryThreadPoolLastTaskCount(MonitorQueryReqDTO reqDTO); + + /** + * Save. + * + * @param message + */ + void save(Message message); + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ItemService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ItemService.java similarity index 73% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ItemService.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ItemService.java index 3b9e565f..e6c411e5 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ItemService.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ItemService.java @@ -1,10 +1,10 @@ -package com.github.dynamic.threadpool.config.service.biz; +package cn.hippo4j.config.service.biz; +import cn.hippo4j.config.model.biz.item.ItemRespDTO; +import cn.hippo4j.config.model.biz.item.ItemUpdateReqDTO; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.config.model.biz.item.ItemQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemRespDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemSaveReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemUpdateReqDTO; +import cn.hippo4j.config.model.biz.item.ItemQueryReqDTO; +import cn.hippo4j.config.model.biz.item.ItemSaveReqDTO; import java.util.List; diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/LogRecordBizService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/LogRecordBizService.java new file mode 100644 index 00000000..ca0bae9c --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/LogRecordBizService.java @@ -0,0 +1,23 @@ +package cn.hippo4j.config.service.biz; + +import cn.hippo4j.config.model.biz.log.LogRecordQueryReqDTO; +import cn.hippo4j.config.model.biz.log.LogRecordRespDTO; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 操作日志. + * + * @author chen.ma + * @date 2021/11/17 21:41 + */ +public interface LogRecordBizService { + + /** + * 查询操作日志. + * + * @param pageQuery + * @return + */ + IPage queryPage(LogRecordQueryReqDTO pageQuery); + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/NotifyService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/NotifyService.java new file mode 100644 index 00000000..c2fa944c --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/NotifyService.java @@ -0,0 +1,64 @@ +package cn.hippo4j.config.service.biz; + +import cn.hippo4j.config.model.biz.notify.NotifyListRespDTO; +import cn.hippo4j.config.model.biz.notify.NotifyQueryReqDTO; +import cn.hippo4j.config.model.biz.notify.NotifyReqDTO; +import cn.hippo4j.config.model.biz.notify.NotifyRespDTO; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 通知管理. + * + * @author chen.ma + * @date 2021/11/17 22:01 + */ +public interface NotifyService { + + /** + * 查询通知配置集合. + * + * @param reqDTO + * @return + */ + List listNotifyConfig(NotifyQueryReqDTO reqDTO); + + /** + * 分页查询. + * + * @param reqDTO + * @return + */ + IPage queryPage(NotifyQueryReqDTO reqDTO); + + /** + * 新增通知配置. + * + * @param reqDTO + */ + void save(NotifyReqDTO reqDTO); + + /** + * 修改通知配置. + * + * @param reqDTO + */ + void update(NotifyReqDTO reqDTO); + + /** + * 删除通知配置. + * + * @param reqDTO + */ + void delete(NotifyReqDTO reqDTO); + + /** + * 启用停用通知. + * + * @param id + * @param status + */ + void enableNotify(String id, Integer status); + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/TenantService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/TenantService.java similarity index 71% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/TenantService.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/TenantService.java index 6dfcfa24..d586b118 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/TenantService.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/TenantService.java @@ -1,10 +1,10 @@ -package com.github.dynamic.threadpool.config.service.biz; +package cn.hippo4j.config.service.biz; +import cn.hippo4j.config.model.biz.tenant.TenantQueryReqDTO; +import cn.hippo4j.config.model.biz.tenant.TenantRespDTO; +import cn.hippo4j.config.model.biz.tenant.TenantSaveReqDTO; +import cn.hippo4j.config.model.biz.tenant.TenantUpdateReqDTO; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantRespDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantSaveReqDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantUpdateReqDTO; /** * Tenant service. diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ThreadPoolService.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ThreadPoolService.java similarity index 53% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ThreadPoolService.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ThreadPoolService.java index 4301bc70..55002e09 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/ThreadPoolService.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/ThreadPoolService.java @@ -1,9 +1,10 @@ -package com.github.dynamic.threadpool.config.service.biz; +package cn.hippo4j.config.service.biz; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolQueryReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolRespDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolRespDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolDelReqDTO; import java.util.List; @@ -42,8 +43,24 @@ public interface ThreadPoolService { /** * Save or update thread pool config. * + * @param identify * @param reqDTO */ - void saveOrUpdateThreadPoolConfig(ThreadPoolSaveOrUpdateReqDTO reqDTO); + void saveOrUpdateThreadPoolConfig(String identify, ThreadPoolSaveOrUpdateReqDTO reqDTO); + + /** + * Delete pool. + * + * @param reqDTO + */ + void deletePool(ThreadPoolDelReqDTO reqDTO); + + /** + * Alarm enable. + * + * @param id + * @param isAlarm + */ + void alarmEnable(String id, Integer isAlarm); } diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java new file mode 100644 index 00000000..7de44cd7 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java @@ -0,0 +1,220 @@ +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.enums.DelEnum; +import cn.hippo4j.common.toolkit.*; +import cn.hippo4j.common.web.exception.ServiceException; +import cn.hippo4j.config.event.LocalDataChangeEvent; +import cn.hippo4j.config.mapper.ConfigInfoMapper; +import cn.hippo4j.config.mapper.ConfigInstanceMapper; +import cn.hippo4j.config.model.ConfigAllInfo; +import cn.hippo4j.config.model.ConfigInfoBase; +import cn.hippo4j.config.model.ConfigInstanceInfo; +import cn.hippo4j.config.service.ConfigChangePublisher; +import cn.hippo4j.config.service.biz.ConfigService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hippo4j.tools.logrecord.annotation.LogRecord; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.LinkedTransferQueue; +import java.util.concurrent.SynchronousQueue; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static cn.hippo4j.config.service.ConfigCacheService.getContent; + +/** + * Config service impl. + * + * @author chen.ma + * @date 2021/6/20 15:21 + */ +@Slf4j +@Service +@AllArgsConstructor +public class ConfigServiceImpl implements ConfigService { + + private final ConfigInfoMapper configInfoMapper; + + private final ConfigInstanceMapper configInstanceMapper; + + @Override + public ConfigAllInfo findConfigAllInfo(String tpId, String itemId, String tenantId) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(StrUtil.isNotBlank(tpId), ConfigAllInfo::getTpId, tpId) + .eq(StrUtil.isNotBlank(itemId), ConfigAllInfo::getItemId, itemId) + .eq(StrUtil.isNotBlank(tenantId), ConfigAllInfo::getTenantId, tenantId); + + ConfigAllInfo configAllInfo = configInfoMapper.selectOne(wrapper); + return configAllInfo; + } + + @Override + public ConfigAllInfo findConfigRecentInfo(String... params) { + ConfigAllInfo resultConfig; + ConfigAllInfo configInstance = null; + + String instanceId = params[3]; + if (StrUtil.isNotBlank(instanceId)) { + LambdaQueryWrapper instanceQueryWrapper = Wrappers.lambdaQuery(ConfigInstanceInfo.class) + .eq(ConfigInstanceInfo::getTpId, params[0]) + .eq(ConfigInstanceInfo::getItemId, params[1]) + .eq(ConfigInstanceInfo::getTenantId, params[2]) + .eq(ConfigInstanceInfo::getInstanceId, params[3]) + .orderByDesc(ConfigInstanceInfo::getGmtCreate) + .last("LIMIT 1"); + + ConfigInstanceInfo instanceInfo = configInstanceMapper.selectOne(instanceQueryWrapper); + if (instanceInfo != null) { + String content = instanceInfo.getContent(); + configInstance = JSONUtil.parseObject(content, ConfigAllInfo.class); + configInstance.setContent(content); + configInstance.setGmtCreate(instanceInfo.getGmtCreate()); + configInstance.setMd5(Md5Util.getTpContentMd5(configInstance)); + } + } + + ConfigAllInfo configAllInfo = findConfigAllInfo(params[0], params[1], params[2]); + if (configAllInfo == null && configInstance == null) { + throw new ServiceException("Thread pool configuration is not defined."); + } else if (configAllInfo != null && configInstance == null) { + resultConfig = configAllInfo; + } else if (configAllInfo == null && configInstance != null) { + resultConfig = configInstance; + } else { + if (configAllInfo.getGmtModified().before(configInstance.getGmtCreate())) { + resultConfig = configInstance; + } else { + resultConfig = configAllInfo; + } + } + + return resultConfig; + } + + @Override + public void insertOrUpdate(String identify, ConfigAllInfo configInfo) { + verification(identify); + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(ConfigAllInfo::getTenantId, configInfo.getTenantId()) + .eq(ConfigInfoBase::getItemId, configInfo.getItemId()) + .eq(ConfigInfoBase::getTpId, configInfo.getTpId()); + ConfigAllInfo existConfig = configInfoMapper.selectOne(queryWrapper); + + ConfigServiceImpl configService = ApplicationContextHolder.getBean(this.getClass()); + configInfo.setCapacity(getQueueCapacityByType(configInfo)); + + ConditionUtil + .condition( + existConfig == null, + () -> configService.addConfigInfo(configInfo), + () -> configService.updateConfigInfo(identify, configInfo) + ); + + ConfigChangePublisher.notifyConfigChange(new LocalDataChangeEvent(identify, ContentUtil.getGroupKey(configInfo))); + } + + private void verification(String identify) { + if (StringUtil.isNotBlank(identify)) { + Map content = getContent(identify); + Assert.isTrue(CollectionUtil.isNotEmpty(content), "线程池实例不存在, 请尝试页面刷新."); + } + } + + public Long addConfigInfo(ConfigAllInfo config) { + config.setContent(ContentUtil.getPoolContent(config)); + config.setMd5(Md5Util.getTpContentMd5(config)); + + try { + // 当前为单体应用, 后续支持集群部署时切换分布式锁. + synchronized (ConfigService.class) { + ConfigAllInfo configAllInfo = configInfoMapper.selectOne( + Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(ConfigAllInfo::getTpId, config.getTpId()) + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL.getIntCode()) + ); + Assert.isNull(configAllInfo, "线程池配置已存在."); + + if (SqlHelper.retBool(configInfoMapper.insert(config))) { + return config.getId(); + } + } + } catch (Exception ex) { + log.error("[db-error] message :: {}", ex.getMessage(), ex); + throw ex; + } + + return null; + } + + @LogRecord( + bizNo = "{{#config.itemId}}_{{#config.tpId}}", + category = "THREAD_POOL_UPDATE", + success = "核心线程: {{#config.coreSize}}, 最大线程: {{#config.maxSize}}, 队列类型: {{#config.queueType}}, 队列容量: {{#config.capacity}}, 拒绝策略: {{#config.rejectedType}}", + detail = "{{#config.toString()}}" + ) + public void updateConfigInfo(String identify, ConfigAllInfo config) { + LambdaUpdateWrapper wrapper = Wrappers.lambdaUpdate(ConfigAllInfo.class) + .eq(ConfigAllInfo::getTpId, config.getTpId()) + .eq(ConfigAllInfo::getItemId, config.getItemId()) + .eq(ConfigAllInfo::getTenantId, config.getTenantId()); + + config.setGmtCreate(null); + config.setContent(ContentUtil.getPoolContent(config)); + config.setMd5(Md5Util.getTpContentMd5(config)); + + try { + // 创建线程池配置实例临时配置, 也可以当作历史配置, 不过针对的是单节点 + if (StrUtil.isNotBlank(identify)) { + ConfigInstanceInfo instanceInfo = BeanUtil.convert(config, ConfigInstanceInfo.class); + instanceInfo.setInstanceId(identify); + configInstanceMapper.insert(instanceInfo); + return; + } + + configInfoMapper.update(config, wrapper); + } catch (Exception ex) { + log.error("[db-error] message :: {}", ex.getMessage(), ex); + throw ex; + } + } + + /** + * 根据队列类型获取队列大小. + *

+ * 不支持设置队列大小 {@link SynchronousQueue} {@link LinkedTransferQueue} + * + * @param config + * @return + */ + private Integer getQueueCapacityByType(ConfigAllInfo config) { + int queueCapacity; + switch (config.getQueueType()) { + case 5: + queueCapacity = Integer.MAX_VALUE; + break; + default: + queueCapacity = config.getCapacity(); + break; + } + + List queueTypes = Stream.of(1, 2, 3, 6, 9).collect(Collectors.toList()); + boolean setDefaultFlag = queueTypes.contains(config.getQueueType()) && (config.getCapacity() == null || Objects.equals(config.getCapacity(), 0)); + if (setDefaultFlag) { + queueCapacity = 1024; + } + + return queueCapacity; + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/HisRunDataServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/HisRunDataServiceImpl.java new file mode 100644 index 00000000..bedd43b1 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/HisRunDataServiceImpl.java @@ -0,0 +1,152 @@ +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.RuntimeMessage; +import cn.hippo4j.common.toolkit.GroupKey; +import cn.hippo4j.config.config.ServerBootstrapProperties; +import cn.hippo4j.config.mapper.HisRunDataMapper; +import cn.hippo4j.config.model.HisRunDataInfo; +import cn.hippo4j.config.model.biz.monitor.MonitorActiveRespDTO; +import cn.hippo4j.config.model.biz.monitor.MonitorQueryReqDTO; +import cn.hippo4j.config.model.biz.monitor.MonitorRespDTO; +import cn.hippo4j.config.service.biz.HisRunDataService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Lists; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; + +import static cn.hutool.core.date.DatePattern.NORM_TIME_PATTERN; + +/** + * His run data service impl. + * + * @author chen.ma + * @date 2021/12/10 21:28 + */ +@Service +@AllArgsConstructor +public class HisRunDataServiceImpl extends ServiceImpl implements HisRunDataService { + + private final ServerBootstrapProperties properties; + + @Override + public List query(MonitorQueryReqDTO reqDTO) { + Date currentDate = new Date(); + DateTime dateTime = DateUtil.offsetMinute(currentDate, -properties.getCleanHistoryDataPeriod()); + long startTime = dateTime.getTime(); + + List hisRunDataInfos = this.lambdaQuery() + .eq(HisRunDataInfo::getTenantId, reqDTO.getTenantId()) + .eq(HisRunDataInfo::getItemId, reqDTO.getItemId()) + .eq(HisRunDataInfo::getTpId, reqDTO.getTpId()) + .eq(HisRunDataInfo::getInstanceId, reqDTO.getInstanceId()) + .between(HisRunDataInfo::getTimestamp, startTime, currentDate.getTime()) + .orderByAsc(HisRunDataInfo::getTimestamp) + .list(); + + return BeanUtil.convert(hisRunDataInfos, MonitorRespDTO.class); + } + + @Override + public MonitorActiveRespDTO queryInfoThreadPoolMonitor(MonitorQueryReqDTO reqDTO) { + Date currentDate = new Date(); + DateTime dateTime = DateUtil.offsetMinute(currentDate, -properties.getCleanHistoryDataPeriod()); + long startTime = dateTime.getTime(); + + List hisRunDataInfos = this.lambdaQuery() + .eq(HisRunDataInfo::getTenantId, reqDTO.getTenantId()) + .eq(HisRunDataInfo::getItemId, reqDTO.getItemId()) + .eq(HisRunDataInfo::getTpId, reqDTO.getTpId()) + .eq(HisRunDataInfo::getInstanceId, reqDTO.getInstanceId()) + .between(HisRunDataInfo::getTimestamp, startTime, currentDate.getTime()) + .orderByAsc(HisRunDataInfo::getTimestamp) + .list(); + + List times = Lists.newArrayList(); + List poolSizeList = Lists.newArrayList(); + List activeSizeList = Lists.newArrayList(); + List queueCapacityList = Lists.newArrayList(); + List queueSizeList = Lists.newArrayList(); + List completedTaskCountList = Lists.newArrayList(); + List rejectCountList = Lists.newArrayList(); + List queueRemainingCapacityList = Lists.newArrayList(); + List currentLoadList = Lists.newArrayList(); + + long countTemp = 0L; + AtomicBoolean firstFlag = new AtomicBoolean(Boolean.TRUE); + for (HisRunDataInfo each : hisRunDataInfos) { + String time = DateUtil.format(new Date(each.getTimestamp()), NORM_TIME_PATTERN); + times.add(time); + poolSizeList.add(each.getPoolSize()); + activeSizeList.add(each.getActiveSize()); + queueSizeList.add(each.getQueueSize()); + rejectCountList.add(each.getRejectCount()); + queueRemainingCapacityList.add(each.getQueueRemainingCapacity()); + currentLoadList.add(each.getCurrentLoad()); + queueCapacityList.add(each.getQueueCapacity()); + + if (firstFlag.get()) { + completedTaskCountList.add(0L); + firstFlag.set(Boolean.FALSE); + countTemp = each.getCompletedTaskCount(); + continue; + } + + long completedTaskCount = each.getCompletedTaskCount(); + long countTask = completedTaskCount - countTemp; + completedTaskCountList.add(countTask); + countTemp = each.getCompletedTaskCount(); + } + + return new MonitorActiveRespDTO(times, poolSizeList, activeSizeList, queueSizeList, completedTaskCountList, rejectCountList, queueRemainingCapacityList, currentLoadList, queueCapacityList); + } + + @Override + public MonitorRespDTO queryThreadPoolLastTaskCount(MonitorQueryReqDTO reqDTO) { + Date currentDate = new Date(); + DateTime dateTime = DateUtil.offsetMinute(currentDate, -properties.getCleanHistoryDataPeriod()); + long startTime = dateTime.getTime(); + + HisRunDataInfo hisRunDataInfo = this.lambdaQuery() + .eq(HisRunDataInfo::getTenantId, reqDTO.getTenantId()) + .eq(HisRunDataInfo::getItemId, reqDTO.getItemId()) + .eq(HisRunDataInfo::getTpId, reqDTO.getTpId()) + .eq(HisRunDataInfo::getInstanceId, reqDTO.getInstanceId()) + .orderByDesc(HisRunDataInfo::getTimestamp) + .between(HisRunDataInfo::getTimestamp, startTime, currentDate.getTime()) + .last("LIMIT 1") + .one(); + + return BeanUtil.convert(hisRunDataInfo, MonitorRespDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(Message message) { + List runtimeMessages = message.getMessages(); + List hisRunDataInfos = Lists.newArrayList(); + + runtimeMessages.forEach(each -> { + HisRunDataInfo hisRunDataInfo = BeanUtil.convert(each, HisRunDataInfo.class); + String[] parseKey = GroupKey.parseKey(each.getGroupKey()); + + hisRunDataInfo.setTpId(parseKey[0]); + hisRunDataInfo.setItemId(parseKey[1]); + hisRunDataInfo.setTenantId(parseKey[2]); + hisRunDataInfo.setInstanceId(parseKey[3]); + + hisRunDataInfos.add(hisRunDataInfo); + }); + + this.saveBatch(hisRunDataInfos); + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ItemServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ItemServiceImpl.java similarity index 72% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ItemServiceImpl.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ItemServiceImpl.java index cc7e03d8..b2a43e85 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/ItemServiceImpl.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ItemServiceImpl.java @@ -1,22 +1,23 @@ -package com.github.dynamic.threadpool.config.service.biz.impl; - +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.common.toolkit.Assert; +import cn.hippo4j.common.enums.DelEnum; +import cn.hippo4j.config.mapper.ItemInfoMapper; +import cn.hippo4j.config.model.ItemInfo; +import cn.hippo4j.config.model.biz.item.ItemQueryReqDTO; +import cn.hippo4j.config.model.biz.item.ItemRespDTO; +import cn.hippo4j.config.model.biz.item.ItemSaveReqDTO; +import cn.hippo4j.config.model.biz.item.ItemUpdateReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolRespDTO; +import cn.hippo4j.config.service.biz.ItemService; +import cn.hippo4j.config.service.biz.ThreadPoolService; +import cn.hippo4j.config.toolkit.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; -import com.github.dynamic.threadpool.config.enums.DelEnum; -import com.github.dynamic.threadpool.config.mapper.ItemInfoMapper; -import com.github.dynamic.threadpool.config.model.ItemInfo; -import com.github.dynamic.threadpool.config.model.biz.item.ItemQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemRespDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemSaveReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemUpdateReqDTO; -import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolRespDTO; -import com.github.dynamic.threadpool.config.service.biz.ItemService; -import com.github.dynamic.threadpool.config.service.biz.ThreadPoolService; -import com.github.dynamic.threadpool.config.toolkit.BeanUtil; import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -44,8 +45,8 @@ public class ItemServiceImpl implements ItemService { .eq(!StringUtils.isEmpty(reqDTO.getItemName()), ItemInfo::getItemName, reqDTO.getItemName()) .eq(!StringUtils.isEmpty(reqDTO.getTenantId()), ItemInfo::getTenantId, reqDTO.getTenantId()) .eq(!StringUtils.isEmpty(reqDTO.getOwner()), ItemInfo::getOwner, reqDTO.getOwner()); - Page resultPage = itemInfoMapper.selectPage(reqDTO, wrapper); + Page resultPage = itemInfoMapper.selectPage(reqDTO, wrapper); return resultPage.convert(each -> BeanUtil.convert(each, ItemRespDTO.class)); } @@ -55,8 +56,8 @@ public class ItemServiceImpl implements ItemService { .lambdaQuery(ItemInfo.class) .eq(ItemInfo::getTenantId, tenantId) .eq(ItemInfo::getItemId, itemId); - ItemInfo itemInfo = itemInfoMapper.selectOne(queryWrapper); + ItemInfo itemInfo = itemInfoMapper.selectOne(queryWrapper); ItemRespDTO result = BeanUtil.convert(itemInfo, ItemRespDTO.class); return result; } @@ -73,12 +74,21 @@ public class ItemServiceImpl implements ItemService { @Override public void saveItem(ItemSaveReqDTO reqDTO) { - ItemInfo itemInfo = BeanUtil.convert(reqDTO, ItemInfo.class); - int insertResult = itemInfoMapper.insert(itemInfo); + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(ItemInfo.class) + .eq(ItemInfo::getItemId, reqDTO.getItemId()); - boolean retBool = SqlHelper.retBool(insertResult); - if (!retBool) { - throw new RuntimeException("Save error"); + // 当前为单体应用, 后续支持集群部署时切换分布式锁. + synchronized (ItemService.class) { + ItemInfo existItemInfo = itemInfoMapper.selectOne(queryWrapper); + Assert.isNull(existItemInfo, "项目配置已存在."); + + ItemInfo itemInfo = BeanUtil.convert(reqDTO, ItemInfo.class); + int insertResult = itemInfoMapper.insert(itemInfo); + + boolean retBool = SqlHelper.retBool(insertResult); + if (!retBool) { + throw new RuntimeException("Save error"); + } } } @@ -100,7 +110,7 @@ public class ItemServiceImpl implements ItemService { public void deleteItem(String namespace, String itemId) { List itemList = threadPoolService.getThreadPoolByItemId(itemId); if (CollectionUtils.isNotEmpty(itemList)) { - throw new RuntimeException("The project contains a thread pool reference, and the deletion failed."); + throw new RuntimeException("项目包含线程池引用, 删除失败."); } int updateResult = itemInfoMapper.update(new ItemInfo(), diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/LogRecordBizServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/LogRecordBizServiceImpl.java new file mode 100644 index 00000000..553bc84b --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/LogRecordBizServiceImpl.java @@ -0,0 +1,39 @@ +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.config.mapper.LogRecordMapper; +import cn.hippo4j.config.model.biz.log.LogRecordQueryReqDTO; +import cn.hippo4j.config.model.biz.log.LogRecordRespDTO; +import cn.hippo4j.config.service.biz.LogRecordBizService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hippo4j.tools.logrecord.model.LogRecordInfo; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * 操作日志. + * + * @author chen.ma + * @date 2021/11/17 21:50 + */ +@Service +@AllArgsConstructor +public class LogRecordBizServiceImpl implements LogRecordBizService { + + private final LogRecordMapper logRecordMapper; + + @Override + public IPage queryPage(LogRecordQueryReqDTO pageQuery) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(LogRecordInfo.class) + .eq(StrUtil.isNotBlank(pageQuery.getBizNo()), LogRecordInfo::getBizNo, pageQuery.getBizNo()) + .eq(StrUtil.isNotBlank(pageQuery.getCategory()), LogRecordInfo::getCategory, pageQuery.getCategory()) + .eq(StrUtil.isNotBlank(pageQuery.getOperator()), LogRecordInfo::getOperator, pageQuery.getOperator()) + .orderByDesc(LogRecordInfo::getCreateTime); + IPage selectPage = logRecordMapper.selectPage(pageQuery, queryWrapper); + return selectPage.convert(each -> BeanUtil.convert(each, LogRecordRespDTO.class)); + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/LogRecordServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/LogRecordServiceImpl.java similarity index 55% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/LogRecordServiceImpl.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/LogRecordServiceImpl.java index b9360832..5e8a8158 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/LogRecordServiceImpl.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/LogRecordServiceImpl.java @@ -1,8 +1,8 @@ -package com.github.dynamic.threadpool.config.service.biz.impl; +package cn.hippo4j.config.service.biz.impl; -import com.github.dynamic.threadpool.config.mapper.LogRecordMapper; -import com.github.dynamic.threadpool.logrecord.model.LogRecordInfo; -import com.github.dynamic.threadpool.logrecord.service.LogRecordService; +import cn.hippo4j.config.mapper.LogRecordMapper; +import cn.hippo4j.tools.logrecord.model.LogRecordInfo; +import cn.hippo4j.tools.logrecord.service.LogRecordService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -16,7 +16,7 @@ import org.springframework.stereotype.Service; @AllArgsConstructor public class LogRecordServiceImpl implements LogRecordService { - private LogRecordMapper logRecordMapper; + private final LogRecordMapper logRecordMapper; @Override public void record(LogRecordInfo logRecordInfo) { diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/NotifyServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/NotifyServiceImpl.java new file mode 100644 index 00000000..4a9d405f --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/NotifyServiceImpl.java @@ -0,0 +1,131 @@ +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.common.toolkit.GroupKey; +import cn.hippo4j.common.web.exception.ServiceException; +import cn.hippo4j.common.enums.EnableEnum; +import cn.hippo4j.config.mapper.NotifyInfoMapper; +import cn.hippo4j.config.model.NotifyInfo; +import cn.hippo4j.config.model.biz.notify.NotifyListRespDTO; +import cn.hippo4j.config.model.biz.notify.NotifyQueryReqDTO; +import cn.hippo4j.config.model.biz.notify.NotifyReqDTO; +import cn.hippo4j.config.model.biz.notify.NotifyRespDTO; +import cn.hippo4j.config.service.biz.NotifyService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import lombok.AllArgsConstructor; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 通知管理. + * + * @author chen.ma + * @date 2021/11/17 22:02 + */ +@Service +@AllArgsConstructor +public class NotifyServiceImpl implements NotifyService { + + private final NotifyInfoMapper notifyInfoMapper; + + @Override + public List listNotifyConfig(NotifyQueryReqDTO reqDTO) { + List notifyListRespList = Lists.newArrayList(); + reqDTO.getGroupKeys().forEach(each -> { + String[] parseKey = GroupKey.parseKey(each); + List notifyInfos = listNotifyCommon("CONFIG", parseKey); + if (CollUtil.isNotEmpty(notifyInfos)) { + notifyListRespList.add(new NotifyListRespDTO(StrUtil.builder(parseKey[0], "+", "CONFIG").toString(), notifyInfos)); + } + + List alarmInfos = listNotifyCommon("ALARM", parseKey); + if (CollUtil.isNotEmpty(alarmInfos)) { + notifyListRespList.add(new NotifyListRespDTO(StrUtil.builder(parseKey[0], "+", "ALARM").toString(), alarmInfos)); + } + }); + + return notifyListRespList; + } + + @Override + public IPage queryPage(NotifyQueryReqDTO reqDTO) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(NotifyInfo.class) + .eq(StrUtil.isNotBlank(reqDTO.getTenantId()), NotifyInfo::getTenantId, reqDTO.getTenantId()) + .eq(StrUtil.isNotBlank(reqDTO.getItemId()), NotifyInfo::getItemId, reqDTO.getItemId()) + .eq(StrUtil.isNotBlank(reqDTO.getTpId()), NotifyInfo::getTpId, reqDTO.getTpId()) + .orderByDesc(NotifyInfo::getGmtCreate); + + IPage resultPage = notifyInfoMapper.selectPage(reqDTO, queryWrapper); + return resultPage.convert(each -> BeanUtil.convert(each, NotifyRespDTO.class)); + } + + @Override + public void save(NotifyReqDTO reqDTO) { + if (existNotify(reqDTO)) { + throw new ServiceException("新增通知报警配置重复."); + } + + notifyInfoMapper.insert(BeanUtil.convert(reqDTO, NotifyInfo.class)); + } + + @Override + public void update(NotifyReqDTO reqDTO) { + NotifyInfo notifyInfo = BeanUtil.convert(reqDTO, NotifyInfo.class); + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(NotifyInfo.class) + .eq(NotifyInfo::getId, reqDTO.getId()); + + try { + notifyInfoMapper.update(notifyInfo, updateWrapper); + } catch (DuplicateKeyException ex) { + throw new ServiceException("修改通知报警配置重复."); + } + } + + @Override + public void delete(NotifyReqDTO reqDTO) { + LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate(NotifyInfo.class) + .eq(NotifyInfo::getId, reqDTO.getId()); + + notifyInfoMapper.delete(updateWrapper); + } + + @Override + public void enableNotify(String id, Integer status) { + NotifyInfo notifyInfo = new NotifyInfo(); + notifyInfo.setId(Long.parseLong(id)); + notifyInfo.setEnable(status); + notifyInfoMapper.updateById(notifyInfo); + } + + private List listNotifyCommon(String type, String[] parseKey) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(NotifyInfo.class) + .eq(NotifyInfo::getTenantId, parseKey[2]) + .eq(NotifyInfo::getItemId, parseKey[1]) + .eq(NotifyInfo::getTpId, parseKey[0]) + .eq(NotifyInfo::getEnable, EnableEnum.YES.getIntCode()) + .eq(NotifyInfo::getType, type); + List notifyInfos = notifyInfoMapper.selectList(queryWrapper); + return notifyInfos; + } + + private boolean existNotify(NotifyReqDTO reqDTO) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(NotifyInfo.class) + .eq(NotifyInfo::getTenantId, reqDTO.getTenantId()) + .eq(NotifyInfo::getItemId, reqDTO.getItemId()) + .eq(NotifyInfo::getTpId, reqDTO.getTpId()) + .eq(NotifyInfo::getPlatform, reqDTO.getPlatform()) + .eq(NotifyInfo::getType, reqDTO.getType()); + + List existNotifyInfos = notifyInfoMapper.selectList(queryWrapper); + return CollUtil.isNotEmpty(existNotifyInfos); + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/TenantServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/TenantServiceImpl.java similarity index 69% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/TenantServiceImpl.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/TenantServiceImpl.java index ccbe7af4..91472d6d 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/biz/impl/TenantServiceImpl.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/TenantServiceImpl.java @@ -1,24 +1,25 @@ -package com.github.dynamic.threadpool.config.service.biz.impl; - +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.common.toolkit.Assert; +import cn.hippo4j.common.enums.DelEnum; +import cn.hippo4j.config.mapper.TenantInfoMapper; +import cn.hippo4j.config.model.TenantInfo; +import cn.hippo4j.config.model.biz.item.ItemQueryReqDTO; +import cn.hippo4j.config.model.biz.item.ItemRespDTO; +import cn.hippo4j.config.model.biz.tenant.TenantQueryReqDTO; +import cn.hippo4j.config.model.biz.tenant.TenantRespDTO; +import cn.hippo4j.config.model.biz.tenant.TenantSaveReqDTO; +import cn.hippo4j.config.model.biz.tenant.TenantUpdateReqDTO; +import cn.hippo4j.config.service.biz.ItemService; +import cn.hippo4j.config.service.biz.TenantService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hippo4j.tools.logrecord.annotation.LogRecord; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; -import com.github.dynamic.threadpool.config.enums.DelEnum; -import com.github.dynamic.threadpool.config.mapper.TenantInfoMapper; -import com.github.dynamic.threadpool.config.model.TenantInfo; -import com.github.dynamic.threadpool.config.model.biz.item.ItemQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemRespDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantRespDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantSaveReqDTO; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantUpdateReqDTO; -import com.github.dynamic.threadpool.config.service.biz.ItemService; -import com.github.dynamic.threadpool.config.service.biz.TenantService; -import com.github.dynamic.threadpool.config.toolkit.BeanUtil; -import com.github.dynamic.threadpool.logrecord.annotation.LogRecord; import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -48,8 +49,8 @@ public class TenantServiceImpl implements TenantService { public TenantRespDTO getTenantByTenantId(String tenantId) { LambdaQueryWrapper queryWrapper = Wrappers .lambdaQuery(TenantInfo.class).eq(TenantInfo::getTenantId, tenantId); - TenantInfo tenantInfo = tenantInfoMapper.selectOne(queryWrapper); + TenantInfo tenantInfo = tenantInfoMapper.selectOne(queryWrapper); TenantRespDTO result = BeanUtil.convert(tenantInfo, TenantRespDTO.class); return result; } @@ -60,19 +61,28 @@ public class TenantServiceImpl implements TenantService { .eq(!StringUtils.isEmpty(reqDTO.getTenantId()), TenantInfo::getTenantId, reqDTO.getTenantId()) .eq(!StringUtils.isEmpty(reqDTO.getTenantName()), TenantInfo::getTenantName, reqDTO.getTenantName()) .eq(!StringUtils.isEmpty(reqDTO.getOwner()), TenantInfo::getOwner, reqDTO.getOwner()); - Page resultPage = tenantInfoMapper.selectPage(reqDTO, wrapper); + Page resultPage = tenantInfoMapper.selectPage(reqDTO, wrapper); return resultPage.convert(each -> BeanUtil.convert(each, TenantRespDTO.class)); } @Override public void saveTenant(TenantSaveReqDTO reqDTO) { - TenantInfo tenantInfo = BeanUtil.convert(reqDTO, TenantInfo.class); - int insertResult = tenantInfoMapper.insert(tenantInfo); + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(TenantInfo.class) + .eq(TenantInfo::getTenantId, reqDTO.getTenantId()); - boolean retBool = SqlHelper.retBool(insertResult); - if (!retBool) { - throw new RuntimeException("Save Error."); + // 当前为单体应用, 后续支持集群部署时切换分布式锁. + synchronized (TenantService.class) { + TenantInfo existTenantInfo = tenantInfoMapper.selectOne(queryWrapper); + Assert.isNull(existTenantInfo, "租户配置已存在."); + + TenantInfo tenantInfo = BeanUtil.convert(reqDTO, TenantInfo.class); + int insertResult = tenantInfoMapper.insert(tenantInfo); + + boolean retBool = SqlHelper.retBool(insertResult); + if (!retBool) { + throw new RuntimeException("Save Error."); + } } } @@ -101,7 +111,7 @@ public class TenantServiceImpl implements TenantService { reqDTO.setTenantId(tenantId); List itemList = itemService.queryItem(reqDTO); if (CollectionUtils.isNotEmpty(itemList)) { - throw new RuntimeException("The line of business contains project references, and the deletion failed."); + throw new RuntimeException("租户包含项目引用, 删除失败."); } int updateResult = tenantInfoMapper.update(new TenantInfo(), diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java new file mode 100644 index 00000000..01a13017 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java @@ -0,0 +1,93 @@ +package cn.hippo4j.config.service.biz.impl; + +import cn.hippo4j.common.enums.DelEnum; +import cn.hippo4j.config.mapper.ConfigInfoMapper; +import cn.hippo4j.config.model.ConfigAllInfo; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolDelReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolQueryReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolRespDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO; +import cn.hippo4j.config.service.biz.ConfigService; +import cn.hippo4j.config.service.biz.ThreadPoolService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hippo4j.tools.logrecord.annotation.LogRecord; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Thread pool service impl. + * + * @author chen.ma + * @date 2021/6/30 21:26 + */ +@Service +@AllArgsConstructor +public class ThreadPoolServiceImpl implements ThreadPoolService { + + private final ConfigService configService; + + private final ConfigInfoMapper configInfoMapper; + + @Override + public IPage queryThreadPoolPage(ThreadPoolQueryReqDTO reqDTO) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(!StringUtils.isBlank(reqDTO.getTenantId()), ConfigAllInfo::getTenantId, reqDTO.getTenantId()) + .eq(!StringUtils.isBlank(reqDTO.getItemId()), ConfigAllInfo::getItemId, reqDTO.getItemId()) + .eq(!StringUtils.isBlank(reqDTO.getTpId()), ConfigAllInfo::getTpId, reqDTO.getTpId()) + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL) + .orderByDesc(ConfigAllInfo::getGmtCreate); + + return configInfoMapper.selectPage(reqDTO, wrapper).convert(each -> BeanUtil.convert(each, ThreadPoolRespDTO.class)); + } + + @Override + public ThreadPoolRespDTO getThreadPool(ThreadPoolQueryReqDTO reqDTO) { + ConfigAllInfo configAllInfo = configService.findConfigAllInfo(reqDTO.getTpId(), reqDTO.getItemId(), reqDTO.getTenantId()); + return BeanUtil.convert(configAllInfo, ThreadPoolRespDTO.class); + } + + @Override + public List getThreadPoolByItemId(String itemId) { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(ConfigAllInfo::getItemId, itemId); + + List selectList = configInfoMapper.selectList(queryWrapper); + return BeanUtil.convert(selectList, ThreadPoolRespDTO.class); + } + + @Override + public void saveOrUpdateThreadPoolConfig(String identify, ThreadPoolSaveOrUpdateReqDTO reqDTO) { + configService.insertOrUpdate(identify, BeanUtil.convert(reqDTO, ConfigAllInfo.class)); + } + + @LogRecord( + bizNo = "{{#reqDTO.itemId}}_{{#reqDTO.tpId}}", + category = "THREAD_POOL_DELETE", + success = "删除线程池: {{#reqDTO.tpId}}", + detail = "{{#reqDTO.toString()}}" + ) + @Override + public void deletePool(ThreadPoolDelReqDTO reqDTO) { + configInfoMapper.delete( + Wrappers.lambdaUpdate(ConfigAllInfo.class) + .eq(ConfigAllInfo::getTenantId, reqDTO.getTenantId()) + .eq(ConfigAllInfo::getItemId, reqDTO.getItemId()) + .eq(ConfigAllInfo::getTpId, reqDTO.getTpId()) + ); + } + + @Override + public void alarmEnable(String id, Integer isAlarm) { + ConfigAllInfo configAllInfo = configInfoMapper.selectById(id); + configAllInfo.setIsAlarm(isAlarm); + // TODO: 是否报警变更, 虽然通知了客户端, 但是并没有在客户端实时生效, 需要考虑一个好的场景思路 + configService.insertOrUpdate(null, configAllInfo); + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/ClientCloseHookRemoveConfigCache.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/ClientCloseHookRemoveConfigCache.java new file mode 100644 index 00000000..2ab54a67 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/ClientCloseHookRemoveConfigCache.java @@ -0,0 +1,37 @@ +package cn.hippo4j.config.service.handler; + +import cn.hippo4j.common.api.ClientCloseHookExecute; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.config.service.ConfigCacheService; +import cn.hutool.core.util.StrUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * Client close hook remove config cache. + * + * @author chen.ma + * @date 2022/1/6 22:20 + */ +@Slf4j +@Component +public class ClientCloseHookRemoveConfigCache implements ClientCloseHookExecute { + + @Override + public void closeHook(ClientCloseHookReq req) { + log.info( + "Remove Config Cache, Execute client hook function. Req :: {}", + JSONUtil.toJSONString(req) + ); + + try { + String groupKey = req.getGroupKey(); + if (StrUtil.isNotBlank(groupKey)) { + ConfigCacheService.removeConfigCache(groupKey); + } + } catch (Exception ex) { + log.error("Failed to remove config cache hook.", ex); + } + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/CustomOperatorGetServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/CustomOperatorGetServiceImpl.java new file mode 100644 index 00000000..56f8edef --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/CustomOperatorGetServiceImpl.java @@ -0,0 +1,25 @@ +package cn.hippo4j.config.service.handler; + +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.common.toolkit.UserContext; +import cn.hippo4j.tools.logrecord.model.Operator; +import cn.hippo4j.tools.logrecord.service.OperatorGetService; +import org.springframework.stereotype.Component; + +/** + * Custom operator get service. + * + * @author chen.ma + * @date 2021/11/28 17:57 + */ +@Component +public class CustomOperatorGetServiceImpl implements OperatorGetService { + + @Override + public Operator getUser() { + String userName = UserContext.getUserName(); + userName = StringUtil.isEmpty(userName) ? "-" : userName; + return new Operator(userName); + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/service/handler/TenantIdFunctionServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/TenantIdFunctionServiceImpl.java similarity index 66% rename from config/src/main/java/com/github/dynamic/threadpool/config/service/handler/TenantIdFunctionServiceImpl.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/TenantIdFunctionServiceImpl.java index 74a5ed68..bff1cdb4 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/service/handler/TenantIdFunctionServiceImpl.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/handler/TenantIdFunctionServiceImpl.java @@ -1,15 +1,15 @@ -package com.github.dynamic.threadpool.config.service.handler; +package cn.hippo4j.config.service.handler; -import com.github.dynamic.threadpool.config.model.biz.tenant.TenantRespDTO; -import com.github.dynamic.threadpool.config.service.biz.TenantService; -import com.github.dynamic.threadpool.logrecord.service.ParseFunction; +import cn.hippo4j.config.model.biz.tenant.TenantRespDTO; +import cn.hippo4j.config.service.biz.TenantService; +import cn.hippo4j.tools.logrecord.service.ParseFunction; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import java.util.Optional; /** - * 查找项目 Id 旧值. + * 查找原租户名称. * * @author chen.ma * @date 2021/10/24 22:07 @@ -20,6 +20,11 @@ public class TenantIdFunctionServiceImpl implements ParseFunction { private final TenantService tenantService; + @Override + public boolean executeBefore() { + return true; + } + @Override public String functionName() { return "TENANT"; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/BeanUtil.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/BeanUtil.java similarity index 96% rename from config/src/main/java/com/github/dynamic/threadpool/config/toolkit/BeanUtil.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/BeanUtil.java index 72772285..4e67e579 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/BeanUtil.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/BeanUtil.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.toolkit; +package cn.hippo4j.config.toolkit; import com.github.dozermapper.core.DozerBeanMapperBuilder; import com.github.dozermapper.core.Mapper; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/ClassUtil.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/ClassUtil.java similarity index 88% rename from config/src/main/java/com/github/dynamic/threadpool/config/toolkit/ClassUtil.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/ClassUtil.java index 58fbb064..e38019b5 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/ClassUtil.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/ClassUtil.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.toolkit; +package cn.hippo4j.config.toolkit; import java.util.Objects; diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/ConfigExecutor.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/ConfigExecutor.java similarity index 76% rename from config/src/main/java/com/github/dynamic/threadpool/config/toolkit/ConfigExecutor.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/ConfigExecutor.java index 473080b3..88840e08 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/ConfigExecutor.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/ConfigExecutor.java @@ -1,11 +1,13 @@ -package com.github.dynamic.threadpool.config.toolkit; +package cn.hippo4j.config.toolkit; -import com.github.dynamic.threadpool.common.executor.ExecutorFactory; +import cn.hippo4j.common.executor.ExecutorFactory; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import static cn.hippo4j.common.constant.Constants.DEFAULT_GROUP; + /** * Config executor. * @@ -15,7 +17,7 @@ import java.util.concurrent.TimeUnit; public class ConfigExecutor { private static final ScheduledExecutorService LONG_POLLING_EXECUTOR = ExecutorFactory.Managed - .newSingleScheduledExecutorService("default group", r -> new Thread(r, "long-polling")); + .newSingleScheduledExecutorService(DEFAULT_GROUP, r -> new Thread(r, "server.long.polling")); public static void executeLongPolling(Runnable runnable) { LONG_POLLING_EXECUTOR.execute(runnable); diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/EnvUtil.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/EnvUtil.java new file mode 100644 index 00000000..ba98053f --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/EnvUtil.java @@ -0,0 +1,55 @@ +package cn.hippo4j.config.toolkit; + +import org.apache.commons.lang3.StringUtils; + +import java.nio.file.Paths; +import java.util.Objects; + +/** + * Env Util. + * + * @author chen.ma + * @date 2022/2/9 07:46 + */ +public class EnvUtil { + + public static final String HIPPO4J_HOME_KEY = "hippo4j.home"; + + public static final String STANDALONE_MODE_PROPERTY_NAME = "hippo4j.standalone"; + + private static String HIPPO4J_HOME_PATH = null; + + private static Boolean IS_STANDALONE = null; + + /** + * Get hippo4j home. + * + * @return + */ + public static String getHippo4JHome() { + if (StringUtils.isBlank(HIPPO4J_HOME_PATH)) { + String hippo4jHome = System.getProperty(HIPPO4J_HOME_KEY); + if (StringUtils.isBlank(hippo4jHome)) { + hippo4jHome = Paths.get(System.getProperty("user.home"), "hippo4j").toString(); + } + + return hippo4jHome; + } + + return HIPPO4J_HOME_PATH; + } + + /** + * Standalone mode or not. + * + * @return + */ + public static boolean getStandaloneMode() { + if (Objects.isNull(IS_STANDALONE)) { + IS_STANDALONE = Boolean.getBoolean(STANDALONE_MODE_PROPERTY_NAME); + } + + return IS_STANDALONE; + } + +} diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/MapUtil.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/MapUtil.java new file mode 100644 index 00000000..d153ffa0 --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/MapUtil.java @@ -0,0 +1,76 @@ +package cn.hippo4j.config.toolkit; + +import cn.hutool.core.collection.CollUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.BiFunction; +import java.util.stream.Collectors; + +/** + * Map util. + * + * @author chen.ma + * @date 2021/6/23 19:09 + */ +public class MapUtil { + + public static Object computeIfAbsent(Map target, Object key, BiFunction mappingFunction, Object param1, Object param2) { + Objects.requireNonNull(target, "target"); + Objects.requireNonNull(key, "key"); + Objects.requireNonNull(mappingFunction, "mappingFunction"); + Objects.requireNonNull(param1, "param1"); + Objects.requireNonNull(param2, "param2"); + + Object val = target.get(key); + if (val == null) { + Object ret = mappingFunction.apply(param1, param2); + target.put(key, ret); + return ret; + } + return val; + } + + + /** + * 根据 Key 进行模糊匹配. + * + * @param sourceMap + * @param filters + * @return + */ + public static List parseMapForFilter(Map sourceMap, String filters) { + List resultList = Lists.newArrayList(); + if (CollUtil.isEmpty(sourceMap)) { + return resultList; + } + + sourceMap.forEach((key, val) -> { + if (checkKey(key, filters)) { + resultList.add(key); + } + }); + + return resultList; + } + + /** + * 匹配想要查询的字符. + * + * @param key + * @param filters + * @return + */ + private static boolean checkKey(String key, String filters) { + if (key.indexOf(filters) > -1) { + return true; + } else { + return false; + } + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/Md5ConfigUtil.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/Md5ConfigUtil.java similarity index 75% rename from config/src/main/java/com/github/dynamic/threadpool/config/toolkit/Md5ConfigUtil.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/Md5ConfigUtil.java index 5550bdd5..b0d47329 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/Md5ConfigUtil.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/Md5ConfigUtil.java @@ -1,9 +1,9 @@ -package com.github.dynamic.threadpool.config.toolkit; +package cn.hippo4j.config.toolkit; -import com.github.dynamic.threadpool.common.toolkit.GroupKey; -import com.github.dynamic.threadpool.common.toolkit.Md5Util; -import com.github.dynamic.threadpool.config.model.ConfigAllInfo; -import com.github.dynamic.threadpool.config.service.ConfigCacheService; +import cn.hippo4j.common.toolkit.GroupKey; +import cn.hippo4j.common.toolkit.Md5Util; +import cn.hippo4j.config.service.ConfigCacheService; +import cn.hippo4j.config.model.ConfigAllInfo; import org.springframework.util.StringUtils; import javax.servlet.http.HttpServletRequest; @@ -14,8 +14,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static com.github.dynamic.threadpool.common.constant.Constants.LINE_SEPARATOR; -import static com.github.dynamic.threadpool.common.constant.Constants.WORD_SEPARATOR; +import static cn.hippo4j.common.constant.Constants.LINE_SEPARATOR; +import static cn.hippo4j.common.constant.Constants.WORD_SEPARATOR; /** @@ -50,8 +50,8 @@ public class Md5ConfigUtil { public static List compareMd5(HttpServletRequest request, Map clientMd5Map) { List changedGroupKeys = new ArrayList(); clientMd5Map.forEach((key, val) -> { - String remoteIp = RequestUtil.getRemoteIp(request); - boolean isUpdateData = ConfigCacheService.isUpdateData(key, val, remoteIp); + String clientIdentify = RequestUtil.getClientIdentify(request); + boolean isUpdateData = ConfigCacheService.isUpdateData(key, val, clientIdentify); if (!isUpdateData) { changedGroupKeys.add(key); } @@ -73,7 +73,7 @@ public class Md5ConfigUtil { if (c == WORD_SEPARATOR_CHAR) { tmpList.add(configKeysString.substring(start, i)); start = i + 1; - if (tmpList.size() > 3) { + if (tmpList.size() > 4) { // Malformed message and return parameter error. throw new IllegalArgumentException("invalid protocol,too much key"); } @@ -84,16 +84,9 @@ public class Md5ConfigUtil { } start = i + 1; - // If it is the old message, the last digit is MD5. The post-multi-tenant message is tenant - if (tmpList.size() == 2) { - String groupKey = getKey(tmpList.get(0), tmpList.get(1)); - groupKey = SingletonRepository.DataIdGroupIdCache.getSingleton(groupKey); - md5Map.put(groupKey, endValue); - } else { - String groupKey = getKey(tmpList.get(0), tmpList.get(1), endValue); - groupKey = SingletonRepository.DataIdGroupIdCache.getSingleton(groupKey); - md5Map.put(groupKey, tmpList.get(2)); - } + String groupKey = getKey(tmpList.get(0), tmpList.get(1), tmpList.get(2), tmpList.get(3)); + groupKey = SingletonRepository.DataIdGroupIdCache.getSingleton(groupKey); + md5Map.put(groupKey, endValue); tmpList.clear(); // Protect malformed messages @@ -113,7 +106,7 @@ public class Md5ConfigUtil { return sb.toString(); } - public static String getKey(String dataId, String group, String tenant) { + public static String getKey(String dataId, String group, String tenant, String identify) { StringBuilder sb = new StringBuilder(); GroupKey.urlEncode(dataId, sb); sb.append('+'); @@ -121,7 +114,9 @@ public class Md5ConfigUtil { if (!StringUtils.isEmpty(tenant)) { sb.append('+'); GroupKey.urlEncode(tenant, sb); + sb.append("+").append(identify); } + return sb.toString(); } @@ -138,7 +133,7 @@ public class Md5ConfigUtil { sb.append(WORD_SEPARATOR); sb.append(dataIdGroupId[1]); // if have tenant, then set it - if (dataIdGroupId.length == 3) { + if (dataIdGroupId.length == 4) { if (org.apache.commons.lang3.StringUtils.isNotBlank(dataIdGroupId[2])) { sb.append(WORD_SEPARATOR); sb.append(dataIdGroupId[2]); diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/RequestUtil.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/RequestUtil.java new file mode 100644 index 00000000..26b3b51b --- /dev/null +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/RequestUtil.java @@ -0,0 +1,28 @@ +package cn.hippo4j.config.toolkit; + +import cn.hutool.core.util.StrUtil; + +import javax.servlet.http.HttpServletRequest; + +import static cn.hippo4j.common.constant.Constants.LONG_PULLING_CLIENT_IDENTIFICATION; + +/** + * Request util. + * + * @author chen.ma + * @date 2021/6/23 18:28 + */ +public class RequestUtil { + + private static final String X_REAL_IP = "X-Real-IP"; + + private static final String X_FORWARDED_FOR = "X-Forwarded-For"; + + private static final String X_FORWARDED_FOR_SPLIT_SYMBOL = ","; + + public static String getClientIdentify(HttpServletRequest request) { + String identify = request.getHeader(LONG_PULLING_CLIENT_IDENTIFICATION); + return StrUtil.isBlank(identify) ? "" : identify; + } + +} diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/SimpleReadWriteLock.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/SimpleReadWriteLock.java similarity index 93% rename from config/src/main/java/com/github/dynamic/threadpool/config/toolkit/SimpleReadWriteLock.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/SimpleReadWriteLock.java index 3f9d7ca5..7b69a0fc 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/SimpleReadWriteLock.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/SimpleReadWriteLock.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.toolkit; +package cn.hippo4j.config.toolkit; /** * Simple read write lock. diff --git a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/SingletonRepository.java b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/SingletonRepository.java similarity index 93% rename from config/src/main/java/com/github/dynamic/threadpool/config/toolkit/SingletonRepository.java rename to hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/SingletonRepository.java index 9f868e65..4f82e85b 100644 --- a/config/src/main/java/com/github/dynamic/threadpool/config/toolkit/SingletonRepository.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/toolkit/SingletonRepository.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.config.toolkit; +package cn.hippo4j.config.toolkit; import java.util.concurrent.ConcurrentHashMap; diff --git a/console/.gitignore b/hippo4j-console/.gitignore similarity index 100% rename from console/.gitignore rename to hippo4j-console/.gitignore diff --git a/server/pom.xml b/hippo4j-console/pom.xml similarity index 53% rename from server/pom.xml rename to hippo4j-console/pom.xml index d86d29d2..abff4c64 100644 --- a/server/pom.xml +++ b/hippo4j-console/pom.xml @@ -4,31 +4,45 @@ 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} - server + hippo4j-console jar ${project.artifactId} ${project.artifactId} + + true + + - com.github.dynamic-threadpool - config + cn.hippo4j + hippo4j-config + + + + cn.hippo4j + hippo4j-discovery - com.github.dynamic-threadpool - console + cn.hippo4j + hippo4j-auth - com.github.dynamic-threadpool - discovery + org.hibernate.validator + hibernate-validator + + + + cn.hutool + hutool-all diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/config/GlobalExceptionHandler.java b/hippo4j-console/src/main/java/cn/hippo4j/console/config/GlobalExceptionHandler.java new file mode 100644 index 00000000..1fee2ec0 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/config/GlobalExceptionHandler.java @@ -0,0 +1,69 @@ +package cn.hippo4j.console.config; + +import cn.hippo4j.common.toolkit.CollectionUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.common.web.exception.AbstractException; +import cn.hippo4j.common.web.exception.ServiceException; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StringUtils; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.servlet.http.HttpServletRequest; +import java.util.Optional; + +/** + * 全局异常捕获器. + * + * @author chen.ma + * @date 2021/11/18 22:18 + */ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(value = {AbstractException.class}) + public Result serviceException(HttpServletRequest request, AbstractException ex) { + if (ex.getCause() != null) { + log.error("[{}] {} [ex] {}", request.getMethod(), request.getRequestURL().toString(), ex.toString(), ex.getCause()); + return Results.failure(ex); + } + + log.info("[{}] {} [ex] {}", request.getMethod(), request.getRequestURL().toString(), ex.toString()); + return Results.failure(ex); + } + + @SneakyThrows + @ExceptionHandler(value = MethodArgumentNotValidException.class) + public Result validExceptionHandler(HttpServletRequest request, MethodArgumentNotValidException ex) { + BindingResult bindingResult = ex.getBindingResult(); + FieldError firstFieldError = CollectionUtil.getFirst(bindingResult.getFieldErrors()); + String exceptionStr = Optional.ofNullable(firstFieldError) + .map(FieldError::getDefaultMessage) + .orElse(StringUtil.EMPTY); + + log.error("[{}] {} [ex] {}", request.getMethod(), getUrl(request), exceptionStr); + return Results.failure(new ServiceException(exceptionStr)); + } + + @ExceptionHandler(value = Throwable.class) + public Result defaultErrorHandler(HttpServletRequest request, Throwable throwable) { + log.error("[{}] {} ", request.getMethod(), getUrl(request), throwable); + return Results.failure(throwable); + } + + private String getUrl(HttpServletRequest request) { + if (StringUtils.isEmpty(request.getQueryString())) { + return request.getRequestURL().toString(); + } + + return request.getRequestURL().toString() + "?" + request.getQueryString(); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/config/WebConfig.java b/hippo4j-console/src/main/java/cn/hippo4j/console/config/WebConfig.java new file mode 100644 index 00000000..fe9296b0 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/config/WebConfig.java @@ -0,0 +1,22 @@ +package cn.hippo4j.console.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Web config. + * + * @author chen.ma + * @date 2021/11/9 22:56 + */ +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/index.html").addResourceLocations("classpath:/static/index.html"); + registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/static/"); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ClientCloseHookController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ClientCloseHookController.java new file mode 100644 index 00000000..9785c160 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ClientCloseHookController.java @@ -0,0 +1,32 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.api.ClientCloseHookExecute; +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +/** + * Client close hook controller. + * + * @author chen.ma + * @date 2022/1/6 22:30 + */ +@RestController +@RequestMapping(Constants.BASE_PATH + "/client/close") +public class ClientCloseHookController { + + @PostMapping + public Result clientCloseHook(@RequestBody ClientCloseHookExecute.ClientCloseHookReq req) { + Map clientCloseHookExecuteMap = ApplicationContextHolder.getBeansOfType(ClientCloseHookExecute.class); + clientCloseHookExecuteMap.forEach((key, execute) -> execute.closeHook(req)); + return Results.success(); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/DashboardController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/DashboardController.java new file mode 100644 index 00000000..e76d758e --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/DashboardController.java @@ -0,0 +1,55 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.console.model.*; +import cn.hippo4j.console.service.DashboardService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Dash board controller. + * + * @author chen.ma + * @date 2021/11/10 21:03 + */ +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/dashboard") +public class DashboardController { + + private final DashboardService dashboardService; + + @GetMapping + public Result dashboard() { + return Results.success(dashboardService.getChartInfo()); + } + + @GetMapping("/line/chart") + public Result lineChart() { + LineChartInfo lineChatInfo = dashboardService.getLineChatInfo(); + return Results.success(lineChatInfo); + } + + @GetMapping("/tenant/chart") + public Result tenantChart() { + TenantChart tenantChart = dashboardService.getTenantChart(); + return Results.success(tenantChart); + } + + @GetMapping("/pie/chart") + public Result pieChart() { + PieChartInfo pieChartInfo = dashboardService.getPieChart(); + return Results.success(pieChartInfo); + } + + @GetMapping("/ranking") + public Result rankingChart() { + RankingChart rankingChart = dashboardService.getRankingChart(); + return Results.success(rankingChart); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/HealthCheckController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/HealthCheckController.java new file mode 100644 index 00000000..6aa75fef --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/HealthCheckController.java @@ -0,0 +1,31 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static cn.hippo4j.common.constant.Constants.UP; + +/** + * Health check controller. + * + * @author chen.ma + * @date 2021/12/8 21:02 + */ +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/health/check") +public class HealthCheckController { + + @GetMapping + public Result healthCheck() { + return Results.success(UP); + } + +} diff --git a/console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ItemController.java similarity index 66% rename from console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java rename to hippo4j-console/src/main/java/cn/hippo4j/console/controller/ItemController.java index 6ef1e052..9d5d2948 100644 --- a/console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ItemController.java @@ -1,15 +1,16 @@ -package com.github.dynamic.threadpool.console.controller; - +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.model.biz.item.ItemQueryReqDTO; +import cn.hippo4j.config.model.biz.item.ItemRespDTO; +import cn.hippo4j.config.model.biz.item.ItemSaveReqDTO; +import cn.hippo4j.config.model.biz.item.ItemUpdateReqDTO; +import cn.hippo4j.config.service.biz.ItemService; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.config.model.biz.item.ItemQueryReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemRespDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemSaveReqDTO; -import com.github.dynamic.threadpool.config.model.biz.item.ItemUpdateReqDTO; -import com.github.dynamic.threadpool.config.service.biz.ItemService; import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** @@ -36,7 +37,7 @@ public class ItemController { } @PostMapping("/save") - public Result saveItem(@RequestBody ItemSaveReqDTO reqDTO) { + public Result saveItem(@Validated @RequestBody ItemSaveReqDTO reqDTO) { itemService.saveItem(reqDTO); return Results.success(); } diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/LogRecordController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/LogRecordController.java new file mode 100644 index 00000000..62825a1d --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/LogRecordController.java @@ -0,0 +1,34 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.model.biz.log.LogRecordQueryReqDTO; +import cn.hippo4j.config.model.biz.log.LogRecordRespDTO; +import cn.hippo4j.config.service.biz.LogRecordBizService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Log record controller. + * + * @author chen.ma + * @date 2021/11/17 21:10 + */ +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/log") +public class LogRecordController { + + private final LogRecordBizService logRecordBizService; + + @PostMapping("/query/page") + public Result> queryPage(@RequestBody LogRecordQueryReqDTO queryReqDTO) { + return Results.success(logRecordBizService.queryPage(queryReqDTO)); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/MonitorController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/MonitorController.java new file mode 100644 index 00000000..3ee3198b --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/MonitorController.java @@ -0,0 +1,73 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.MessageWrapper; +import cn.hippo4j.common.toolkit.MessageConvert; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.model.biz.monitor.MonitorActiveRespDTO; +import cn.hippo4j.config.model.biz.monitor.MonitorQueryReqDTO; +import cn.hippo4j.config.model.biz.monitor.MonitorRespDTO; +import cn.hippo4j.config.monitor.QueryMonitorExecuteChoose; +import cn.hippo4j.config.service.biz.HisRunDataService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Monitor controller. + * + * @author chen.ma + * @date 2021/12/7 22:29 + */ +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/monitor") +public class MonitorController { + + private final HisRunDataService hisRunDataService; + + private final QueryMonitorExecuteChoose queryMonitorExecuteChoose; + + private final ThreadPoolTaskExecutor monitorThreadPoolTaskExecutor; + + @GetMapping + public Result> queryMonitor(MonitorQueryReqDTO reqDTO) { + List monitorRespList = hisRunDataService.query(reqDTO); + return Results.success(monitorRespList); + } + + @PostMapping("/info") + public Result queryInfoThreadPoolMonitor(@RequestBody MonitorQueryReqDTO reqDTO) { + MonitorActiveRespDTO monitorRespList = hisRunDataService.queryInfoThreadPoolMonitor(reqDTO); + return Results.success(monitorRespList); + } + + @PostMapping("/last/task/count") + public Result queryThreadPoolLastTaskCount(@RequestBody MonitorQueryReqDTO reqDTO) { + MonitorRespDTO resultDTO = hisRunDataService.queryThreadPoolLastTaskCount(reqDTO); + return Results.success(resultDTO); + } + + @PostMapping + public Result dataCollect(@RequestBody MessageWrapper messageWrapper) { + Runnable task = () -> { + Message message = MessageConvert.convert(messageWrapper); + queryMonitorExecuteChoose.chooseAndExecute(message); + }; + + try { + monitorThreadPoolTaskExecutor.execute(task); + } catch (Exception ex) { + log.error("Monitoring data insertion database task overflow.", ex); + } + + return Results.success(); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/NotifyController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/NotifyController.java new file mode 100644 index 00000000..8b82b5f5 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/NotifyController.java @@ -0,0 +1,66 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.model.biz.notify.NotifyListRespDTO; +import cn.hippo4j.config.model.biz.notify.NotifyQueryReqDTO; +import cn.hippo4j.config.model.biz.notify.NotifyReqDTO; +import cn.hippo4j.config.model.biz.notify.NotifyRespDTO; +import cn.hippo4j.config.service.biz.NotifyService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 通知管理. + * + * @author chen.ma + * @date 2021/11/17 22:00 + */ +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/notify") +public class NotifyController { + + private final NotifyService notifyService; + + @PostMapping("/list/config") + public Result> listNotifyConfig(@RequestBody NotifyQueryReqDTO reqDTO) { + List resultData = notifyService.listNotifyConfig(reqDTO); + return Results.success(resultData); + } + + @PostMapping("/query/page") + public Result> queryPage(@RequestBody NotifyQueryReqDTO reqDTO) { + IPage resultPage = notifyService.queryPage(reqDTO); + return Results.success(resultPage); + } + + @PostMapping("/save") + public Result saveNotifyConfig(@RequestBody NotifyReqDTO reqDTO) { + notifyService.save(reqDTO); + return Results.success(); + } + + @PostMapping("/update") + public Result updateNotifyConfig(@RequestBody NotifyReqDTO reqDTO) { + notifyService.update(reqDTO); + return Results.success(); + } + + @DeleteMapping("/remove") + public Result removeNotifyConfig(@RequestBody NotifyReqDTO reqDTO) { + notifyService.delete(reqDTO); + return Results.success(); + } + + @PostMapping("/enable/{id}/{status}") + public Result enableNotify(@PathVariable("id") String id, @PathVariable("status") Integer status) { + notifyService.enableNotify(id, status); + return Results.success(); + } + +} diff --git a/console/src/main/java/com/github/dynamic/threadpool/console/controller/PermissionController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/PermissionController.java similarity index 80% rename from console/src/main/java/com/github/dynamic/threadpool/console/controller/PermissionController.java rename to hippo4j-console/src/main/java/cn/hippo4j/console/controller/PermissionController.java index fe043479..94a19bfb 100644 --- a/console/src/main/java/com/github/dynamic/threadpool/console/controller/PermissionController.java +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/PermissionController.java @@ -1,10 +1,10 @@ -package com.github.dynamic.threadpool.console.controller; +package cn.hippo4j.console.controller; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.auth.model.biz.permission.PermissionRespDTO; -import com.github.dynamic.threadpool.auth.service.PermissionService; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; +import cn.hippo4j.auth.model.biz.permission.PermissionRespDTO; +import cn.hippo4j.auth.service.PermissionService; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; diff --git a/console/src/main/java/com/github/dynamic/threadpool/console/controller/RoleController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/RoleController.java similarity index 81% rename from console/src/main/java/com/github/dynamic/threadpool/console/controller/RoleController.java rename to hippo4j-console/src/main/java/cn/hippo4j/console/controller/RoleController.java index 0139ebc9..06648324 100644 --- a/console/src/main/java/com/github/dynamic/threadpool/console/controller/RoleController.java +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/RoleController.java @@ -1,10 +1,10 @@ -package com.github.dynamic.threadpool.console.controller; +package cn.hippo4j.console.controller; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.dynamic.threadpool.auth.model.biz.role.RoleRespDTO; -import com.github.dynamic.threadpool.auth.service.RoleService; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; +import cn.hippo4j.auth.model.biz.role.RoleRespDTO; +import cn.hippo4j.auth.service.RoleService; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/TenantController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/TenantController.java new file mode 100644 index 00000000..9082a384 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/TenantController.java @@ -0,0 +1,58 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.model.biz.tenant.TenantQueryReqDTO; +import cn.hippo4j.config.model.biz.tenant.TenantRespDTO; +import cn.hippo4j.config.model.biz.tenant.TenantSaveReqDTO; +import cn.hippo4j.config.model.biz.tenant.TenantUpdateReqDTO; +import cn.hippo4j.config.service.biz.TenantService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * Tenant controller. + * + * @author chen.ma + * @date 2021/6/25 18:31 + */ +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/tenant") +public class TenantController { + + private final TenantService tenantService; + + @PostMapping("/query/page") + public Result> queryNameSpacePage(@RequestBody TenantQueryReqDTO reqDTO) { + IPage resultPage = tenantService.queryTenantPage(reqDTO); + return Results.success(resultPage); + } + + @GetMapping("/query/{tenantId}") + public Result queryNameSpace(@PathVariable("tenantId") String tenantId) { + return Results.success(tenantService.getTenantByTenantId(tenantId)); + } + + @PostMapping("/save") + public Result saveNameSpace(@Validated @RequestBody TenantSaveReqDTO reqDTO) { + tenantService.saveTenant(reqDTO); + return Results.success(Boolean.TRUE); + } + + @PostMapping("/update") + public Result updateNameSpace(@RequestBody TenantUpdateReqDTO reqDTO) { + tenantService.updateTenant(reqDTO); + return Results.success(Boolean.TRUE); + } + + @DeleteMapping("/delete/{tenantId}") + public Result deleteNameSpace(@PathVariable("tenantId") String tenantId) { + tenantService.deleteTenantById(tenantId); + return Results.success(Boolean.TRUE); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ThreadPoolController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ThreadPoolController.java new file mode 100644 index 00000000..590373a7 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/ThreadPoolController.java @@ -0,0 +1,182 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.config.model.CacheItem; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolDelReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolQueryReqDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolRespDTO; +import cn.hippo4j.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO; +import cn.hippo4j.config.service.ConfigCacheService; +import cn.hippo4j.config.service.biz.ThreadPoolService; +import cn.hippo4j.config.toolkit.BeanUtil; +import cn.hippo4j.console.model.ThreadPoolInstanceInfo; +import cn.hippo4j.discovery.core.BaseInstanceRegistry; +import cn.hippo4j.discovery.core.Lease; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.text.StrBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.google.common.collect.Lists; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static cn.hippo4j.common.constant.Constants.HTTP_EXECUTE_TIMEOUT; +import static cn.hippo4j.common.toolkit.ContentUtil.getGroupKey; + +/** + * Thread pool controller. + * + * @author chen.ma + * @date 2021/6/30 20:54 + */ +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/thread/pool") +public class ThreadPoolController { + + private final ThreadPoolService threadPoolService; + + private final BaseInstanceRegistry baseInstanceRegistry; + + @PostMapping("/query/page") + public Result> queryNameSpacePage(@RequestBody ThreadPoolQueryReqDTO reqDTO) { + return Results.success(threadPoolService.queryThreadPoolPage(reqDTO)); + } + + @PostMapping("/query") + public Result queryNameSpace(@RequestBody ThreadPoolQueryReqDTO reqDTO) { + return Results.success(threadPoolService.getThreadPool(reqDTO)); + } + + @PostMapping("/save_or_update") + public Result saveOrUpdateThreadPoolConfig(@RequestParam(value = "identify", required = false) String identify, + @Validated @RequestBody ThreadPoolSaveOrUpdateReqDTO reqDTO) { + threadPoolService.saveOrUpdateThreadPoolConfig(identify, reqDTO); + return Results.success(); + } + + @DeleteMapping("/delete") + public Result deletePool(@RequestBody ThreadPoolDelReqDTO reqDTO) { + threadPoolService.deletePool(reqDTO); + return Results.success(); + } + + @PostMapping("/alarm/enable/{id}/{isAlarm}") + public Result alarmEnable(@PathVariable("id") String id, @PathVariable("isAlarm") Integer isAlarm) { + threadPoolService.alarmEnable(id, isAlarm); + return Results.success(); + } + + @GetMapping("/run/state/{tpId}") + public Result runState(@PathVariable("tpId") String tpId, + @RequestParam(value = "clientAddress") String clientAddress) { + String urlString = StrBuilder.create("http://", clientAddress, "/run/state/", tpId).toString(); + String data = HttpUtil.get(urlString, HTTP_EXECUTE_TIMEOUT); + Result result = JSONUtil.parseObject(data, Result.class); + return result; + } + + @GetMapping("/run/thread/state/{tpId}") + public Result runThreadState(@PathVariable("tpId") String tpId, + @RequestParam(value = "clientAddress") String clientAddress) { + String urlString = StrBuilder.create("http://", clientAddress, "/run/thread/state/", tpId).toString(); + String data = HttpUtil.get(urlString, HTTP_EXECUTE_TIMEOUT); + Result result = JSONUtil.parseObject(data, Result.class); + return result; + } + + @GetMapping("/web/base/info") + public Result getPoolBaseState(@RequestParam(value = "clientAddress") String clientAddress) { + String urlString = StrBuilder.create("http://", clientAddress, "/web/base/info").toString(); + String data = HttpUtil.get(urlString, HTTP_EXECUTE_TIMEOUT); + Result result = JSONUtil.parseObject(data, Result.class); + return result; + } + + @GetMapping("/web/run/state") + public Result getPoolRunState(@RequestParam(value = "clientAddress") String clientAddress) { + String urlString = StrBuilder.create("http://", clientAddress, "/web/run/state").toString(); + String data = HttpUtil.get(urlString, HTTP_EXECUTE_TIMEOUT); + Result result = JSONUtil.parseObject(data, Result.class); + return result; + } + + @PostMapping("/web/update/pool") + public Result updateWebThreadPool(@RequestParam(value = "clientAddress") String clientAddress, + @RequestBody PoolParameterInfo poolParameterInfo) { + String urlString = StrBuilder.create("http://", clientAddress, "/web/update/pool").toString(); + String data = HttpUtil.post(urlString, JSONUtil.toJSONString(poolParameterInfo), HTTP_EXECUTE_TIMEOUT); + Result result = JSONUtil.parseObject(data, Result.class); + return result; + } + + @GetMapping("/list/instance/{itemId}/{tpId}") + public Result> listInstance(@PathVariable("itemId") String itemId, + @PathVariable("tpId") String tpId) { + List> leases = baseInstanceRegistry.listInstance(itemId); + Lease first = CollUtil.getFirst(leases); + if (first == null) { + return Results.success(Lists.newArrayList()); + } + + InstanceInfo holder = first.getHolder(); + String itemTenantKey = holder.getGroupKey(); + String groupKey = getGroupKey(tpId, itemTenantKey); + Map content = ConfigCacheService.getContent(groupKey); + Map activeMap = + leases.stream().map(each -> each.getHolder()).filter(each -> StringUtil.isNotBlank(each.getActive())) + .collect(Collectors.toMap(InstanceInfo::getIdentify, InstanceInfo::getActive)); + + Map clientBasePathMap = leases.stream().map(each -> each.getHolder()) + .filter(each -> StringUtil.isNotBlank(each.getClientBasePath())) + .collect(Collectors.toMap(InstanceInfo::getIdentify, InstanceInfo::getClientBasePath)); + + List returnThreadPool = Lists.newArrayList(); + content.forEach((key, val) -> { + ThreadPoolInstanceInfo threadPoolInstanceInfo = + BeanUtil.convert(val.configAllInfo, ThreadPoolInstanceInfo.class); + threadPoolInstanceInfo.setClientAddress(StrUtil.subBefore(key, Constants.IDENTIFY_SLICER_SYMBOL, false)); + threadPoolInstanceInfo.setActive(activeMap.get(key)); + threadPoolInstanceInfo.setIdentify(key); + threadPoolInstanceInfo.setClientBasePath(clientBasePathMap.get(key)); + returnThreadPool.add(threadPoolInstanceInfo); + }); + + return Results.success(returnThreadPool); + } + + @GetMapping("/list/client/instance/{itemId}") + public Result listClientInstance(@PathVariable("itemId") String itemId) { + List> leases = baseInstanceRegistry.listInstance(itemId); + Lease first = CollUtil.getFirst(leases); + if (first == null) { + return Results.success(Lists.newArrayList()); + } + + List returnThreadPool = Lists.newArrayList(); + leases.forEach(each -> { + InstanceInfo holder = each.getHolder(); + ThreadPoolInstanceInfo threadPoolInstanceInfo = new ThreadPoolInstanceInfo(); + threadPoolInstanceInfo.setActive(holder.getActive()); + threadPoolInstanceInfo.setClientAddress(holder.getCallBackUrl()); + threadPoolInstanceInfo.setIdentify(holder.getIdentify()); + + returnThreadPool.add(threadPoolInstanceInfo); + }); + + return Results.success(returnThreadPool); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/controller/UserController.java b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/UserController.java new file mode 100644 index 00000000..04091505 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/controller/UserController.java @@ -0,0 +1,79 @@ +package cn.hippo4j.console.controller; + +import cn.hippo4j.auth.model.UserInfo; +import cn.hippo4j.auth.model.biz.user.UserQueryPageReqDTO; +import cn.hippo4j.auth.model.biz.user.UserReqDTO; +import cn.hippo4j.auth.model.biz.user.UserRespDTO; +import cn.hippo4j.auth.security.AuthManager; +import cn.hippo4j.auth.service.UserService; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.model.TokenInfo; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +import static cn.hippo4j.auth.constant.Constants.TOKEN_VALIDITY_IN_SECONDS; + +/** + * User controller. + * + * @author chen.ma + * @date 2021/10/30 21:15 + */ +@RestController +@AllArgsConstructor +@RequestMapping(Constants.BASE_PATH + "/auth/users") +public class UserController { + + private final UserService userService; + + private final AuthManager authManager; + + @PostMapping("/apply/token") + public Result applyToken(@RequestBody UserInfo userInfo) { + String accessToken = authManager.resolveTokenFromUser(userInfo.getUserName(), userInfo.getPassword()); + TokenInfo tokenInfo = new TokenInfo(accessToken, TOKEN_VALIDITY_IN_SECONDS); + return Results.success(tokenInfo); + } + + @PostMapping("/page") + public Result> listUser(@RequestBody UserQueryPageReqDTO reqDTO) { + IPage resultUserPage = userService.listUser(reqDTO); + return Results.success(resultUserPage); + } + + @GetMapping("/info/{username}") + public Result userInfo(@PathVariable("username") String username) { + UserRespDTO userRespDTO = userService.getUser(new UserReqDTO().setUserName(username)); + return Results.success(userRespDTO); + } + + @PostMapping("/add") + public Result addUser(@RequestBody UserReqDTO reqDTO) { + userService.addUser(reqDTO); + return Results.success(); + } + + @PutMapping("/update") + public Result updateUser(@RequestBody UserReqDTO reqDTO) { + userService.updateUser(reqDTO); + return Results.success(); + } + + @DeleteMapping("/remove/{userName}") + public Result deleteUser(@PathVariable("userName") String userName) { + userService.deleteUser(userName); + return Results.success(); + } + + @GetMapping("/search/{userName}") + public Result> searchUsersLikeUserName(@PathVariable("userName") String userName) { + List resultUserNames = userService.getUserLikeUsername(userName); + return Results.success(resultUserNames); + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/model/ChartInfo.java b/hippo4j-console/src/main/java/cn/hippo4j/console/model/ChartInfo.java new file mode 100644 index 00000000..cba5cefc --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/model/ChartInfo.java @@ -0,0 +1,36 @@ +package cn.hippo4j.console.model; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * Char info. + * + * @author chen.ma + * @date 2021/11/10 21:06 + */ +@Data +@Accessors(chain = true) +public class ChartInfo { + + /** + * 租户统计 + */ + private Integer tenantCount; + + /** + * 项目统计 + */ + private Integer itemCount; + + /** + * 线程池统计 + */ + private Integer threadPoolCount; + + /** + * 线程池实例统计 + */ + private Integer threadPoolInstanceCount; + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/model/LineChartInfo.java b/hippo4j-console/src/main/java/cn/hippo4j/console/model/LineChartInfo.java new file mode 100644 index 00000000..452bc719 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/model/LineChartInfo.java @@ -0,0 +1,40 @@ +package cn.hippo4j.console.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * Line chart info. + * + * @author chen.ma + * @date 2021/12/11 12:49 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class LineChartInfo { + + /** + * oneList + */ + private List oneList; + + /** + * twoList + */ + private List twoList; + + /** + * threeList + */ + private List threeList; + + /** + * fourList + */ + private List fourList; + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/model/PieChartInfo.java b/hippo4j-console/src/main/java/cn/hippo4j/console/model/PieChartInfo.java new file mode 100644 index 00000000..08cbd9a7 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/model/PieChartInfo.java @@ -0,0 +1,31 @@ +package cn.hippo4j.console.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * Pie chart info. + * + * @author chen.ma + * @date 2021/12/11 14:27 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PieChartInfo { + + /** + * itemIds + */ + private List itemIds; + + /** + * pieDataList + */ + private List> pieDataList; + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/model/RankingChart.java b/hippo4j-console/src/main/java/cn/hippo4j/console/model/RankingChart.java new file mode 100644 index 00000000..9e51abf9 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/model/RankingChart.java @@ -0,0 +1,45 @@ +package cn.hippo4j.console.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * Ranking chart. + * + * @author chen.ma + * @date 2021/12/11 19:39 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RankingChart { + + /** + * rankingChartInfoList + */ + private List rankingChartInfoList; + + @Data + public static class RankingChartInfo { + + /** + * groupKey + */ + private String groupKey; + + /** + * completedTaskCount + */ + private Long maxCompletedTaskCount; + + /** + * inst + */ + private Integer inst; + + } + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/model/TenantChart.java b/hippo4j-console/src/main/java/cn/hippo4j/console/model/TenantChart.java new file mode 100644 index 00000000..fec46bbf --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/model/TenantChart.java @@ -0,0 +1,26 @@ +package cn.hippo4j.console.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * Tenant chart. + * + * @author chen.ma + * @date 2021/12/11 16:35 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class TenantChart { + + /** + * tenantCharts + */ + private List> tenantCharts; + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/model/ThreadPoolInstanceInfo.java b/hippo4j-console/src/main/java/cn/hippo4j/console/model/ThreadPoolInstanceInfo.java new file mode 100644 index 00000000..cc58d6c3 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/model/ThreadPoolInstanceInfo.java @@ -0,0 +1,35 @@ +package cn.hippo4j.console.model; + +import cn.hippo4j.config.model.ConfigAllInfo; +import lombok.Data; + +/** + * ThreadPool instance info. + * + * @author chen.ma + * @date 2021/11/11 23:39 + */ +@Data +public class ThreadPoolInstanceInfo extends ConfigAllInfo { + + /** + * clientAddress + */ + private String clientAddress; + + /** + * identify + */ + private String identify; + + /** + * clientBasePath + */ + private String clientBasePath; + + /** + * active + */ + private String active; + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/service/DashboardService.java b/hippo4j-console/src/main/java/cn/hippo4j/console/service/DashboardService.java new file mode 100644 index 00000000..a873addd --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/service/DashboardService.java @@ -0,0 +1,48 @@ +package cn.hippo4j.console.service; + +import cn.hippo4j.console.model.*; + +/** + * Dashboard service. + * + * @author chen.ma + * @date 2021/11/1 21:06 + */ +public interface DashboardService { + + /** + * Get chart info. + * + * @return + */ + ChartInfo getChartInfo(); + + /** + * Fet line chat info. + * + * @return + */ + LineChartInfo getLineChatInfo(); + + /** + * Get tenant chart. + * + * @return + */ + TenantChart getTenantChart(); + + /** + * Get pie chart. + * + * @return + */ + PieChartInfo getPieChart(); + + /** + * Get ranking chart. + * + * @return + */ + RankingChart getRankingChart(); + +} diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java b/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java new file mode 100644 index 00000000..f43e1554 --- /dev/null +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java @@ -0,0 +1,186 @@ +package cn.hippo4j.console.service.impl; + +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.toolkit.GroupKey; +import cn.hippo4j.common.enums.DelEnum; +import cn.hippo4j.config.mapper.ConfigInfoMapper; +import cn.hippo4j.config.mapper.HisRunDataMapper; +import cn.hippo4j.config.mapper.ItemInfoMapper; +import cn.hippo4j.config.mapper.TenantInfoMapper; +import cn.hippo4j.config.model.*; +import cn.hippo4j.config.service.ConfigCacheService; +import cn.hippo4j.config.service.biz.HisRunDataService; +import cn.hippo4j.console.model.*; +import cn.hippo4j.console.service.DashboardService; +import cn.hippo4j.discovery.core.BaseInstanceRegistry; +import cn.hippo4j.discovery.core.Lease; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Dict; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static cn.hippo4j.common.toolkit.ContentUtil.getGroupKey; + +/** + * Dashboard service impl. + * + * @author chen.ma + * @date 2021/11/10 21:08 + */ +@Service +@AllArgsConstructor +public class DashboardServiceImpl implements DashboardService { + + private final TenantInfoMapper tenantInfoMapper; + + private final ItemInfoMapper itemInfoMapper; + + private final ConfigInfoMapper configInfoMapper; + + private final HisRunDataService hisRunDataService; + + private final HisRunDataMapper hisRunDataMapper; + + private final BaseInstanceRegistry baseInstanceRegistry; + + @Override + public ChartInfo getChartInfo() { + Integer tenantCount = tenantInfoMapper.selectCount(Wrappers.lambdaQuery(TenantInfo.class).eq(TenantInfo::getDelFlag, DelEnum.NORMAL)); + Integer itemCount = itemInfoMapper.selectCount(Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getDelFlag, DelEnum.NORMAL)); + Integer threadPoolCount = configInfoMapper.selectCount(Wrappers.lambdaQuery(ConfigAllInfo.class).eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL)); + + ChartInfo chartInfo = new ChartInfo(); + chartInfo.setTenantCount(tenantCount) + .setItemCount(itemCount) + .setThreadPoolCount(threadPoolCount) + .setThreadPoolInstanceCount(ConfigCacheService.getTotal()); + return chartInfo; + } + + @Override + public LineChartInfo getLineChatInfo() { + Date currentDate = new Date(); + DateTime startTime = DateUtil.offsetMinute(currentDate, -10); + + List threadPoolTaskRankings = hisRunDataMapper.queryThreadPoolMaxRanking(startTime.getTime(), currentDate.getTime()); + + List oneList = Lists.newArrayList(); + List twoList = Lists.newArrayList(); + List threeList = Lists.newArrayList(); + List fourList = Lists.newArrayList(); + + ArrayList> lists = Lists.newArrayList(oneList, twoList, threeList, fourList); + for (int i = 0; i < threadPoolTaskRankings.size(); i++) { + List eachList = lists.get(i); + HisRunDataMapper.ThreadPoolTaskRanking taskRanking = threadPoolTaskRankings.get(i); + eachList.add(taskRanking.getTpId()); + eachList.add(taskRanking.getMaxQueueSize()); + eachList.add(taskRanking.getMaxRejectCount()); + eachList.add(taskRanking.getMaxCompletedTaskCount()); + } + + return new LineChartInfo(oneList, twoList, threeList, fourList); + } + + @Override + public TenantChart getTenantChart() { + List> tenantChartList = Lists.newArrayList(); + List tenantInfos = tenantInfoMapper.selectList(Wrappers.lambdaQuery(TenantInfo.class).eq(TenantInfo::getDelFlag, DelEnum.NORMAL)); + for (TenantInfo tenant : tenantInfos) { + int tenantThreadPoolNum = 0; + LambdaQueryWrapper itemQueryWrapper = Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getTenantId, tenant.getTenantId()).eq(ItemInfo::getDelFlag, DelEnum.NORMAL).select(ItemInfo::getItemId); + List itemInfos = itemInfoMapper.selectList(itemQueryWrapper); + for (ItemInfo item : itemInfos) { + LambdaQueryWrapper threadPoolQueryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(ConfigInfoBase::getItemId, item.getItemId()) + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL); + Integer threadPoolCount = configInfoMapper.selectCount(threadPoolQueryWrapper); + tenantThreadPoolNum += threadPoolCount; + } + + Dict dict = Dict.create().set("name", tenant.getTenantId()).set("value", tenantThreadPoolNum); + tenantChartList.add(dict); + } + + List resultTenantChartList = tenantChartList.stream() + .sorted((one, two) -> (int) two.get("value") - (int) one.get("value")) + .limit(5) + .collect(Collectors.toList()); + + return new TenantChart(resultTenantChartList); + } + + @Override + public PieChartInfo getPieChart() { + LambdaQueryWrapper itemQueryWrapper = Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getDelFlag, DelEnum.NORMAL).select(ItemInfo::getItemId); + List itemNameList = itemInfoMapper.selectObjs(itemQueryWrapper); + + List> pieDataList = Lists.newArrayList(); + for (Object each : itemNameList) { + LambdaQueryWrapper threadPoolQueryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) + .eq(ConfigInfoBase::getItemId, each) + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL); + Integer threadPoolCount = configInfoMapper.selectCount(threadPoolQueryWrapper); + if (threadPoolCount != null) { + Dict dict = Dict.create().set("name", each).set("value", threadPoolCount); + pieDataList.add(dict); + } + } + + pieDataList.sort((one, two) -> (int) two.get("value") - (int) one.get("value")); + + List resultItemIds = Lists.newArrayList(); + List> resultPieDataList = pieDataList.stream() + .limit(5) + .map(each -> { + resultItemIds.add(each.get("name").toString()); + return each; + }) + .collect(Collectors.toList()); + + return new PieChartInfo(resultItemIds, resultPieDataList); + } + + @Override + public RankingChart getRankingChart() { + Date currentDate = new Date(); + DateTime tenTime = DateUtil.offsetMinute(currentDate, -10); + + List resultList = Lists.newArrayList(); + List threadPoolTaskRankings = hisRunDataMapper.queryThreadPoolTaskSumRanking(tenTime.getTime(), currentDate.getTime()); + threadPoolTaskRankings.forEach(each -> { + RankingChart.RankingChartInfo rankingChartInfo = new RankingChart.RankingChartInfo(); + rankingChartInfo.setMaxCompletedTaskCount(each.getMaxCompletedTaskCount()); + List> leases = baseInstanceRegistry.listInstance(each.getItemId()); + Lease first = CollUtil.getFirst(leases); + if (first == null) { + rankingChartInfo.setInst(0); + } else { + InstanceInfo holder = first.getHolder(); + String itemTenantKey = holder.getGroupKey(); + String groupKey = getGroupKey(each.getTpId(), itemTenantKey); + Map content = ConfigCacheService.getContent(groupKey); + rankingChartInfo.setInst(content.keySet().size()); + } + + String keyTenant = GroupKey.getKeyTenant(each.getTenantId(), each.getItemId(), each.getTpId()); + rankingChartInfo.setGroupKey(keyTenant); + + resultList.add(rankingChartInfo); + }); + + return new RankingChart(resultList); + } + +} diff --git a/hippo4j-console/src/main/resources/static/favicon.ico b/hippo4j-console/src/main/resources/static/favicon.ico new file mode 100644 index 00000000..ad413bec Binary files /dev/null and b/hippo4j-console/src/main/resources/static/favicon.ico differ diff --git a/hippo4j-console/src/main/resources/static/hippo4j.gif b/hippo4j-console/src/main/resources/static/hippo4j.gif new file mode 100644 index 00000000..fdbd32c6 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/hippo4j.gif differ diff --git a/hippo4j-console/src/main/resources/static/index.html b/hippo4j-console/src/main/resources/static/index.html new file mode 100644 index 00000000..194507f2 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/index.html @@ -0,0 +1 @@ +Hippo4J Web
\ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/app.a8785f8e.css b/hippo4j-console/src/main/resources/static/static/css/app.a8785f8e.css new file mode 100644 index 00000000..bd992416 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/app.a8785f8e.css @@ -0,0 +1 @@ +@font-face{font-family:element-icons;src:url(../../static/fonts/element-icons.535877f5.woff) format("woff"),url(../../static/fonts/element-icons.732389de.ttf) format("truetype");font-weight:400;font-display:"auto";font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-ice-cream-round:before{content:"\E6A0"}.el-icon-ice-cream-square:before{content:"\E6A3"}.el-icon-lollipop:before{content:"\E6A4"}.el-icon-potato-strips:before{content:"\E6A5"}.el-icon-milk-tea:before{content:"\E6A6"}.el-icon-ice-drink:before{content:"\E6A7"}.el-icon-ice-tea:before{content:"\E6A9"}.el-icon-coffee:before{content:"\E6AA"}.el-icon-orange:before{content:"\E6AB"}.el-icon-pear:before{content:"\E6AC"}.el-icon-apple:before{content:"\E6AD"}.el-icon-cherry:before{content:"\E6AE"}.el-icon-watermelon:before{content:"\E6AF"}.el-icon-grape:before{content:"\E6B0"}.el-icon-refrigerator:before{content:"\E6B1"}.el-icon-goblet-square-full:before{content:"\E6B2"}.el-icon-goblet-square:before{content:"\E6B3"}.el-icon-goblet-full:before{content:"\E6B4"}.el-icon-goblet:before{content:"\E6B5"}.el-icon-cold-drink:before{content:"\E6B6"}.el-icon-coffee-cup:before{content:"\E6B8"}.el-icon-water-cup:before{content:"\E6B9"}.el-icon-hot-water:before{content:"\E6BA"}.el-icon-ice-cream:before{content:"\E6BB"}.el-icon-dessert:before{content:"\E6BC"}.el-icon-sugar:before{content:"\E6BD"}.el-icon-tableware:before{content:"\E6BE"}.el-icon-burger:before{content:"\E6BF"}.el-icon-knife-fork:before{content:"\E6C1"}.el-icon-fork-spoon:before{content:"\E6C2"}.el-icon-chicken:before{content:"\E6C3"}.el-icon-food:before{content:"\E6C4"}.el-icon-dish-1:before{content:"\E6C5"}.el-icon-dish:before{content:"\E6C6"}.el-icon-moon-night:before{content:"\E6EE"}.el-icon-moon:before{content:"\E6F0"}.el-icon-cloudy-and-sunny:before{content:"\E6F1"}.el-icon-partly-cloudy:before{content:"\E6F2"}.el-icon-cloudy:before{content:"\E6F3"}.el-icon-sunny:before{content:"\E6F6"}.el-icon-sunset:before{content:"\E6F7"}.el-icon-sunrise-1:before{content:"\E6F8"}.el-icon-sunrise:before{content:"\E6F9"}.el-icon-heavy-rain:before{content:"\E6FA"}.el-icon-lightning:before{content:"\E6FB"}.el-icon-light-rain:before{content:"\E6FC"}.el-icon-wind-power:before{content:"\E6FD"}.el-icon-baseball:before{content:"\E712"}.el-icon-soccer:before{content:"\E713"}.el-icon-football:before{content:"\E715"}.el-icon-basketball:before{content:"\E716"}.el-icon-ship:before{content:"\E73F"}.el-icon-truck:before{content:"\E740"}.el-icon-bicycle:before{content:"\E741"}.el-icon-mobile-phone:before{content:"\E6D3"}.el-icon-service:before{content:"\E6D4"}.el-icon-key:before{content:"\E6E2"}.el-icon-unlock:before{content:"\E6E4"}.el-icon-lock:before{content:"\E6E5"}.el-icon-watch:before{content:"\E6FE"}.el-icon-watch-1:before{content:"\E6FF"}.el-icon-timer:before{content:"\E702"}.el-icon-alarm-clock:before{content:"\E703"}.el-icon-map-location:before{content:"\E704"}.el-icon-delete-location:before{content:"\E705"}.el-icon-add-location:before{content:"\E706"}.el-icon-location-information:before{content:"\E707"}.el-icon-location-outline:before{content:"\E708"}.el-icon-location:before{content:"\E79E"}.el-icon-place:before{content:"\E709"}.el-icon-discover:before{content:"\E70A"}.el-icon-first-aid-kit:before{content:"\E70B"}.el-icon-trophy-1:before{content:"\E70C"}.el-icon-trophy:before{content:"\E70D"}.el-icon-medal:before{content:"\E70E"}.el-icon-medal-1:before{content:"\E70F"}.el-icon-stopwatch:before{content:"\E710"}.el-icon-mic:before{content:"\E711"}.el-icon-copy-document:before{content:"\E718"}.el-icon-full-screen:before{content:"\E719"}.el-icon-switch-button:before{content:"\E71B"}.el-icon-aim:before{content:"\E71C"}.el-icon-crop:before{content:"\E71D"}.el-icon-odometer:before{content:"\E71E"}.el-icon-time:before{content:"\E71F"}.el-icon-bangzhu:before{content:"\E724"}.el-icon-close-notification:before{content:"\E726"}.el-icon-microphone:before{content:"\E727"}.el-icon-turn-off-microphone:before{content:"\E728"}.el-icon-position:before{content:"\E729"}.el-icon-postcard:before{content:"\E72A"}.el-icon-message:before{content:"\E72B"}.el-icon-chat-line-square:before{content:"\E72D"}.el-icon-chat-dot-square:before{content:"\E72E"}.el-icon-chat-dot-round:before{content:"\E72F"}.el-icon-chat-square:before{content:"\E730"}.el-icon-chat-line-round:before{content:"\E731"}.el-icon-chat-round:before{content:"\E732"}.el-icon-set-up:before{content:"\E733"}.el-icon-turn-off:before{content:"\E734"}.el-icon-open:before{content:"\E735"}.el-icon-connection:before{content:"\E736"}.el-icon-link:before{content:"\E737"}.el-icon-cpu:before{content:"\E738"}.el-icon-thumb:before{content:"\E739"}.el-icon-female:before{content:"\E73A"}.el-icon-male:before{content:"\E73B"}.el-icon-guide:before{content:"\E73C"}.el-icon-news:before{content:"\E73E"}.el-icon-price-tag:before{content:"\E744"}.el-icon-discount:before{content:"\E745"}.el-icon-wallet:before{content:"\E747"}.el-icon-coin:before{content:"\E748"}.el-icon-money:before{content:"\E749"}.el-icon-bank-card:before{content:"\E74A"}.el-icon-box:before{content:"\E74B"}.el-icon-present:before{content:"\E74C"}.el-icon-sell:before{content:"\E6D5"}.el-icon-sold-out:before{content:"\E6D6"}.el-icon-shopping-bag-2:before{content:"\E74D"}.el-icon-shopping-bag-1:before{content:"\E74E"}.el-icon-shopping-cart-2:before{content:"\E74F"}.el-icon-shopping-cart-1:before{content:"\E750"}.el-icon-shopping-cart-full:before{content:"\E751"}.el-icon-smoking:before{content:"\E752"}.el-icon-no-smoking:before{content:"\E753"}.el-icon-house:before{content:"\E754"}.el-icon-table-lamp:before{content:"\E755"}.el-icon-school:before{content:"\E756"}.el-icon-office-building:before{content:"\E757"}.el-icon-toilet-paper:before{content:"\E758"}.el-icon-notebook-2:before{content:"\E759"}.el-icon-notebook-1:before{content:"\E75A"}.el-icon-files:before{content:"\E75B"}.el-icon-collection:before{content:"\E75C"}.el-icon-receiving:before{content:"\E75D"}.el-icon-suitcase-1:before{content:"\E760"}.el-icon-suitcase:before{content:"\E761"}.el-icon-film:before{content:"\E763"}.el-icon-collection-tag:before{content:"\E765"}.el-icon-data-analysis:before{content:"\E766"}.el-icon-pie-chart:before{content:"\E767"}.el-icon-data-board:before{content:"\E768"}.el-icon-data-line:before{content:"\E76D"}.el-icon-reading:before{content:"\E769"}.el-icon-magic-stick:before{content:"\E76A"}.el-icon-coordinate:before{content:"\E76B"}.el-icon-mouse:before{content:"\E76C"}.el-icon-brush:before{content:"\E76E"}.el-icon-headset:before{content:"\E76F"}.el-icon-umbrella:before{content:"\E770"}.el-icon-scissors:before{content:"\E771"}.el-icon-mobile:before{content:"\E773"}.el-icon-attract:before{content:"\E774"}.el-icon-monitor:before{content:"\E775"}.el-icon-search:before{content:"\E778"}.el-icon-takeaway-box:before{content:"\E77A"}.el-icon-paperclip:before{content:"\E77D"}.el-icon-printer:before{content:"\E77E"}.el-icon-document-add:before{content:"\E782"}.el-icon-document:before{content:"\E785"}.el-icon-document-checked:before{content:"\E786"}.el-icon-document-copy:before{content:"\E787"}.el-icon-document-delete:before{content:"\E788"}.el-icon-document-remove:before{content:"\E789"}.el-icon-tickets:before{content:"\E78B"}.el-icon-folder-checked:before{content:"\E77F"}.el-icon-folder-delete:before{content:"\E780"}.el-icon-folder-remove:before{content:"\E781"}.el-icon-folder-add:before{content:"\E783"}.el-icon-folder-opened:before{content:"\E784"}.el-icon-folder:before{content:"\E78A"}.el-icon-edit-outline:before{content:"\E764"}.el-icon-edit:before{content:"\E78C"}.el-icon-date:before{content:"\E78E"}.el-icon-c-scale-to-original:before{content:"\E7C6"}.el-icon-view:before{content:"\E6CE"}.el-icon-loading:before{content:"\E6CF"}.el-icon-rank:before{content:"\E6D1"}.el-icon-sort-down:before{content:"\E7C4"}.el-icon-sort-up:before{content:"\E7C5"}.el-icon-sort:before{content:"\E6D2"}.el-icon-finished:before{content:"\E6CD"}.el-icon-refresh-left:before{content:"\E6C7"}.el-icon-refresh-right:before{content:"\E6C8"}.el-icon-refresh:before{content:"\E6D0"}.el-icon-video-play:before{content:"\E7C0"}.el-icon-video-pause:before{content:"\E7C1"}.el-icon-d-arrow-right:before{content:"\E6DC"}.el-icon-d-arrow-left:before{content:"\E6DD"}.el-icon-arrow-up:before{content:"\E6E1"}.el-icon-arrow-down:before{content:"\E6DF"}.el-icon-arrow-right:before{content:"\E6E0"}.el-icon-arrow-left:before{content:"\E6DE"}.el-icon-top-right:before{content:"\E6E7"}.el-icon-top-left:before{content:"\E6E8"}.el-icon-top:before{content:"\E6E6"}.el-icon-bottom:before{content:"\E6EB"}.el-icon-right:before{content:"\E6E9"}.el-icon-back:before{content:"\E6EA"}.el-icon-bottom-right:before{content:"\E6EC"}.el-icon-bottom-left:before{content:"\E6ED"}.el-icon-caret-top:before{content:"\E78F"}.el-icon-caret-bottom:before{content:"\E790"}.el-icon-caret-right:before{content:"\E791"}.el-icon-caret-left:before{content:"\E792"}.el-icon-d-caret:before{content:"\E79A"}.el-icon-share:before{content:"\E793"}.el-icon-menu:before{content:"\E798"}.el-icon-s-grid:before{content:"\E7A6"}.el-icon-s-check:before{content:"\E7A7"}.el-icon-s-data:before{content:"\E7A8"}.el-icon-s-opportunity:before{content:"\E7AA"}.el-icon-s-custom:before{content:"\E7AB"}.el-icon-s-claim:before{content:"\E7AD"}.el-icon-s-finance:before{content:"\E7AE"}.el-icon-s-comment:before{content:"\E7AF"}.el-icon-s-flag:before{content:"\E7B0"}.el-icon-s-marketing:before{content:"\E7B1"}.el-icon-s-shop:before{content:"\E7B4"}.el-icon-s-open:before{content:"\E7B5"}.el-icon-s-management:before{content:"\E7B6"}.el-icon-s-ticket:before{content:"\E7B7"}.el-icon-s-release:before{content:"\E7B8"}.el-icon-s-home:before{content:"\E7B9"}.el-icon-s-promotion:before{content:"\E7BA"}.el-icon-s-operation:before{content:"\E7BB"}.el-icon-s-unfold:before{content:"\E7BC"}.el-icon-s-fold:before{content:"\E7A9"}.el-icon-s-platform:before{content:"\E7BD"}.el-icon-s-order:before{content:"\E7BE"}.el-icon-s-cooperation:before{content:"\E7BF"}.el-icon-bell:before{content:"\E725"}.el-icon-message-solid:before{content:"\E799"}.el-icon-video-camera:before{content:"\E772"}.el-icon-video-camera-solid:before{content:"\E796"}.el-icon-camera:before{content:"\E779"}.el-icon-camera-solid:before{content:"\E79B"}.el-icon-download:before{content:"\E77C"}.el-icon-upload2:before{content:"\E77B"}.el-icon-upload:before{content:"\E7C3"}.el-icon-picture-outline-round:before{content:"\E75F"}.el-icon-picture-outline:before{content:"\E75E"}.el-icon-picture:before{content:"\E79F"}.el-icon-close:before{content:"\E6DB"}.el-icon-check:before{content:"\E6DA"}.el-icon-plus:before{content:"\E6D9"}.el-icon-minus:before{content:"\E6D8"}.el-icon-help:before{content:"\E73D"}.el-icon-s-help:before{content:"\E7B3"}.el-icon-circle-close:before{content:"\E78D"}.el-icon-circle-check:before{content:"\E720"}.el-icon-circle-plus-outline:before{content:"\E723"}.el-icon-remove-outline:before{content:"\E722"}.el-icon-zoom-out:before{content:"\E776"}.el-icon-zoom-in:before{content:"\E777"}.el-icon-error:before{content:"\E79D"}.el-icon-success:before{content:"\E79C"}.el-icon-circle-plus:before{content:"\E7A0"}.el-icon-remove:before{content:"\E7A2"}.el-icon-info:before{content:"\E7A1"}.el-icon-question:before{content:"\E7A4"}.el-icon-warning-outline:before{content:"\E6C9"}.el-icon-warning:before{content:"\E7A3"}.el-icon-goods:before{content:"\E7C2"}.el-icon-s-goods:before{content:"\E7B2"}.el-icon-star-off:before{content:"\E717"}.el-icon-star-on:before{content:"\E797"}.el-icon-more-outline:before{content:"\E6CC"}.el-icon-more:before{content:"\E794"}.el-icon-phone-outline:before{content:"\E6CB"}.el-icon-phone:before{content:"\E795"}.el-icon-user:before{content:"\E6E3"}.el-icon-user-solid:before{content:"\E7A5"}.el-icon-setting:before{content:"\E6CA"}.el-icon-s-tools:before{content:"\E7AC"}.el-icon-delete:before{content:"\E6D7"}.el-icon-delete-solid:before{content:"\E7C9"}.el-icon-eleme:before{content:"\E7C7"}.el-icon-platform-eleme:before{content:"\E7CA"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.el-pagination{white-space:nowrap;padding:2px 5px;color:#303133;font-weight:700}.el-pagination:after,.el-pagination:before{display:table;content:""}.el-pagination:after{clear:both}.el-pagination button,.el-pagination span:not([class*=suffix]){display:inline-block;font-size:13px;min-width:35.5px;height:28px;line-height:28px;vertical-align:top;-webkit-box-sizing:border-box;box-sizing:border-box}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield;line-height:normal}.el-pagination .el-input__suffix{right:0;-webkit-transform:scale(.8);transform:scale(.8)}.el-pagination .el-select .el-input{width:100px;margin:0 5px}.el-pagination .el-select .el-input .el-input__inner{padding-right:25px;border-radius:3px}.el-pagination button{border:none;padding:0 6px;background:transparent}.el-pagination button:focus{outline:none}.el-pagination button:hover{color:#1890ff}.el-pagination button:disabled{color:#c0c4cc;background-color:#fff;cursor:not-allowed}.el-pagination .btn-next,.el-pagination .btn-prev{background:50% no-repeat;background-size:16px;background-color:#fff;cursor:pointer;margin:0;color:#303133}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700}.el-pagination .btn-prev{padding-right:12px}.el-pagination .btn-next{padding-left:12px}.el-pagination .el-pager li.disabled{color:#c0c4cc;cursor:not-allowed}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li,.el-pagination--small .el-pager li.btn-quicknext,.el-pagination--small .el-pager li.btn-quickprev,.el-pagination--small .el-pager li:last-child{border-color:transparent;font-size:12px;line-height:22px;height:22px;min-width:22px}.el-pagination--small .arrow.disabled{visibility:hidden}.el-pagination--small .more:before,.el-pagination--small li.more:before{line-height:24px}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){height:22px;line-height:22px}.el-pagination--small .el-pagination__editor,.el-pagination--small .el-pagination__editor.el-input .el-input__inner{height:22px}.el-pagination__sizes{margin:0 10px 0 0;font-weight:400;color:#606266}.el-pagination__sizes .el-input .el-input__inner{font-size:13px;padding-left:8px}.el-pagination__sizes .el-input .el-input__inner:hover{border-color:#1890ff}.el-pagination__total{margin-right:10px;font-weight:400;color:#606266}.el-pagination__jump{margin-left:24px;font-weight:400;color:#606266}.el-pagination__jump .el-input__inner{padding:0 3px}.el-pagination__rightwrapper{float:right}.el-pagination__editor{line-height:18px;padding:0 2px;height:28px;text-align:center;margin:0 2px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:3px}.el-pagination__editor.el-input{width:50px}.el-pagination__editor.el-input .el-input__inner{height:28px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 5px;background-color:#f4f4f5;color:#606266;min-width:30px;border-radius:2px}.el-pagination.is-background .btn-next.disabled,.el-pagination.is-background .btn-prev.disabled,.el-pagination.is-background .el-pager li.disabled{color:#c0c4cc}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev{padding:0}.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev:disabled{color:#c0c4cc}.el-pagination.is-background .el-pager li:not(.disabled):hover{color:#1890ff}.el-pagination.is-background .el-pager li:not(.disabled).active{background-color:#1890ff;color:#fff}.el-pagination.is-background.el-pagination--small .btn-next,.el-pagination.is-background.el-pagination--small .btn-prev,.el-pagination.is-background.el-pagination--small .el-pager li{margin:0 3px;min-width:22px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;display:inline-block;vertical-align:top;font-size:0;padding:0;margin:0}.el-pager .more:before{line-height:30px}.el-pager li{padding:0 4px;background:#fff;vertical-align:top;display:inline-block;font-size:13px;min-width:35.5px;height:28px;line-height:28px;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;margin:0}.el-pager li.btn-quicknext,.el-pager li.btn-quickprev{line-height:28px;color:#303133}.el-pager li.btn-quicknext.disabled,.el-pager li.btn-quickprev.disabled{color:#c0c4cc}.el-pager li.btn-quicknext:hover,.el-pager li.btn-quickprev:hover{cursor:pointer}.el-pager li.active+li{border-left:0}.el-pager li:hover{color:#1890ff}.el-pager li.active{color:#1890ff;cursor:default}@-webkit-keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}.el-dialog{margin:0 auto 50px;background:#fff;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.el-dialog.is-fullscreen{width:100%;margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog__header{padding:20px;padding-bottom:10px}.el-dialog__headerbtn{position:absolute;top:20px;right:20px;padding:0;background:transparent;border:none;outline:none;cursor:pointer;font-size:16px}.el-dialog__headerbtn .el-dialog__close{color:#909399}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:#1890ff}.el-dialog__title{line-height:24px;font-size:18px;color:#303133}.el-dialog__body{padding:30px 20px;color:#606266;font-size:14px;word-break:break-all}.el-dialog__footer{padding:20px;padding-top:10px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px 25px 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.dialog-fade-enter-active{-webkit-animation:dialog-fade-in .3s;animation:dialog-fade-in .3s}.dialog-fade-leave-active{-webkit-animation:dialog-fade-out .3s;animation:dialog-fade-out .3s}@-webkit-keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete-suggestion{margin:5px 0;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:4px;border:1px solid #dfe4ed;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:#606266;font-size:14px;list-style:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li.highlighted,.el-autocomplete-suggestion li:hover{background-color:#f5f7fa}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid #000}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:#999}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:#fff}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-dropdown{display:inline-block;position:relative;color:#606266;font-size:14px}.el-dropdown .el-button-group{display:block}.el-dropdown .el-button-group .el-button{float:none}.el-dropdown .el-dropdown__caret-button{padding-left:5px;padding-right:5px;position:relative;border-left:none}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:5px;bottom:5px;left:0;background:hsla(0,0%,100%,.5)}.el-dropdown .el-dropdown__caret-button.el-button--default:before{background:rgba(220,223,230,.5)}.el-dropdown .el-dropdown__caret-button:hover:not(.is-disabled):before{top:0;bottom:0}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{padding-left:0}.el-dropdown__icon{font-size:12px;margin:0 3px}.el-dropdown .el-dropdown-selfdefine:focus:active,.el-dropdown .el-dropdown-selfdefine:focus:not(.focusing){outline-width:0}.el-dropdown [disabled]{cursor:not-allowed;color:#bbb}.el-dropdown-menu{position:absolute;top:0;left:0;z-index:10;padding:10px 0;margin:5px 0;background-color:#fff;border:1px solid #e6ebf5;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-dropdown-menu__item{list-style:none;line-height:36px;padding:0 20px;margin:0;font-size:14px;color:#606266;cursor:pointer;outline:none}.el-dropdown-menu__item:focus,.el-dropdown-menu__item:not(.is-disabled):hover{background-color:#e8f4ff;color:#46a6ff}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{position:relative;margin-top:6px;border-top:1px solid #e6ebf5}.el-dropdown-menu__item--divided:before{content:"";height:6px;display:block;margin:0 -20px;background-color:#fff}.el-dropdown-menu__item.is-disabled{cursor:default;color:#bbb;pointer-events:none}.el-dropdown-menu--medium{padding:6px 0}.el-dropdown-menu--medium .el-dropdown-menu__item{line-height:30px;padding:0 17px;font-size:14px}.el-dropdown-menu--medium .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:6px}.el-dropdown-menu--medium .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:6px;margin:0 -17px}.el-dropdown-menu--small{padding:6px 0}.el-dropdown-menu--small .el-dropdown-menu__item{line-height:27px;padding:0 15px;font-size:13px}.el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:4px}.el-dropdown-menu--small .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:4px;margin:0 -15px}.el-dropdown-menu--mini{padding:3px 0}.el-dropdown-menu--mini .el-dropdown-menu__item{line-height:24px;padding:0 10px;font-size:12px}.el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided{margin-top:3px}.el-dropdown-menu--mini .el-dropdown-menu__item.el-dropdown-menu__item--divided:before{height:3px;margin:0 -10px}.el-menu{border-right:1px solid #e6e6e6;list-style:none;position:relative;margin:0;padding-left:0;background-color:#fff}.el-menu:after,.el-menu:before{display:table;content:""}.el-menu:after{clear:both}.el-menu.el-menu--horizontal{border-bottom:1px solid #e6e6e6}.el-menu--horizontal{border-right:none}.el-menu--horizontal>.el-menu-item{float:left;height:60px;line-height:60px;margin:0;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-submenu{float:left}.el-menu--horizontal>.el-submenu:focus,.el-menu--horizontal>.el-submenu:hover{outline:none}.el-menu--horizontal>.el-submenu:focus .el-submenu__title,.el-menu--horizontal>.el-submenu:hover .el-submenu__title{color:#303133}.el-menu--horizontal>.el-submenu.is-active .el-submenu__title{border-bottom:2px solid #1890ff;color:#303133}.el-menu--horizontal>.el-submenu .el-submenu__title{height:60px;line-height:60px;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-submenu .el-submenu__title:hover{background-color:#fff}.el-menu--horizontal>.el-submenu .el-submenu__icon-arrow{position:static;vertical-align:middle;margin-left:8px;margin-top:-3px}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-submenu__title{background-color:#fff;float:none;height:36px;line-height:36px;padding:0 10px;color:#909399}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-submenu.is-active>.el-submenu__title{color:#303133}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:none;color:#303133}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid #1890ff;color:#303133}.el-menu--collapse{width:64px}.el-menu--collapse>.el-menu-item [class^=el-icon-],.el-menu--collapse>.el-submenu>.el-submenu__title [class^=el-icon-]{margin:0;vertical-align:middle;width:24px;text-align:center}.el-menu--collapse>.el-menu-item .el-submenu__icon-arrow,.el-menu--collapse>.el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item span,.el-menu--collapse>.el-submenu>.el-submenu__title span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-submenu{min-width:200px}.el-menu--collapse .el-submenu{position:relative}.el-menu--collapse .el-submenu .el-menu{position:absolute;margin-left:5px;top:0;left:100%;z-index:10;border:1px solid #dfe4ed;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--collapse .el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:none;transform:none}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--popup-bottom-start{margin-top:5px}.el-menu--popup-right-start{margin-left:5px;margin-right:5px}.el-menu-item{height:56px;line-height:56px;font-size:14px;color:#303133;padding:0 20px;list-style:none;cursor:pointer;position:relative;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:middle}.el-menu-item i{color:#909399}.el-menu-item:focus,.el-menu-item:hover{outline:none;background-color:#e8f4ff}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:none!important}.el-menu-item [class^=el-icon-]{margin-right:5px;width:24px;text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:#1890ff}.el-menu-item.is-active i{color:inherit}.el-submenu{list-style:none;margin:0;padding-left:0}.el-submenu__title{height:56px;line-height:56px;font-size:14px;color:#303133;padding:0 20px;list-style:none;cursor:pointer;position:relative;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-submenu__title *{vertical-align:middle}.el-submenu__title i{color:#909399}.el-submenu__title:focus,.el-submenu__title:hover{outline:none;background-color:#e8f4ff}.el-submenu__title.is-disabled{opacity:.25;cursor:not-allowed;background:none!important}.el-submenu__title:hover{background-color:#e8f4ff}.el-submenu .el-menu{border:none}.el-submenu .el-menu-item{height:50px;line-height:50px;padding:0 45px;min-width:200px}.el-submenu__icon-arrow{position:absolute;top:50%;right:20px;margin-top:-7px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:12px}.el-submenu.is-active .el-submenu__title{border-bottom-color:#1890ff}.el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.el-submenu.is-disabled .el-menu-item,.el-submenu.is-disabled .el-submenu__title{opacity:.25;cursor:not-allowed;background:none!important}.el-submenu [class^=el-icon-]{vertical-align:middle;margin-right:5px;width:24px;text-align:center;font-size:18px}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px 20px;line-height:normal;font-size:12px;color:#909399}.horizontal-collapse-transition .el-submenu__title .el-submenu__icon-arrow{-webkit-transition:.2s;transition:.2s;opacity:0}.el-radio-group{display:inline-block;line-height:1;vertical-align:middle;font-size:0}.el-radio-button,.el-radio-button__inner{position:relative;display:inline-block;outline:none}.el-radio-button__inner{line-height:1;white-space:nowrap;vertical-align:middle;background:#fff;border:1px solid #dcdfe6;font-weight:400;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-radio-button__inner.is-round{padding:12px 20px}.el-radio-button__inner:hover{color:#1890ff}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:1px solid #dcdfe6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-radio-button__orig-radio{opacity:0;outline:none;position:absolute;z-index:-1}.el-radio-button__orig-radio:checked+.el-radio-button__inner{color:#fff;background-color:#1890ff;border-color:#1890ff;-webkit-box-shadow:-1px 0 0 0 #1890ff;box-shadow:-1px 0 0 0 #1890ff}.el-radio-button__orig-radio:disabled+.el-radio-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#e6ebf5;-webkit-box-shadow:none;box-shadow:none}.el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner{background-color:#f2f6fc}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 4px 4px 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:4px}.el-radio-button--medium .el-radio-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-radio-button--medium .el-radio-button__inner.is-round{padding:10px 20px}.el-radio-button--small .el-radio-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:9px 15px}.el-radio-button--mini .el-radio-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-radio-button--mini .el-radio-button__inner.is-round{padding:7px 15px}.el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled){-webkit-box-shadow:0 0 2px 2px #1890ff;box-shadow:0 0 2px 2px #1890ff}.el-switch{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:14px;line-height:20px;height:20px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{-webkit-transition:.2s;transition:.2s;height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:#303133}.el-switch__label.is-active{color:#1890ff}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__core{margin:0;display:inline-block;position:relative;width:40px;height:20px;border:1px solid #dcdfe6;outline:none;border-radius:10px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#dcdfe6;cursor:pointer;-webkit-transition:border-color .3s,background-color .3s;transition:border-color .3s,background-color .3s;vertical-align:middle}.el-switch__core:after{content:"";position:absolute;top:1px;left:1px;border-radius:100%;-webkit-transition:all .3s;transition:all .3s;width:16px;height:16px;background-color:#fff}.el-switch.is-checked .el-switch__core{border-color:#1890ff;background-color:#1890ff}.el-switch.is-checked .el-switch__core:after{left:100%;margin-left:-17px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter,.el-switch .label-fade-leave-active{opacity:0}.el-select-dropdown{position:absolute;z-index:1001;border:1px solid #dfe4ed;border-radius:4px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0}.el-select-dropdown.is-multiple .el-select-dropdown__item{padding-right:40px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:#1890ff;background-color:#fff}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:#f5f7fa}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{position:absolute;right:20px;font-family:element-icons;content:"\E6DA";font-size:12px;font-weight:700;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:#999;font-size:14px}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-select-dropdown__item{font-size:14px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#606266;height:34px;line-height:34px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-select-dropdown__item.is-disabled:hover{background-color:#fff}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:#f5f7fa}.el-select-dropdown__item.selected{color:#1890ff;font-weight:700}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:#dfe4ed}.el-select-group__title{padding-left:20px;font-size:12px;color:#909399;line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select{display:inline-block;position:relative}.el-select .el-select__tags>span{display:contents}.el-select:hover .el-input__inner{border-color:#c0c4cc}.el-select .el-input__inner{cursor:pointer;padding-right:35px}.el-select .el-input__inner:focus{border-color:#1890ff}.el-select .el-input .el-select__caret{color:#c0c4cc;font-size:14px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:rotate(180deg);transform:rotate(180deg);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:14px;text-align:center;-webkit-transform:rotate(180deg);transform:rotate(180deg);border-radius:100%;color:#c0c4cc;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-select .el-input .el-select__caret.is-show-close:hover{color:#909399}.el-select .el-input.is-disabled .el-input__inner{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__inner:hover{border-color:#dfe4ed}.el-select .el-input.is-focus .el-input__inner{border-color:#1890ff}.el-select>.el-input{display:block}.el-select__input{border:none;outline:none;padding:0;margin-left:15px;color:#666;font-size:14px;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-mini{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:1000;right:25px;color:#c0c4cc;line-height:18px;font-size:14px}.el-select__close:hover{color:#909399}.el-select__tags{position:absolute;line-height:normal;white-space:normal;z-index:1;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-select__tags-text{overflow:hidden;text-overflow:ellipsis}.el-select .el-tag{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:#f0f2f5;display:-webkit-box;display:-ms-flexbox;display:flex;max-width:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-select .el-tag__close.el-icon-close{background-color:#c0c4cc;top:0;color:#fff;-ms-flex-negative:0;flex-shrink:0}.el-select .el-tag__close.el-icon-close:hover{background-color:#909399}.el-select .el-tag__close.el-icon-close:before{display:block;-webkit-transform:translateY(.5px);transform:translateY(.5px)}.el-table{position:relative;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex:1;flex:1;width:100%;max-width:100%;background-color:#fff;font-size:14px;color:#606266}.el-table__empty-block{min-height:60px;text-align:center;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:#909399}.el-table__expand-column .cell{padding:0;text-align:center}.el-table__expand-icon{position:relative;cursor:pointer;color:#666;font-size:12px;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;height:20px}.el-table__expand-icon--expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-table__expand-icon>.el-icon{position:absolute;left:50%;top:50%;margin-left:-5px;margin-top:-5px}.el-table__expanded-cell{background-color:#fff}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table--scrollable-x .el-table__body-wrapper{overflow-x:auto}.el-table--scrollable-y .el-table__body-wrapper{overflow-y:auto}.el-table thead{color:#909399;font-weight:500}.el-table thead.is-group th.el-table__cell{background:#f5f7fa}.el-table .el-table__cell{padding:12px 0;min-width:0;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table--medium .el-table__cell{padding:10px 0}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:8px 0}.el-table--mini{font-size:12px}.el-table--mini .el-table__cell{padding:6px 0}.el-table tr{background-color:#fff}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:1px solid #dfe6ec}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}.el-table th.el-table__cell>.cell{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;vertical-align:middle;padding-left:10px;padding-right:10px;width:100%}.el-table th.el-table__cell>.cell.highlight{color:#1890ff}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{-webkit-box-sizing:border-box;box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table .cell{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding-left:10px;padding-right:10px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--border,.el-table--group{border:1px solid #dfe6ec}.el-table--border:after,.el-table--group:after,.el-table:before{content:"";position:absolute;background-color:#e6ebf5;z-index:1}.el-table--border:after,.el-table--group:after{top:0;right:0;width:1px;height:100%}.el-table:before{left:0;bottom:0;width:100%;height:1px}.el-table--border{border-right:none;border-bottom:none}.el-table--border.el-loading-parent--relative{border-color:transparent}.el-table--border .el-table__cell{border-right:1px solid #dfe6ec}.el-table--border .el-table__cell:first-child .cell{padding-left:10px}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:1px solid #dfe6ec;border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:1px solid #dfe6ec}.el-table--hidden{visibility:hidden}.el-table__fixed,.el-table__fixed-right{position:absolute;top:0;left:0;overflow-x:hidden;overflow-y:hidden;-webkit-box-shadow:0 0 10px rgba(0,0,0,.12);box-shadow:0 0 10px rgba(0,0,0,.12)}.el-table__fixed-right:before,.el-table__fixed:before{content:"";position:absolute;left:0;bottom:0;width:100%;height:1px;background-color:#e6ebf5;z-index:4}.el-table__fixed-right-patch{position:absolute;top:-1px;right:0;background-color:#fff;border-bottom:1px solid #dfe6ec}.el-table__fixed-right{top:0;left:auto;right:0}.el-table__fixed-right .el-table__fixed-body-wrapper,.el-table__fixed-right .el-table__fixed-footer-wrapper,.el-table__fixed-right .el-table__fixed-header-wrapper{left:auto;right:0}.el-table__fixed-header-wrapper{position:absolute;left:0;top:0;z-index:3}.el-table__fixed-footer-wrapper{position:absolute;left:0;bottom:0;z-index:3}.el-table__fixed-footer-wrapper tbody td.el-table__cell{border-top:1px solid #dfe6ec;background-color:#f5f7fa;color:#606266}.el-table__fixed-body-wrapper{position:absolute;left:0;top:37px;overflow:hidden;z-index:3}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__footer-wrapper{margin-top:-1px}.el-table__footer-wrapper td.el-table__cell{border-top:1px solid #dfe6ec}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:#f5f7fa;color:#606266}.el-table__body-wrapper{overflow:hidden;position:relative}.el-table__body-wrapper.is-scrolling-left~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right,.el-table__body-wrapper.is-scrolling-right~.el-table__fixed-right{-webkit-box-shadow:none;box-shadow:none}.el-table__body-wrapper .el-table--border.is-scrolling-right~.el-table__fixed-right{border-left:1px solid #dfe6ec}.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:1px solid #dfe6ec}.el-table .caret-wrapper{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:5px solid transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:#c0c4cc;top:5px}.el-table .sort-caret.descending{border-top-color:#c0c4cc;bottom:7px}.el-table .ascending .sort-caret.ascending{border-bottom-color:#1890ff}.el-table .descending .sort-caret.descending{border-top-color:#1890ff}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:#fafafa}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:#e8f4ff}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:#f5f7fa}.el-table__body tr.current-row>td.el-table__cell{background-color:#e8f4ff}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:1px solid #dfe6ec;z-index:10}.el-table__column-filter-trigger{display:inline-block;line-height:34px;cursor:pointer}.el-table__column-filter-trigger i{color:#909399;font-size:12px;-webkit-transform:scale(.75);transform:scale(.75)}.el-table--enable-row-transition .el-table__body td.el-table__cell{-webkit-transition:background-color .25s ease;transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:#f5f7fa}.el-table--fluid-height .el-table__fixed,.el-table--fluid-height .el-table__fixed-right{bottom:0;overflow:hidden}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:20px;line-height:20px;height:20px;text-align:center;margin-right:3px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:1px solid #e6ebf5;border-radius:2px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:2px 0}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:14px}.el-table-filter__list-item:hover{background-color:#e8f4ff;color:#46a6ff}.el-table-filter__list-item.is-active{background-color:#1890ff;color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid #e6ebf5;padding:8px}.el-table-filter__bottom button{background:transparent;border:none;color:#606266;cursor:pointer;font-size:13px;padding:0 3px}.el-table-filter__bottom button:hover{color:#1890ff}.el-table-filter__bottom button:focus{outline:none}.el-table-filter__bottom button.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:block;margin-right:5px;margin-bottom:8px;margin-left:5px}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover div{background-color:#f2f6fc}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:#606266}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current div{background-color:#f2f6fc}.el-date-table td{width:32px;padding:4px 0;text-align:center;cursor:pointer;position:relative}.el-date-table td,.el-date-table td div{height:30px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-table td div{padding:3px 0}.el-date-table td span{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:#c0c4cc}.el-date-table td.today{position:relative}.el-date-table td.today span{color:#1890ff;font-weight:700}.el-date-table td.today.end-date span,.el-date-table td.today.start-date span{color:#fff}.el-date-table td.available:hover{color:#1890ff}.el-date-table td.in-range div,.el-date-table td.in-range div:hover{background-color:#f2f6fc}.el-date-table td.current:not(.disabled) span{color:#fff;background-color:#1890ff}.el-date-table td.end-date div,.el-date-table td.start-date div{color:#fff}.el-date-table td.end-date span,.el-date-table td.start-date span{background-color:#1890ff}.el-date-table td.start-date div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled div{background-color:#f5f7fa;opacity:1;cursor:not-allowed;color:#c0c4cc}.el-date-table td.selected div{margin-left:5px;margin-right:5px;background-color:#f2f6fc;border-radius:15px}.el-date-table td.selected div:hover{background-color:#f2f6fc}.el-date-table td.selected span{background-color:#1890ff;color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:#606266}.el-date-table th{padding:5px;color:#606266;font-weight:400;border-bottom:1px solid #e6ebf5}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-month-table td.today .cell{color:#1890ff;font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:#f5f7fa;cursor:not-allowed;color:#c0c4cc}.el-month-table td.disabled .cell:hover{color:#c0c4cc}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:#606266;margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:#1890ff}.el-month-table td.in-range div,.el-month-table td.in-range div:hover{background-color:#f2f6fc}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:#1890ff}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:#1890ff}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:#303133}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:#1890ff;font-weight:700}.el-year-table td.disabled .cell{background-color:#f5f7fa;cursor:not-allowed;color:#c0c4cc}.el-year-table td.disabled .cell:hover{color:#c0c4cc}.el-year-table td .cell{width:48px;height:32px;display:block;line-height:32px;color:#606266;margin:0 auto}.el-year-table td .cell:hover,.el-year-table td.current:not(.disabled) .cell{color:#1890ff}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid #e4e4e4}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{-webkit-box-sizing:border-box;box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:#303133}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:1px solid #e6ebf5}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:#606266}.el-date-picker__header-label.active,.el-date-picker__header-label:hover{color:#1890ff}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.selected:not(.disabled){color:#1890ff;font-weight:700}.time-select-item.disabled{color:#dfe4ed;cursor:not-allowed}.time-select-item:hover{background-color:#f5f7fa;font-weight:700;cursor:pointer}.el-date-editor{position:relative;display:inline-block;text-align:left}.el-date-editor.el-input,.el-date-editor.el-input__inner{width:220px}.el-date-editor--monthrange.el-input,.el-date-editor--monthrange.el-input__inner{width:300px}.el-date-editor--daterange.el-input,.el-date-editor--daterange.el-input__inner,.el-date-editor--timerange.el-input,.el-date-editor--timerange.el-input__inner{width:350px}.el-date-editor--datetimerange.el-input,.el-date-editor--datetimerange.el-input__inner{width:400px}.el-date-editor--dates .el-input__inner{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .el-icon-circle-close{cursor:pointer}.el-date-editor .el-range__icon{font-size:14px;margin-left:-5px;color:#c0c4cc;float:left;line-height:32px}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:none;display:inline-block;height:100%;margin:0;padding:0;width:39%;text-align:center;font-size:14px;color:#606266}.el-date-editor .el-range-input::-webkit-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::-moz-placeholder{color:#c0c4cc}.el-date-editor .el-range-input:-ms-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::-ms-input-placeholder{color:#c0c4cc}.el-date-editor .el-range-input::placeholder{color:#c0c4cc}.el-date-editor .el-range-separator{display:inline-block;height:100%;padding:0 5px;margin:0;text-align:center;line-height:32px;font-size:14px;width:5%;color:#303133}.el-date-editor .el-range__close-icon{font-size:14px;color:#c0c4cc;width:25px;display:inline-block;float:right;line-height:32px}.el-range-editor.el-input__inner{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px 10px}.el-range-editor .el-range-input{line-height:1}.el-range-editor.is-active,.el-range-editor.is-active:hover{border-color:#1890ff}.el-range-editor--medium.el-input__inner{height:36px}.el-range-editor--medium .el-range-separator{line-height:28px;font-size:14px}.el-range-editor--medium .el-range-input{font-size:14px}.el-range-editor--medium .el-range__close-icon,.el-range-editor--medium .el-range__icon{line-height:28px}.el-range-editor--small.el-input__inner{height:32px}.el-range-editor--small .el-range-separator{line-height:24px;font-size:13px}.el-range-editor--small .el-range-input{font-size:13px}.el-range-editor--small .el-range__close-icon,.el-range-editor--small .el-range__icon{line-height:24px}.el-range-editor--mini.el-input__inner{height:28px}.el-range-editor--mini .el-range-separator{line-height:20px;font-size:12px}.el-range-editor--mini .el-range-input{font-size:12px}.el-range-editor--mini .el-range__close-icon,.el-range-editor--mini .el-range__icon{line-height:20px}.el-range-editor.is-disabled{background-color:#f5f7fa;border-color:#dfe4ed;color:#c0c4cc;cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:#dfe4ed}.el-range-editor.is-disabled input{background-color:#f5f7fa;color:#c0c4cc;cursor:not-allowed}.el-range-editor.is-disabled input::-webkit-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::-moz-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input:-ms-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::-ms-input-placeholder{color:#c0c4cc}.el-range-editor.is-disabled input::placeholder{color:#c0c4cc}.el-range-editor.is-disabled .el-range-separator{color:#c0c4cc}.el-picker-panel{color:#606266;border:1px solid #dfe4ed;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);background:#fff;border-radius:4px;line-height:30px;margin:5px 0}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid #e4e4e4;padding:4px;text-align:right;background-color:#fff;position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:#606266;padding-left:12px;text-align:left;outline:none;cursor:pointer}.el-picker-panel__shortcut:hover{color:#1890ff}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:#1890ff}.el-picker-panel__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:none;font-size:12px}.el-picker-panel__btn[disabled]{color:#ccc;cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:#303133;border:0;background:transparent;cursor:pointer;outline:none;margin-top:8px}.el-picker-panel__icon-btn:hover{color:#1890ff}.el-picker-panel__icon-btn.is-disabled{color:#bbb}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid #e4e4e4;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;background-color:#fff;overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:190px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{-webkit-transform:translateY(-32px);transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.disabled):not(.active){background:#fff;cursor:default}.el-time-spinner__arrow{font-size:12px;color:#909399;position:absolute;left:0;width:100%;z-index:1;text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:#1890ff}.el-time-spinner__arrow.el-icon-arrow-up{top:10px}.el-time-spinner__arrow.el-icon-arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner,.el-time-spinner__list{padding:0;text-align:center}.el-time-spinner__list{margin:0;list-style:none}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:#606266}.el-time-spinner__item:hover:not(.disabled):not(.active){background:#f5f7fa;cursor:pointer}.el-time-spinner__item.active:not(.disabled){color:#303133;font-weight:700}.el-time-spinner__item.disabled{color:#c0c4cc;cursor:not-allowed}.el-time-panel{margin:5px 0;border:1px solid #dfe4ed;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:2px;position:absolute;width:180px;left:0;z-index:1000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:content-box;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-15px;height:32px;z-index:-1;left:0;right:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;text-align:left;border-top:1px solid #dfe4ed;border-bottom:1px solid #dfe4ed}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid #e4e4e4;padding:4px;height:36px;line-height:25px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:none;font-size:12px;color:#303133}.el-time-panel__btn.confirm{font-weight:800;color:#1890ff}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px}.el-time-range-picker__cell{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid #dfe4ed}.el-popover{position:absolute;background:#fff;min-width:150px;border-radius:4px;border:1px solid #e6ebf5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);word-break:break-all}.el-popover--plain{padding:18px 20px}.el-popover__title{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.el-popover:focus,.el-popover:focus:active,.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.v-modal-enter{-webkit-animation:v-modal-in .2s ease;animation:v-modal-in .2s ease}.v-modal-leave{-webkit-animation:v-modal-out .2s ease forwards;animation:v-modal-out .2s ease forwards}@keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000}.el-popup-parent--hidden{overflow:hidden}.el-message-box{display:inline-block;width:420px;padding-bottom:10px;vertical-align:middle;background-color:#fff;border-radius:4px;border:1px solid #e6ebf5;font-size:18px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden}.el-message-box__wrapper{position:fixed;top:0;bottom:0;left:0;right:0;text-align:center}.el-message-box__wrapper:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box__header{position:relative;padding:15px;padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:18px;line-height:1;color:#303133}.el-message-box__headerbtn{position:absolute;top:15px;right:15px;padding:0;border:none;outline:none;background:transparent;font-size:16px;cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:#909399}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:#1890ff}.el-message-box__content{padding:10px 15px;color:#606266;font-size:14px}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input input.invalid,.el-message-box__input input.invalid:focus{border-color:#ff4949}.el-message-box__status{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px}.el-message-box__status.el-icon-success{color:#13ce66}.el-message-box__status.el-icon-info{color:#909399}.el-message-box__status.el-icon-warning{color:#ffba00}.el-message-box__status.el-icon-error{color:#ff4949}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:#ff4949;font-size:12px;min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;text-align:right}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.el-message-box--center{padding-bottom:30px}.el-message-box--center .el-message-box__header{padding-top:30px}.el-message-box--center .el-message-box__title{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns,.el-message-box--center .el-message-box__content{text-align:center}.el-message-box--center .el-message-box__content{padding-left:27px;padding-right:27px}.msgbox-fade-enter-active{-webkit-animation:msgbox-fade-in .3s;animation:msgbox-fade-in .3s}.msgbox-fade-leave-active{-webkit-animation:msgbox-fade-out .3s;animation:msgbox-fade-out .3s}@-webkit-keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:#c0c4cc}.el-breadcrumb__separator[class*=icon]{margin:0 6px;font-weight:400}.el-breadcrumb__item{float:left}.el-breadcrumb__inner{color:#606266}.el-breadcrumb__inner.is-link,.el-breadcrumb__inner a{font-weight:700;text-decoration:none;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1);color:#303133}.el-breadcrumb__inner.is-link:hover,.el-breadcrumb__inner a:hover{color:#1890ff;cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover{font-weight:400;color:#606266;cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-form--label-left .el-form-item__label{text-align:left}.el-form--label-top .el-form-item__label{float:none;display:inline-block;text-align:left;padding:0 0 10px 0}.el-form--inline .el-form-item{display:inline-block;margin-right:10px;vertical-align:top}.el-form--inline .el-form-item__label{float:none;display:inline-block}.el-form--inline .el-form-item__content{display:inline-block;vertical-align:top}.el-form--inline.el-form--label-top .el-form-item__content{display:block}.el-form-item{margin-bottom:22px}.el-form-item:after,.el-form-item:before{display:table;content:""}.el-form-item:after{clear:both}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--medium .el-form-item__content,.el-form-item--medium .el-form-item__label{line-height:36px}.el-form-item--small .el-form-item__content,.el-form-item--small .el-form-item__label{line-height:32px}.el-form-item--small.el-form-item{margin-bottom:18px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item--mini .el-form-item__content,.el-form-item--mini .el-form-item__label{line-height:28px}.el-form-item--mini.el-form-item{margin-bottom:18px}.el-form-item--mini .el-form-item__error{padding-top:1px}.el-form-item__label-wrap{float:left}.el-form-item__label-wrap .el-form-item__label{display:inline-block;float:none}.el-form-item__label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#606266;line-height:40px;padding:0 12px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-form-item__content{line-height:40px;position:relative;font-size:14px}.el-form-item__content:after,.el-form-item__content:before{display:table;content:""}.el-form-item__content:after{clear:both}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:#ff4949;font-size:12px;line-height:1;padding-top:4px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{content:"*";color:#ff4949;margin-right:4px}.el-form-item.is-error .el-input__inner,.el-form-item.is-error .el-input__inner:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{border-color:#ff4949}.el-form-item.is-error .el-input-group__append .el-input__inner,.el-form-item.is-error .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-error .el-input__validateIcon{color:#ff4949}.el-form-item--feedback .el-input__validateIcon{display:inline-block}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:#1890ff;z-index:1;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);list-style:none}.el-tabs__new-tab{float:right;border:1px solid #d3dce6;height:18px;width:18px;line-height:18px;margin:12px 0 9px 10px;border-radius:3px;text-align:center;font-size:12px;color:#d3dce6;cursor:pointer;-webkit-transition:all .15s;transition:all .15s}.el-tabs__new-tab .el-icon-plus{-webkit-transform:scale(.8);transform:scale(.8)}.el-tabs__new-tab:hover{color:#1890ff}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:#dfe4ed;z-index:1}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:#909399}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{white-space:nowrap;position:relative;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;float:left;z-index:2}.el-tabs__nav.is-stretch{min-width:100%;display:-webkit-box;display:-ms-flexbox;display:flex}.el-tabs__nav.is-stretch>*{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:40px;display:inline-block;list-style:none;font-size:14px;font-weight:500;color:#303133;position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:none}.el-tabs__item:focus.is-active.is-focus:not(:active){-webkit-box-shadow:0 0 2px 2px #1890ff inset;box-shadow:inset 0 0 2px 2px #1890ff;border-radius:3px}.el-tabs__item .el-icon-close{border-radius:50%;text-align:center;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);margin-left:5px}.el-tabs__item .el-icon-close:before{-webkit-transform:scale(.9);transform:scale(.9);display:inline-block}.el-tabs__item .el-icon-close:hover{background-color:#c0c4cc;color:#fff}.el-tabs__item.is-active{color:#1890ff}.el-tabs__item:hover{color:#1890ff;cursor:pointer}.el-tabs__item.is-disabled{color:#c0c4cc;cursor:default}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid #dfe4ed}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid #dfe4ed;border-bottom:none;border-radius:4px 4px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close{position:relative;font-size:12px;width:0;height:14px;vertical-align:middle;line-height:15px;overflow:hidden;top:-1px;right:-2px;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid #dfe4ed;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .el-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:#fff}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .el-icon-close{width:14px}.el-tabs--border-card{background:#fff;border:1px solid #dcdfe6;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04);box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:#f5f7fa;border-bottom:1px solid #dfe4ed;margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);border:1px solid transparent;margin-top:-1px;color:#909399}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item,.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:#1890ff;background-color:#fff;border-right-color:#dcdfe6;border-left-color:#dcdfe6}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:#1890ff}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:#c0c4cc}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid #dcdfe6}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{float:none}.el-tabs--left .el-tabs__item.is-left,.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-right{display:block}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid #dfe4ed;border-bottom:none;border-top:1px solid #dfe4ed;text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid #dfe4ed;border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid #dfe4ed;border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid #dfe4ed;border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid #dfe4ed}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid #dfe4ed}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid #dfe4ed;border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid #dfe4ed;border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid #dfe4ed;border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid #dfe4ed}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter .3s;animation:slideInRight-enter .3s}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave .3s;animation:slideInRight-leave .3s}.slideInLeft-enter{-webkit-animation:slideInLeft-enter .3s;animation:slideInLeft-enter .3s}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave .3s;animation:slideInLeft-leave .3s}@-webkit-keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}.el-tree{position:relative;cursor:default;background:#fff;color:#606266}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#909399;font-size:14px}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:#1890ff}.el-tree-node{white-space:nowrap;outline:none}.el-tree-node:focus>.el-tree-node__content{background-color:#f5f7fa}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:#1890ff;color:#fff}.el-tree-node__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:#f5f7fa}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:#c0c4cc;font-size:12px;-webkit-transform:rotate(0deg);transform:rotate(0deg);-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.el-tree-node__expand-icon.expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__label{font-size:14px}.el-tree-node__loading-icon{margin-right:8px;font-size:14px;color:#c0c4cc}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#edf6ff}.el-alert{width:100%;padding:8px 16px;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;position:relative;background-color:#fff;overflow:hidden;opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:opacity .2s;transition:opacity .2s}.el-alert.is-light .el-alert__closebtn{color:#c0c4cc}.el-alert.is-dark .el-alert__closebtn,.el-alert.is-dark .el-alert__description{color:#fff}.el-alert.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-alert--success.is-light{background-color:#e7faf0;color:#13ce66}.el-alert--success.is-light .el-alert__description{color:#13ce66}.el-alert--success.is-dark{background-color:#13ce66;color:#fff}.el-alert--info.is-light{background-color:#f4f4f5;color:#909399}.el-alert--info.is-dark{background-color:#909399;color:#fff}.el-alert--info .el-alert__description{color:#909399}.el-alert--warning.is-light{background-color:#fff8e6;color:#ffba00}.el-alert--warning.is-light .el-alert__description{color:#ffba00}.el-alert--warning.is-dark{background-color:#ffba00;color:#fff}.el-alert--error.is-light{background-color:#ffeded;color:#ff4949}.el-alert--error.is-light .el-alert__description{color:#ff4949}.el-alert--error.is-dark{background-color:#ff4949;color:#fff}.el-alert__content{display:table-cell;padding:0 8px}.el-alert__icon{font-size:16px;width:16px}.el-alert__icon.is-big{font-size:28px;width:28px}.el-alert__title{font-size:13px;line-height:18px}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:12px;margin:5px 0 0 0}.el-alert__closebtn{font-size:12px;opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert__closebtn.is-customed{font-style:normal;font-size:13px;top:9px}.el-alert-fade-enter,.el-alert-fade-leave-active{opacity:0}.el-notification{display:-webkit-box;display:-ms-flexbox;display:flex;width:330px;padding:14px 26px 14px 13px;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #e6ebf5;position:fixed;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;overflow:hidden}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:13px;margin-right:8px}.el-notification__title{font-weight:700;font-size:16px;color:#303133;margin:0}.el-notification__content{font-size:14px;line-height:21px;margin:6px 0 0 0;color:#606266;text-align:justify}.el-notification__content p{margin:0}.el-notification__icon{height:24px;width:24px;font-size:24px}.el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:#909399;font-size:16px}.el-notification__closeBtn:hover{color:#606266}.el-notification .el-icon-success{color:#13ce66}.el-notification .el-icon-error{color:#ff4949}.el-notification .el-icon-info{color:#909399}.el-notification .el-icon-warning{color:#ffba00}.el-notification-fade-enter.right{right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.el-notification-fade-enter.left{left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.el-notification-fade-leave-active{opacity:0}.el-input-number{position:relative;display:inline-block;width:180px;line-height:38px}.el-input-number .el-input{display:block}.el-input-number .el-input__inner{-webkit-appearance:none;padding-left:50px;padding-right:50px;text-align:center}.el-input-number__decrease,.el-input-number__increase{position:absolute;z-index:1;top:1px;width:40px;height:auto;text-align:center;background:#f5f7fa;color:#606266;cursor:pointer;font-size:13px}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:#1890ff}.el-input-number__decrease:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled),.el-input-number__increase:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled){border-color:#1890ff}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 4px 4px 0;border-left:1px solid #dcdfe6}.el-input-number__decrease{left:1px;border-radius:4px 0 0 4px;border-right:1px solid #dcdfe6}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:#dfe4ed;color:#dfe4ed}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:#dfe4ed;cursor:not-allowed}.el-input-number--medium{width:200px;line-height:34px}.el-input-number--medium .el-input-number__decrease,.el-input-number--medium .el-input-number__increase{width:36px;font-size:14px}.el-input-number--medium .el-input__inner{padding-left:43px;padding-right:43px}.el-input-number--small{width:130px;line-height:30px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:32px;font-size:13px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.9);transform:scale(.9)}.el-input-number--small .el-input__inner{padding-left:39px;padding-right:39px}.el-input-number--mini{width:130px;line-height:26px}.el-input-number--mini .el-input-number__decrease,.el-input-number--mini .el-input-number__increase{width:28px;font-size:12px}.el-input-number--mini .el-input-number__decrease [class*=el-icon],.el-input-number--mini .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number--mini .el-input__inner{padding-left:35px;padding-right:35px}.el-input-number.is-without-controls .el-input__inner{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__inner{padding-left:15px;padding-right:50px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{height:auto;line-height:19px}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{border-radius:0 4px 0 0;border-bottom:1px solid #dcdfe6}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;bottom:1px;top:auto;left:auto;border-right:none;border-left:1px solid #dcdfe6;border-radius:0 0 4px 0}.el-input-number.is-controls-right[class*=medium] [class*=decrease],.el-input-number.is-controls-right[class*=medium] [class*=increase]{line-height:17px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{line-height:15px}.el-input-number.is-controls-right[class*=mini] [class*=decrease],.el-input-number.is-controls-right[class*=mini] [class*=increase]{line-height:13px}.el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing){outline-width:0}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2;min-width:10px;word-wrap:break-word}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow:after{content:" ";border-width:5px}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow:after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#fff}.el-tooltip__popper.is-light{background:#fff;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow:after{border-top-color:#fff}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow:after{border-bottom-color:#fff}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow:after{border-left-color:#fff}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow:after{border-right-color:#fff}.el-slider:after,.el-slider:before{display:table;content:""}.el-slider:after{clear:both}.el-slider__runway{width:100%;height:6px;margin:16px 0;background-color:#dfe4ed;border-radius:3px;position:relative;cursor:pointer;vertical-align:middle}.el-slider__runway.show-input{margin-right:160px;width:auto}.el-slider__runway.disabled{cursor:default}.el-slider__runway.disabled .el-slider__bar{background-color:#c0c4cc}.el-slider__runway.disabled .el-slider__button{border-color:#c0c4cc}.el-slider__runway.disabled .el-slider__button-wrapper.dragging,.el-slider__runway.disabled .el-slider__button-wrapper.hover,.el-slider__runway.disabled .el-slider__button-wrapper:hover{cursor:not-allowed}.el-slider__runway.disabled .el-slider__button.dragging,.el-slider__runway.disabled .el-slider__button.hover,.el-slider__runway.disabled .el-slider__button:hover{-webkit-transform:scale(1);transform:scale(1)}.el-slider__runway.disabled .el-slider__button.dragging,.el-slider__runway.disabled .el-slider__button.hover,.el-slider__runway.disabled .el-slider__button:hover{cursor:not-allowed}.el-slider__input{float:right;margin-top:3px;width:130px}.el-slider__input.el-input-number--mini{margin-top:5px}.el-slider__input.el-input-number--medium{margin-top:0}.el-slider__input.el-input-number--large{margin-top:-2px}.el-slider__bar{height:6px;background-color:#1890ff;border-top-left-radius:3px;border-bottom-left-radius:3px;position:absolute}.el-slider__button-wrapper{height:36px;width:36px;position:absolute;z-index:1001;top:-15px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal}.el-slider__button-wrapper:after{content:"";height:100%}.el-slider__button-wrapper .el-tooltip,.el-slider__button-wrapper:after{display:inline-block;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{width:16px;height:16px;border:2px solid #1890ff;background-color:#fff;border-radius:50%;-webkit-transition:.2s;transition:.2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:6px;width:6px;border-radius:100%;background-color:#fff;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#909399;margin-top:15px}.el-slider.is-vertical{position:relative}.el-slider.is-vertical .el-slider__runway{width:6px;height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:6px;height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:-15px}.el-slider.is-vertical .el-slider__button-wrapper,.el-slider.is-vertical .el-slider__stop{-webkit-transform:translateY(50%);transform:translateY(50%)}.el-slider.is-vertical.el-slider--with-input{padding-bottom:58px}.el-slider.is-vertical.el-slider--with-input .el-slider__input{overflow:visible;float:none;position:absolute;bottom:22px;width:36px;margin-top:15px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input__inner{text-align:center;padding-left:5px;padding-right:5px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{top:32px;margin-top:-1px;border:1px solid #dcdfe6;line-height:20px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease{width:18px;right:18px;border-bottom-left-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{width:19px;border-bottom-right-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase~.el-input .el-input__inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__increase{border-color:#c0c4cc}.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__increase{border-color:#1890ff}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;-webkit-transform:translateY(50%);transform:translateY(50%)}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:hsla(0,0%,100%,.9);margin:0;top:0;right:0;bottom:0;left:0;-webkit-transition:opacity .3s;transition:opacity .3s}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:-25px}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:50px;width:50px}.el-loading-spinner{top:50%;margin-top:-21px;width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:#1890ff;margin:3px 0;font-size:14px}.el-loading-spinner .circular{height:42px;width:42px;-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:#1890ff;stroke-linecap:round}.el-loading-spinner i{color:#1890ff}.el-loading-fade-enter,.el-loading-fade-leave-active{opacity:0}@-webkit-keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-row{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.el-row:after,.el-row:before{display:table;content:""}.el-row:after{clear:both}.el-row--flex{display:-webkit-box;display:-ms-flexbox;display:flex}.el-row--flex:after,.el-row--flex:before{display:none}.el-row--flex.is-justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-row--flex.is-justify-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.el-row--flex.is-justify-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-row--flex.is-justify-space-around{-ms-flex-pack:distribute;justify-content:space-around}.el-row--flex.is-align-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.el-row--flex.is-align-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-row--flex.is-align-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}[class*=el-col-]{float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.el-col-0{display:none;width:0}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{width:4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{width:8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{width:12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{width:16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{width:20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{width:25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{width:29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{width:33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{width:37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{width:41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{width:45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{width:50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{width:54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{width:58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{width:62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{width:66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{width:70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{width:75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{width:79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{width:83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{width:87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{width:91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{width:95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{width:100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:767px){.el-col-xs-0{display:none;width:0}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{width:4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{width:8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{width:12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{width:16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{width:20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{width:25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{width:29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{width:33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{width:37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{width:41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{width:45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{width:50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{width:54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{width:58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{width:62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{width:66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{width:70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{width:75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{width:79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{width:83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{width:87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{width:91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{width:95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{width:100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0{display:none;width:0}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{width:4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{width:8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{width:12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{width:16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{width:20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{width:25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{width:29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{width:33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{width:37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{width:41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{width:45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{width:50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{width:54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{width:58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{width:62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{width:66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{width:70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{width:75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{width:79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{width:83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{width:87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{width:91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{width:95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{width:100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0{display:none;width:0}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{width:4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{width:8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{width:12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{width:16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{width:20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{width:25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{width:29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{width:33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{width:37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{width:41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{width:45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{width:50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{width:54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{width:58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{width:62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{width:66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{width:70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{width:75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{width:79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{width:83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{width:87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{width:91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{width:95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{width:100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0{display:none;width:0}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{width:4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{width:8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{width:12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{width:16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{width:20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{width:25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{width:29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{width:33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{width:37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{width:41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{width:45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{width:50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{width:54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{width:58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{width:62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{width:66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{width:70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{width:75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{width:79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{width:83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{width:87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{width:91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{width:95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{width:100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0{display:none;width:0}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{width:4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{width:8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{width:12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{width:16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{width:20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{width:25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{width:29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{width:33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{width:37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{width:41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{width:45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{width:50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{width:54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{width:58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{width:62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{width:66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{width:70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{width:75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{width:79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{width:83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{width:87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{width:91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{width:95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{width:100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}.el-upload{display:inline-block;text-align:center;cursor:pointer;outline:none}.el-upload__tip{font-size:12px;color:#606266;margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0;filter:alpha(opacity=0)}.el-upload--picture-card{background-color:#fbfdff;border:1px dashed #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;cursor:pointer;line-height:146px;vertical-align:top}.el-upload--picture-card i{font-size:28px;color:#8c939d}.el-upload--picture-card:hover,.el-upload:focus{border-color:#1890ff;color:#1890ff}.el-upload:focus .el-upload-dragger{border-color:#1890ff}.el-upload-dragger{background-color:#fff;border:1px dashed #d9d9d9;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:360px;height:180px;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon-upload{font-size:67px;color:#c0c4cc;margin:40px 0 16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:1px solid #dcdfe6;margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:#606266;font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:#1890ff;font-style:normal}.el-upload-dragger:hover{border-color:#1890ff}.el-upload-dragger.is-dragover{background-color:rgba(32,159,255,.06);border:2px dashed #1890ff}.el-upload-list{margin:0;padding:0;list-style:none}.el-upload-list__item{-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:#606266;line-height:1.8;margin-top:5px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item:first-child{margin-top:10px}.el-upload-list__item .el-icon-upload-success{color:#13ce66}.el-upload-list__item .el-icon-close{display:none;position:absolute;top:5px;right:5px;cursor:pointer;opacity:.75;color:#606266}.el-upload-list__item .el-icon-close:hover{opacity:1}.el-upload-list__item .el-icon-close-tip{display:none;position:absolute;top:5px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:#1890ff}.el-upload-list__item:hover{background-color:#f5f7fa}.el-upload-list__item:hover .el-icon-close{display:inline-block}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:block}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:#1890ff;cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon-close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon-close-tip,.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label,.el-upload-list__item.is-success:not(.focusing):focus .el-icon-close-tip{display:none}.el-upload-list.is-disabled .el-upload-list__item:hover .el-upload-list__item-status-label{display:block}.el-upload-list__item-name{color:#606266;display:block;margin-right:40px;overflow:hidden;padding-left:4px;text-overflow:ellipsis;-webkit-transition:color .3s;transition:color .3s;white-space:nowrap}.el-upload-list__item-name [class^=el-icon]{height:100%;margin-right:7px;color:#909399;line-height:inherit}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:#606266;display:none}.el-upload-list__item-delete:hover{color:#1890ff}.el-upload-list--picture-card{margin:0;display:inline;vertical-align:top}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;margin:0 8px 8px 0;display:inline-block}.el-upload-list--picture-card .el-upload-list__item .el-icon-check,.el-upload-list--picture-card .el-upload-list__item .el-icon-circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon-close,.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%}.el-upload-list--picture-card .el-upload-list__item-status-label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;text-align:center;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s}.el-upload-list--picture-card .el-upload-list__item-actions:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:15px}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-block}.el-upload-list--picture-card .el-progress{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:10px;padding:10px 10px 10px 90px;height:92px}.el-upload-list--picture .el-upload-list__item .el-icon-check,.el-upload-list--picture .el-upload-list__item .el-icon-circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{background:transparent;-webkit-box-shadow:none;box-shadow:none;top:-2px;right:-12px}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name{line-height:70px;margin-top:0}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item-thumbnail{vertical-align:middle;display:inline-block;width:70px;height:70px;float:left;position:relative;z-index:1;margin-left:-80px;background-color:#fff}.el-upload-list--picture .el-upload-list__item-name{display:block;margin-top:20px}.el-upload-list--picture .el-upload-list__item-name i{font-size:70px;line-height:1;position:absolute;left:9px;top:10px}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 1px 1px #ccc;box-shadow:0 1px 1px #ccc}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-cover__label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.72);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{-webkit-transform:translateY(-13px);transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:#303133}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-progress{position:relative;line-height:1}.el-progress__text{font-size:14px;color:#606266;display:inline-block;vertical-align:middle;margin-left:10px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:#13ce66}.el-progress.is-success .el-progress__text{color:#13ce66}.el-progress.is-warning .el-progress-bar__inner{background-color:#ffba00}.el-progress.is-warning .el-progress__text{color:#ffba00}.el-progress.is-exception .el-progress-bar__inner{background-color:#ff4949}.el-progress.is-exception .el-progress__text{color:#ff4949}.el-progress-bar{padding-right:50px;display:inline-block;vertical-align:middle;width:100%;margin-right:-55px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:#e6ebf5;overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:#1890ff;text-align:right;border-radius:100px;line-height:1;white-space:nowrap;-webkit-transition:width .6s ease;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:#ececec;stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-message{min-width:380px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border-width:1px;border-style:solid;border-color:#e6ebf5;position:fixed;left:50%;top:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#edf2fc;-webkit-transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,transform .4s,top .4s;transition:opacity .3s,transform .4s,top .4s,-webkit-transform .4s;overflow:hidden;padding:15px 15px 15px 20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-message.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message.is-closable .el-message__content{padding-right:16px}.el-message p{margin:0}.el-message--info .el-message__content{color:#909399}.el-message--success{background-color:#e7faf0;border-color:#d0f5e0}.el-message--success .el-message__content{color:#13ce66}.el-message--warning{background-color:#fff8e6;border-color:#fff1cc}.el-message--warning .el-message__content{color:#ffba00}.el-message--error{background-color:#ffeded;border-color:#ffdbdb}.el-message--error .el-message__content{color:#ff4949}.el-message__icon{margin-right:10px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message__closeBtn{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;color:#c0c4cc;font-size:16px}.el-message__closeBtn:focus{outline-width:0}.el-message__closeBtn:hover{color:#909399}.el-message .el-icon-success{color:#13ce66}.el-message .el-icon-error{color:#ff4949}.el-message .el-icon-info{color:#909399}.el-message .el-icon-warning{color:#ffba00}.el-message-fade-enter,.el-message-fade-leave-active{opacity:0;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.el-badge{position:relative;vertical-align:middle;display:inline-block}.el-badge__content{background-color:#ff4949;border-radius:10px;color:#fff;display:inline-block;font-size:12px;height:18px;line-height:18px;padding:0 6px;text-align:center;white-space:nowrap;border:1px solid #fff}.el-badge__content.is-fixed{position:absolute;top:0;right:10px;-webkit-transform:translateY(-50%) translateX(100%);transform:translateY(-50%) translateX(100%)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:#1890ff}.el-badge__content--success{background-color:#13ce66}.el-badge__content--warning{background-color:#ffba00}.el-badge__content--info{background-color:#909399}.el-badge__content--danger{background-color:#ff4949}.el-card{border-radius:4px;border:1px solid #e6ebf5;background-color:#fff;overflow:hidden;color:#303133;-webkit-transition:.3s;transition:.3s}.el-card.is-always-shadow,.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-card__header{padding:18px 20px;border-bottom:1px solid #e6ebf5;-webkit-box-sizing:border-box;box-sizing:border-box}.el-card__body{padding:20px}.el-rate{height:20px;line-height:1}.el-rate:active,.el-rate:focus{outline-width:0}.el-rate__item{font-size:0;vertical-align:middle}.el-rate__icon,.el-rate__item{display:inline-block;position:relative}.el-rate__icon{font-size:18px;margin-right:6px;color:#c0c4cc;-webkit-transition:.3s;transition:.3s}.el-rate__icon.hover{-webkit-transform:scale(1.15);transform:scale(1.15)}.el-rate__decimal,.el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate__decimal{display:inline-block;overflow:hidden}.el-rate__text{font-size:14px;vertical-align:middle}.el-steps{display:-webkit-box;display:-ms-flexbox;display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:#f5f7fa}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}.el-step{position:relative;-ms-flex-negative:1;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{-ms-flex-preferred-size:auto!important;flex-basis:auto!important;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:#303133;border-color:#303133}.el-step__head.is-wait{color:#c0c4cc;border-color:#c0c4cc}.el-step__head.is-success{color:#13ce66;border-color:#13ce66}.el-step__head.is-error{color:#ff4949;border-color:#ff4949}.el-step__head.is-finish{color:#1890ff;border-color:#1890ff}.el-step__icon{position:relative;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:24px;height:24px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#fff;-webkit-transition:.15s ease-out;transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{-webkit-transform:translateY(1px);transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:#c0c4cc}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;-webkit-transition:.15s ease-out;transition:.15s ease-out;-webkit-box-sizing:border-box;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:#303133}.el-step__title.is-wait{color:#c0c4cc}.el-step__title.is-success{color:#13ce66}.el-step__title.is-error{color:#ff4949}.el-step__title.is-finish{color:#1890ff}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:#303133}.el-step__description.is-wait{color:#c0c4cc}.el-step__description.is-success{color:#13ce66}.el-step__description.is-error{color:#ff4949}.el-step__description.is-finish{color:#1890ff}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:-webkit-box;display:-ms-flexbox;display:flex}.el-step.is-vertical .el-step__head{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:transparent;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{-webkit-transform:scale(.8) translateY(1px);transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:#c0c4cc}.el-step.is-simple .el-step__arrow:before{-webkit-transform:rotate(-45deg) translateY(-4px);transform:rotate(-45deg) translateY(-4px);-webkit-transform-origin:0 0;transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{-webkit-transform:rotate(45deg) translateY(4px);transform:rotate(45deg) translateY(4px);-webkit-transform-origin:100% 100%;transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-carousel{position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:none;padding:0;margin:0;height:36px;width:36px;cursor:pointer;-webkit-transition:.3s;transition:.3s;border-radius:50%;background-color:rgba(31,45,61,.11);color:#fff;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);transform:translateY(-50%);text-align:center;font-size:12px}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:rgba(31,45,61,.23)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:2}.el-carousel__indicators--horizontal{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:26px;text-align:center;position:static;-webkit-transform:none;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:#c0c4cc;opacity:.24}.el-carousel__indicators--labels{left:0;right:0;-webkit-transform:none;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:12px 4px}.el-carousel__indicator--vertical{padding:4px 12px}.el-carousel__indicator--vertical .el-carousel__button{width:2px;height:15px}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:30px;height:2px;background-color:#fff;border:none;outline:none;padding:0;margin:0;cursor:pointer;-webkit-transition:.3s;transition:.3s}.carousel-arrow-left-enter,.carousel-arrow-left-leave-active{-webkit-transform:translateY(-50%) translateX(-10px);transform:translateY(-50%) translateX(-10px);opacity:0}.carousel-arrow-right-enter,.carousel-arrow-right-leave-active{-webkit-transform:translateY(-50%) translateX(10px);transform:translateY(-50%) translateX(10px);opacity:0}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:0}.el-carousel__item.is-active{z-index:2}.el-carousel__item--card,.el-carousel__item.is-animating{-webkit-transition:-webkit-transform .4s ease-in-out;transition:-webkit-transform .4s ease-in-out;transition:transform .4s ease-in-out;transition:transform .4s ease-in-out,-webkit-transform .4s ease-in-out}.el-carousel__item--card{width:50%}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:1}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:2}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:#fff;opacity:.24;-webkit-transition:.2s;transition:.2s}.fade-in-linear-enter-active,.fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.fade-in-linear-enter,.fade-in-linear-leave,.fade-in-linear-leave-active{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-linear-enter,.el-fade-in-linear-leave,.el-fade-in-linear-leave-active{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-fade-in-enter,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter,.el-zoom-in-center-leave-active{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center top;transform-origin:center top}.el-zoom-in-top-enter,.el-zoom-in-top-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center bottom;transform-origin:center bottom}.el-zoom-in-bottom-enter,.el-zoom-in-bottom-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:top left;transform-origin:top left}.el-zoom-in-left-enter,.el-zoom-in-left-leave-active{opacity:0;-webkit-transform:scale(.45);transform:scale(.45)}.collapse-transition{-webkit-transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out;transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out}.horizontal-collapse-transition{-webkit-transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out;transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out}.el-list-enter-active,.el-list-leave-active{-webkit-transition:all 1s;transition:all 1s}.el-list-enter,.el-list-leave-active{opacity:0;-webkit-transform:translateY(-30px);transform:translateY(-30px)}.el-opacity-transition{-webkit-transition:opacity .3s cubic-bezier(.55,0,.1,1);transition:opacity .3s cubic-bezier(.55,0,.1,1)}.el-collapse{border-top:1px solid #e6ebf5;border-bottom:1px solid #e6ebf5}.el-collapse-item.is-disabled .el-collapse-item__header{color:#bbb;cursor:not-allowed}.el-collapse-item__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:48px;line-height:48px;background-color:#fff;color:#303133;cursor:pointer;border-bottom:1px solid #e6ebf5;font-size:13px;font-weight:500;-webkit-transition:border-bottom-color .3s;transition:border-bottom-color .3s;outline:none}.el-collapse-item__arrow{margin:0 8px 0 auto;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-weight:300}.el-collapse-item__arrow.is-active{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:#1890ff}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:#fff;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #e6ebf5}.el-collapse-item__content{padding-bottom:25px;font-size:13px;color:#303133;line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-popper .popper__arrow,.el-popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));filter:drop-shadow(0 2px 12px rgba(0,0,0,.03))}.el-popper .popper__arrow:after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#e6ebf5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-6px;border-top-color:#fff;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#e6ebf5}.el-popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#e6ebf5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow:after{bottom:-6px;left:1px;border-right-color:#fff;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#e6ebf5}.el-popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#fff}.el-tag{background-color:#e8f4ff;border-color:#d1e9ff;display:inline-block;height:32px;padding:0 10px;line-height:30px;font-size:12px;color:#1890ff;border-width:1px;border-style:solid;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-tag.is-hit{border-color:#1890ff}.el-tag .el-tag__close{color:#1890ff}.el-tag .el-tag__close:hover{color:#fff;background-color:#1890ff}.el-tag.el-tag--info{background-color:#f4f4f5;border-color:#e9e9eb;color:#909399}.el-tag.el-tag--info.is-hit{border-color:#909399}.el-tag.el-tag--info .el-tag__close{color:#909399}.el-tag.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag.el-tag--success{background-color:#e7faf0;border-color:#d0f5e0;color:#13ce66}.el-tag.el-tag--success.is-hit{border-color:#13ce66}.el-tag.el-tag--success .el-tag__close{color:#13ce66}.el-tag.el-tag--success .el-tag__close:hover{color:#fff;background-color:#13ce66}.el-tag.el-tag--warning{background-color:#fff8e6;border-color:#fff1cc;color:#ffba00}.el-tag.el-tag--warning.is-hit{border-color:#ffba00}.el-tag.el-tag--warning .el-tag__close{color:#ffba00}.el-tag.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#ffba00}.el-tag.el-tag--danger{background-color:#ffeded;border-color:#ffdbdb;color:#ff4949}.el-tag.el-tag--danger.is-hit{border-color:#ff4949}.el-tag.el-tag--danger .el-tag__close{color:#ff4949}.el-tag.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#ff4949}.el-tag .el-icon-close{border-radius:50%;text-align:center;position:relative;cursor:pointer;font-size:12px;height:16px;width:16px;line-height:16px;vertical-align:middle;top:-1px;right:-5px}.el-tag .el-icon-close:before{display:block}.el-tag--dark{background-color:#1890ff;color:#fff}.el-tag--dark,.el-tag--dark.is-hit{border-color:#1890ff}.el-tag--dark .el-tag__close{color:#fff}.el-tag--dark .el-tag__close:hover{color:#fff;background-color:#46a6ff}.el-tag--dark.el-tag--info{background-color:#909399;border-color:#909399;color:#fff}.el-tag--dark.el-tag--info.is-hit{border-color:#909399}.el-tag--dark.el-tag--info .el-tag__close{color:#fff}.el-tag--dark.el-tag--info .el-tag__close:hover{color:#fff;background-color:#a6a9ad}.el-tag--dark.el-tag--success{background-color:#13ce66;border-color:#13ce66;color:#fff}.el-tag--dark.el-tag--success.is-hit{border-color:#13ce66}.el-tag--dark.el-tag--success .el-tag__close{color:#fff}.el-tag--dark.el-tag--success .el-tag__close:hover{color:#fff;background-color:#42d885}.el-tag--dark.el-tag--warning{background-color:#ffba00;border-color:#ffba00;color:#fff}.el-tag--dark.el-tag--warning.is-hit{border-color:#ffba00}.el-tag--dark.el-tag--warning .el-tag__close{color:#fff}.el-tag--dark.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#ffc833}.el-tag--dark.el-tag--danger{background-color:#ff4949;border-color:#ff4949;color:#fff}.el-tag--dark.el-tag--danger.is-hit{border-color:#ff4949}.el-tag--dark.el-tag--danger .el-tag__close{color:#fff}.el-tag--dark.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#ff6d6d}.el-tag--plain{background-color:#fff;border-color:#a3d3ff;color:#1890ff}.el-tag--plain.is-hit{border-color:#1890ff}.el-tag--plain .el-tag__close{color:#1890ff}.el-tag--plain .el-tag__close:hover{color:#fff;background-color:#1890ff}.el-tag--plain.el-tag--info{background-color:#fff;border-color:#d3d4d6;color:#909399}.el-tag--plain.el-tag--info.is-hit{border-color:#909399}.el-tag--plain.el-tag--info .el-tag__close{color:#909399}.el-tag--plain.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag--plain.el-tag--success{background-color:#fff;border-color:#a1ebc2;color:#13ce66}.el-tag--plain.el-tag--success.is-hit{border-color:#13ce66}.el-tag--plain.el-tag--success .el-tag__close{color:#13ce66}.el-tag--plain.el-tag--success .el-tag__close:hover{color:#fff;background-color:#13ce66}.el-tag--plain.el-tag--warning{background-color:#fff;border-color:#ffe399;color:#ffba00}.el-tag--plain.el-tag--warning.is-hit{border-color:#ffba00}.el-tag--plain.el-tag--warning .el-tag__close{color:#ffba00}.el-tag--plain.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#ffba00}.el-tag--plain.el-tag--danger{background-color:#fff;border-color:#ffb6b6;color:#ff4949}.el-tag--plain.el-tag--danger.is-hit{border-color:#ff4949}.el-tag--plain.el-tag--danger .el-tag__close{color:#ff4949}.el-tag--plain.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#ff4949}.el-tag--medium{height:28px;line-height:26px}.el-tag--medium .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--small{height:24px;padding:0 8px;line-height:22px}.el-tag--small .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--mini{height:20px;padding:0 5px;line-height:19px}.el-tag--mini .el-icon-close{margin-left:-3px;-webkit-transform:scale(.7);transform:scale(.7)}.el-cascader{display:inline-block;position:relative;font-size:14px;line-height:40px}.el-cascader:not(.is-disabled):hover .el-input__inner{cursor:pointer;border-color:#c0c4cc}.el-cascader .el-input{cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis}.el-cascader .el-input .el-input__inner:focus{border-color:#1890ff}.el-cascader .el-input .el-icon-arrow-down{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:14px}.el-cascader .el-input .el-icon-arrow-down.is-reverse{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.el-cascader .el-input .el-icon-circle-close:hover{color:#909399}.el-cascader .el-input.is-focus .el-input__inner{border-color:#1890ff}.el-cascader--medium{font-size:14px;line-height:36px}.el-cascader--small{font-size:13px;line-height:32px}.el-cascader--mini{font-size:12px;line-height:28px}.el-cascader.is-disabled .el-cascader__label{z-index:2;color:#c0c4cc}.el-cascader__dropdown{margin:5px 0;font-size:14px;background:#fff;border:1px solid #dfe4ed;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:normal;text-align:left;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader__tags .el-tag{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:#f0f2f5}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{-webkit-box-flex:0;-ms-flex:none;flex:none;background-color:#c0c4cc;color:#fff}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:#909399}.el-cascader__suggestion-panel{border-radius:4px}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:14px;color:#606266;text-align:center}.el-cascader__suggestion-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;padding:0 15px;text-align:left;outline:none;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:#f5f7fa}.el-cascader__suggestion-item.is-checked{color:#1890ff;font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:#c0c4cc}.el-cascader__search-input{-webkit-box-flex:1;-ms-flex:1;flex:1;height:24px;min-width:60px;margin:2px 0 2px 15px;padding:0;color:#606266;border:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader__search-input::-webkit-input-placeholder{color:#c0c4cc}.el-cascader__search-input::-moz-placeholder{color:#c0c4cc}.el-cascader__search-input:-ms-input-placeholder{color:#c0c4cc}.el-cascader__search-input::-ms-input-placeholder{color:#c0c4cc}.el-cascader__search-input::placeholder{color:#c0c4cc}.el-color-predefine{font-size:12px;margin-top:8px;width:280px}.el-color-predefine,.el-color-predefine__colors{display:-webkit-box;display:-ms-flexbox;display:flex}.el-color-predefine__colors{-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{-webkit-box-shadow:0 0 3px 2px #1890ff;box-shadow:0 0 3px 2px #1890ff}.el-color-predefine__color-selector>div{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px}.el-color-hue-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(180deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.el-color-svpanel__black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(transparent));background:linear-gradient(0deg,#000,transparent)}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-alpha-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(hsla(0,0%,100%,0)),to(#fff));background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,#fff);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),to(#fff));background:linear-gradient(180deg,hsla(0,0%,100%,0) 0,#fff)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:6px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-dropdown__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:none;font-size:12px}.el-color-dropdown__btn[disabled]{color:#ccc;cursor:not-allowed}.el-color-dropdown__btn:hover{color:#1890ff;border-color:#1890ff}.el-color-dropdown__link-btn{cursor:pointer;color:#1890ff;text-decoration:none;padding:15px;font-size:12px}.el-color-dropdown__link-btn:hover{color:tint(#1890ff,20%)}.el-color-picker{display:inline-block;position:relative;line-height:normal;height:40px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--medium{height:36px}.el-color-picker--medium .el-color-picker__trigger{height:36px;width:36px}.el-color-picker--medium .el-color-picker__mask{height:34px;width:34px}.el-color-picker--small{height:32px}.el-color-picker--small .el-color-picker__trigger{height:32px;width:32px}.el-color-picker--small .el-color-picker__mask{height:30px;width:30px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker--mini{height:28px}.el-color-picker--mini .el-color-picker__trigger{height:28px;width:28px}.el-color-picker--mini .el-color-picker__mask{height:26px;width:26px}.el-color-picker--mini .el-color-picker__empty,.el-color-picker--mini .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker__mask{height:38px;width:38px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:hsla(0,0%,100%,.7)}.el-color-picker__trigger{display:inline-block;height:40px;width:40px;padding:4px;border:1px solid #e6e6e6;border-radius:4px;font-size:0;cursor:pointer}.el-color-picker__color,.el-color-picker__trigger{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative}.el-color-picker__color{display:block;border:1px solid #999;border-radius:2px;width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-picker__color-inner{position:absolute;left:0;top:0;right:0;bottom:0}.el-color-picker__empty{color:#999}.el-color-picker__empty,.el-color-picker__icon{font-size:12px;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.el-color-picker__icon{display:inline-block;width:100%;color:#fff;text-align:center}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;-webkit-box-sizing:content-box;box-sizing:content-box;background-color:#fff;border:1px solid #e6ebf5;border-radius:4px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#fff;background-image:none;border:1px solid #dcdfe6;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea__inner::-moz-placeholder{color:#c0c4cc}.el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea__inner:hover{border-color:#c0c4cc}.el-textarea__inner:focus{outline:none;border-color:#1890ff}.el-textarea .el-input__count{color:#909399;background:#fff;position:absolute;font-size:12px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:#f5f7fa;border-color:#dfe4ed;color:#c0c4cc;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea.is-exceed .el-textarea__inner{border-color:#ff4949}.el-textarea.is-exceed .el-input__count{color:#ff4949}.el-input{position:relative;font-size:14px;display:inline-block;width:100%}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner,.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input .el-input__clear{color:#c0c4cc;font-size:14px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input .el-input__count{height:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#909399;font-size:12px}.el-input .el-input__count .el-input__count-inner{background:#fff;line-height:normal;display:inline-block;padding:0 5px}.el-input__inner{-webkit-appearance:none;background-color:#fff;background-image:none;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;display:inline-block;font-size:inherit;height:40px;line-height:40px;outline:none;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__inner::-ms-reveal{display:none}.el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input__inner::-moz-placeholder{color:#c0c4cc}.el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input__inner::placeholder{color:#c0c4cc}.el-input__inner:hover{border-color:#c0c4cc}.el-input__inner:focus{outline:none;border-color:#1890ff}.el-input__suffix{position:absolute;height:100%;right:5px;top:0;text-align:center;color:#c0c4cc;-webkit-transition:all .3s;transition:all .3s;pointer-events:none}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{position:absolute;left:5px;top:0;color:#c0c4cc}.el-input__icon,.el-input__prefix{height:100%;text-align:center;-webkit-transition:all .3s;transition:all .3s}.el-input__icon{width:25px;line-height:40px}.el-input__icon:after{content:"";height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__inner{outline:none;border-color:#1890ff}.el-input.is-disabled .el-input__inner{background-color:#f5f7fa;border-color:#dfe4ed;color:#c0c4cc;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__inner{border-color:#ff4949}.el-input.is-exceed .el-input__suffix .el-input__count{color:#ff4949}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px;line-height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px;line-height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px;line-height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate;border-spacing:0}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#f5f7fa;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #dcdfe6;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:none}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-10px -20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append{border-left:0}.el-input-group--prepend .el-input__inner,.el-input-group__append{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input-group--append .el-input__inner{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input__inner::-ms-clear{display:none;width:0;height:0}.el-transfer{font-size:14px}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{display:block;margin:0 auto;padding:10px;border-radius:50%;color:#fff;background-color:#1890ff;font-size:0}.el-transfer__button.is-with-texts{border-radius:4px}.el-transfer__button.is-disabled,.el-transfer__button.is-disabled:hover{border:1px solid #dcdfe6;background-color:#f5f7fa;color:#c0c4cc}.el-transfer__button:first-child{margin-bottom:10px}.el-transfer__button:nth-child(2){margin:0}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button [class*=el-icon-]+span{margin-left:0}.el-transfer-panel{border:1px solid #e6ebf5;border-radius:4px;overflow:hidden;background:#fff;display:inline-block;vertical-align:middle;width:200px;max-height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:246px}.el-transfer-panel__body.is-with-footer{padding-bottom:40px}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:246px;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:194px;padding-top:0}.el-transfer-panel__item{height:30px;line-height:30px;padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:#606266}.el-transfer-panel__item:hover{color:#1890ff}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:24px;line-height:30px}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;margin:15px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:auto}.el-transfer-panel__filter .el-input__inner{height:32px;width:100%;font-size:12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:16px;padding-right:10px;padding-left:30px}.el-transfer-panel__filter .el-input__icon{margin-left:5px}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{height:40px;line-height:40px;background:#f5f7fa;margin:0;padding-left:15px;border-bottom:1px solid #e6ebf5;-webkit-box-sizing:border-box;box-sizing:border-box;color:#000}.el-transfer-panel .el-transfer-panel__header .el-checkbox{display:block;line-height:40px}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:#303133;font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;color:#909399;font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:40px;background:#fff;margin:0;padding:0;border-top:1px solid #e6ebf5;position:absolute;bottom:0;left:0;width:100%;z-index:1}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:#606266}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:30px;line-height:30px;padding:6px 15px 0;color:#909399;text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:0}.el-container.is-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.el-header{padding:0 20px}.el-aside,.el-header{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-aside{overflow:auto}.el-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;overflow:auto;padding:20px}.el-footer,.el-main{-webkit-box-sizing:border-box;box-sizing:border-box}.el-footer{padding:0 20px;-ms-flex-negative:0;flex-shrink:0}.el-timeline{margin:0;font-size:14px;list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid #dfe4ed}.el-timeline-item__icon{color:#fff;font-size:13px}.el-timeline-item__node{position:absolute;background-color:#dfe4ed;border-radius:50%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:12px;height:12px}.el-timeline-item__node--large{left:-2px;width:14px;height:14px}.el-timeline-item__node--primary{background-color:#1890ff}.el-timeline-item__node--success{background-color:#13ce66}.el-timeline-item__node--warning{background-color:#ffba00}.el-timeline-item__node--danger{background-color:#ff4949}.el-timeline-item__node--info{background-color:#909399}.el-timeline-item__dot{position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-timeline-item__content{color:#303133}.el-timeline-item__timestamp{color:#909399;line-height:1;font-size:13px}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-link{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:none;cursor:pointer;padding:0;font-size:14px;font-weight:500}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid #1890ff}.el-link.is-disabled{cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default{color:#606266}.el-link.el-link--default:hover{color:#1890ff}.el-link.el-link--default:after{border-color:#1890ff}.el-link.el-link--default.is-disabled{color:#c0c4cc}.el-link.el-link--primary{color:#1890ff}.el-link.el-link--primary:hover{color:#46a6ff}.el-link.el-link--primary:after{border-color:#1890ff}.el-link.el-link--primary.is-disabled{color:#8cc8ff}.el-link.el-link--primary.is-underline:hover:after{border-color:#1890ff}.el-link.el-link--danger{color:#ff4949}.el-link.el-link--danger:hover{color:#ff6d6d}.el-link.el-link--danger:after{border-color:#ff4949}.el-link.el-link--danger.is-disabled{color:#ffa4a4}.el-link.el-link--danger.is-underline:hover:after{border-color:#ff4949}.el-link.el-link--success{color:#13ce66}.el-link.el-link--success:hover{color:#42d885}.el-link.el-link--success:after{border-color:#13ce66}.el-link.el-link--success.is-disabled{color:#89e7b3}.el-link.el-link--success.is-underline:hover:after{border-color:#13ce66}.el-link.el-link--warning{color:#ffba00}.el-link.el-link--warning:hover{color:#ffc833}.el-link.el-link--warning:after{border-color:#ffba00}.el-link.el-link--warning.is-disabled{color:#ffdd80}.el-link.el-link--warning.is-underline:hover:after{border-color:#ffba00}.el-link.el-link--info{color:#909399}.el-link.el-link--info:hover{color:#a6a9ad}.el-link.el-link--info:after{border-color:#909399}.el-link.el-link--info.is-disabled{color:#c8c9cc}.el-link.el-link--info.is-underline:hover:after{border-color:#909399}.el-divider{background-color:#dcdfe6;position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative}.el-divider__text{position:absolute;background-color:#fff;padding:0 20px;font-weight:500;color:#303133;font-size:14px}.el-divider__text.is-left{left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-divider__text.is-center{left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-image__error,.el-image__inner,.el-image__placeholder{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top}.el-image__inner--center{position:relative;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block}.el-image__error,.el-image__placeholder{background:#f5f7fa}.el-image__error{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:14px;color:#c0c4cc;vertical-align:middle}.el-image__preview{cursor:pointer}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:24px;color:#fff;background-color:#606266}.el-image-viewer__canvas{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-image-viewer__actions{left:50%;bottom:30px;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:282px;height:44px;padding:0 23px;background-color:#606266;border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.el-image-viewer__prev{left:40px}.el-image-viewer__next,.el-image-viewer__prev{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:44px;height:44px;font-size:24px;color:#fff;background-color:#606266;border-color:#fff}.el-image-viewer__next{right:40px;text-indent:2px}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in .3s;animation:viewer-fade-in .3s}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out .3s;animation:viewer-fade-out .3s}@-webkit-keyframes viewer-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;border-color:#dcdfe6;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:400;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:12px 20px;font-size:14px;border-radius:4px}.el-button+.el-button{margin-left:10px}.el-button.is-round{padding:12px 20px}.el-button:focus,.el-button:hover{color:#1890ff;border-color:#badeff;background-color:#e8f4ff}.el-button:active{color:#1682e6;border-color:#1682e6;outline:none}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon-]+span{margin-left:5px}.el-button.is-plain:focus,.el-button.is-plain:hover{background:#fff;border-color:#1890ff;color:#1890ff}.el-button.is-plain:active{background:#fff;outline:none}.el-button.is-active,.el-button.is-plain:active{border-color:#1682e6;color:#1682e6}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#e6ebf5}.el-button.is-disabled.el-button--text{background-color:transparent}.el-button.is-disabled.is-plain,.el-button.is-disabled.is-plain:focus,.el-button.is-disabled.is-plain:hover{background-color:#fff;border-color:#e6ebf5;color:#c0c4cc}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:hsla(0,0%,100%,.35)}.el-button.is-round{border-radius:20px;padding:12px 23px}.el-button.is-circle{border-radius:50%;padding:12px}.el-button--primary{color:#fff;background-color:#1890ff;border-color:#1890ff}.el-button--primary:focus,.el-button--primary:hover{background:#46a6ff;border-color:#46a6ff;color:#fff}.el-button--primary:active{outline:none}.el-button--primary.is-active,.el-button--primary:active{background:#1682e6;border-color:#1682e6;color:#fff}.el-button--primary.is-disabled,.el-button--primary.is-disabled:active,.el-button--primary.is-disabled:focus,.el-button--primary.is-disabled:hover{color:#fff;background-color:#8cc8ff;border-color:#8cc8ff}.el-button--primary.is-plain{color:#1890ff;background:#e8f4ff;border-color:#a3d3ff}.el-button--primary.is-plain:focus,.el-button--primary.is-plain:hover{background:#1890ff;border-color:#1890ff;color:#fff}.el-button--primary.is-plain:active{background:#1682e6;border-color:#1682e6;color:#fff;outline:none}.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover{color:#74bcff;background-color:#e8f4ff;border-color:#d1e9ff}.el-button--success{color:#fff;background-color:#13ce66;border-color:#13ce66}.el-button--success:focus,.el-button--success:hover{background:#42d885;border-color:#42d885;color:#fff}.el-button--success:active{outline:none}.el-button--success.is-active,.el-button--success:active{background:#11b95c;border-color:#11b95c;color:#fff}.el-button--success.is-disabled,.el-button--success.is-disabled:active,.el-button--success.is-disabled:focus,.el-button--success.is-disabled:hover{color:#fff;background-color:#89e7b3;border-color:#89e7b3}.el-button--success.is-plain{color:#13ce66;background:#e7faf0;border-color:#a1ebc2}.el-button--success.is-plain:focus,.el-button--success.is-plain:hover{background:#13ce66;border-color:#13ce66;color:#fff}.el-button--success.is-plain:active{background:#11b95c;border-color:#11b95c;color:#fff;outline:none}.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover{color:#71e2a3;background-color:#e7faf0;border-color:#d0f5e0}.el-button--warning{color:#fff;background-color:#ffba00;border-color:#ffba00}.el-button--warning:focus,.el-button--warning:hover{background:#ffc833;border-color:#ffc833;color:#fff}.el-button--warning:active{outline:none}.el-button--warning.is-active,.el-button--warning:active{background:#e6a700;border-color:#e6a700;color:#fff}.el-button--warning.is-disabled,.el-button--warning.is-disabled:active,.el-button--warning.is-disabled:focus,.el-button--warning.is-disabled:hover{color:#fff;background-color:#ffdd80;border-color:#ffdd80}.el-button--warning.is-plain{color:#ffba00;background:#fff8e6;border-color:#ffe399}.el-button--warning.is-plain:focus,.el-button--warning.is-plain:hover{background:#ffba00;border-color:#ffba00;color:#fff}.el-button--warning.is-plain:active{background:#e6a700;border-color:#e6a700;color:#fff;outline:none}.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover{color:#ffd666;background-color:#fff8e6;border-color:#fff1cc}.el-button--danger{color:#fff;background-color:#ff4949;border-color:#ff4949}.el-button--danger:focus,.el-button--danger:hover{background:#ff6d6d;border-color:#ff6d6d;color:#fff}.el-button--danger:active{outline:none}.el-button--danger.is-active,.el-button--danger:active{background:#e64242;border-color:#e64242;color:#fff}.el-button--danger.is-disabled,.el-button--danger.is-disabled:active,.el-button--danger.is-disabled:focus,.el-button--danger.is-disabled:hover{color:#fff;background-color:#ffa4a4;border-color:#ffa4a4}.el-button--danger.is-plain{color:#ff4949;background:#ffeded;border-color:#ffb6b6}.el-button--danger.is-plain:focus,.el-button--danger.is-plain:hover{background:#ff4949;border-color:#ff4949;color:#fff}.el-button--danger.is-plain:active{background:#e64242;border-color:#e64242;color:#fff;outline:none}.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover{color:#ff9292;background-color:#ffeded;border-color:#ffdbdb}.el-button--info{color:#fff;background-color:#909399;border-color:#909399}.el-button--info:focus,.el-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.el-button--info:active{outline:none}.el-button--info.is-active,.el-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.el-button--info.is-disabled,.el-button--info.is-disabled:active,.el-button--info.is-disabled:focus,.el-button--info.is-disabled:hover{color:#fff;background-color:#c8c9cc;border-color:#c8c9cc}.el-button--info.is-plain{color:#909399;background:#f4f4f5;border-color:#d3d4d6}.el-button--info.is-plain:focus,.el-button--info.is-plain:hover{background:#909399;border-color:#909399;color:#fff}.el-button--info.is-plain:active{background:#82848a;border-color:#82848a;color:#fff;outline:none}.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover{color:#bcbec2;background-color:#f4f4f5;border-color:#e9e9eb}.el-button--medium{padding:10px 20px;font-size:14px;border-radius:4px}.el-button--medium.is-round{padding:10px 20px}.el-button--medium.is-circle{padding:10px}.el-button--small{padding:9px 15px;font-size:12px;border-radius:3px}.el-button--small.is-round{padding:9px 15px}.el-button--small.is-circle{padding:9px}.el-button--mini{padding:7px 15px;font-size:12px;border-radius:3px}.el-button--mini.is-round{padding:7px 15px}.el-button--mini.is-circle{padding:7px}.el-button--text{border-color:transparent;color:#1890ff;background:transparent;padding-left:0;padding-right:0}.el-button--text:focus,.el-button--text:hover{color:#46a6ff;border-color:transparent;background-color:transparent}.el-button--text:active{color:#1682e6;background-color:transparent}.el-button--text.is-disabled,.el-button--text.is-disabled:focus,.el-button--text.is-disabled:hover,.el-button--text:active{border-color:transparent}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button.is-disabled{z-index:1}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px;border-top-left-radius:4px;border-bottom-left-radius:4px}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:20px}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button.is-active,.el-button-group>.el-button:not(.is-disabled):active,.el-button-group>.el-button:not(.is-disabled):focus,.el-button-group>.el-button:not(.is-disabled):hover{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-calendar{background-color:#fff}.el-calendar__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:12px 20px;border-bottom:1px solid #dfe6ec}.el-calendar__title{color:#000;-ms-flex-item-align:center;align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:#606266;font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:#c0c4cc}.el-calendar-table td{border-bottom:1px solid #dfe6ec;border-right:1px solid #dfe6ec;vertical-align:top;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.el-calendar-table td.is-selected{background-color:#f2f8fe}.el-calendar-table td.is-today{color:#1890ff}.el-calendar-table tr:first-child td{border-top:1px solid #dfe6ec}.el-calendar-table tr td:first-child{border-left:1px solid #dfe6ec}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px;height:85px}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:#f2f8fe}.el-backtop{position:fixed;background-color:#fff;width:40px;height:40px;border-radius:50%;color:#1890ff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-size:20px;-webkit-box-shadow:0 0 6px rgba(0,0,0,.12);box-shadow:0 0 6px rgba(0,0,0,.12);cursor:pointer;z-index:5}.el-backtop:hover{background-color:#f2f6fc}.el-page-header{line-height:24px}.el-page-header,.el-page-header__left{display:-webkit-box;display:-ms-flexbox;display:flex}.el-page-header__left{cursor:pointer;margin-right:40px;position:relative}.el-page-header__left:after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:#dcdfe6}.el-page-header__left .el-icon-back{font-size:18px;margin-right:6px;-ms-flex-item-align:center;align-self:center}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:#303133}.el-checkbox{color:#606266;font-weight:500;font-size:14px;position:relative;cursor:pointer;display:inline-block;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px}.el-checkbox.is-bordered{padding:9px 20px 9px 10px;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:normal;height:40px}.el-checkbox.is-bordered.is-checked{border-color:#1890ff}.el-checkbox.is-bordered.is-disabled{border-color:#e6ebf5;cursor:not-allowed}.el-checkbox.is-bordered+.el-checkbox.is-bordered{margin-left:10px}.el-checkbox.is-bordered.el-checkbox--medium{padding:7px 20px 7px 10px;border-radius:4px;height:36px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label{line-height:17px;font-size:14px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:5px 15px 5px 10px;border-radius:3px;height:32px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{line-height:15px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox.is-bordered.el-checkbox--mini{padding:3px 15px 3px 10px;border-radius:3px;height:28px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__label{line-height:12px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:none;display:inline-block;line-height:1;position:relative;vertical-align:middle}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:#edf2fc;border-color:#dcdfe6;cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:#c0c4cc}.el-checkbox__input.is-disabled .el-checkbox__inner+.el-checkbox__label{cursor:not-allowed}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:#f2f6fc;border-color:#dcdfe6}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:#c0c4cc}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:#f2f6fc;border-color:#dcdfe6}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:#c0c4cc;border-color:#c0c4cc}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:#c0c4cc;cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:#1890ff;border-color:#1890ff}.el-checkbox__input.is-checked .el-checkbox__inner:after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:#1890ff}.el-checkbox__input.is-focus .el-checkbox__inner{border-color:#1890ff}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:#1890ff;border-color:#1890ff}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:#fff;height:2px;-webkit-transform:scale(.5);transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:1px solid #dcdfe6;border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;-webkit-transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:#1890ff}.el-checkbox__inner:after{-webkit-box-sizing:content-box;box-sizing:content-box;content:"";border:1px solid #fff;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;-webkit-transform:rotate(45deg) scaleY(0);transform:rotate(45deg) scaleY(0);width:3px;-webkit-transition:-webkit-transform .15s ease-in .05s;transition:-webkit-transform .15s ease-in .05s;transition:transform .15s ease-in .05s;transition:transform .15s ease-in .05s,-webkit-transform .15s ease-in .05s;-webkit-transform-origin:center;transform-origin:center}.el-checkbox__original{opacity:0;outline:none;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:10px;line-height:19px;font-size:14px}.el-checkbox:last-of-type{margin-right:0}.el-checkbox-button,.el-checkbox-button__inner{position:relative;display:inline-block}.el-checkbox-button__inner{line-height:1;font-weight:500;white-space:nowrap;vertical-align:middle;cursor:pointer;background:#fff;border:1px solid #dcdfe6;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;margin:0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:12px 20px;font-size:14px;border-radius:0}.el-checkbox-button__inner.is-round{padding:12px 20px}.el-checkbox-button__inner:hover{color:#1890ff}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:none;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:#fff;background-color:#1890ff;border-color:#1890ff;-webkit-box-shadow:-1px 0 0 0 #74bcff;box-shadow:-1px 0 0 0 #74bcff}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:#1890ff}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#e6ebf5;-webkit-box-shadow:none;box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:#e6ebf5}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:1px solid #dcdfe6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:#1890ff}.el-checkbox-button:last-child .el-checkbox-button__inner{border-radius:0 4px 4px 0}.el-checkbox-button--medium .el-checkbox-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-checkbox-button--medium .el-checkbox-button__inner.is-round{padding:10px 20px}.el-checkbox-button--small .el-checkbox-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:9px 15px}.el-checkbox-button--mini .el-checkbox-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-checkbox-button--mini .el-checkbox-button__inner.is-round{padding:7px 15px}.el-checkbox-group{font-size:0}.el-radio{color:#606266;font-weight:500;line-height:1;position:relative;cursor:pointer;display:inline-block;white-space:nowrap;outline:none;font-size:14px;margin-right:30px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.el-radio.is-bordered{padding:12px 20px 0 10px;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px}.el-radio.is-bordered.is-checked{border-color:#1890ff}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:#e6ebf5}.el-radio.is-bordered+.el-radio.is-bordered{margin-left:10px}.el-radio--medium.is-bordered{padding:10px 20px 0 10px;border-radius:4px;height:36px}.el-radio--medium.is-bordered .el-radio__label{font-size:14px}.el-radio--medium.is-bordered .el-radio__inner{height:14px;width:14px}.el-radio--small.is-bordered{padding:8px 15px 0 10px;border-radius:3px;height:32px}.el-radio--small.is-bordered .el-radio__label{font-size:12px}.el-radio--small.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio--mini.is-bordered{padding:6px 15px 0 10px;border-radius:3px;height:28px}.el-radio--mini.is-bordered .el-radio__label{font-size:12px}.el-radio--mini.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:none;display:inline-block;line-height:1;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:#f5f7fa;border-color:#dfe4ed;cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:#f5f7fa}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:#f5f7fa;border-color:#dfe4ed}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:#c0c4cc}.el-radio__input.is-disabled+span.el-radio__label{color:#c0c4cc;cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:#1890ff;background:#1890ff}.el-radio__input.is-checked .el-radio__inner:after{-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:#1890ff}.el-radio__input.is-focus .el-radio__inner{border-color:#1890ff}.el-radio__inner{border:1px solid #dcdfe6;border-radius:100%;width:14px;height:14px;background-color:#fff;position:relative;cursor:pointer;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.el-radio__inner:hover{border-color:#1890ff}.el-radio__inner:after{width:4px;height:4px;border-radius:100%;background-color:#fff;content:"";position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%) scale(0);transform:translate(-50%,-50%) scale(0);-webkit-transition:-webkit-transform .15s ease-in;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in,-webkit-transform .15s ease-in}.el-radio__original{opacity:0;outline:none;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{-webkit-box-shadow:0 0 2px 2px #1890ff;box-shadow:0 0 2px 2px #1890ff}.el-radio__label{font-size:14px;padding-left:10px}.el-scrollbar{overflow:hidden;position:relative}.el-scrollbar:active>.el-scrollbar__bar,.el-scrollbar:focus>.el-scrollbar__bar,.el-scrollbar:hover>.el-scrollbar__bar{opacity:1;-webkit-transition:opacity .34s ease-out;transition:opacity .34s ease-out}.el-scrollbar__wrap{overflow:scroll;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{width:0;height:0}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:rgba(144,147,153,.3);-webkit-transition:background-color .3s;transition:background-color .3s}.el-scrollbar__thumb:hover{background-color:rgba(144,147,153,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px;opacity:0;-webkit-transition:opacity .12s ease-out;transition:opacity .12s ease-out}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-cascader-panel{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:4px;font-size:14px}.el-cascader-panel.is-bordered{border:1px solid #dfe4ed;border-radius:4px}.el-cascader-menu{min-width:180px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;border-right:1px solid #dfe4ed}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;-webkit-box-sizing:border-box;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;color:#c0c4cc}.el-cascader-node{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:none}.el-cascader-node.is-selectable.in-active-path{color:#606266}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:#1890ff;font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:#f5f7fa}.el-cascader-node.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-avatar{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow:hidden;color:#fff;background:#c0c4cc;width:40px;height:40px;line-height:40px;font-size:14px}.el-avatar>img{display:block;height:100%;vertical-align:middle}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:4px}.el-avatar--icon{font-size:18px}.el-avatar--large{width:40px;height:40px;line-height:40px}.el-avatar--medium{width:36px;height:36px;line-height:36px}.el-avatar--small{width:28px;height:28px;line-height:28px}@-webkit-keyframes el-drawer-fade-in{0%{opacity:0}to{opacity:1}}@keyframes el-drawer-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes rtl-drawer-in{0%{-webkit-transform:translate(100%);transform:translate(100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@keyframes rtl-drawer-in{0%{-webkit-transform:translate(100%);transform:translate(100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@-webkit-keyframes rtl-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translate(100%);transform:translate(100%)}}@keyframes rtl-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translate(100%);transform:translate(100%)}}@-webkit-keyframes ltr-drawer-in{0%{-webkit-transform:translate(-100%);transform:translate(-100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@keyframes ltr-drawer-in{0%{-webkit-transform:translate(-100%);transform:translate(-100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@-webkit-keyframes ltr-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translate(-100%);transform:translate(-100%)}}@keyframes ltr-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translate(-100%);transform:translate(-100%)}}@-webkit-keyframes ttb-drawer-in{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@keyframes ttb-drawer-in{0%{-webkit-transform:translateY(-100%);transform:translateY(-100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@-webkit-keyframes ttb-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@keyframes ttb-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translateY(-100%);transform:translateY(-100%)}}@-webkit-keyframes btt-drawer-in{0%{-webkit-transform:translateY(100%);transform:translateY(100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@keyframes btt-drawer-in{0%{-webkit-transform:translateY(100%);transform:translateY(100%)}to{-webkit-transform:translate(0);transform:translate(0)}}@-webkit-keyframes btt-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}@keyframes btt-drawer-out{0%{-webkit-transform:translate(0);transform:translate(0)}to{-webkit-transform:translateY(100%);transform:translateY(100%)}}.el-drawer{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);overflow:hidden;outline:0}.el-drawer.rtl{-webkit-animation:rtl-drawer-out .3s;animation:rtl-drawer-out .3s}.el-drawer__open .el-drawer.rtl{-webkit-animation:rtl-drawer-in .3s 1ms;animation:rtl-drawer-in .3s 1ms}.el-drawer.ltr{-webkit-animation:ltr-drawer-out .3s;animation:ltr-drawer-out .3s}.el-drawer__open .el-drawer.ltr{-webkit-animation:ltr-drawer-in .3s 1ms;animation:ltr-drawer-in .3s 1ms}.el-drawer.ttb{-webkit-animation:ttb-drawer-out .3s;animation:ttb-drawer-out .3s}.el-drawer__open .el-drawer.ttb{-webkit-animation:ttb-drawer-in .3s 1ms;animation:ttb-drawer-in .3s 1ms}.el-drawer.btt{-webkit-animation:btt-drawer-out .3s;animation:btt-drawer-out .3s}.el-drawer__open .el-drawer.btt{-webkit-animation:btt-drawer-in .3s 1ms;animation:btt-drawer-in .3s 1ms}.el-drawer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;margin:0}.el-drawer__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#72767b;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:32px;padding:20px;padding-bottom:0}.el-drawer__header>:first-child,.el-drawer__title{-webkit-box-flex:1;-ms-flex:1;flex:1}.el-drawer__title{margin:0;line-height:inherit;font-size:1rem}.el-drawer__close-btn{border:none;cursor:pointer;font-size:20px;color:inherit;background-color:transparent}.el-drawer__body{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:auto}.el-drawer__body>*{-webkit-box-sizing:border-box;box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer__container{position:relative;left:0;right:0;top:0;bottom:0;height:100%;width:100%}.el-drawer-fade-enter-active{-webkit-animation:el-drawer-fade-in .3s;animation:el-drawer-fade-in .3s}.el-drawer-fade-leave-active{animation:el-drawer-fade-in .3s reverse}.el-popconfirm__main{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin:0}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:#f2f2f2}.el-skeleton.is-animated .el-skeleton__item{background:-webkit-gradient(linear,left top,right top,color-stop(25%,#f2f2f2),color-stop(37%,#e6e6e6),color-stop(63%,#f2f2f2));background:linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-skeleton__item{background:#f2f2f2;display:inline-block;height:16px;border-radius:4px;width:100%}.el-skeleton__circle{border-radius:50%;width:36px;height:36px;line-height:36px}.el-skeleton__circle--lg{width:40px;height:40px;line-height:40px}.el-skeleton__circle--md{width:28px;height:28px;line-height:28px}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:13px}.el-skeleton__caption{height:12px}.el-skeleton__h1{height:20px}.el-skeleton__h3{height:18px}.el-skeleton__h5{height:16px}.el-skeleton__image{width:unset;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:0}.el-skeleton__image svg{fill:#dcdde0;width:22%;height:22%}.el-empty{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 0}.el-empty__image{width:160px}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{fill:#dcdde0;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:20px}.el-empty__description p{margin:0;font-size:14px;color:#909399}.el-empty__bottom{margin-top:20px}.el-descriptions{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px;color:#303133}.el-descriptions__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px}.el-descriptions__title{font-size:16px;font-weight:700}.el-descriptions__body{color:#606266;background-color:#fff}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%;table-layout:fixed}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:left;font-weight:400;line-height:1.5}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-right{text-align:right}.el-descriptions .is-bordered{table-layout:auto}.el-descriptions .is-bordered .el-descriptions-item__cell{border:1px solid #e6ebf5;padding:12px 10px}.el-descriptions :not(.is-bordered) .el-descriptions-item__cell{padding-bottom:12px}.el-descriptions--medium.is-bordered .el-descriptions-item__cell{padding:10px}.el-descriptions--medium:not(.is-bordered) .el-descriptions-item__cell{padding-bottom:10px}.el-descriptions--small{font-size:12px}.el-descriptions--small.is-bordered .el-descriptions-item__cell{padding:8px 10px}.el-descriptions--small:not(.is-bordered) .el-descriptions-item__cell{padding-bottom:8px}.el-descriptions--mini{font-size:12px}.el-descriptions--mini.is-bordered .el-descriptions-item__cell{padding:6px 10px}.el-descriptions--mini:not(.is-bordered) .el-descriptions-item__cell{padding-bottom:6px}.el-descriptions-item{vertical-align:top}.el-descriptions-item__container{display:-webkit-box;display:-ms-flexbox;display:flex}.el-descriptions-item__container .el-descriptions-item__content,.el-descriptions-item__container .el-descriptions-item__label{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline}.el-descriptions-item__container .el-descriptions-item__content{-webkit-box-flex:1;-ms-flex:1;flex:1}.el-descriptions-item__label.has-colon:after{content:":";position:relative;top:-.5px}.el-descriptions-item__label.is-bordered-label{font-weight:700;color:#909399;background:#fafafa}.el-descriptions-item__label:not(.is-bordered-label){margin-right:10px}.el-descriptions-item__content{word-break:break-word;overflow-wrap:break-word}.el-result{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 30px}.el-result__icon svg{width:64px;height:64px}.el-result__title{margin-top:20px}.el-result__title p{margin:0;font-size:20px;color:#303133;line-height:1.3}.el-result__subtitle{margin-top:10px}.el-result__subtitle p{margin:0;font-size:14px;color:#606266;line-height:1.3}.el-result__extra{margin-top:30px}.el-result .icon-success{fill:#13ce66}.el-result .icon-error{fill:#ff4949}.el-result .icon-info{fill:#909399}.el-result .icon-warning{fill:#ffba00}.fade-enter-active,.fade-leave-active{-webkit-transition:opacity .28s;transition:opacity .28s}.fade-enter,.fade-leave-active{opacity:0}.fade-transform-enter-active,.fade-transform-leave-active{-webkit-transition:all .5s;transition:all .5s}.fade-transform-enter{opacity:0;-webkit-transform:translateX(-30px);transform:translateX(-30px)}.fade-transform-leave-to{opacity:0;-webkit-transform:translateX(30px);transform:translateX(30px)}.breadcrumb-enter-active,.breadcrumb-leave-active{-webkit-transition:all .5s;transition:all .5s}.breadcrumb-enter,.breadcrumb-leave-active{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.breadcrumb-move{-webkit-transition:all .5s;transition:all .5s}.breadcrumb-leave-active{position:absolute}.el-breadcrumb__inner,.el-breadcrumb__inner a{font-weight:400!important}.el-upload input[type=file]{display:none!important}.el-upload__input{display:none}.cell .el-tag{margin-right:0}.small-padding .cell{padding-left:5px;padding-right:5px}.fixed-width .el-button--mini{padding:7px 10px;width:60px}.status-col .cell{padding:0 10px;text-align:center}.status-col .cell .el-tag{margin-right:0}.el-dialog{-webkit-transform:none;transform:none;left:0;position:relative;margin:0 auto}.upload-container .el-upload{width:100%}.upload-container .el-upload .el-upload-dragger{width:100%;height:200px}.el-dropdown-menu a{display:block}.el-range-editor.el-input__inner{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}#app .main-container{min-height:100%;-webkit-transition:margin-left .28s;transition:margin-left .28s;margin-left:210px;position:relative}#app .sidebar-container{-webkit-transition:width .28s;transition:width .28s;width:210px!important;background-color:#304156;height:100%;position:fixed;font-size:0;top:0;bottom:0;left:0;z-index:1001;overflow:hidden}#app .sidebar-container .horizontal-collapse-transition{-webkit-transition:width 0s ease-in-out,padding-left 0s ease-in-out,padding-right 0s ease-in-out;transition:width 0s ease-in-out,padding-left 0s ease-in-out,padding-right 0s ease-in-out}#app .sidebar-container .scrollbar-wrapper{overflow-x:hidden!important}#app .sidebar-container .el-scrollbar__bar.is-vertical{right:0}#app .sidebar-container .el-scrollbar{height:100%}#app .sidebar-container.has-logo .el-scrollbar{height:calc(100% - 50px)}#app .sidebar-container .is-horizontal{display:none}#app .sidebar-container a{display:inline-block;width:100%;overflow:hidden}#app .sidebar-container .svg-icon{margin-right:16px}#app .sidebar-container .el-menu{border:none;height:100%;width:100%!important}#app .sidebar-container .el-submenu__title:hover,#app .sidebar-container .submenu-title-noDropdown:hover{background-color:#263445!important}#app .sidebar-container .is-active>.el-submenu__title{color:#f4f4f5!important}#app .sidebar-container .el-submenu .el-menu-item,#app .sidebar-container .nest-menu .el-submenu>.el-submenu__title{min-width:210px!important;background-color:#1f2d3d!important}#app .sidebar-container .el-submenu .el-menu-item:hover,#app .sidebar-container .nest-menu .el-submenu>.el-submenu__title:hover{background-color:#001528!important}#app .hideSidebar .sidebar-container{width:54px!important}#app .hideSidebar .main-container{margin-left:54px}#app .hideSidebar .submenu-title-noDropdown{padding:0!important;position:relative}#app .hideSidebar .submenu-title-noDropdown .el-tooltip{padding:0!important}#app .hideSidebar .submenu-title-noDropdown .el-tooltip .svg-icon{margin-left:20px}#app .hideSidebar .el-submenu{overflow:hidden}#app .hideSidebar .el-submenu>.el-submenu__title{padding:0!important}#app .hideSidebar .el-submenu>.el-submenu__title .svg-icon{margin-left:20px}#app .hideSidebar .el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}#app .hideSidebar .el-menu--collapse .el-submenu>.el-submenu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}#app .el-menu--collapse .el-menu .el-submenu{min-width:210px!important}#app .mobile .main-container{margin-left:0}#app .mobile .sidebar-container{-webkit-transition:-webkit-transform .28s;transition:-webkit-transform .28s;transition:transform .28s;transition:transform .28s,-webkit-transform .28s;width:210px!important}#app .mobile.hideSidebar .sidebar-container{pointer-events:none;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transform:translate3d(-210px,0,0);transform:translate3d(-210px,0,0)}#app .withoutAnimation .main-container,#app .withoutAnimation .sidebar-container{-webkit-transition:none;transition:none}.el-menu--vertical>.el-menu .svg-icon{margin-right:16px}.el-menu--vertical .el-menu-item:hover,.el-menu--vertical .nest-menu .el-submenu>.el-submenu__title:hover{background-color:#263445!important}.el-menu--vertical>.el-menu--popup{max-height:100vh;overflow-y:auto}.el-menu--vertical>.el-menu--popup::-webkit-scrollbar-track-piece{background:#d3dce6}.el-menu--vertical>.el-menu--popup::-webkit-scrollbar{width:6px}.el-menu--vertical>.el-menu--popup::-webkit-scrollbar-thumb{background:#99a9bf;border-radius:20px}.blue-btn{background:#324157}.blue-btn:hover{color:#324157}.blue-btn:hover:after,.blue-btn:hover:before{background:#324157}.light-blue-btn{background:#3a71a8}.light-blue-btn:hover{color:#3a71a8}.light-blue-btn:hover:after,.light-blue-btn:hover:before{background:#3a71a8}.red-btn{background:#c03639}.red-btn:hover{color:#c03639}.red-btn:hover:after,.red-btn:hover:before{background:#c03639}.pink-btn{background:#e65d6e}.pink-btn:hover{color:#e65d6e}.pink-btn:hover:after,.pink-btn:hover:before{background:#e65d6e}.green-btn{background:#30b08f}.green-btn:hover{color:#30b08f}.green-btn:hover:after,.green-btn:hover:before{background:#30b08f}.tiffany-btn{background:#4ab7bd}.tiffany-btn:hover{color:#4ab7bd}.tiffany-btn:hover:after,.tiffany-btn:hover:before{background:#4ab7bd}.yellow-btn{background:#fec171}.yellow-btn:hover{color:#fec171}.yellow-btn:hover:after,.yellow-btn:hover:before{background:#fec171}.pan-btn{font-size:14px;color:#fff;padding:14px 36px;border-radius:8px;border:none;outline:none;-webkit-transition:all .6s ease;transition:all .6s ease;position:relative;display:inline-block}.pan-btn:hover{background:#fff}.pan-btn:hover:after,.pan-btn:hover:before{width:100%;-webkit-transition:all .6s ease;transition:all .6s ease}.pan-btn:after,.pan-btn:before{content:"";position:absolute;top:0;right:0;height:2px;width:0;-webkit-transition:all .4s ease;transition:all .4s ease}.pan-btn:after{right:inherit;top:inherit;left:0;bottom:0}.custom-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;color:#fff;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;padding:10px 15px;font-size:14px;border-radius:4px}*{padding:0;margin:0}body{height:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif}label{font-weight:700}html{-webkit-box-sizing:border-box;box-sizing:border-box}#app,html{height:100%}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}.no-padding{padding:0!important}.padding-content{padding:4px 0}a:active,a:focus{outline:none}a,a:focus,a:hover{cursor:pointer;color:inherit;text-decoration:none}div:focus{outline:none}.fr{float:right}.fl{float:left}.pr-5{padding-right:5px}.pl-5{padding-left:5px}.block{display:block}.pointer{cursor:pointer}.inlineBlock{display:block}.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}aside{background:#eef1f6;padding:8px 24px;margin-bottom:20px;border-radius:2px;display:block;line-height:32px;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;color:#2c3e50;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}aside a{color:#337ab7;cursor:pointer}aside a:hover{color:#20a0ff}.app-container{padding:20px}.components-container{margin:30px 50px;position:relative}.pagination-container{margin-top:30px}.text-center{text-align:center}.sub-navbar{height:50px;line-height:50px;position:relative;width:100%;text-align:right;padding-right:20px;-webkit-transition:position .6s ease;transition:position .6s ease;background:-webkit-gradient(linear,left top,right top,from(#20b6f9),color-stop(0,#20b6f9),color-stop(100%,#2178f1),to(#2178f1));background:linear-gradient(90deg,#20b6f9,#20b6f9 0,#2178f1 100%,#2178f1 0)}.sub-navbar .subtitle{font-size:20px;color:#fff}.sub-navbar.deleted,.sub-navbar.draft{background:#d0d0d0}.link-type,.link-type:focus{color:#337ab7;cursor:pointer}.link-type:focus:hover,.link-type:hover{color:#20a0ff}.filter-container{padding-bottom:10px}.filter-container .filter-item{display:inline-block;vertical-align:middle;margin-bottom:10px}.multiselect{line-height:16px}.multiselect--active{z-index:1000!important}ol,ul{list-style:none}.showRightPanel{overflow:hidden;position:relative;width:calc(100% - 15px)}.rightPanel-background[data-v-1cc16d82]{position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity .3s cubic-bezier(.7,.3,.1,1);transition:opacity .3s cubic-bezier(.7,.3,.1,1);background:rgba(0,0,0,.2);z-index:-1}.rightPanel[data-v-1cc16d82]{width:100%;max-width:260px;height:100vh;position:fixed;top:0;right:0;-webkit-box-shadow:0 0 15px 0 rgba(0,0,0,.05);box-shadow:0 0 15px 0 rgba(0,0,0,.05);-webkit-transition:all .25s cubic-bezier(.7,.3,.1,1);transition:all .25s cubic-bezier(.7,.3,.1,1);-webkit-transform:translate(100%);transform:translate(100%);background:#fff;z-index:40000}.show[data-v-1cc16d82]{-webkit-transition:all .3s cubic-bezier(.7,.3,.1,1);transition:all .3s cubic-bezier(.7,.3,.1,1)}.show .rightPanel-background[data-v-1cc16d82]{z-index:20000;opacity:1;width:100%;height:100%}.show .rightPanel[data-v-1cc16d82]{-webkit-transform:translate(0);transform:translate(0)}.handle-button[data-v-1cc16d82]{width:48px;height:48px;position:absolute;left:-48px;text-align:center;font-size:24px;border-radius:6px 0 0 6px!important;z-index:0;pointer-events:auto;cursor:pointer;color:#fff;line-height:48px}.handle-button i[data-v-1cc16d82]{font-size:24px;line-height:48px}.app-main[data-v-92459f82]{min-height:calc(100vh - 50px);width:100%;position:relative;overflow:hidden}.fixed-header+.app-main[data-v-92459f82]{padding-top:50px}.hasTagsView .app-main[data-v-92459f82]{min-height:calc(100vh - 84px)}.hasTagsView .fixed-header+.app-main[data-v-92459f82]{padding-top:84px}.el-popup-parent--hidden .fixed-header{padding-right:15px}.app-breadcrumb.el-breadcrumb[data-v-1919fc1a]{display:inline-block;font-size:14px;line-height:50px;margin-left:8px}.app-breadcrumb.el-breadcrumb .no-redirect[data-v-1919fc1a]{color:#97a8be;cursor:text}.hamburger[data-v-49e15297]{display:inline-block;vertical-align:middle;width:20px;height:20px}.hamburger.is-active[data-v-49e15297]{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.message-title[data-v-be34583a]{font-size:16px;color:#333;font-weight:700;padding-right:8px}.navbar[data-v-48310396]{height:50px;overflow:hidden;position:relative;background:#fff;-webkit-box-shadow:0 1px 4px rgba(0,21,41,.08);box-shadow:0 1px 4px rgba(0,21,41,.08)}.navbar .hamburger-container[data-v-48310396]{line-height:46px;height:100%;float:left;cursor:pointer;-webkit-transition:background .3s;transition:background .3s;-webkit-tap-highlight-color:transparent}.navbar .hamburger-container[data-v-48310396]:hover{background:rgba(0,0,0,.025)}.navbar .breadcrumb-container[data-v-48310396]{float:left}.navbar .errLog-container[data-v-48310396]{display:inline-block;vertical-align:top}.navbar .right-menu[data-v-48310396]{float:right;height:100%;line-height:50px}.navbar .right-menu[data-v-48310396]:focus{outline:none}.navbar .right-menu .right-menu-item[data-v-48310396]{display:inline-block;padding:0 8px;height:100%;font-size:18px;color:#5a5e66;vertical-align:text-bottom}.navbar .right-menu .right-menu-item.hover-effect[data-v-48310396]{cursor:pointer;-webkit-transition:background .3s;transition:background .3s}.navbar .right-menu .right-menu-item.hover-effect[data-v-48310396]:hover{background:rgba(0,0,0,.025)}.navbar .right-menu .avatar-container[data-v-48310396]{margin-right:30px}.navbar .right-menu .avatar-container .avatar-wrapper[data-v-48310396]{margin-top:5px;position:relative}.navbar .right-menu .avatar-container .avatar-wrapper .user-avatar[data-v-48310396]{cursor:pointer;width:40px;height:40px;border-radius:10px}.navbar .right-menu .avatar-container .avatar-wrapper .el-icon-caret-bottom[data-v-48310396]{cursor:pointer;position:absolute;right:-20px;top:25px;font-size:12px}.theme-message,.theme-picker-dropdown{z-index:99999!important}.theme-picker .el-color-picker__trigger{height:26px!important;width:26px!important;padding:2px}.theme-picker-dropdown .el-color-dropdown__link-btn{display:none}.drawer-container[data-v-5d274279]{padding:24px;font-size:14px;line-height:1.5;word-wrap:break-word}.drawer-container .drawer-title[data-v-5d274279]{margin-bottom:12px;color:rgba(0,0,0,.85);font-size:14px;line-height:22px}.drawer-container .drawer-item[data-v-5d274279]{color:rgba(0,0,0,.65);font-size:14px;padding:12px 0}.drawer-container .drawer-switch[data-v-5d274279]{float:right}.sidebarLogoFade-enter-active[data-v-1d0da3a0]{-webkit-transition:opacity 1.5s;transition:opacity 1.5s}.sidebarLogoFade-enter[data-v-1d0da3a0],.sidebarLogoFade-leave-to[data-v-1d0da3a0]{opacity:0}.sidebar-logo-container[data-v-1d0da3a0]{position:relative;width:100%;height:50px;line-height:50px;background:#2b2f3a;text-align:center;overflow:hidden}.sidebar-logo-container .sidebar-logo-link[data-v-1d0da3a0]{height:100%;width:100%}.sidebar-logo-container .sidebar-logo-link .sidebar-logo[data-v-1d0da3a0]{width:32px;height:32px;vertical-align:middle;margin-right:12px}.sidebar-logo-container .sidebar-logo-link .sidebar-title[data-v-1d0da3a0]{display:inline-block;margin:0;color:#fff;font-weight:600;line-height:50px;font-size:14px;font-family:Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;vertical-align:middle}.sidebar-logo-container.collapse .sidebar-logo[data-v-1d0da3a0]{margin-right:0}.scroll-container[data-v-59c4e7df]{white-space:nowrap;position:relative;overflow:hidden;width:100%}.scroll-container[data-v-59c4e7df] .el-scrollbar__bar{bottom:0}.scroll-container[data-v-59c4e7df] .el-scrollbar__wrap{height:70px}.tags-view-container[data-v-c64b5a6c]{height:50px;width:100%;background:#fff;border-bottom:1px solid #d8dce5;-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.12),0 0 3px 0 rgba(0,0,0,.04);box-shadow:0 1px 3px 0 rgba(0,0,0,.12),0 0 3px 0 rgba(0,0,0,.04)}.tags-view-container .tags-view-wrapper .tags-view-item[data-v-c64b5a6c]{display:inline-block;position:relative;cursor:pointer;height:35px;line-height:35px;border:1px solid #d8dce5;color:#495060;background:#fff;padding:0 15px;font-size:13px;margin-left:10px;margin-top:15px;border-radius:3px 3px 0 0}.tags-view-container .tags-view-wrapper .tags-view-item[data-v-c64b5a6c]:first-of-type{margin-left:15px}.tags-view-container .tags-view-wrapper .tags-view-item[data-v-c64b5a6c]:last-of-type{margin-right:15px}.tags-view-container .tags-view-wrapper .tags-view-item.active[data-v-c64b5a6c]{background-color:#198fff;color:#fff;border-color:#198fff}.tags-view-container .tags-view-wrapper .tags-view-item.active[data-v-c64b5a6c]:before{content:"";background:#fff;display:inline-block;width:8px;height:8px;border-radius:50%;position:relative;margin-right:2px}.tags-view-container .contextmenu[data-v-c64b5a6c]{margin:0;background:#fff;z-index:3000;position:absolute;list-style-type:none;padding:5px 0;border-radius:4px;font-size:12px;font-weight:400;color:#333;-webkit-box-shadow:2px 2px 3px 0 rgba(0,0,0,.3);box-shadow:2px 2px 3px 0 rgba(0,0,0,.3)}.tags-view-container .contextmenu li[data-v-c64b5a6c]{margin:0;padding:7px 16px;cursor:pointer}.tags-view-container .contextmenu li[data-v-c64b5a6c]:hover{background:#eee}.tags-view-wrapper .tags-view-item .el-icon-close{width:16px;height:16px;vertical-align:2px;border-radius:50%;text-align:center;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tags-view-wrapper .tags-view-item .el-icon-close:before{-webkit-transform:scale(.6);transform:scale(.6);display:inline-block;vertical-align:-3px}.tags-view-wrapper .tags-view-item .el-icon-close:hover{background-color:#b4bccc;color:#fff}[data-v-2539468a]:export{menuText:#bfcbd9;menuActiveText:#409eff;subMenuActiveText:#f4f4f5;menuBg:#304156;menuHover:#263445;subMenuBg:#1f2d3d;subMenuHover:#001528;sideBarWidth:210px}.app-wrapper[data-v-2539468a]{position:relative;height:100%;width:100%}.app-wrapper[data-v-2539468a]:after{content:"";display:table;clear:both}.app-wrapper.mobile.openSidebar[data-v-2539468a]{position:fixed;top:0}.drawer-bg[data-v-2539468a]{background:#000;opacity:.3;width:100%;top:0;height:100%;position:absolute;z-index:999}.fixed-header[data-v-2539468a]{position:fixed;top:0;right:0;z-index:9;width:calc(100% - 210px);-webkit-transition:width .28s;transition:width .28s}.hideSidebar .fixed-header[data-v-2539468a]{width:calc(100% - 54px)}.mobile .fixed-header[data-v-2539468a]{width:100%}.svg-icon[data-v-f9f7fefc]{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.svg-external-icon[data-v-f9f7fefc]{background-color:currentColor;-webkit-mask-size:cover!important;mask-size:cover!important;display:inline-block} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-06cdbb30.23d65ecc.css b/hippo4j-console/src/main/resources/static/static/css/chunk-06cdbb30.23d65ecc.css new file mode 100644 index 00000000..d253025a --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-06cdbb30.23d65ecc.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}.stack-info>li[data-v-a62d4c8c]{margin-bottom:24px}.stack-info>li p[data-v-a62d4c8c]:first-child{color:#06f;font-weight:600;margin-top:10px}.stack-info>li ul[data-v-a62d4c8c]{margin-left:30px}.stack-info>li ul li[data-v-a62d4c8c]{color:#fc5531;text-align:justify;margin:10px auto} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-1504cdfc.febaf7ae.css b/hippo4j-console/src/main/resources/static/static/css/chunk-1504cdfc.febaf7ae.css new file mode 100644 index 00000000..4054fd75 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-1504cdfc.febaf7ae.css @@ -0,0 +1 @@ +.pan-item[data-v-799537af]{width:200px;height:200px;border-radius:50%;display:inline-block;position:relative;cursor:default;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.2);box-shadow:0 1px 3px rgba(0,0,0,.2)}.pan-info-roles-container[data-v-799537af]{padding:20px;text-align:center}.pan-thumb[data-v-799537af]{width:100%;height:100%;background-position:50%;background-size:cover;border-radius:50%;overflow:hidden;position:absolute;-webkit-transform-origin:95% 40%;transform-origin:95% 40%;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.pan-info[data-v-799537af]{position:absolute;width:inherit;height:inherit;border-radius:50%;overflow:hidden;-webkit-box-shadow:inset 0 0 0 5px rgba(0,0,0,.05);box-shadow:inset 0 0 0 5px rgba(0,0,0,.05)}.pan-info h3[data-v-799537af]{color:#fff;text-transform:uppercase;position:relative;letter-spacing:2px;font-size:18px;margin:0 60px;padding:22px 0 0 0;height:85px;font-family:Open Sans,Arial,sans-serif;text-shadow:0 0 1px #fff,0 1px 2px rgba(0,0,0,.3)}.pan-info p[data-v-799537af]{color:#fff;padding:10px 5px;font-style:italic;margin:0 30px;font-size:12px;border-top:1px solid hsla(0,0%,100%,.5)}.pan-info p a[data-v-799537af]{display:block;color:#333;width:80px;height:80px;background:hsla(0,0%,100%,.3);border-radius:50%;color:#fff;font-style:normal;font-weight:700;text-transform:uppercase;font-size:9px;letter-spacing:1px;padding-top:24px;margin:7px auto 0;font-family:Open Sans,Arial,sans-serif;opacity:0;-webkit-transition:opacity .3s ease-in-out .2s,background .2s linear 0s,-webkit-transform .3s ease-in-out .2s;transition:opacity .3s ease-in-out .2s,background .2s linear 0s,-webkit-transform .3s ease-in-out .2s;transition:transform .3s ease-in-out .2s,opacity .3s ease-in-out .2s,background .2s linear 0s;transition:transform .3s ease-in-out .2s,opacity .3s ease-in-out .2s,background .2s linear 0s,-webkit-transform .3s ease-in-out .2s;-webkit-transform:translateX(60px) rotate(90deg);transform:translateX(60px) rotate(90deg)}.pan-info p a[data-v-799537af]:hover{background:hsla(0,0%,100%,.5)}.pan-item:hover .pan-thumb[data-v-799537af]{-webkit-transform:rotate(-110deg);transform:rotate(-110deg)}.pan-item:hover .pan-info p a[data-v-799537af]{opacity:1;-webkit-transform:translateX(0) rotate(0deg);transform:translateX(0) rotate(0deg)}.box-center[data-v-72e10cd6]{margin:0 auto;display:table}.text-muted[data-v-72e10cd6]{color:#777}.user-profile .user-name[data-v-72e10cd6]{font-weight:700}.user-profile .box-center[data-v-72e10cd6]{padding-top:10px}.user-profile .user-role[data-v-72e10cd6]{padding-top:10px;font-weight:400;font-size:14px}.user-profile .box-social[data-v-72e10cd6]{padding-top:30px}.user-profile .box-social .el-table[data-v-72e10cd6]{border-top:1px solid #dfe6ec}.user-profile .user-follow[data-v-72e10cd6]{padding-top:20px}.user-bio[data-v-72e10cd6]{margin-top:20px;color:#606266}.user-bio span[data-v-72e10cd6]{padding-left:4px}.user-bio .user-bio-section[data-v-72e10cd6]{font-size:14px;padding:15px 0}.user-bio .user-bio-section .user-bio-section-header[data-v-72e10cd6]{border-bottom:1px solid #dfe6ec;padding-bottom:10px;margin-bottom:10px;font-weight:700}.user-activity .user-block .description[data-v-1066d76c],.user-activity .user-block .username[data-v-1066d76c]{display:block;margin-left:50px;padding:2px 0}.user-activity .user-block .username[data-v-1066d76c]{font-size:16px;color:#000}.user-activity .user-block[data-v-1066d76c] :after{clear:both}.user-activity .user-block .img-circle[data-v-1066d76c]{border-radius:50%;width:40px;height:40px;float:left}.user-activity .user-block span[data-v-1066d76c]{font-weight:500;font-size:12px}.user-activity .post[data-v-1066d76c]{font-size:14px;border-bottom:1px solid #d2d6de;margin-bottom:15px;padding-bottom:15px;color:#666}.user-activity .post .image[data-v-1066d76c]{width:100%;height:100%}.user-activity .post .user-images[data-v-1066d76c]{padding-top:20px}.user-activity .list-inline[data-v-1066d76c]{padding-left:0;margin-left:-5px;list-style:none}.user-activity .list-inline li[data-v-1066d76c]{display:inline-block;padding-right:5px;padding-left:5px;font-size:13px}.user-activity .list-inline .link-black[data-v-1066d76c]:focus,.user-activity .list-inline .link-black[data-v-1066d76c]:hover{color:#999}.box-center[data-v-1066d76c]{margin:0 auto;display:table}.text-muted[data-v-1066d76c]{color:#777} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-16eb7b18.6d24dacd.css b/hippo4j-console/src/main/resources/static/static/css/chunk-16eb7b18.6d24dacd.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-16eb7b18.6d24dacd.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-3714bce8.0ea63c11.css b/hippo4j-console/src/main/resources/static/static/css/chunk-3714bce8.0ea63c11.css new file mode 100644 index 00000000..54e528bd --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-3714bce8.0ea63c11.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}.dashboard-editor-container[data-v-64a76a61]{padding:32px;background-color:#f0f2f5;position:relative}.dashboard-editor-container .github-corner[data-v-64a76a61]{position:absolute;top:0;border:0;right:0}.dashboard-editor-container .chart-wrapper[data-v-64a76a61]{background:#fff;padding:16px 16px 0;margin-bottom:32px}@media(max-width:1024px){.chart-wrapper[data-v-64a76a61]{padding:8px}} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-380263e8.6d24dacd.css b/hippo4j-console/src/main/resources/static/static/css/chunk-380263e8.6d24dacd.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-380263e8.6d24dacd.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-434632c4.adc5827d.css b/hippo4j-console/src/main/resources/static/static/css/chunk-434632c4.adc5827d.css new file mode 100644 index 00000000..f088e565 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-434632c4.adc5827d.css @@ -0,0 +1 @@ +.editor-container[data-v-7505e034]{height:82vh;overflow:auto} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-45e73af7.5f8941eb.css b/hippo4j-console/src/main/resources/static/static/css/chunk-45e73af7.5f8941eb.css new file mode 100644 index 00000000..76139dec --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-45e73af7.5f8941eb.css @@ -0,0 +1 @@ +.errPage-container[data-v-6fb1594e]{width:800px;max-width:100%;margin:100px auto}.errPage-container .pan-back-btn[data-v-6fb1594e]{background:#008489;color:#fff;border:none!important}.errPage-container .pan-gif[data-v-6fb1594e]{margin:0 auto;display:block}.errPage-container .pan-img[data-v-6fb1594e]{display:block;margin:0 auto;width:100%}.errPage-container .text-jumbo[data-v-6fb1594e]{font-size:60px;font-weight:700;color:#484848}.errPage-container .list-unstyled[data-v-6fb1594e]{font-size:14px}.errPage-container .list-unstyled li[data-v-6fb1594e]{padding-bottom:5px}.errPage-container .list-unstyled a[data-v-6fb1594e]{color:#008489;text-decoration:none}.errPage-container .list-unstyled a[data-v-6fb1594e]:hover{text-decoration:underline} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-4934959c.6d24dacd.css b/hippo4j-console/src/main/resources/static/static/css/chunk-4934959c.6d24dacd.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-4934959c.6d24dacd.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-4b345e33.6d24dacd.css b/hippo4j-console/src/main/resources/static/static/css/chunk-4b345e33.6d24dacd.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-4b345e33.6d24dacd.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-648295c6.6d24dacd.css b/hippo4j-console/src/main/resources/static/static/css/chunk-648295c6.6d24dacd.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-648295c6.6d24dacd.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-6f742c38.454dc39d.css b/hippo4j-console/src/main/resources/static/static/css/chunk-6f742c38.454dc39d.css new file mode 100644 index 00000000..ea25b761 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-6f742c38.454dc39d.css @@ -0,0 +1 @@ +.social-signup-container[data-v-7309fbbb]{margin:20px 0}.social-signup-container .sign-btn[data-v-7309fbbb]{display:inline-block;cursor:pointer}.social-signup-container .icon[data-v-7309fbbb]{color:#fff;font-size:24px;margin-top:8px}.social-signup-container .qq-svg-container[data-v-7309fbbb],.social-signup-container .wx-svg-container[data-v-7309fbbb]{display:inline-block;width:40px;height:40px;line-height:40px;text-align:center;padding-top:1px;border-radius:4px;margin-bottom:20px;margin-right:5px}.social-signup-container .wx-svg-container[data-v-7309fbbb]{background-color:#24da70}.social-signup-container .qq-svg-container[data-v-7309fbbb]{background-color:#6ba2d6;margin-left:50px}@supports(-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-16fd3f0c]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-16fd3f0c]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-16fd3f0c]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-16fd3f0c]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-16fd3f0c]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-16fd3f0c]{position:relative}.login-container .title-container .title[data-v-16fd3f0c]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-16fd3f0c]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.login-container .thirdparty-button[data-v-16fd3f0c]{position:absolute;right:0;bottom:6px}@media only screen and (max-width:470px){.login-container .thirdparty-button[data-v-16fd3f0c]{display:none}} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-7b878d9e.62f36dd0.css b/hippo4j-console/src/main/resources/static/static/css/chunk-7b878d9e.62f36dd0.css new file mode 100644 index 00000000..072cfa3a --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-7b878d9e.62f36dd0.css @@ -0,0 +1 @@ +.github-corner:hover .octo-arm[data-v-83aa39e4]{-webkit-animation:octocat-wave-data-v-83aa39e4 .56s ease-in-out;animation:octocat-wave-data-v-83aa39e4 .56s ease-in-out}@-webkit-keyframes octocat-wave-data-v-83aa39e4{0%,to{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@keyframes octocat-wave-data-v-83aa39e4{0%,to{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm[data-v-83aa39e4]{-webkit-animation:none;animation:none}.github-corner .octo-arm[data-v-83aa39e4]{-webkit-animation:octocat-wave-data-v-83aa39e4 .56s ease-in-out;animation:octocat-wave-data-v-83aa39e4 .56s ease-in-out}}.panel-group[data-v-787f9ab2]{margin-top:18px}.panel-group .card-panel-col[data-v-787f9ab2]{margin-bottom:32px}.panel-group .card-panel[data-v-787f9ab2]{height:108px;cursor:pointer;font-size:12px;position:relative;overflow:hidden;color:#666;background:#fff;-webkit-box-shadow:4px 4px 40px rgba(0,0,0,.05);box-shadow:4px 4px 40px rgba(0,0,0,.05);border-color:rgba(0,0,0,.05)}.panel-group .card-panel:hover .card-panel-icon-wrapper[data-v-787f9ab2]{color:#fff}.panel-group .card-panel:hover .icon-people[data-v-787f9ab2]{background:#dae8d6}.panel-group .card-panel:hover .icon-message[data-v-787f9ab2]{background:#36a3f7}.panel-group .card-panel:hover .icon-money[data-v-787f9ab2]{background:#a0a6f4}.panel-group .card-panel:hover .icon-shopping[data-v-787f9ab2]{background:#dae8d6}.panel-group .card-panel .icon-people[data-v-787f9ab2]{color:#40c9c6}.panel-group .card-panel .icon-message[data-v-787f9ab2]{color:#36a3f7}.panel-group .card-panel .icon-money[data-v-787f9ab2]{color:#a0a6f4}.panel-group .card-panel .icon-shopping[data-v-787f9ab2]{color:#34bfa3}.panel-group .card-panel .card-panel-icon-wrapper[data-v-787f9ab2]{float:left;margin:14px 0 0 14px;padding:16px;-webkit-transition:all .38s ease-out;transition:all .38s ease-out;border-radius:6px}.panel-group .card-panel .card-panel-icon[data-v-787f9ab2]{float:left;font-size:48px}.panel-group .card-panel .card-panel-description[data-v-787f9ab2]{float:right;font-weight:700;margin:26px;margin-left:0}.panel-group .card-panel .card-panel-description .card-panel-text[data-v-787f9ab2]{line-height:18px;color:rgba(0,0,0,.45);font-size:16px;margin-bottom:12px}.panel-group .card-panel .card-panel-description .card-panel-num[data-v-787f9ab2]{font-size:20px}@media(max-width:550px){.card-panel-description[data-v-787f9ab2]{display:none}.card-panel-icon-wrapper[data-v-787f9ab2]{float:none!important;width:100%;height:100%;margin:0!important}.card-panel-icon-wrapper .svg-icon[data-v-787f9ab2]{display:block;margin:14px auto!important;float:none!important}}.dashboard-editor-container[data-v-384bf764]{padding:32px;background-color:#f0f2f5;position:relative}.dashboard-editor-container .github-corner[data-v-384bf764]{position:absolute;top:0;border:0;right:0}.dashboard-editor-container .el-form-item[data-v-384bf764]{margin-bottom:5px!important;padding-bottom:20px}.dashboard-editor-container .chart-wrapper[data-v-384bf764]{background:#fff;padding:16px 16px 0;margin-bottom:32px}@media(max-width:1024px){.chart-wrapper[data-v-384bf764]{padding:8px}} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-91584750.13a7e89e.css b/hippo4j-console/src/main/resources/static/static/css/chunk-91584750.13a7e89e.css new file mode 100644 index 00000000..2369f9f7 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-91584750.13a7e89e.css @@ -0,0 +1 @@ +.wscn-http404-container[data-v-26fcd89f]{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);position:absolute;top:40%;left:50%}.wscn-http404[data-v-26fcd89f]{position:relative;width:1200px;padding:0 50px;overflow:hidden}.wscn-http404 .pic-404[data-v-26fcd89f]{position:relative;float:left;width:600px;overflow:hidden}.wscn-http404 .pic-404__parent[data-v-26fcd89f]{width:100%}.wscn-http404 .pic-404__child[data-v-26fcd89f]{position:absolute}.wscn-http404 .pic-404__child.left[data-v-26fcd89f]{width:80px;top:17px;left:220px;opacity:0;-webkit-animation-name:cloudLeft-data-v-26fcd89f;animation-name:cloudLeft-data-v-26fcd89f;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s}.wscn-http404 .pic-404__child.mid[data-v-26fcd89f]{width:46px;top:10px;left:420px;opacity:0;-webkit-animation-name:cloudMid-data-v-26fcd89f;animation-name:cloudMid-data-v-26fcd89f;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1.2s;animation-delay:1.2s}.wscn-http404 .pic-404__child.right[data-v-26fcd89f]{width:62px;top:100px;left:500px;opacity:0;-webkit-animation-name:cloudRight-data-v-26fcd89f;animation-name:cloudRight-data-v-26fcd89f;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s}@-webkit-keyframes cloudLeft-data-v-26fcd89f{0%{top:17px;left:220px;opacity:0}20%{top:33px;left:188px;opacity:1}80%{top:81px;left:92px;opacity:1}to{top:97px;left:60px;opacity:0}}@keyframes cloudLeft-data-v-26fcd89f{0%{top:17px;left:220px;opacity:0}20%{top:33px;left:188px;opacity:1}80%{top:81px;left:92px;opacity:1}to{top:97px;left:60px;opacity:0}}@-webkit-keyframes cloudMid-data-v-26fcd89f{0%{top:10px;left:420px;opacity:0}20%{top:40px;left:360px;opacity:1}70%{top:130px;left:180px;opacity:1}to{top:160px;left:120px;opacity:0}}@keyframes cloudMid-data-v-26fcd89f{0%{top:10px;left:420px;opacity:0}20%{top:40px;left:360px;opacity:1}70%{top:130px;left:180px;opacity:1}to{top:160px;left:120px;opacity:0}}@-webkit-keyframes cloudRight-data-v-26fcd89f{0%{top:100px;left:500px;opacity:0}20%{top:120px;left:460px;opacity:1}80%{top:180px;left:340px;opacity:1}to{top:200px;left:300px;opacity:0}}@keyframes cloudRight-data-v-26fcd89f{0%{top:100px;left:500px;opacity:0}20%{top:120px;left:460px;opacity:1}80%{top:180px;left:340px;opacity:1}to{top:200px;left:300px;opacity:0}}.wscn-http404 .bullshit[data-v-26fcd89f]{position:relative;float:left;width:300px;padding:30px 0;overflow:hidden}.wscn-http404 .bullshit__oops[data-v-26fcd89f]{font-size:32px;line-height:40px;color:#1482f0;margin-bottom:20px;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__headline[data-v-26fcd89f],.wscn-http404 .bullshit__oops[data-v-26fcd89f]{font-weight:700;opacity:0;-webkit-animation-name:slideUp-data-v-26fcd89f;animation-name:slideUp-data-v-26fcd89f;-webkit-animation-duration:.5s;animation-duration:.5s}.wscn-http404 .bullshit__headline[data-v-26fcd89f]{font-size:20px;line-height:24px;color:#222;margin-bottom:10px;-webkit-animation-delay:.1s;animation-delay:.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__info[data-v-26fcd89f]{font-size:13px;line-height:21px;color:grey;margin-bottom:30px;-webkit-animation-delay:.2s;animation-delay:.2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__info[data-v-26fcd89f],.wscn-http404 .bullshit__return-home[data-v-26fcd89f]{opacity:0;-webkit-animation-name:slideUp-data-v-26fcd89f;animation-name:slideUp-data-v-26fcd89f;-webkit-animation-duration:.5s;animation-duration:.5s}.wscn-http404 .bullshit__return-home[data-v-26fcd89f]{display:block;float:left;width:110px;height:36px;background:#1482f0;border-radius:100px;text-align:center;color:#fff;font-size:14px;line-height:36px;cursor:pointer;-webkit-animation-delay:.3s;animation-delay:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes slideUp-data-v-26fcd89f{0%{-webkit-transform:translateY(60px);transform:translateY(60px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes slideUp-data-v-26fcd89f{0%{-webkit-transform:translateY(60px);transform:translateY(60px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-a6de055c.9905f991.css b/hippo4j-console/src/main/resources/static/static/css/chunk-a6de055c.9905f991.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-a6de055c.9905f991.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-bc53b446.55a106d0.css b/hippo4j-console/src/main/resources/static/static/css/chunk-bc53b446.55a106d0.css new file mode 100644 index 00000000..4ded159d --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-bc53b446.55a106d0.css @@ -0,0 +1 @@ +div.jsoneditor,div.jsoneditor-outer{-moz-box-sizing:border-box;-webkit-box-sizing:border-box}div.jsoneditor .jsoneditor-search input{height:auto;border:inherit}div.jsoneditor .jsoneditor-search input:focus{border:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}div.jsoneditor table{border-collapse:collapse;width:auto}div.jsoneditor td,div.jsoneditor th{padding:0;display:table-cell;text-align:left;vertical-align:inherit;border-radius:inherit}div.jsoneditor-field,div.jsoneditor-readonly,div.jsoneditor-value{border:1px solid transparent;min-height:16px;min-width:32px;padding:2px;margin:1px;word-wrap:break-word;float:left}div.jsoneditor-field p,div.jsoneditor-value p{margin:0}div.jsoneditor-value{word-break:break-word}div.jsoneditor-readonly{min-width:16px;color:grey}div.jsoneditor-empty{border-color:#d3d3d3;border-style:dashed;border-radius:2px}div.jsoneditor-field.jsoneditor-empty:after,div.jsoneditor-value.jsoneditor-empty:after{pointer-events:none;color:#d3d3d3;font-size:8pt}div.jsoneditor-field.jsoneditor-empty:after{content:"field"}div.jsoneditor-value.jsoneditor-empty:after{content:"value"}a.jsoneditor-value.jsoneditor-url,div.jsoneditor-value.jsoneditor-url{color:green;text-decoration:underline}a.jsoneditor-value.jsoneditor-url{display:inline-block;padding:2px;margin:2px}a.jsoneditor-value.jsoneditor-url:focus,a.jsoneditor-value.jsoneditor-url:hover{color:#ee422e}div.jsoneditor td.jsoneditor-separator{padding:3px 0;vertical-align:top;color:grey}div.jsoneditor-field.jsoneditor-highlight,div.jsoneditor-field[contenteditable=true]:focus,div.jsoneditor-field[contenteditable=true]:hover,div.jsoneditor-value.jsoneditor-highlight,div.jsoneditor-value[contenteditable=true]:focus,div.jsoneditor-value[contenteditable=true]:hover{background-color:#ffffab;border:1px solid #ff0;border-radius:2px}div.jsoneditor-field.jsoneditor-highlight-active,div.jsoneditor-field.jsoneditor-highlight-active:focus,div.jsoneditor-field.jsoneditor-highlight-active:hover,div.jsoneditor-value.jsoneditor-highlight-active,div.jsoneditor-value.jsoneditor-highlight-active:focus,div.jsoneditor-value.jsoneditor-highlight-active:hover{background-color:#fe0;border:1px solid #ffc700;border-radius:2px}div.jsoneditor-value.jsoneditor-string{color:green}div.jsoneditor-value.jsoneditor-array,div.jsoneditor-value.jsoneditor-object{min-width:16px;color:grey}div.jsoneditor-value.jsoneditor-number{color:#ee422e}div.jsoneditor-value.jsoneditor-boolean{color:#ff8c00}div.jsoneditor-value.jsoneditor-null{color:#004ed0}div.jsoneditor-value.jsoneditor-invalid{color:#000}div.jsoneditor-tree button{width:24px;height:24px;padding:0;margin:0;border:none;cursor:pointer;background:url(../../static/img/jsoneditor-icons.8e7baace.svg)}div.jsoneditor-mode-form tr.jsoneditor-expandable td.jsoneditor-tree,div.jsoneditor-mode-view tr.jsoneditor-expandable td.jsoneditor-tree{cursor:pointer}div.jsoneditor-tree button.jsoneditor-collapsed{background-position:0 -48px}div.jsoneditor-tree button.jsoneditor-expanded{background-position:0 -72px}div.jsoneditor-tree button.jsoneditor-contextmenu{background-position:-48px -72px}div.jsoneditor-tree button.jsoneditor-contextmenu.jsoneditor-selected,div.jsoneditor-tree button.jsoneditor-contextmenu:focus,div.jsoneditor-tree button.jsoneditor-contextmenu:hover,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu{background-position:-48px -48px}div.jsoneditor-tree :focus{outline:0}div.jsoneditor-tree button:focus{background-color:#f5f5f5;outline:1px solid #e5e5e5}div.jsoneditor-tree button.jsoneditor-invisible{visibility:hidden;background:0 0}div.jsoneditor{color:#1a1a1a;border:1px solid #3883fa;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;overflow:hidden;position:relative;padding:0;line-height:100%}div.jsoneditor-tree table.jsoneditor-tree{border-collapse:collapse;border-spacing:0;width:100%;margin:0}div.jsoneditor-outer{position:static;width:100%;height:100%;margin:-35px 0 0;padding:35px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.ace-jsoneditor,textarea.jsoneditor-text{min-height:150px}div.jsoneditor-tree{width:100%;height:100%;position:relative;overflow:auto}textarea.jsoneditor-text{width:100%;height:100%;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;outline-width:0;border:none;background-color:#fff;resize:none}tr.jsoneditor-highlight,tr.jsoneditor-selected{background-color:#e6e6e6}tr.jsoneditor-selected button.jsoneditor-contextmenu,tr.jsoneditor-selected button.jsoneditor-dragarea{visibility:hidden}tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea{visibility:visible}div.jsoneditor-tree button.jsoneditor-dragarea{background:url(../../static/img/jsoneditor-icons.8e7baace.svg) -72px -72px;cursor:move}div.jsoneditor-tree button.jsoneditor-dragarea:focus,div.jsoneditor-tree button.jsoneditor-dragarea:hover,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea{background-position:-72px -48px}div.jsoneditor td,div.jsoneditor th,div.jsoneditor tr{padding:0;margin:0}div.jsoneditor td,div.jsoneditor td.jsoneditor-tree{vertical-align:top}.jsoneditor-schema-error,div.jsoneditor-field,div.jsoneditor-value,div.jsoneditor td,div.jsoneditor textarea,div.jsoneditor th{font-family:droid sans mono,consolas,monospace,courier new,courier,sans-serif;font-size:10pt;color:#1a1a1a}.jsoneditor-schema-error{cursor:default;display:inline-block;height:24px;line-height:24px;position:relative;text-align:center;width:24px}div.jsoneditor-tree .jsoneditor-schema-error{width:24px;height:24px;padding:0;margin:0 4px 0 0;background:url(../../static/img/jsoneditor-icons.8e7baace.svg) -168px -48px}.jsoneditor-schema-error .jsoneditor-popover{background-color:#4c4c4c;border-radius:3px;-webkit-box-shadow:0 0 5px rgba(0,0,0,.4);box-shadow:0 0 5px rgba(0,0,0,.4);color:#fff;display:none;padding:7px 10px;position:absolute;width:200px;z-index:4}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-above{bottom:32px;left:-98px}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-below{top:32px;left:-98px}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-left{top:-7px;right:32px}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-right{top:-7px;left:32px}.jsoneditor-schema-error .jsoneditor-popover:before{border-right:7px solid transparent;border-left:7px solid transparent;content:"";display:block;left:50%;margin-left:-7px;position:absolute}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-above:before{border-top:7px solid #4c4c4c;bottom:-7px}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-below:before{border-bottom:7px solid #4c4c4c;top:-7px}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-left:before,.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-right:before{border-top:7px solid transparent;border-bottom:7px solid transparent;content:"";top:19px;margin-left:inherit;margin-top:-7px;position:absolute}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-left:before{border-left:7px solid #4c4c4c;right:-14px;left:inherit}.jsoneditor-schema-error .jsoneditor-popover.jsoneditor-right:before{border-right:7px solid #4c4c4c;left:-14px}.jsoneditor-schema-error:focus .jsoneditor-popover,.jsoneditor-schema-error:hover .jsoneditor-popover{display:block;-webkit-animation:fade-in .3s linear 1,move-up .3s linear 1;-moz-animation:fade-in .3s linear 1,move-up .3s linear 1;-ms-animation:fade-in .3s linear 1,move-up .3s linear 1}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}.jsoneditor .jsoneditor-text-errors{width:100%;border-collapse:collapse;background-color:#ffef8b;border-top:1px solid gold}.jsoneditor .jsoneditor-text-errors td{padding:3px 6px;vertical-align:middle}.jsoneditor-text-errors .jsoneditor-schema-error{border:none;width:24px;height:24px;padding:0;margin:0 4px 0 0;background:url(../../static/img/jsoneditor-icons.8e7baace.svg) -168px -48px}div.jsoneditor-contextmenu-root{position:relative;width:0;height:0}div.jsoneditor-contextmenu{position:absolute;z-index:99999}div.jsoneditor-contextmenu,div.jsoneditor-contextmenu li,div.jsoneditor-contextmenu ul{-webkit-box-sizing:content-box;box-sizing:content-box}div.jsoneditor-contextmenu ul{position:relative;left:0;top:0;width:124px;background:#fff;border:1px solid #d3d3d3;-webkit-box-shadow:2px 2px 12px hsla(0,0%,50.2%,.3);box-shadow:2px 2px 12px hsla(0,0%,50.2%,.3);list-style:none;margin:0;padding:0}div.jsoneditor-contextmenu ul li button{padding:0;margin:0;width:124px;height:24px;border:none;cursor:pointer;color:#4d4d4d;background:0 0;font-size:10pt;font-family:arial,sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:26px;text-align:left}div.jsoneditor-contextmenu ul li button::-moz-focus-inner{padding:0;border:0}div.jsoneditor-contextmenu ul li button:focus,div.jsoneditor-contextmenu ul li button:hover{color:#1a1a1a;background-color:#f5f5f5;outline:0}div.jsoneditor-contextmenu ul li button.jsoneditor-default{width:92px}div.jsoneditor-contextmenu ul li button.jsoneditor-expand{float:right;width:32px;height:24px;border-left:1px solid #e5e5e5}div.jsoneditor-contextmenu div.jsoneditor-icon{float:left;width:24px;height:24px;border:none;padding:0;margin:0;background-image:url(../../static/img/jsoneditor-icons.8e7baace.svg)}div.jsoneditor-contextmenu ul li button div.jsoneditor-expand{float:right;width:24px;height:24px;padding:0;margin:0 4px 0 0;background:url(../../static/img/jsoneditor-icons.8e7baace.svg) 0 -72px;opacity:.4}div.jsoneditor-contextmenu ul li.jsoneditor-selected div.jsoneditor-expand,div.jsoneditor-contextmenu ul li button.jsoneditor-expand:focus div.jsoneditor-expand,div.jsoneditor-contextmenu ul li button.jsoneditor-expand:hover div.jsoneditor-expand,div.jsoneditor-contextmenu ul li button:focus div.jsoneditor-expand,div.jsoneditor-contextmenu ul li button:hover div.jsoneditor-expand{opacity:1}div.jsoneditor-contextmenu div.jsoneditor-separator{height:0;border-top:1px solid #e5e5e5;padding-top:5px;margin-top:5px}div.jsoneditor-contextmenu button.jsoneditor-remove>div.jsoneditor-icon{background-position:-24px -24px}div.jsoneditor-contextmenu button.jsoneditor-remove:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-remove:hover>div.jsoneditor-icon{background-position:-24px 0}div.jsoneditor-contextmenu button.jsoneditor-append>div.jsoneditor-icon{background-position:0 -24px}div.jsoneditor-contextmenu button.jsoneditor-append:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-append:hover>div.jsoneditor-icon{background-position:0 0}div.jsoneditor-contextmenu button.jsoneditor-insert>div.jsoneditor-icon{background-position:0 -24px}div.jsoneditor-contextmenu button.jsoneditor-insert:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-insert:hover>div.jsoneditor-icon{background-position:0 0}div.jsoneditor-contextmenu button.jsoneditor-duplicate>div.jsoneditor-icon{background-position:-48px -24px}div.jsoneditor-contextmenu button.jsoneditor-duplicate:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-duplicate:hover>div.jsoneditor-icon{background-position:-48px 0}div.jsoneditor-contextmenu button.jsoneditor-sort-asc>div.jsoneditor-icon{background-position:-168px -24px}div.jsoneditor-contextmenu button.jsoneditor-sort-asc:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-sort-asc:hover>div.jsoneditor-icon{background-position:-168px 0}div.jsoneditor-contextmenu button.jsoneditor-sort-desc>div.jsoneditor-icon{background-position:-192px -24px}div.jsoneditor-contextmenu button.jsoneditor-sort-desc:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-sort-desc:hover>div.jsoneditor-icon{background-position:-192px 0}div.jsoneditor-contextmenu ul li button.jsoneditor-selected,div.jsoneditor-contextmenu ul li button.jsoneditor-selected:focus,div.jsoneditor-contextmenu ul li button.jsoneditor-selected:hover{color:#fff;background-color:#ee422e}div.jsoneditor-contextmenu ul li{overflow:hidden}div.jsoneditor-contextmenu ul li ul{display:none;position:relative;left:-10px;top:0;border:none;-webkit-box-shadow:inset 0 0 10px hsla(0,0%,50.2%,.5);box-shadow:inset 0 0 10px hsla(0,0%,50.2%,.5);padding:0 10px;-webkit-transition:all .3s ease-out;transition:all .3s ease-out}div.jsoneditor-contextmenu ul li ul li button{padding-left:24px;-webkit-animation:all 1s ease-in-out;animation:all 1s ease-in-out}div.jsoneditor-contextmenu ul li ul li button:focus,div.jsoneditor-contextmenu ul li ul li button:hover{background-color:#f5f5f5}div.jsoneditor-contextmenu button.jsoneditor-type-string>div.jsoneditor-icon{background-position:-144px -24px}div.jsoneditor-contextmenu button.jsoneditor-type-string.jsoneditor-selected>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-string:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-string:hover>div.jsoneditor-icon{background-position:-144px 0}div.jsoneditor-contextmenu button.jsoneditor-type-auto>div.jsoneditor-icon{background-position:-120px -24px}div.jsoneditor-contextmenu button.jsoneditor-type-auto.jsoneditor-selected>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-auto:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-auto:hover>div.jsoneditor-icon{background-position:-120px 0}div.jsoneditor-contextmenu button.jsoneditor-type-object>div.jsoneditor-icon{background-position:-72px -24px}div.jsoneditor-contextmenu button.jsoneditor-type-object.jsoneditor-selected>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-object:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-object:hover>div.jsoneditor-icon{background-position:-72px 0}div.jsoneditor-contextmenu button.jsoneditor-type-array>div.jsoneditor-icon{background-position:-96px -24px}div.jsoneditor-contextmenu button.jsoneditor-type-array.jsoneditor-selected>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-array:focus>div.jsoneditor-icon,div.jsoneditor-contextmenu button.jsoneditor-type-array:hover>div.jsoneditor-icon{background-position:-96px 0}div.jsoneditor-contextmenu button.jsoneditor-type-modes>div.jsoneditor-icon{background-image:none;width:6px}div.jsoneditor-menu{width:100%;height:35px;padding:2px;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;background-color:#3883fa;border-bottom:1px solid #3883fa}div.jsoneditor-menu>button,div.jsoneditor-menu>div.jsoneditor-modes>button{width:26px;height:26px;margin:2px;padding:0;border-radius:2px;border:1px solid transparent;background:url(../../static/img/jsoneditor-icons.8e7baace.svg);color:#fff;opacity:.8;font-family:arial,sans-serif;font-size:10pt;float:left}div.jsoneditor-menu>button:hover,div.jsoneditor-menu>div.jsoneditor-modes>button:hover{background-color:hsla(0,0%,100%,.2);border:1px solid hsla(0,0%,100%,.4)}div.jsoneditor-menu>button:active,div.jsoneditor-menu>button:focus,div.jsoneditor-menu>div.jsoneditor-modes>button:active,div.jsoneditor-menu>div.jsoneditor-modes>button:focus{background-color:hsla(0,0%,100%,.3)}div.jsoneditor-menu>button:disabled,div.jsoneditor-menu>div.jsoneditor-modes>button:disabled{opacity:.5}div.jsoneditor-menu>button.jsoneditor-collapse-all{background-position:0 -96px}div.jsoneditor-menu>button.jsoneditor-expand-all{background-position:0 -120px}div.jsoneditor-menu>button.jsoneditor-undo{background-position:-24px -96px}div.jsoneditor-menu>button.jsoneditor-undo:disabled{background-position:-24px -120px}div.jsoneditor-menu>button.jsoneditor-redo{background-position:-48px -96px}div.jsoneditor-menu>button.jsoneditor-redo:disabled{background-position:-48px -120px}div.jsoneditor-menu>button.jsoneditor-compact{background-position:-72px -96px}div.jsoneditor-menu>button.jsoneditor-format{background-position:-72px -120px}div.jsoneditor-menu>div.jsoneditor-modes{display:inline-block;float:left}div.jsoneditor-menu>div.jsoneditor-modes>button{background-image:none;width:auto;padding-left:6px;padding-right:6px}div.jsoneditor-menu>button.jsoneditor-separator,div.jsoneditor-menu>div.jsoneditor-modes>button.jsoneditor-separator{margin-left:10px}div.jsoneditor-menu a{font-family:arial,sans-serif;font-size:10pt;color:#fff;opacity:.8;vertical-align:middle}div.jsoneditor-menu a:hover{opacity:1}div.jsoneditor-menu a.jsoneditor-poweredBy{font-size:8pt;position:absolute;right:0;top:0;padding:10px}table.jsoneditor-search div.jsoneditor-results,table.jsoneditor-search input{font-family:arial,sans-serif;font-size:10pt;color:#1a1a1a;background:0 0}table.jsoneditor-search div.jsoneditor-results{color:#fff;padding-right:5px;line-height:24px}table.jsoneditor-search{position:absolute;right:4px;top:4px;border-collapse:collapse;border-spacing:0}table.jsoneditor-search div.jsoneditor-frame{border:1px solid transparent;background-color:#fff;padding:0 2px;margin:0}table.jsoneditor-search div.jsoneditor-frame table{border-collapse:collapse}table.jsoneditor-search input{width:120px;border:none;outline:0;margin:1px;line-height:20px}table.jsoneditor-search button{width:16px;height:24px;padding:0;margin:0;border:none;background:url(../../static/img/jsoneditor-icons.8e7baace.svg);vertical-align:top}table.jsoneditor-search button:hover{background-color:transparent}table.jsoneditor-search button.jsoneditor-refresh{width:18px;background-position:-99px -73px}table.jsoneditor-search button.jsoneditor-next{cursor:pointer;background-position:-124px -73px}table.jsoneditor-search button.jsoneditor-next:hover{background-position:-124px -49px}table.jsoneditor-search button.jsoneditor-previous{cursor:pointer;background-position:-148px -73px;margin-right:2px}table.jsoneditor-search button.jsoneditor-previous:hover{background-position:-148px -49px} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-e25b23da.6d24dacd.css b/hippo4j-console/src/main/resources/static/static/css/chunk-e25b23da.6d24dacd.css new file mode 100644 index 00000000..72a7cbfe --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-e25b23da.6d24dacd.css @@ -0,0 +1 @@ +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-libs.3dfb7769.css b/hippo4j-console/src/main/resources/static/static/css/chunk-libs.3dfb7769.css new file mode 100644 index 00000000..baeecbc6 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-libs.3dfb7769.css @@ -0,0 +1 @@ +/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;-webkit-box-shadow:0 0 10px #29d,0 0 5px #29d;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translateY(-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;-webkit-box-sizing:border-box;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/fonts/element-icons.535877f5.woff b/hippo4j-console/src/main/resources/static/static/fonts/element-icons.535877f5.woff new file mode 100644 index 00000000..02b9a253 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/static/fonts/element-icons.535877f5.woff differ diff --git a/hippo4j-console/src/main/resources/static/static/fonts/element-icons.732389de.ttf b/hippo4j-console/src/main/resources/static/static/fonts/element-icons.732389de.ttf new file mode 100644 index 00000000..91b74de3 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/static/fonts/element-icons.732389de.ttf differ diff --git a/hippo4j-console/src/main/resources/static/static/img/401.089007e7.gif b/hippo4j-console/src/main/resources/static/static/img/401.089007e7.gif new file mode 100644 index 00000000..cd6e0d94 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/static/img/401.089007e7.gif differ diff --git a/hippo4j-console/src/main/resources/static/static/img/404.a57b6f31.png b/hippo4j-console/src/main/resources/static/static/img/404.a57b6f31.png new file mode 100644 index 00000000..3d8e2305 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/static/img/404.a57b6f31.png differ diff --git a/hippo4j-console/src/main/resources/static/static/img/404_cloud.0f4bc32b.png b/hippo4j-console/src/main/resources/static/static/img/404_cloud.0f4bc32b.png new file mode 100644 index 00000000..c6281d09 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/static/img/404_cloud.0f4bc32b.png differ diff --git a/hippo4j-console/src/main/resources/static/static/img/hippo4j.ecba1844.gif b/hippo4j-console/src/main/resources/static/static/img/hippo4j.ecba1844.gif new file mode 100644 index 00000000..fdbd32c6 Binary files /dev/null and b/hippo4j-console/src/main/resources/static/static/img/hippo4j.ecba1844.gif differ diff --git a/hippo4j-console/src/main/resources/static/static/img/jsoneditor-icons.8e7baace.svg b/hippo4j-console/src/main/resources/static/static/img/jsoneditor-icons.8e7baace.svg new file mode 100644 index 00000000..1b40068a --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/img/jsoneditor-icons.8e7baace.svg @@ -0,0 +1,893 @@ + + + JSON Editor Icons + + + + image/svg+xml + + JSON Editor Icons + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hippo4j-console/src/main/resources/static/static/js/app.e8738b62.js b/hippo4j-console/src/main/resources/static/static/js/app.e8738b62.js new file mode 100644 index 00000000..2cccc193 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/app.e8738b62.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"028b":function(e,t,n){"use strict";n("f12c")},"0334":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-batch-create",use:"icon-batch-create-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"034c":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_two",use:"icon-tenant_two-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"034f":function(e,t,n){"use strict";n("67e7")},"06c2":function(e,t,n){"use strict";n("92a6")},"0781":function(e,t,n){"use strict";n.r(t);var a=n("24ab"),i=n.n(a),o=n("83d6"),c=n.n(o),s=c.a.showSettings,l=c.a.tagsView,r=c.a.fixedHeader,d=c.a.sidebarLogo,h={theme:i.a.theme,showSettings:s,tagsView:l,fixedHeader:r,sidebarLogo:d},u={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},p={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}};t["default"]={namespaced:!0,state:h,mutations:u,actions:p}},"096e":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-skill",use:"icon-skill-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"0f9a":function(e,t,n){"use strict";n.r(t);n("96cf");var a=n("3b8d"),i=n("b775");function o(e){return Object(i["a"])({url:"/hippo4j/v1/cs/auth/login",method:"post",data:e})}var c=n("5f87"),s=n("a18c"),l={token:Object(c["a"])(),name:"",avatar:"",introduction:"",roles:[]},r={SET_TOKEN:function(e,t){e.token=t},SET_INTRODUCTION:function(e,t){e.introduction=t},SET_NAME:function(e,t){e.name=t},SET_AVATAR:function(e,t){e.avatar=t},SET_ROLES:function(e,t){e.roles=t}},d={login:function(e,t){var n=e.commit,a=t.username,i=t.password;return new Promise((function(e,t){o({username:a.trim(),password:i,rememberMe:1}).then((function(t){var a=t.data,i=t.roles;n("SET_TOKEN",a),localStorage.setItem("roles",JSON.stringify(i)),Object(c["c"])(a),e()})).catch((function(e){alert("登录失败"),t(e)}))}))},getInfo:function(e){var t=e.commit;e.state;return new Promise((function(e,n){var a={};a.roles=JSON.parse(localStorage.getItem("roles")),t("SET_ROLES",a.roles),e(a)}))},logout:function(e){var t=e.commit;e.state;return new Promise((function(e){t("SET_TOKEN",""),t("SET_ROLES",[]),Object(c["b"])(),Object(s["d"])(),e()}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){t("SET_TOKEN",""),t("SET_ROLES",[]),Object(c["b"])(),e()}))},changeRoles:function(e,t){var n=e.commit,i=e.dispatch;return new Promise(function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(a){var o,l,r,d;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o=t+"-token",n("SET_TOKEN",o),Object(c["c"])(o),e.next=5,i("getInfo");case 5:return l=e.sent,r=l.roles,Object(s["d"])(),e.next=10,i("permission/generateRoutes",r,{root:!0});case 10:d=e.sent,s["c"].addRoutes(d),i("tagsView/delAllViews",null,{root:!0}),a();case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}};t["default"]={namespaced:!0,state:l,mutations:r,actions:d}},"12a5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-shopping",use:"icon-shopping-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},1424:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_logo2",use:"icon-tenant_logo2-usage",viewBox:"0 0 1331 1024",content:''});c.a.add(s);t["default"]=s},1430:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-qq",use:"icon-qq-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"158d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item",use:"icon-item-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},1695:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-thread_pool_Instance",use:"icon-thread_pool_Instance-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},1779:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-bug",use:"icon-bug-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"186a":function(e,t,n){"use strict";n("dc52")},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},1994:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user-cfg",use:"icon-user-cfg-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},2021:function(e,t,n){},"24ab":function(e,t,n){e.exports={theme:"#1890ff"}},2538:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-json",use:"icon-json-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},2580:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-language",use:"icon-language-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"273b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-running",use:"icon-running-usage",viewBox:"0 0 1129 1024",content:''});c.a.add(s);t["default"]=s},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"2f11":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-peoples",use:"icon-peoples-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},3046:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-money",use:"icon-money-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"31c2":function(e,t,n){"use strict";n.r(t),n.d(t,"filterAsyncRoutes",(function(){return c}));var a=n("db72"),i=(n("ac6a"),n("6762"),n("2fdb"),n("a18c"));function o(e,t){return!t.meta||!t.meta.roles||e.some((function(e){return t.meta.roles.includes(e)}))}function c(e,t){var n=[];return e.forEach((function(e){var i=Object(a["a"])({},e);o(t,i)&&(i.children&&(i.children=c(i.children,t)),n.push(i))})),n}var s={routes:[],addRoutes:[]},l={SET_ROUTES:function(e,t){e.addRoutes=t,e.routes=i["b"].concat(t)}},r={generateRoutes:function(e,t){var n=e.commit;return new Promise((function(e){var a;a=t.includes("ROLE_ADMIN")?i["a"]||[]:c(i["a"],t),n("SET_ROUTES",a),e(a)}))}};t["default"]={namespaced:!0,state:s,mutations:l,actions:r}},3289:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-list",use:"icon-list-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},3561:function(e,t,n){},"3da9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-thread_logo",use:"icon-thread_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"42e9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-instance_logo",use:"icon-instance_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},4360:function(e,t,n){"use strict";n("a481"),n("ac6a");var a=n("2b0e"),i=n("2f62"),o=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},size:function(e){return e.app.size},device:function(e){return e.app.device},visitedViews:function(e){return e.tagsView.visitedViews},cachedViews:function(e){return e.tagsView.cachedViews},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name},introduction:function(e){return e.user.introduction},roles:function(e){return e.user.roles},permission_routes:function(e){return e.permission.routes},errorLogs:function(e){return e.errorLog.logs}}),c=o;a["default"].use(i["a"]);var s=n("c653"),l=s.keys().reduce((function(e,t){var n=t.replace(/^\.\/(.*)\.\w+$/,"$1"),a=s(t);return e[n]=a.default,e}),{}),r=new i["a"].Store({modules:l,getters:c});t["a"]=r},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"47ff":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-message",use:"icon-message-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"4d49":function(e,t,n){"use strict";n.r(t);var a={logs:[]},i={ADD_ERROR_LOG:function(e,t){e.logs.push(t)},CLEAR_ERROR_LOG:function(e){e.logs.splice(0)}},o={addErrorLog:function(e,t){var n=e.commit;n("ADD_ERROR_LOG",t)},clearErrorLog:function(e){var t=e.commit;t("CLEAR_ERROR_LOG")}};t["default"]={namespaced:!0,state:a,mutations:i,actions:o}},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});c.a.add(s);t["default"]=s},"51ff":function(e,t,n){var a={"./404.svg":"a14a","./batch-create.svg":"0334","./battery-line.svg":"659b","./bug.svg":"1779","./cfg-datasouce.svg":"ce80","./chart.svg":"c829","./clipboard.svg":"bc35","./component.svg":"56d6","./dashboard.svg":"f782","./documentation.svg":"90fb","./drag.svg":"9bbf","./edit.svg":"aa46","./education.svg":"ad1c","./email.svg":"cbb7","./example.svg":"30c3","./excel.svg":"6599","./exe-cfg.svg":"c309","./exit-fullscreen.svg":"dbc7","./eye-open.svg":"d7ec","./eye.svg":"4df5","./fail.svg":"9448","./form.svg":"eb1b","./fullscreen.svg":"9921","./guide.svg":"6683","./icon.svg":"9d91","./instance_logo.svg":"42e9","./item.svg":"158d","./item_logo.svg":"b444","./item_logo2.svg":"ac67","./item_logo3.svg":"5f29","./item_logo4.svg":"8811","./item_logo_1.svg":"d314","./item_three.svg":"bddf","./item_two.svg":"d50e","./json.svg":"2538","./language.svg":"2580","./lessee.svg":"dbd7","./link.svg":"18f0","./list.svg":"3289","./lock.svg":"ab00","./log.svg":"fea0","./message.svg":"47ff","./money.svg":"3046","./nested.svg":"dcf8","./password.svg":"2a3d","./pdf.svg":"f9a1","./people.svg":"d056","./peoples.svg":"2f11","./project.svg":"69e4","./qq.svg":"1430","./running.svg":"273b","./search.svg":"8e8d","./shopping.svg":"12a5","./size.svg":"8644","./skill.svg":"096e","./star.svg":"708a","./success.svg":"a8cf","./tab.svg":"8fb7","./table.svg":"47f1","./task-cfg.svg":"7824","./task-tmp.svg":"90d2","./tenant_logo.svg":"67a0","./tenant_logo2.svg":"1424","./tenant_two.svg":"034c","./theme.svg":"e534","./threadPool_logo1.svg":"b6d1","./threadPool_logo2.svg":"9bc4","./thread_logo.svg":"3da9","./thread_pool_Instance.svg":"1695","./threadpool_logo.svg":"eb7b","./tree-table.svg":"e7c8","./tree.svg":"93cd","./user-cfg.svg":"1994","./user.svg":"b3b5","./wechat.svg":"80da","./work.svg":"7bb0","./zip.svg":"8aa6"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},"52f9":function(e,t,n){"use strict";n("9b0e")},"56d6":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-component",use:"icon-component-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"56d7":function(e,t,n){"use strict";n.r(t);var a={};n.r(a),n.d(a,"parseTime",(function(){return $["f"]})),n.d(a,"formatTime",(function(){return $["d"]})),n.d(a,"timeAgo",(function(){return I})),n.d(a,"numberFormatter",(function(){return R})),n.d(a,"toThousandFilter",(function(){return q})),n.d(a,"uppercaseFirst",(function(){return N}));n("456d"),n("ac6a"),n("cadf"),n("551c"),n("f751"),n("097d");var i=n("2b0e"),o=n("a78e"),c=n.n(o),s=(n("f5df"),n("5c96")),l=n.n(s),r=(n("24ab"),n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),d=[],h={name:"App"},u=h,p=n("2877"),v=Object(p["a"])(u,r,d,!1,null,null,null),m=v.exports,f=n("4360"),w=n("a18c"),g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{"xlink:href":e.iconName}})])},b=[],x=n("61f7"),z={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(x["b"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},y=z,M=(n("68fa"),Object(p["a"])(y,g,b,!1,null,"f9f7fefc",null)),V=M.exports;i["default"].component("svg-icon",V);var C=n("51ff"),_=function(e){return e.keys().map(e)};_(C);var k=n("db72"),E=(n("96cf"),n("3b8d")),H=n("323e"),L=n.n(H),B=(n("a5d8"),n("5f87")),F=n("83d6"),S=n.n(F),O=S.a.title||"Vue Element Admin";function A(e){return e?"".concat(e," - ").concat(O):"".concat(O)}L.a.configure({showSpinner:!1});var T=["/login","/auth-redirect"];w["c"].beforeEach(function(){var e=Object(E["a"])(regeneratorRuntime.mark((function e(t,n,a){var i,o,c,l,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(L.a.start(),document.title=A(t.meta.title),i=Object(B["a"])(),!i){e.next=35;break}if("/login"!==t.path){e.next=9;break}a({path:"/"}),L.a.done(),e.next=33;break;case 9:if(o=f["a"].getters.roles&&f["a"].getters.roles.length>0,!o){e.next=14;break}a(),e.next=33;break;case 14:return e.prev=14,e.next=17,f["a"].dispatch("user/getInfo");case 17:return c=e.sent,l=c.roles,e.next=21,f["a"].dispatch("permission/generateRoutes",l);case 21:r=e.sent,w["c"].addRoutes(r),a(Object(k["a"])(Object(k["a"])({},t),{},{replace:!0})),e.next=33;break;case 26:return e.prev=26,e.t0=e["catch"](14),e.next=30,f["a"].dispatch("user/resetToken");case 30:s["Message"].error(e.t0||"Has Error"),a("/login?redirect=".concat(t.path)),L.a.done();case 33:e.next=36;break;case 35:-1!==T.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),L.a.done());case 36:case"end":return e.stop()}}),e,null,[[14,26]])})));return function(t,n,a){return e.apply(this,arguments)}}()),w["c"].afterEach((function(){L.a.done()}));n("6762"),n("2fdb");var D=S.a.errorLog;function j(){var e="production";return Object(x["c"])(D)?e===D:!!Object(x["a"])(D)&&D.includes(e)}j()&&(i["default"].config.errorHandler=function(e,t,n,a){i["default"].nextTick((function(){f["a"].dispatch("errorLog/addErrorLog",{err:e,vm:t,info:n,url:window.location.href}),console.error(e,n)}))});n("6b54"),n("a481"),n("c5f6");var $=n("ed08");function P(e,t){return 1===e?e+t:e+t+"s"}function I(e){var t=Date.now()/1e3-Number(e);return t<3600?P(~~(t/60)," minute"):t<86400?P(~~(t/3600)," hour"):P(~~(t/86400)," day")}function R(e,t){for(var n=[{value:1e18,symbol:"E"},{value:1e15,symbol:"P"},{value:1e12,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"}],a=0;a=n[a].value)return(e/n[a].value+.1).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+n[a].symbol;return e.toString()}function q(e){return(+e||0).toString().replace(/^-?\d+/g,(function(e){return e.replace(/(?=(?!\b)(\d{3})+$)/g,",")}))}function N(e){return e.charAt(0).toUpperCase()+e.slice(1)}for(var W=n("313e"),G=n("00e7"),U=n.n(G),J=(n("3b2b"),n("2d63")),Z=n("75fc"),K=n("96eb"),X=n.n(K),Y={admin:{token:"admin-token"},editor:{token:"editor-token"}},Q={"admin-token":{roles:["admin"],introduction:"I am a super administrator",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Super Admin"},"editor-token":{roles:["editor"],introduction:"I am an editor",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Normal Editor"}},ee=[{url:"/user/login",type:"post",response:function(e){var t=e.body.username,n=Y[t];return n?{code:"20000",data:n}:{code:"60204",message:"Account and password are incorrect."}}},{url:"/user/info.*",type:"get",response:function(e){var t=e.query.token,n=Q[t];return n?{code:"20000",data:n}:{code:"50008",message:"Login failed, unable to get user details."}}},{url:"/user/logout",type:"post",response:function(e){return{code:"20000",data:"success"}}}],te=[{path:"/redirect",component:"layout/Layout",hidden:!0,children:[{path:"/redirect/:path*",component:"views/redirect/index"}]},{path:"/login",component:"views/login/index",hidden:!0},{path:"/auth-redirect",component:"views/login/auth-redirect",hidden:!0},{path:"/404",component:"views/error-page/404",hidden:!0},{path:"/401",component:"views/error-page/401",hidden:!0},{path:"",component:"layout/Layout",redirect:"dashboard",children:[{path:"dashboard",component:"views/dashboard/index",name:"Dashboard",meta:{title:"Dashboard",icon:"dashboard",affix:!0}}]},{path:"/documentation",component:"layout/Layout",children:[{path:"index",component:"views/documentation/index",name:"Documentation",meta:{title:"Documentation",icon:"documentation",affix:!0}}]},{path:"/guide",component:"layout/Layout",redirect:"/guide/index",children:[{path:"index",component:"views/guide/index",name:"Guide",meta:{title:"Guide",icon:"guide",noCache:!0}}]}],ne=[{path:"/permission",component:"layout/Layout",redirect:"/permission/index",alwaysShow:!0,meta:{title:"Permission",icon:"lock",roles:["admin","editor"]},children:[{path:"page",component:"views/permission/page",name:"PagePermission",meta:{title:"Page Permission11111",roles:["admin"]}},{path:"directive",component:"views/permission/directive",name:"DirectivePermission",meta:{title:"Directive Permission"}},{path:"role",component:"views/permission/role",name:"RolePermission",meta:{title:"Role Permission",roles:["admin"]}}]},{path:"/icon",component:"layout/Layout",children:[{path:"index",component:"views/icons/index",name:"Icons",meta:{title:"Icons",icon:"icon",noCache:!0}}]},{path:"/components",component:"layout/Layout",redirect:"noRedirect",name:"ComponentDemo",meta:{title:"Components",icon:"component"},children:[{path:"tinymce",component:"views/components-demo/tinymce",name:"TinymceDemo",meta:{title:"Tinymce"}},{path:"markdown",component:"views/components-demo/markdown",name:"MarkdownDemo",meta:{title:"Markdown"}},{path:"json-editor",component:"views/components-demo/json-editor",name:"JsonEditorDemo",meta:{title:"Json Editor"}},{path:"split-pane",component:"views/components-demo/split-pane",name:"SplitpaneDemo",meta:{title:"SplitPane"}},{path:"avatar-upload",component:"views/components-demo/avatar-upload",name:"AvatarUploadDemo",meta:{title:"Avatar Upload"}},{path:"dropzone",component:"views/components-demo/dropzone",name:"DropzoneDemo",meta:{title:"Dropzone"}},{path:"sticky",component:"views/components-demo/sticky",name:"StickyDemo",meta:{title:"Sticky"}},{path:"count-to",component:"views/components-demo/count-to",name:"CountToDemo",meta:{title:"Count To"}},{path:"mixin",component:"views/components-demo/mixin",name:"ComponentMixinDemo",meta:{title:"componentMixin"}},{path:"back-to-top",component:"views/components-demo/back-to-top",name:"BackToTopDemo",meta:{title:"Back To Top"}},{path:"drag-dialog",component:"views/components-demo/drag-dialog",name:"DragDialogDemo",meta:{title:"Drag Dialog"}},{path:"drag-select",component:"views/components-demo/drag-select",name:"DragSelectDemo",meta:{title:"Drag Select"}},{path:"dnd-list",component:"views/components-demo/dnd-list",name:"DndListDemo",meta:{title:"Dnd List"}},{path:"drag-kanban",component:"views/components-demo/drag-kanban",name:"DragKanbanDemo",meta:{title:"Drag Kanban"}}]},{path:"/charts",component:"layout/Layout",redirect:"noRedirect",name:"Charts",meta:{title:"Charts",icon:"chart"},children:[{path:"keyboard",component:"views/charts/keyboard",name:"KeyboardChart",meta:{title:"Keyboard Chart",noCache:!0}},{path:"line",component:"views/charts/line",name:"LineChart",meta:{title:"Line Chart",noCache:!0}},{path:"mixchart",component:"views/charts/mixChart",name:"MixChart",meta:{title:"Mix Chart",noCache:!0}}]},{path:"/nested",component:"layout/Layout",redirect:"/nested/menu1/menu1-1",name:"Nested",meta:{title:"Nested",icon:"nested"},children:[{path:"menu1",component:"views/nested/menu1/index",name:"Menu1",meta:{title:"Menu1"},redirect:"/nested/menu1/menu1-1",children:[{path:"menu1-1",component:"views/nested/menu1/menu1-1",name:"Menu1-1",meta:{title:"Menu1-1"}},{path:"menu1-2",component:"views/nested/menu1/menu1-2",name:"Menu1-2",redirect:"/nested/menu1/menu1-2/menu1-2-1",meta:{title:"Menu1-2"},children:[{path:"menu1-2-1",component:"views/nested/menu1/menu1-2/menu1-2-1",name:"Menu1-2-1",meta:{title:"Menu1-2-1"}},{path:"menu1-2-2",component:"views/nested/menu1/menu1-2/menu1-2-2",name:"Menu1-2-2",meta:{title:"Menu1-2-2"}}]},{path:"menu1-3",component:"views/nested/menu1/menu1-3",name:"Menu1-3",meta:{title:"Menu1-3"}}]},{path:"menu2",name:"Menu2",component:"views/nested/menu2/index",meta:{title:"Menu2"}}]},{path:"/example",component:"layout/Layout",redirect:"/example/list",name:"Example",meta:{title:"Example",icon:"example"},children:[{path:"create",component:"views/example/create",name:"CreateArticle",meta:{title:"Create Article",icon:"edit"}},{path:"edit/:id(\\d+)",component:"views/example/edit",name:"EditArticle",meta:{title:"Edit Article",noCache:!0},hidden:!0},{path:"list",component:"views/example/list",name:"ArticleList",meta:{title:"Article List",icon:"list"}}]},{path:"/tab",component:"layout/Layout",children:[{path:"index",component:"views/tab/index",name:"Tab",meta:{title:"Tab",icon:"tab"}}]},{path:"/error",component:"layout/Layout",redirect:"noRedirect",name:"ErrorPages",meta:{title:"Error Pages",icon:"404"},children:[{path:"401",component:"views/error-page/401",name:"Page401",meta:{title:"Page 401",noCache:!0}},{path:"404",component:"views/error-page/404",name:"Page404",meta:{title:"Page 404",noCache:!0}}]},{path:"/error-log",component:"layout/Layout",redirect:"noRedirect",children:[{path:"log",component:"views/error-log/index",name:"ErrorLog",meta:{title:"Error Log",icon:"bug"}}]},{path:"/excel",component:"layout/Layout",redirect:"/excel/export-excel",name:"Excel",meta:{title:"Excel",icon:"excel"},children:[{path:"export-excel",component:"views/excel/export-excel",name:"ExportExcel",meta:{title:"Export Excel"}},{path:"export-selected-excel",component:"views/excel/select-excel",name:"SelectExcel",meta:{title:"Select Excel"}},{path:"export-merge-header",component:"views/excel/merge-header",name:"MergeHeader",meta:{title:"Merge Header"}},{path:"upload-excel",component:"views/excel/upload-excel",name:"UploadExcel",meta:{title:"Upload Excel"}}]},{path:"/zip",component:"layout/Layout",redirect:"/zip/download",alwaysShow:!0,meta:{title:"Zip",icon:"zip"},children:[{path:"download",component:"views/zip/index",name:"ExportZip",meta:{title:"Export Zip"}}]},{path:"/pdf",component:"layout/Layout",redirect:"/pdf/index",children:[{path:"index",component:"views/pdf/index",name:"PDF",meta:{title:"PDF",icon:"pdf"}}]},{path:"/pdf/download",component:"views/pdf/download",hidden:!0},{path:"/theme",component:"layout/Layout",redirect:"noRedirect",children:[{path:"index",component:"views/theme/index",name:"Theme",meta:{title:"Theme",icon:"theme"}}]},{path:"/clipboard",component:"layout/Layout",redirect:"noRedirect",children:[{path:"index",component:"views/clipboard/index",name:"ClipboardDemo",meta:{title:"Clipboard Demo",icon:"clipboard"}}]},{path:"/i18n",component:"layout/Layout",children:[{path:"index",component:"views/i18n-demo/index",name:"I18n",meta:{title:"I18n",icon:"international"}}]},{path:"external-link",component:"layout/Layout",children:[{path:"https://github.com/PanJiaChen/vue-element-admin",meta:{title:"External Link",icon:"link"}}]},{path:"*",redirect:"/404",hidden:!0}],ae=Object($["c"])([].concat(Object(Z["a"])(te),Object(Z["a"])(ne))),ie=[{key:"admin",name:"admin",description:"Super Administrator. Have access to view all pages.",routes:ae},{key:"editor",name:"editor",description:"Normal Editor. Can see all pages except permission page",routes:ae.filter((function(e){return"/permission"!==e.path}))},{key:"visitor",name:"visitor",description:"Just a visitor. Can only see the home page and the document page",routes:[{path:"",redirect:"dashboard",children:[{path:"dashboard",name:"Dashboard",meta:{title:"dashboard",icon:"dashboard"}}]}]}],oe=[{url:"/routes",type:"get",response:function(e){return{code:2e4,data:ae}}},{url:"/roles",type:"get",response:function(e){return{code:2e4,data:ie}}},{url:"/role",type:"post",response:{code:2e4,data:{key:X.a.mock("@integer(300, 5000)")}}},{url:"/role/[A-Za-z0-9]",type:"put",response:{code:2e4,data:{status:"success"}}},{url:"/role/[A-Za-z0-9]",type:"delete",response:{code:2e4,data:{status:"success"}}}],ce=(n("7f7f"),[]),se=100,le=0;le'});c.a.add(s);t["default"]=s},"5f87":function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return l}));var a=n("a78e"),i=n.n(a),o="Admin-Token";function c(){return i.a.get(o)}function s(e){return i.a.set(o,e)}function l(){return i.a.remove(o)}},"61f7":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o}));n("6b54");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}function i(e){return"string"===typeof e||e instanceof String}function o(e){return"undefined"===typeof Array.isArray?"[object Array]"===Object.prototype.toString.call(e):Array.isArray(e)}},6599:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-excel",use:"icon-excel-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"659b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-battery-line",use:"icon-battery-line-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},6683:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-guide",use:"icon-guide-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"67a0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_logo",use:"icon-tenant_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"67e7":function(e,t,n){},"68fa":function(e,t,n){"use strict";n("2021")},"69d8":function(e,t,n){"use strict";n("c3a3")},"69e4":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-project",use:"icon-project-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"708a":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-star",use:"icon-star-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},7509:function(e,t,n){"use strict";n.r(t);var a=n("75fc"),i=n("768b"),o=(n("ac6a"),n("2d63")),c=(n("7f7f"),n("6762"),n("2fdb"),{visitedViews:[],cachedViews:[]}),s={ADD_VISITED_VIEW:function(e,t){e.visitedViews.some((function(e){return e.path===t.path}))||e.visitedViews.push(Object.assign({},t,{title:t.meta.title||"no-name"}))},ADD_CACHED_VIEW:function(e,t){e.cachedViews.includes(t.name)||t.meta.noCache||e.cachedViews.push(t.name)},DEL_VISITED_VIEW:function(e,t){var n,a=Object(o["a"])(e.visitedViews.entries());try{for(a.s();!(n=a.n()).done;){var c=Object(i["a"])(n.value,2),s=c[0],l=c[1];if(l.path===t.path){e.visitedViews.splice(s,1);break}}}catch(r){a.e(r)}finally{a.f()}},DEL_CACHED_VIEW:function(e,t){var n,a=Object(o["a"])(e.cachedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i===t.name){var c=e.cachedViews.indexOf(i);e.cachedViews.splice(c,1);break}}}catch(s){a.e(s)}finally{a.f()}},DEL_OTHERS_VISITED_VIEWS:function(e,t){e.visitedViews=e.visitedViews.filter((function(e){return e.meta.affix||e.path===t.path}))},DEL_OTHERS_CACHED_VIEWS:function(e,t){var n,a=Object(o["a"])(e.cachedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i===t.name){var c=e.cachedViews.indexOf(i);e.cachedViews=e.cachedViews.slice(c,c+1);break}}}catch(s){a.e(s)}finally{a.f()}},DEL_ALL_VISITED_VIEWS:function(e){var t=e.visitedViews.filter((function(e){return e.meta.affix}));e.visitedViews=t},DEL_ALL_CACHED_VIEWS:function(e){e.cachedViews=[]},UPDATE_VISITED_VIEW:function(e,t){var n,a=Object(o["a"])(e.visitedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.path===t.path){i=Object.assign(i,t);break}}}catch(c){a.e(c)}finally{a.f()}}},l={addView:function(e,t){var n=e.dispatch;n("addVisitedView",t),n("addCachedView",t)},addVisitedView:function(e,t){var n=e.commit;n("ADD_VISITED_VIEW",t)},addCachedView:function(e,t){var n=e.commit;n("ADD_CACHED_VIEW",t)},delView:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delVisitedView",t),n("delCachedView",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delVisitedView:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_VISITED_VIEW",t),e(Object(a["a"])(i.visitedViews))}))},delCachedView:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_CACHED_VIEW",t),e(Object(a["a"])(i.cachedViews))}))},delOthersViews:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delOthersVisitedViews",t),n("delOthersCachedViews",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delOthersVisitedViews:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_OTHERS_VISITED_VIEWS",t),e(Object(a["a"])(i.visitedViews))}))},delOthersCachedViews:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_OTHERS_CACHED_VIEWS",t),e(Object(a["a"])(i.cachedViews))}))},delAllViews:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delAllVisitedViews",t),n("delAllCachedViews",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delAllVisitedViews:function(e){var t=e.commit,n=e.state;return new Promise((function(e){t("DEL_ALL_VISITED_VIEWS"),e(Object(a["a"])(n.visitedViews))}))},delAllCachedViews:function(e){var t=e.commit,n=e.state;return new Promise((function(e){t("DEL_ALL_CACHED_VIEWS"),e(Object(a["a"])(n.cachedViews))}))},updateVisitedView:function(e,t){var n=e.commit;n("UPDATE_VISITED_VIEW",t)}};t["default"]={namespaced:!0,state:c,mutations:s,actions:l}},"76ff":function(e,t,n){"use strict";n("d320")},"77fe":function(e,t,n){},7824:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-task-cfg",use:"icon-task-cfg-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"7bb0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-work",use:"icon-work-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"80da":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-wechat",use:"icon-wechat-usage",viewBox:"0 0 128 110",content:''});c.a.add(s);t["default"]=s},"83d6":function(e,t){e.exports={title:"Hippo4J Web",showSettings:!0,tagsView:!0,fixedHeader:!1,sidebarLogo:!0,errorLog:"production"}},8644:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-size",use:"icon-size-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},8811:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo4",use:"icon-item_logo4-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"8aa6":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-zip",use:"icon-zip-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"8d4d":function(e,t,n){},"8e8d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-search",use:"icon-search-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"8fb7":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tab",use:"icon-tab-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"90d2":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-task-tmp",use:"icon-task-tmp-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"90fb":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-documentation",use:"icon-documentation-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"92a6":function(e,t,n){},"93cd":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},9448:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-fail",use:"icon-fail-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},9921:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-fullscreen",use:"icon-fullscreen-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"9a1c":function(e,t,n){},"9b0e":function(e,t,n){},"9bbf":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-drag",use:"icon-drag-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"9bc4":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadPool_logo2",use:"icon-threadPool_logo2-usage",viewBox:"0 0 1044 1024",content:''});c.a.add(s);t["default"]=s},"9d91":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-icon",use:"icon-icon-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},a14a:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-404",use:"icon-404-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},a18c:function(e,t,n){"use strict";var a,i,o=n("2b0e"),c=n("8c4f"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),e._v(" "),n("sidebar",{staticClass:"sidebar-container"}),e._v(" "),n("div",{staticClass:"main-container",class:{hasTagsView:e.needTagsView}},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar"),e._v(" "),e.needTagsView?n("tags-view"):e._e()],1),e._v(" "),n("app-main"),e._v(" "),e.showSettings?n("right-panel",[n("settings")],1):e._e()],1)],1)},l=[],r=n("db72"),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"rightPanel",staticClass:"rightPanel-container",class:{show:e.show}},[n("div",{staticClass:"rightPanel-background"}),e._v(" "),n("div",{staticClass:"rightPanel",staticStyle:{display:"none"}},[n("div",{staticClass:"handle-button",style:{top:e.buttonTop+"px","background-color":e.theme},on:{click:function(t){e.show=!e.show}}},[n("i",{class:e.show?"el-icon-close":"el-icon-setting"})]),e._v(" "),n("div",{staticClass:"rightPanel-items"},[e._t("default")],2)])])},h=[],u=(n("c5f6"),n("ed08")),p={name:"RightPanel",props:{clickNotClose:{default:!1,type:Boolean},buttonTop:{default:250,type:Number}},data:function(){return{show:!1}},computed:{theme:function(){return this.$store.state.settings.theme}},watch:{show:function(e){e&&!this.clickNotClose&&this.addEventClick(),e?Object(u["a"])(document.body,"showRightPanel"):Object(u["g"])(document.body,"showRightPanel")}},mounted:function(){this.insertToBody()},beforeDestroy:function(){var e=this.$refs.rightPanel;e.remove()},methods:{addEventClick:function(){window.addEventListener("click",this.closeSidebar)},closeSidebar:function(e){var t=e.target.closest(".rightPanel");t||(this.show=!1,window.removeEventListener("click",this.closeSidebar))},insertToBody:function(){var e=this.$refs.rightPanel,t=document.querySelector("body");t.insertBefore(e,t.firstChild)}}},v=p,m=(n("fab5"),n("f842"),n("2877")),f=Object(m["a"])(v,d,h,!1,null,"1cc16d82",null),w=f.exports,g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("keep-alive",{attrs:{include:e.cachedViews}},[n("router-view",{key:e.key})],1)],1)],1)},b=[],x={name:"AppMain",computed:{cachedViews:function(){return this.$store.state.tagsView.cachedViews},key:function(){return this.$route.path}}},z=x,y=(n("c968"),n("028b"),Object(m["a"])(z,g,b,!1,null,"92459f82",null)),M=y.exports,V=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"navbar"},[a("hamburger",{staticClass:"hamburger-container",attrs:{id:"hamburger-container","is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),e._v(" "),a("breadcrumb",{staticClass:"breadcrumb-container",attrs:{id:"breadcrumb-container"}}),e._v(" "),a("div",{staticClass:"right-menu"},["mobile"!==e.device?[a("error-log",{staticClass:"errLog-container right-menu-item hover-effect"})]:e._e(),e._v(" "),a("el-dropdown",{staticClass:"avatar-container right-menu-item hover-effect",attrs:{trigger:"click"}},[a("div",{staticClass:"avatar-wrapper"},[a("img",{staticClass:"user-avatar",attrs:{src:n("f561")}}),e._v(" "),a("i",{staticClass:"el-icon-caret-bottom"})]),e._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("router-link",{attrs:{to:"/"}},[a("el-dropdown-item",[e._v("Dashboard")])],1),e._v(" "),a("el-dropdown-item",{attrs:{divided:""}},[a("span",{staticStyle:{display:"block"},on:{click:e.logout}},[e._v("Log Out")])])],1)],1)],2)],1)},C=[],_=(n("96cf"),n("3b8d")),k=n("2f62"),E=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,(function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])})),1)],1)},H=[],L=(n("7f7f"),n("f559"),n("bd11")),B=n.n(L),F={data:function(){return{levelList:null}},watch:{$route:function(e){e.path.startsWith("/redirect/")||this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter((function(e){return e.meta&&e.meta.title})),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter((function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb}))},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=B.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},S=F,O=(n("d9ae"),Object(m["a"])(S,E,H,!1,null,"1919fc1a",null)),A=O.exports,T=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},D=[],j={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},$=j,P=(n("186a"),Object(m["a"])($,T,D,!1,null,"49e15297",null)),I=P.exports,R=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.errorLogs.length>0?n("div",[n("el-badge",{staticStyle:{"line-height":"25px","margin-top":"-5px"},attrs:{"is-dot":!0},nativeOn:{click:function(t){e.dialogTableVisible=!0}}},[n("el-button",{staticStyle:{padding:"8px 10px"},attrs:{size:"small",type:"danger"}},[n("svg-icon",{attrs:{"icon-class":"bug"}})],1)],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogTableVisible,width:"80%","append-to-body":""},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("span",{staticStyle:{"padding-right":"10px"}},[e._v("Error Log")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-delete"},on:{click:e.clearAll}},[e._v("Clear All")])],1),e._v(" "),n("el-table",{attrs:{data:e.errorLogs,border:""}},[n("el-table-column",{attrs:{label:"Message"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("div",[n("span",{staticClass:"message-title"},[e._v("Msg:")]),e._v(" "),n("el-tag",{attrs:{type:"danger"}},[e._v("\n "+e._s(a.err.message)+"\n ")])],1),e._v(" "),n("br"),e._v(" "),n("div",[n("span",{staticClass:"message-title",staticStyle:{"padding-right":"10px"}},[e._v("Info: ")]),e._v(" "),n("el-tag",{attrs:{type:"warning"}},[e._v("\n "+e._s(a.vm.$vnode.tag)+" error in "+e._s(a.info)+"\n ")])],1),e._v(" "),n("br"),e._v(" "),n("div",[n("span",{staticClass:"message-title",staticStyle:{"padding-right":"16px"}},[e._v("Url: ")]),e._v(" "),n("el-tag",{attrs:{type:"success"}},[e._v("\n "+e._s(a.url)+"\n ")])],1)]}}],null,!1,3621415002)}),e._v(" "),n("el-table-column",{attrs:{label:"Stack"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.err.stack)+"\n ")]}}],null,!1,1726869048)})],1)],1)],1):e._e()},q=[],N={name:"ErrorLog",data:function(){return{dialogTableVisible:!1}},computed:{errorLogs:function(){return this.$store.getters.errorLogs}},methods:{clearAll:function(){this.dialogTableVisible=!1,this.$store.dispatch("errorLog/clearErrorLog")}}},W=N,G=(n("69d8"),Object(m["a"])(W,R,q,!1,null,"be34583a",null)),U=G.exports,J={components:{Breadcrumb:A,Hamburger:I,ErrorLog:U},computed:Object(r["a"])({},Object(k["b"])(["sidebar","avatar","device"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=Object(_["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.$cookie.delete("userName"),e.next=3,this.$store.dispatch("user/logout");case 3:this.$router.push("/login?redirect=".concat(this.$route.fullPath));case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},Z=J,K=(n("76ff"),Object(m["a"])(Z,V,C,!1,null,"48310396",null)),X=K.exports,Y=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"drawer-container"},[n("div",[n("h3",{staticClass:"drawer-title"},[e._v("Page style setting")]),e._v(" "),n("div",{staticClass:"drawer-item"},[n("span",[e._v("Theme Color")]),e._v(" "),n("theme-picker",{staticStyle:{float:"right",height:"26px",margin:"-3px 8px 0 0"},on:{change:e.themeChange}})],1),e._v(" "),n("div",{staticClass:"drawer-item"},[n("span",[e._v("Open Tags-View")]),e._v(" "),n("el-switch",{staticClass:"drawer-switch",model:{value:e.tagsView,callback:function(t){e.tagsView=t},expression:"tagsView"}})],1),e._v(" "),n("div",{staticClass:"drawer-item"},[n("span",[e._v("Fixed Header")]),e._v(" "),n("el-switch",{staticClass:"drawer-switch",model:{value:e.fixedHeader,callback:function(t){e.fixedHeader=t},expression:"fixedHeader"}})],1),e._v(" "),n("div",{staticClass:"drawer-item"},[n("span",[e._v("Sidebar Logo")]),e._v(" "),n("el-switch",{staticClass:"drawer-switch",model:{value:e.sidebarLogo,callback:function(t){e.sidebarLogo=t},expression:"sidebarLogo"}})],1)])])},Q=[],ee=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-color-picker",{staticClass:"theme-picker",attrs:{predefine:["#409EFF","#1890ff","#304156","#212121","#11a983","#13c2c2","#6959CD","#f5222d"],"popper-class":"theme-picker-dropdown"},model:{value:e.theme,callback:function(t){e.theme=t},expression:"theme"}})},te=[],ne=(n("6b54"),n("ac6a"),n("3b2b"),n("a481"),n("f6f8").version),ae="#409EFF",ie={data:function(){return{chalk:"",theme:""}},computed:{defaultTheme:function(){return this.$store.state.settings.theme}},watch:{defaultTheme:{handler:function(e,t){this.theme=e},immediate:!0},theme:function(){var e=Object(_["a"])(regeneratorRuntime.mark((function e(t){var n,a,i,o,c,s,l,r,d=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.chalk?this.theme:ae,"string"===typeof t){e.next=3;break}return e.abrupt("return");case 3:if(a=this.getThemeCluster(t.replace("#","")),i=this.getThemeCluster(n.replace("#","")),console.log(a,i),o=this.$message({message:" Compiling the theme",customClass:"theme-message",type:"success",duration:0,iconClass:"el-icon-loading"}),c=function(e,t){return function(){var n=d.getThemeCluster(ae.replace("#","")),i=d.updateStyle(d[e],n,a),o=document.getElementById(t);o||(o=document.createElement("style"),o.setAttribute("id",t),document.head.appendChild(o)),o.innerText=i}},this.chalk){e.next=12;break}return s="https://unpkg.com/element-ui@".concat(ne,"/lib/theme-chalk/index.css"),e.next=12,this.getCSSString(s,"chalk");case 12:l=c("chalk","chalk-style"),l(),r=[].slice.call(document.querySelectorAll("style")).filter((function(e){var t=e.innerText;return new RegExp(n,"i").test(t)&&!/Chalk Variables/.test(t)})),r.forEach((function(e){var t=e.innerText;"string"===typeof t&&(e.innerText=d.updateStyle(t,i,a))})),this.$emit("change",t),o.close();case 18:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},methods:{updateStyle:function(e,t,n){var a=e;return t.forEach((function(e,t){a=a.replace(new RegExp(e,"ig"),n[t])})),a},getCSSString:function(e,t){var n=this;return new Promise((function(a){var i=new XMLHttpRequest;i.onreadystatechange=function(){4===i.readyState&&200===i.status&&(n[t]=i.responseText.replace(/@font-face{[^}]+}/,""),a())},i.open("GET",e),i.send()}))},getThemeCluster:function(e){for(var t=function(e,t){var n=parseInt(e.slice(0,2),16),a=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return 0===t?[n,a,i].join(","):(n+=Math.round(t*(255-n)),a+=Math.round(t*(255-a)),i+=Math.round(t*(255-i)),n=n.toString(16),a=a.toString(16),i=i.toString(16),"#".concat(n).concat(a).concat(i))},n=function(e,t){var n=parseInt(e.slice(0,2),16),a=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return n=Math.round((1-t)*n),a=Math.round((1-t)*a),i=Math.round((1-t)*i),n=n.toString(16),a=a.toString(16),i=i.toString(16),"#".concat(n).concat(a).concat(i)},a=[e],i=0;i<=9;i++)a.push(t(e,Number((i/10).toFixed(2))));return a.push(n(e,.1)),a}}},oe=ie,ce=(n("06c2"),Object(m["a"])(oe,ee,te,!1,null,null,null)),se=ce.exports,le={components:{ThemePicker:se},data:function(){return{}},computed:{fixedHeader:{get:function(){return this.$store.state.settings.fixedHeader},set:function(e){this.$store.dispatch("settings/changeSetting",{key:"fixedHeader",value:e})}},tagsView:{get:function(){return this.$store.state.settings.tagsView},set:function(e){this.$store.dispatch("settings/changeSetting",{key:"tagsView",value:e})}},sidebarLogo:{get:function(){return this.$store.state.settings.sidebarLogo},set:function(e){this.$store.dispatch("settings/changeSetting",{key:"sidebarLogo",value:e})}}},methods:{themeChange:function(e){this.$store.dispatch("settings/changeSetting",{key:"theme",value:e})}}},re=le,de=(n("f271"),Object(m["a"])(re,Y,Q,!1,null,"5d274279",null)),he=de.exports,ue=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),e._v(" "),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.permission_routes,(function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})})),1)],1)],1)},pe=[],ve=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),e._v(" "),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])])],1)],1)},me=[],fe={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"Hippo4J 1.2.0",logo:"https://images-machen.oss-cn-beijing.aliyuncs.com/20211127_hippo4j_logo.png"}}},we=fe,ge=(n("b95c"),Object(m["a"])(we,ve,me,!1,null,"1d0da3a0",null)),be=ge.exports,xe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",{staticClass:"menu-wrapper"},[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._v(" "),e._l(e.item.children,(function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})}))],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},ze=[],ye=n("df7c"),Me=n.n(ye),Ve=n("61f7"),Ce={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&o.push(e("svg-icon",{attrs:{"icon-class":a}})),i&&o.push(e("span",{slot:"title"},[i])),o}},_e=Ce,ke=Object(m["a"])(_e,a,i,!1,null,null,null),Ee=ke.exports,He=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("component",e._b({},"component",e.linkProps(e.to),!1),[e._t("default")],2)},Le=[],Be={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Object(Ve["b"])(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Fe=Be,Se=Object(m["a"])(Fe,He,Le,!1,null,null,null),Oe=Se.exports,Ae={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},Te={name:"SidebarItem",components:{Item:Ee,AppLink:Oe},mixins:[Ae],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter((function(t){return!t.hidden&&(e.onlyOneChild=t,!0)}));return 1===a.length||0===a.length&&(this.onlyOneChild=Object(r["a"])(Object(r["a"])({},n),{},{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(Ve["b"])(e)?e:Object(Ve["b"])(this.basePath)?this.basePath:Me.a.resolve(this.basePath,e)}}},De=Te,je=Object(m["a"])(De,xe,ze,!1,null,null,null),$e=je.exports,Pe=n("cf1e"),Ie=n.n(Pe),Re={components:{SidebarItem:$e,Logo:be},computed:Object(r["a"])(Object(r["a"])({},Object(k["b"])(["permission_routes","sidebar"])),{},{activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return Ie.a},isCollapse:function(){return!this.sidebar.opened}})},qe=Re,Ne=Object(m["a"])(qe,ue,pe,!1,null,null,null),We=Ne.exports,Ge=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tags-view-container",attrs:{id:"tags-view-container"}},[n("scroll-pane",{ref:"scrollPane",staticClass:"tags-view-wrapper"},e._l(e.visitedViews,(function(t){return n("router-link",{key:t.path,ref:"tag",refInFor:!0,staticClass:"tags-view-item",class:e.isActive(t)?"active":"",attrs:{to:{path:t.path,query:t.query,fullPath:t.fullPath},tag:"span"},nativeOn:{mouseup:function(n){return"button"in n&&1!==n.button?null:e.closeSelectedTag(t)},contextmenu:function(n){return n.preventDefault(),e.openMenu(t,n)}}},[e._v("\n "+e._s(t.title)+"\n "),t.meta.affix?e._e():n("span",{staticClass:"el-icon-close",on:{click:function(n){return n.preventDefault(),n.stopPropagation(),e.closeSelectedTag(t)}}})])})),1),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"contextmenu",style:{left:e.left+"px",top:e.top+"px"}},[n("li",{on:{click:function(t){return e.refreshSelectedTag(e.selectedTag)}}},[e._v("Refresh")]),e._v(" "),e.selectedTag.meta&&e.selectedTag.meta.affix?e._e():n("li",{on:{click:function(t){return e.closeSelectedTag(e.selectedTag)}}},[e._v("Close")]),e._v(" "),n("li",{on:{click:e.closeOthersTags}},[e._v("Close Others")]),e._v(" "),n("li",{on:{click:function(t){return e.closeAllTags(e.selectedTag)}}},[e._v("Close All")])])],1)},Ue=[],Je=n("2d63"),Ze=n("75fc"),Ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-scrollbar",{ref:"scrollContainer",staticClass:"scroll-container",attrs:{vertical:!1},nativeOn:{wheel:function(t){return t.preventDefault(),e.handleScroll(t)}}},[e._t("default")],2)},Xe=[],Ye=(n("20d6"),4),Qe={name:"ScrollPane",data:function(){return{left:0}},computed:{scrollWrapper:function(){return this.$refs.scrollContainer.$refs.wrap}},methods:{handleScroll:function(e){var t=e.wheelDelta||40*-e.deltaY,n=this.scrollWrapper;n.scrollLeft=n.scrollLeft+t/4},moveToTarget:function(e){var t=this.$refs.scrollContainer.$el,n=t.offsetWidth,a=this.scrollWrapper,i=this.$parent.$refs.tag,o=null,c=null;if(i.length>0&&(o=i[0],c=i[i.length-1]),o===e)a.scrollLeft=0;else if(c===e)a.scrollLeft=a.scrollWidth-n;else{var s=i.findIndex((function(t){return t===e})),l=i[s-1],r=i[s+1],d=r.$el.offsetLeft+r.$el.offsetWidth+Ye,h=l.$el.offsetLeft-Ye;d>a.scrollLeft+n?a.scrollLeft=d-n:h1&&void 0!==arguments[1]?arguments[1]:"/",a=[];return e.forEach((function(e){if(e.meta&&e.meta.affix){var i=Me.a.resolve(n,e.path);a.push({fullPath:i,path:i,name:e.name,meta:Object(r["a"])({},e.meta)})}if(e.children){var o=t.filterAffixTags(e.children,e.path);o.length>=1&&(a=[].concat(Object(Ze["a"])(a),Object(Ze["a"])(o)))}})),a},initTags:function(){var e,t=this.affixTags=this.filterAffixTags(this.routes),n=Object(Je["a"])(t);try{for(n.s();!(e=n.n()).done;){var a=e.value;a.name&&this.$store.dispatch("tagsView/addVisitedView",a)}}catch(i){n.e(i)}finally{n.f()}},addTags:function(){var e=this.$route.name;return e&&this.$store.dispatch("tagsView/addView",this.$route),!1},moveToCurrentTag:function(){var e=this,t=this.$refs.tag;this.$nextTick((function(){var n,a=Object(Je["a"])(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.to.path===e.$route.path){e.$refs.scrollPane.moveToTarget(i),i.to.fullPath!==e.$route.fullPath&&e.$store.dispatch("tagsView/updateVisitedView",e.$route);break}}}catch(o){a.e(o)}finally{a.f()}}))},refreshSelectedTag:function(e){var t=this;this.$store.dispatch("tagsView/delCachedView",e).then((function(){var n=e.fullPath;t.$nextTick((function(){t.$router.replace({path:"/redirect"+n})}))}))},closeSelectedTag:function(e){var t=this;this.$store.dispatch("tagsView/delView",e).then((function(n){var a=n.visitedViews;t.isActive(e)&&t.toLastView(a,e)}))},closeOthersTags:function(){var e=this;this.$router.push(this.selectedTag),this.$store.dispatch("tagsView/delOthersViews",this.selectedTag).then((function(){e.moveToCurrentTag()}))},closeAllTags:function(e){var t=this;this.$store.dispatch("tagsView/delAllViews").then((function(n){var a=n.visitedViews;t.affixTags.some((function(t){return t.path===e.path}))||t.toLastView(a,e)}))},toLastView:function(e,t){var n=e.slice(-1)[0];n?this.$router.push(n):"Dashboard"===t.name?this.$router.replace({path:"/redirect"+t.fullPath}):this.$router.push("/")},openMenu:function(e,t){var n=105,a=this.$el.getBoundingClientRect().left,i=this.$el.offsetWidth,o=i-n,c=t.clientX-a+15;this.left=c>o?o:c,this.top=t.clientY,this.visible=!0,this.selectedTag=e},closeMenu:function(){this.visible=!1}}},it=at,ot=(n("034f"),n("cfaa"),Object(m["a"])(it,Ge,Ue,!1,null,"c64b5a6c",null)),ct=ot.exports,st=n("4360"),lt=document,rt=lt.body,dt=992,ht={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&st["a"].dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(st["a"].dispatch("app/toggleDevice","mobile"),st["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=rt.getBoundingClientRect();return e.width-1'});c.a.add(s);t["default"]=s},aa46:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-edit",use:"icon-edit-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},aace:function(e,t,n){},ab00:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-lock",use:"icon-lock-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ac67:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo2",use:"icon-item_logo2-usage",viewBox:"0 0 1027 1024",content:''});c.a.add(s);t["default"]=s},ad1c:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-education",use:"icon-education-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},b20f:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},b3b5:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b3b6:function(e,t,n){},b444:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo",use:"icon-item_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b6d1:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadPool_logo1",use:"icon-threadPool_logo1-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b775:function(e,t,n){"use strict";var a=n("bc3a"),i=n.n(a),o=n("5c96"),c=n("4360"),s=n("5f87"),l=n("a18c"),r=i.a.create({baseURL:"",timeout:2e4});r.interceptors.request.use((function(e){return c["a"].getters.token&&(e.headers["Authorization"]=Object(s["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),r.interceptors.response.use((function(e){var t=e.data;if("A000004"!==t.code){if("20000"!==t.code&&"0"!==t.code&&"200"!==t.code)return Object(o["Message"])({message:t.message||"Error",type:"error",duration:5e3}),"50008"!==t.code&&"50012"!==t.code&&"50014"!==t.code||o["MessageBox"].confirm("You have been logged out, you can cancel to stay on this page, or log in again","Confirm logout",{confirmButtonText:"Re-Login",cancelButtonText:"Cancel",type:"warning"}).then((function(){c["a"].dispatch("user/resetToken").then((function(){location.reload()}))})),Promise.reject(new Error(t.message||"Error"));var n=e.data,a=n.code;if("0"===a){var i=n.data;return i}return"200"===a?n:t}Object(s["b"])(),Object(l["d"])(),alert(t.message),document.location.href="index.html"}),(function(e){return console.log("err"+e),Object(o["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=r},b95c:function(e,t,n){"use strict";n("77fe")},bc35:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-clipboard",use:"icon-clipboard-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},bddf:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_three",use:"icon-item_three-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},c309:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-exe-cfg",use:"icon-exe-cfg-usage",viewBox:"0 0 1529 1024",content:''});c.a.add(s);t["default"]=s},c3a3:function(e,t,n){},c653:function(e,t,n){var a={"./app.js":"d9cd","./errorLog.js":"4d49","./permission.js":"31c2","./settings.js":"0781","./tagsView.js":"7509","./user.js":"0f9a"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="c653"},c829:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-chart",use:"icon-chart-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},c968:function(e,t,n){"use strict";n("9a1c")},c9e0:function(e,t,n){"use strict";n("5773")},cbb7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-email",use:"icon-email-usage",viewBox:"0 0 128 96",content:''});c.a.add(s);t["default"]=s},ce80:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-cfg-datasouce",use:"icon-cfg-datasouce-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},cfaa:function(e,t,n){"use strict";n("3561")},d056:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-people",use:"icon-people-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},d314:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo_1",use:"icon-item_logo_1-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d320:function(e,t,n){},d50e:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_two",use:"icon-item_two-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d9ae:function(e,t,n){"use strict";n("8d4d")},d9cd:function(e,t,n){"use strict";n.r(t);var a=n("a78e"),i=n.n(a),o={sidebar:{opened:!i.a.get("sidebarStatus")||!!+i.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop",size:i.a.get("size")||"medium"},c={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?i.a.set("sidebarStatus",1):i.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){i.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t},SET_SIZE:function(e,t){e.size=t,i.a.set("size",t)}},s={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)},setSize:function(e,t){var n=e.commit;n("SET_SIZE",t)}};t["default"]={namespaced:!0,state:o,mutations:c,actions:s}},dbc7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-exit-fullscreen",use:"icon-exit-fullscreen-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},dbd7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-lessee",use:"icon-lessee-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},dc52:function(e,t,n){},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},e534:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-theme",use:"icon-theme-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},e7c8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tree-table",use:"icon-tree-table-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},eb7b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadpool_logo",use:"icon-threadpool_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},ed08:function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"g",(function(){return h}));n("3b2b"),n("4917"),n("4f7f"),n("5df3"),n("1c4c"),n("28a5"),n("ac6a"),n("456d"),n("a481"),n("6b54");var a=n("7618");function i(e,t){if(0===arguments.length)return null;var n,i=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===Object(a["a"])(e)?n=e:("string"===typeof e&&/^[0-9]+$/.test(e)&&(e=parseInt(e)),"number"===typeof e&&10===e.toString().length&&(e*=1e3),n=new Date(e));var o={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()},c=i.replace(/{(y|m|d|h|i|s|a)+}/g,(function(e,t){var n=o[t];return"a"===t?["日","一","二","三","四","五","六"][n]:(e.length>0&&n<10&&(n="0"+n),n||0)}));return c}function o(e,t){e=10===(""+e).length?1e3*parseInt(e):+e;var n=new Date(e),a=Date.now(),o=(a-n)/1e3;return o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.ceil(o/3600)+"小时前":o<172800?"1天前":t?i(e,t):n.getMonth()+1+"月"+n.getDate()+"日"+n.getHours()+"时"+n.getMinutes()+"分"}function c(e){var t=e.split("?")[1];return t?JSON.parse('{"'+decodeURIComponent(t).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"').replace(/\+/g," ")+'"}'):{}}function s(e,t,n){var a,i,o,c,s,l=function l(){var r=+new Date-c;r0?a=setTimeout(l,t-r):(a=null,n||(s=e.apply(o,i),a||(o=i=null)))};return function(){for(var i=arguments.length,r=new Array(i),d=0;d'});c.a.add(s);t["default"]=s},f842:function(e,t,n){"use strict";n("f514")},f9a1:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-pdf",use:"icon-pdf-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},fab5:function(e,t,n){"use strict";n("b3b6")},fea0:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-log",use:"icon-log-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-04a4268a.c9a819e9.js b/hippo4j-console/src/main/resources/static/static/js/chunk-04a4268a.c9a819e9.js new file mode 100644 index 00000000..70eaf7dd --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-04a4268a.c9a819e9.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-04a4268a"],{"386d":function(n,t,e){"use strict";var r=e("cb7c"),a=e("83a1"),i=e("5f1b");e("214f")("search",1,(function(n,t,e,o){return[function(e){var r=n(this),a=void 0==e?void 0:e[t];return void 0!==a?a.call(e,r):new RegExp(e)[t](String(r))},function(n){var t=o(e,n,this);if(t.done)return t.value;var c=r(n),u=String(this),d=c.lastIndex;a(d,0)||(c.lastIndex=0);var l=i(c,u);return a(c.lastIndex,d)||(c.lastIndex=d),null===l?-1:l.index}]}))},"83a1":function(n,t){n.exports=Object.is||function(n,t){return n===t?0!==n||1/n===1/t:n!=n&&t!=t}},b829:function(n,t,e){"use strict";e.r(t);e("386d");var r,a,i={name:"AuthRedirect",created:function(){var n=window.location.search.slice(1);window.localStorage&&(window.localStorage.setItem("x-admin-oauth-code",n),window.close())},render:function(n){return n()}},o=i,c=e("2877"),u=Object(c["a"])(o,r,a,!1,null,null,null);t["default"]=u.exports}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-06cdbb30.73970c7d.js b/hippo4j-console/src/main/resources/static/static/js/chunk-06cdbb30.73970c7d.js new file mode 100644 index 00000000..25e23899 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-06cdbb30.73970c7d.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-06cdbb30"],{"06ea":function(e,t,i){"use strict";i("2e75")},"2e75":function(e,t,i){},"333d":function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[i("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},n=[];i("c5f6");Math.easeInOutQuad=function(e,t,i,a){return e/=a/2,e<1?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t)};var l=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function r(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,i){var a=s(),n=e-a,o=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=o;var s=Math.easeInOutQuad(u,a,n,t);r(s),u0,expression:"total > 0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),i("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.instanceDialogFormVisible,width:"1000px"},on:{"update:visible":function(t){e.instanceDialogFormVisible=t}}},[i("test"),e._v(" "),i("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"right","label-width":"110px"}},[i("h3",[e._v("\n        线程池负载高时, 禁止频繁刷新此页面!!!\n ")]),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:""}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"线程池ID"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.tpId,callback:function(t){e.$set(e.runTimeTemp,"tpId",t)},expression:"runTimeTemp.tpId"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"环境标识"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.active,callback:function(t){e.$set(e.runTimeTemp,"active",t)},expression:"runTimeTemp.active"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"实例Host"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.host,callback:function(t){e.$set(e.runTimeTemp,"host",t)},expression:"runTimeTemp.host"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"实例标识"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.identify,callback:function(t){e.$set(e.runTimeTemp,"identify",t)},expression:"runTimeTemp.identify"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"运行状态"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.state,callback:function(t){e.$set(e.runTimeTemp,"state",t)},expression:"runTimeTemp.state"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"《负载相关》"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"当前负载",prop:"currentLoad"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.currentLoad,callback:function(t){e.$set(e.runTimeTemp,"currentLoad",t)},expression:"runTimeTemp.currentLoad"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"峰值负载",prop:"peakLoad"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.peakLoad,callback:function(t){e.$set(e.runTimeTemp,"peakLoad",t)},expression:"runTimeTemp.peakLoad"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"内存占比",prop:"currentLoad"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.memoryProportion,callback:function(t){e.$set(e.runTimeTemp,"memoryProportion",t)},expression:"runTimeTemp.memoryProportion"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"剩余内存",prop:"currentLoad"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.freeMemory,callback:function(t){e.$set(e.runTimeTemp,"freeMemory",t)},expression:"runTimeTemp.freeMemory"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"《线程相关》"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"核心线程"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.coreSize,callback:function(t){e.$set(e.runTimeTemp,"coreSize",t)},expression:"runTimeTemp.coreSize"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"当前线程",prop:"poolSize"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.poolSize,callback:function(t){e.$set(e.runTimeTemp,"poolSize",t)},expression:"runTimeTemp.poolSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"最大线程",prop:"maximumSize"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.maximumSize,callback:function(t){e.$set(e.runTimeTemp,"maximumSize",t)},expression:"runTimeTemp.maximumSize"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"活跃线程",prop:"activeSize"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.activeSize,callback:function(t){e.$set(e.runTimeTemp,"activeSize",t)},expression:"runTimeTemp.activeSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"LargestSize",prop:"largestPoolSize"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.largestPoolSize,callback:function(t){e.$set(e.runTimeTemp,"largestPoolSize",t)},expression:"runTimeTemp.largestPoolSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"《队列相关》"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"阻塞队列"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.queueType,callback:function(t){e.$set(e.runTimeTemp,"queueType",t)},expression:"runTimeTemp.queueType"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列容量",prop:"queueCapacity"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.queueCapacity,callback:function(t){e.$set(e.runTimeTemp,"queueCapacity",t)},expression:"runTimeTemp.queueCapacity"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列元素",prop:"queueSize"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.queueSize,callback:function(t){e.$set(e.runTimeTemp,"queueSize",t)},expression:"runTimeTemp.queueSize"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列剩余容量",prop:"queueRemainingCapacity"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.queueRemainingCapacity,callback:function(t){e.$set(e.runTimeTemp,"queueRemainingCapacity",t)},expression:"runTimeTemp.queueRemainingCapacity"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"《其它信息》"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"任务总量",prop:"completedTaskCount"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.completedTaskCount,callback:function(t){e.$set(e.runTimeTemp,"completedTaskCount",t)},expression:"runTimeTemp.completedTaskCount"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"拒绝次数",prop:"rejectCount"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.rejectCount,callback:function(t){e.$set(e.runTimeTemp,"rejectCount",t)},expression:"runTimeTemp.rejectCount"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"最后更新时间",prop:"clientLastRefreshTime"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.clientLastRefreshTime,callback:function(t){e.$set(e.runTimeTemp,"clientLastRefreshTime",t)},expression:"runTimeTemp.clientLastRefreshTime"}})],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"拒绝策略",prop:"RejectedExecutionHandler"}},[i("el-input",{attrs:{disabled:!0},model:{value:e.runTimeTemp.rejectedName,callback:function(t){e.$set(e.runTimeTemp,"rejectedName",t)},expression:"runTimeTemp.rejectedName"}})],1)],1)],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.instanceDialogFormVisible=!1}}},[e._v("\n 关闭\n ")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleInfo()}}},[e._v("\n 刷新\n ")])],1)],1),e._v(" "),i("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"1000px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"110px"}},[i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"基本信息"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"租户ID",prop:"tenantId"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"请选择租户",disabled:"create"!==e.dialogStatus},model:{value:e.temp.tenantId,callback:function(t){e.$set(e.temp,"tenantId",t)},expression:"temp.tenantId"}},e._l(e.tenantOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"核心线程",prop:"coreSize"}},[i("el-input-number",{attrs:{placeholder:"核心线程",min:1,max:999},model:{value:e.temp.coreSize,callback:function(t){e.$set(e.temp,"coreSize",t)},expression:"temp.coreSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"项目ID",prop:"itemId"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"请选择项目",disabled:"create"!==e.dialogStatus},model:{value:e.temp.itemId,callback:function(t){e.$set(e.temp,"itemId",t)},expression:"temp.itemId"}},e._l(e.itemOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"最大线程",prop:"maxSize"}},[i("el-input-number",{attrs:{placeholder:"最大线程",min:1,max:999},model:{value:e.temp.maxSize,callback:function(t){e.$set(e.temp,"maxSize",t)},expression:"temp.maxSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"线程池ID",prop:"tpId"}},[i("el-input",{attrs:{size:"medium",placeholder:"请输入线程池ID",disabled:"create"!==e.dialogStatus},model:{value:e.temp.tpId,callback:function(t){e.$set(e.temp,"tpId",t)},expression:"temp.tpId"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"扩展信息"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列类型",prop:"queueType"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"队列类型",disabled:!0},on:{change:e.selectQueueType},model:{value:e.temp.queueType,callback:function(t){e.$set(e.temp,"queueType",t)},expression:"temp.queueType"}},e._l(e.queueTypeOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列容量",prop:"capacity"}},[i("el-input-number",{attrs:{placeholder:"队列容量",min:0,max:2147483647,disabled:9!=e.temp.queueType},model:{value:e.temp.capacity,callback:function(t){e.$set(e.temp,"capacity",t)},expression:"temp.capacity"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"核心线程超时",prop:"isAlarm"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"核心线程超时"},model:{value:e.temp.allowCoreThreadTimeOut,callback:function(t){e.$set(e.temp,"allowCoreThreadTimeOut",t)},expression:"temp.allowCoreThreadTimeOut"}},e._l(e.allowCoreThreadTimeOutTypes,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"KATime/S",prop:"keepAliveTime"}},[i("el-input-number",{attrs:{placeholder:"Time/S",min:1,max:99999},model:{value:e.temp.keepAliveTime,callback:function(t){e.$set(e.temp,"keepAliveTime",t)},expression:"temp.keepAliveTime"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"拒绝策略",prop:"rejectedType"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"拒绝策略"},on:{change:e.selectRejectedType},model:{value:e.temp.rejectedType,callback:function(t){e.$set(e.temp,"rejectedType",t)},expression:"temp.rejectedType"}},e._l(e.rejectedOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1)],1),e._v(" "),e.isRejectShow?i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"SPI 拒绝策略",prop:"customRejectedType"}},[i("el-input",{attrs:{placeholder:"请输入自定义 SPI 拒绝策略标识"},on:{input:function(t){return e.onInput()}},model:{value:e.temp.customRejectedType,callback:function(t){e.$set(e.temp,"customRejectedType",t)},expression:"temp.customRejectedType"}})],1)],1)],1):e._e()],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确认\n ")])],1)],1),e._v(" "),i("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),i("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("\n Confirm\n ")])],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"Stack Info",visible:e.isStackShow,width:"60%"},on:{"update:visible":function(t){e.isStackShow=t}}},[i("ul",{staticClass:"stack-info"},e._l(e.stackInfo,(function(t){return i("li",{key:t.threadId},[i("p",[e._v('\n "'+e._s(t.threadName)+'" #'+e._s(t.threadId)+" java.lang.Thread.State:\n "+e._s(t.threadStatus)+"\n ")]),e._v(" "),i("ul",e._l(t.threadStack,(function(t,a){return i("li",{key:a},[e._v("at "+e._s(t))])})),0)])})),0),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.isStackShow=!1}}},[e._v("关 闭")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.handleStackInfo}},[e._v("\n 刷 新\n ")])],1)])],1)},n=[],l=(i("ac6a"),i("456d"),i("dd71")),r=i("3737"),s=i("4d85"),o=i("397f"),u=i("6724"),c=i("333d"),p=(i("bc3a"),{components:{Pagination:c["a"]},directives:{waves:u["a"]},filters:{statusFilter:function(e){var t={DEV:"info",TEST:"success",UAT:"warning",PROD:"danger"};return t[e]},queueFilter:function(e){return"1"==e?"ArrayBlockingQueue":"2"==e?"LinkedBlockingQueue":"3"==e?"LinkedBlockingDeque":"4"==e?"SynchronousQueue":"5"==e?"LinkedTransferQueue":"6"==e?"PriorityBlockingQueue":"9"==e?"ResizableLinkedBlockingQueue":void 0},rejectedFilter:function(e){return"1"==e?"CallerRunsPolicy":"2"==e?"AbortPolicy":"3"==e?"DiscardPolicy":"4"==e?"DiscardOldestPolicy":"5"==e?"RunsOldestTaskPolicy":"6"==e?"SyncPutQueuePolicy":"CustomRejectedPolicy - "+e}},data:function(){return{list:null,listLoading:!1,total:0,listQuery:{current:1,size:10,itemId:"",tpId:""},isStackShow:!1,stackInfo:[],rowInfo:{},size:500,pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,isRejectShow:!1,instanceDialogFormVisible:!1,tenantOptions:[],threadPoolOptions:[],itemOptions:[],queueTypeOptions:[{key:1,display_name:"ArrayBlockingQueue"},{key:2,display_name:"LinkedBlockingQueue"},{key:3,display_name:"LinkedBlockingDeque"},{key:4,display_name:"SynchronousQueue"},{key:5,display_name:"LinkedTransferQueue"},{key:6,display_name:"PriorityBlockingQueue"},{key:9,display_name:"ResizableLinkedBlockingQueue (支持动态修改队列大小)"}],rejectedOptions:[{key:1,display_name:"CallerRunsPolicy"},{key:2,display_name:"AbortPolicy"},{key:3,display_name:"DiscardPolicy"},{key:4,display_name:"DiscardOldestPolicy"},{key:5,display_name:"RunsOldestTaskPolicy"},{key:6,display_name:"SyncPutQueuePolicy"},{key:99,display_name:"CustomRejectedPolicy(自定义 SPI 策略)"}],alarmTypes:[{key:1,display_name:"报警"},{key:0,display_name:"不报警"}],allowCoreThreadTimeOutTypes:[{key:1,display_name:"超时"},{key:0,display_name:"不超时"}],rules:{tenantId:[{required:!0,message:"this is required",trigger:"blur"}],itemId:[{required:!0,message:"this is required",trigger:"blur"}],tpId:[{required:!0,message:"this is required",trigger:"blur"}],coreSize:[{required:!0,message:"this is required",trigger:"blur"}],maxSize:[{required:!0,message:"this is required",trigger:"blur"}],queueType:[{required:!0,message:"this is required",trigger:"blur"}],keepAliveTime:[{required:!0,message:"this is required",trigger:"blur"}],isAlarm:[{required:!0,message:"this is required",trigger:"blur"}],capacityAlarm:[{required:!0,message:"this is required",trigger:"blur"}],livenessAlarm:[{required:!0,message:"this is required",trigger:"blur"}],rejectedType:[{required:!0,message:"this is required",trigger:"blur"}]},dialogStatus:"",textMap:{update:"Edit",create:"Create",info:"Info"},temp:{id:void 0,tenantId:"",itemId:"",rejectedType:null,customRejectedType:null},runTimeTemp:{},tempRow:{},visible:!0}},created:function(){this.initSelect()},methods:{onInput:function(){this.$forceUpdate()},fetchData:function(){var e=this;if(null!=this.listQuery.tenantId&&0!=Object.keys(this.listQuery.tenantId).length)if(null!=this.listQuery.itemId&&0!=Object.keys(this.listQuery.itemId).length)if(null!=this.listQuery.tpId&&0!=Object.keys(this.listQuery.tpId).length){this.listLoading=!0;var t=[this.listQuery.itemId,this.listQuery.tpId];o["a"](t).then((function(t){t.records;e.list=t,e.listLoading=!1}))}else this.$message.warning("线程池 ID 不允许为空");else this.$message.warning("项目 ID 不允许为空");else this.$message.warning("租户 ID 不允许为空")},refreshData:function(){this.listQuery.tenantId=null,this.listQuery.itemId=null,this.listQuery.tpId=null,this.itemOptions=[],this.threadPoolOptions=[]},initSelect:function(){var e=this;l["c"]({size:this.size}).then((function(t){for(var i=t.records,a=0;a0,expression:"total > 0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),i("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"1000px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"110px"}},[i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"《基本信息》"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"租户ID",prop:"tenantId"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"请选择租户",disabled:"create"!==e.dialogStatus},on:{change:function(t){return e.tenantTempSelectList()}},model:{value:e.temp.tenantId,callback:function(t){e.$set(e.temp,"tenantId",t)},expression:"temp.tenantId"}},e._l(e.tenantOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"核心线程",prop:"coreSize"}},[i("el-input-number",{attrs:{placeholder:"核心线程",min:1,max:999},model:{value:e.temp.coreSize,callback:function(t){e.$set(e.temp,"coreSize",t)},expression:"temp.coreSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"项目ID",prop:"itemId"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"请选择项目",disabled:"create"!==e.dialogStatus},model:{value:e.temp.itemId,callback:function(t){e.$set(e.temp,"itemId",t)},expression:"temp.itemId"}},e._l(e.itemTempOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"最大线程",prop:"maxSize"}},[i("el-input-number",{attrs:{placeholder:"最大线程",min:1,max:999},model:{value:e.temp.maxSize,callback:function(t){e.$set(e.temp,"maxSize",t)},expression:"temp.maxSize"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"线程池ID",prop:"tpId"}},[i("el-input",{attrs:{size:"medium",placeholder:"请输入线程池ID",disabled:"create"!==e.dialogStatus},model:{value:e.temp.tpId,callback:function(t){e.$set(e.temp,"tpId",t)},expression:"temp.tpId"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"《扩展信息》"}})],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列类型",prop:"queueType"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"队列类型"},on:{change:e.selectQueueType},model:{value:e.temp.queueType,callback:function(t){e.$set(e.temp,"queueType",t)},expression:"temp.queueType"}},e._l(e.queueTypeOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"队列容量",prop:"capacity"}},[i("el-input-number",{attrs:{placeholder:"队列容量",min:0,max:2147483647,disabled:4===e.temp.queueType||5===e.temp.queueType},model:{value:e.temp.capacity,callback:function(t){e.$set(e.temp,"capacity",t)},expression:"temp.capacity"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"核心线程超时",prop:"isAlarm"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"核心线程超时"},model:{value:e.temp.allowCoreThreadTimeOut,callback:function(t){e.$set(e.temp,"allowCoreThreadTimeOut",t)},expression:"temp.allowCoreThreadTimeOut"}},e._l(e.allowCoreThreadTimeOutTypes,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"KATime/S",prop:"keepAliveTime"}},[i("el-input-number",{attrs:{placeholder:"Time / S",min:1,max:99999},model:{value:e.temp.keepAliveTime,callback:function(t){e.$set(e.temp,"keepAliveTime",t)},expression:"temp.keepAliveTime"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"是否报警",prop:"isAlarm"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"是否报警"},model:{value:e.temp.isAlarm,callback:function(t){e.$set(e.temp,"isAlarm",t)},expression:"temp.isAlarm"}},e._l(e.alarmTypes,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"活跃度报警",prop:"livenessAlarm"}},[i("el-input-number",{attrs:{placeholder:"活跃度报警",min:30,max:90},model:{value:e.temp.livenessAlarm,callback:function(t){e.$set(e.temp,"livenessAlarm",t)},expression:"temp.livenessAlarm"}})],1)],1)],1),e._v(" "),i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"拒绝策略",prop:"rejectedType"}},[i("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"拒绝策略"},on:{change:e.selectRejectedType},model:{value:e.temp.rejectedType,callback:function(t){e.$set(e.temp,"rejectedType",t)},expression:"temp.rejectedType"}},e._l(e.rejectedOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"容量报警",prop:"capacityAlarm"}},[i("el-input-number",{attrs:{placeholder:"容量报警",min:30,max:90},model:{value:e.temp.capacityAlarm,callback:function(t){e.$set(e.temp,"capacityAlarm",t)},expression:"temp.capacityAlarm"}})],1)],1)],1),e._v(" "),e.isRejectShow?i("el-row",{attrs:{gutter:20}},[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"SPI 拒绝策略",prop:"customRejectedType"}},[i("el-input",{attrs:{placeholder:"请输入自定义 SPI 拒绝策略标识"},on:{input:function(t){return e.onInput()}},model:{value:e.temp.customRejectedType,callback:function(t){e.$set(e.temp,"customRejectedType",t)},expression:"temp.customRejectedType"}})],1)],1)],1):e._e()],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确认\n ")])],1)],1),e._v(" "),i("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),i("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("Confirm")])],1)],1)],1)},n=[],l=(i("ac6a"),i("456d"),i("3737")),r=i("dd71"),s=i("4d85"),o=i("6724"),c=i("333d"),u={name:"JobProject",components:{Pagination:c["a"]},directives:{waves:o["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]},queueFilter:function(e){return"1"==e?"ArrayBlockingQueue":"2"==e?"LinkedBlockingQueue":"3"==e?"LinkedBlockingDeque":"4"==e?"SynchronousQueue":"5"==e?"LinkedTransferQueue":"6"==e?"PriorityBlockingQueue":"9"==e?"ResizableLinkedBlockingQueue":void 0}},data:function(){var e=this;return{isRejectShow:!1,list:null,listLoading:!0,total:0,listQuery:{current:1,size:10,tpId:"",itemId:""},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],isEditDisabled:!1,dialogFormVisible:!1,tenantOptions:[],threadPoolOptions:[],itemOptions:[],itemTempOptions:[],queueTypeOptions:[{key:1,display_name:"ArrayBlockingQueue"},{key:2,display_name:"LinkedBlockingQueue"},{key:3,display_name:"LinkedBlockingDeque"},{key:4,display_name:"SynchronousQueue"},{key:5,display_name:"LinkedTransferQueue"},{key:6,display_name:"PriorityBlockingQueue"},{key:9,display_name:"ResizableLinkedBlockingQueue (支持动态修改队列大小)"}],rejectedOptions:[{key:1,display_name:"CallerRunsPolicy"},{key:2,display_name:"AbortPolicy"},{key:3,display_name:"DiscardPolicy"},{key:4,display_name:"DiscardOldestPolicy"},{key:5,display_name:"RunsOldestTaskPolicy"},{key:6,display_name:"SyncPutQueuePolicy"},{key:99,display_name:"CustomRejectedPolicy(自定义 SPI 策略)"}],alarmTypes:[{key:1,display_name:"报警"},{key:0,display_name:"不报警"}],allowCoreThreadTimeOutTypes:[{key:1,display_name:"超时"},{key:0,display_name:"不超时"}],size:500,dialogStatus:"",textMap:{update:"Edit",create:"Create"},rules:{tenantId:[{required:!0,message:"this is required",trigger:"blur"}],itemId:[{required:!0,message:"this is required",trigger:"blur"}],tpId:[{required:!0,message:"this is required",trigger:"blur"}],coreSize:[{required:!0,message:"this is required",trigger:"blur"}],maxSize:[{required:!0,message:"this is required",trigger:"blur"},{validator:function(t,i,a){parseInt(i)0&&void 0!==arguments[0]?arguments[0]:{},e=t.poolSizeList,i=t.activeSizeList,n=(t.queueSizeList,t.completedTaskCountList,t.rejectCountList),a=t.dayList,r=(t.queueRemainingCapacityList,t.currentLoadList);this.chart.setOption({title:{text:"Historical Data Chart"},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{data:["poolSize","activeSize","rejectCount","currentLoad"]},toolbox:{feature:{}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:a}],yAxis:[{type:"value"}],series:[{name:"poolSize",type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:e},{name:"activeSize",type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:i},{name:"rejectCount",type:"line",stack:"Total",color:"#f47920",areaStyle:{},emphasis:{focus:"series"},data:n},{name:"currentLoad",type:"line",stack:"Total",areaStyle:{},label:{position:"top"},emphasis:{focus:"series"},data:r}]})}}},d=c,h=i("2877"),p=Object(h["a"])(d,s,o,!1,null,null,null),f=p.exports,m=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.className,style:{height:t.height,width:t.width}})},y=[],v={mixins:[u],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"450px"},autoResize:{type:Boolean,default:!0},chartData:{type:Object,required:!0}},data:function(){return{chart:null}},watch:{chartData:{deep:!0,handler:function(t){this.setOptions(t)}}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=i("313e");this.chart=t.init(this.$el,"macarons"),this.setOptions(this.chartData)},setOptions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(t.poolSizeList,t.activeSizeList,t.queueSizeList),i=t.completedTaskCountList,n=(t.rejectCountList,t.dayList),a=t.queueRemainingCapacityList,r=t.queueCapacityList;this.chart.setOption({title:{text:"Historical Data Chart"},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{data:["queueSize","queueRemainingCapacity","queueCapacity","completedTaskCount"]},toolbox:{feature:{}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:n}],yAxis:[{type:"value"}],series:[{name:"queueSize",type:"line",stack:"Total",areaStyle:{},label:{position:"top"},emphasis:{focus:"series"},data:e},{name:"queueRemainingCapacity",type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:a},{name:"queueCapacity",type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:r},{name:"completedTaskCount",type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:i}]})}}},b=v,g=Object(h["a"])(b,m,y,!1,null,null,null),_=g.exports,C=i("c9fe"),w=i("6724"),j=i("333d"),I=i("3737"),S=i("dd71"),O=i("4d85"),k=i("397f"),L=i("b775");function z(t){return Object(L["a"])({url:"/hippo4j/v1/cs/monitor/info",method:"post",data:t})}function x(t){return Object(L["a"])({url:"/hippo4j/v1/cs/monitor/last/task/count",method:"post",data:t})}var Q={name:"DashboardAdmin",components:{Pagination:j["a"],LineChart:f,LineChartTwo:_},directives:{waves:w["a"]},filters:{queueFilter:function(t){return"1"==t?"ArrayBlockingQueue":"2"==t?"LinkedBlockingQueue":"3"==t?"LinkedBlockingDeque":"4"==t?"SynchronousQueue":"5"==t?"LinkedTransferQueue":"6"==t?"PriorityBlockingQueue":"9"==t?"ResizableLinkedBlockingQueue":void 0},rejectedFilter:function(t){return"1"==t?"CallerRunsPolicy":"2"==t?"AbortPolicy":"3"==t?"DiscardPolicy":"4"==t?"DiscardOldestPolicy":"5"==t?"RunsOldestTaskPolicy":"6"==t?"SyncPutQueuePolicy":null!=t&&""!=t?"CustomRejectedPolicy - "+t:void 0},alarmFilter:function(t){return"1"==t?"报警":"0"==t?"忽略":void 0},allowCoreThreadTimeOutFilter:function(t){return"1"==t?"超时":"0"==t?"不超时":void 0}},data:function(){return{lineChartData:{chartInfo:{poolSizeList:[],activeSizeList:[],queueSizeList:[],completedTaskCountList:[],rejectCountList:[],dayList:[],queueRemainingCapacityList:[],currentLoadList:[],queueCapacityList:[]}},countSucTotal:0,countRunningTotal:0,countFailTotal:0,show:!1,size:500,tenantOptions:[],threadPoolOptions:[],itemOptions:[],identifyOptions:[],listQuery:{current:1,size:10,itemId:"",tpId:"",tenantId:"",identify:"",instanceId:""},temp:{},fromIdentify:"",lastTaskCount:null}},created:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.chartInfo(),this.initSelect();case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{handleSetLineChartData:function(t){this.lineChartData=lineChartData[t]},fetchData:function(){var t=this;null!=this.listQuery.tenantId&&0!=Object.keys(this.listQuery.tenantId).length?null!=this.listQuery.itemId&&0!=Object.keys(this.listQuery.itemId).length?null!=this.listQuery.tpId&&0!=Object.keys(this.listQuery.tpId).length?null!=this.listQuery.identify&&0!=Object.keys(this.listQuery.identify).length?(this.listQuery.instanceId=this.listQuery.identify,O["d"](this.listQuery).then((function(e){t.temp=e,t.fromIdentify=t.listQuery.identify})),x(this.listQuery).then((function(e){t.lastTaskCount=e.completedTaskCount})),this.initChart()):this.$message.warning("IP : PORT 不允许为空"):this.$message.warning("线程池 ID 不允许为空"):this.$message.warning("项目 ID 不允许为空"):this.$message.warning("租户 ID 不允许为空")},refreshData:function(){this.listQuery.tenantId=null,this.listQuery.itemId=null,this.listQuery.tpId=null,this.listQuery.identify=null,this.itemOptions=[],this.threadPoolOptions=[],this.identifyOptions=[]},chartInfo:function(){var t=this;C["a"]().then((function(e){t.show=!0,t.countSucTotal=e.tenantCount,t.countRunningTotal=e.threadPoolCount,t.countFailTotal=e.itemCount}))},initSelect:function(){var t=this;S["c"]({size:this.size}).then((function(e){for(var i=e.records,n=0;n0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),a("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:e.rules,model:e.temp,"label-position":"right","label-width":"100px"}},[a("el-form-item",{attrs:{label:"用户名",prop:"userName"}},[a("el-input",{attrs:{placeholder:"用户名"},model:{value:e.temp.userName,callback:function(t){e.$set(e.temp,"userName",t)},expression:"temp.userName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"密 码",prop:"password"}},[a("el-input",{attrs:{placeholder:"密码",minlength:"6"},model:{value:e.temp.password,callback:function(t){e.$set(e.temp,"password",t)},expression:"temp.password"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"角色",prop:"role"}},[a("el-select",{staticClass:"filter-item",attrs:{placeholder:"角色类型"},model:{value:e.temp.role,callback:function(t){e.$set(e.temp,"role",t)},expression:"temp.role"}},e._l(e.roles,(function(e){return a("el-option",{key:e.key,attrs:{label:e,value:e}})})),1)],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确定\n ")])],1)],1)],1)},i=[],r=a("cc68"),o=a("6724"),s=a("333d"),l={name:"User",components:{Pagination:s["a"]},directives:{waves:o["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]}},data:function(){return{list:null,listLoading:!0,total:0,listQuery:{current:1,size:10,userName:void 0},roles:["ROLE_USER","ROLE_ADMIN"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,dialogStatus:"",textMap:{update:"Edit",create:"Create"},rules:{role:[{required:!0,message:"role is required",trigger:"change"}],userName:[{required:!0,message:"userName is required",trigger:"blur"}],password:[{required:!1,message:"password is required",trigger:"blur"}]},temp:{id:void 0,role:"",userName:"",password:"",permission:""},resetTemp:function(){this.temp=this.$options.data().temp}}},created:function(){this.fetchData()},methods:{fetchData:function(){var e=this;this.listLoading=!0,r["d"](this.listQuery).then((function(t){e.total=t.total,e.list=t.records,e.listLoading=!1}))},handleCreate:function(){var e=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&r["a"](e.temp).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Created Successfully",type:"success",duration:2e3})}))}))},handleUpdate:function(e){var t=this;this.temp=Object.assign({},e),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var a=Object.assign({},e.temp);r["e"](a).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Update Successfully",type:"success",duration:2e3})}))}}))},openDelConfirm:function(e){return this.$confirm("此操作将删除 ".concat(e,", 是否继续?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"})},handleDelete:function(e){var t=this;this.openDelConfirm(e.userName).then((function(){r["b"](e.userName).then((function(e){t.fetchData(),t.$notify({title:"Success",message:"Delete Successfully",type:"success",duration:2e3})}))}))}}},u=l,c=a("2877"),d=Object(c["a"])(u,n,i,!1,null,null,null);t["default"]=d.exports},6724:function(e,t,a){"use strict";a("8d41");var n="@@wavesContext";function i(e,t){function a(a){var n=Object.assign({},t.value),i=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},n),r=i.ele;if(r){r.style.position="relative",r.style.overflow="hidden";var o=r.getBoundingClientRect(),s=r.querySelector(".waves-ripple");switch(s?s.className="waves-ripple":(s=document.createElement("span"),s.className="waves-ripple",s.style.height=s.style.width=Math.max(o.width,o.height)+"px",r.appendChild(s)),i.type){case"center":s.style.top=o.height/2-s.offsetHeight/2+"px",s.style.left=o.width/2-s.offsetWidth/2+"px";break;default:s.style.top=(a.pageY-o.top-s.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",s.style.left=(a.pageX-o.left-s.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return s.style.backgroundColor=i.color,s.className="waves-ripple z-active",!1}}return e[n]?e[n].removeHandle=a:e[n]={removeHandle:a},a}var r={bind:function(e,t){e.addEventListener("click",i(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[n].removeHandle,!1),e.addEventListener("click",i(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[n].removeHandle,!1),e[n]=null,delete e[n]}},o=function(e){e.directive("waves",r)};window.Vue&&(window.waves=r,Vue.use(o)),r.install=o;t["a"]=r},7456:function(e,t,a){},"8d41":function(e,t,a){},cc68:function(e,t,a){"use strict";a.d(t,"d",(function(){return i})),a.d(t,"e",(function(){return r})),a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return l}));var n=a("b775");function i(e){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/page",method:"post",data:e})}function r(e){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/update",method:"put",data:e})}function o(e){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/add",method:"post",data:e})}function s(e){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/remove/"+e,method:"delete"})}function l(e){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/info/"+e,method:"get"})}},e498:function(e,t,a){"use strict";a("7456")}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-4b345e33.5169cc75.js b/hippo4j-console/src/main/resources/static/static/js/chunk-4b345e33.5169cc75.js new file mode 100644 index 00000000..3e59f0ea --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-4b345e33.5169cc75.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4b345e33"],{"266a":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"租户ID"},on:{change:function(t){return e.tenantSelectList()}},model:{value:e.listQuery.tenantId,callback:function(t){e.$set(e.listQuery,"tenantId",t)},expression:"listQuery.tenantId"}},e._l(e.tenantOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1),e._v(" "),n("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"项目ID"},on:{change:function(t){return e.itemSelectList()}},model:{value:e.listQuery.itemId,callback:function(t){e.$set(e.listQuery,"itemId",t)},expression:"listQuery.itemId"}},e._l(e.itemOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1),e._v(" "),n("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"线程池ID"},model:{value:e.listQuery.tpId,callback:function(t){e.$set(e.listQuery,"tpId",t)},expression:"listQuery.tpId"}},e._l(e.threadPoolOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1),e._v(" "),n("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.fetchData}},[e._v("\n 搜索\n ")]),e._v(" "),n("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.handleCreate}},[e._v("\n 添加\n ")])],1),e._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{align:"center",label:"序号",width:"95"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.$index+1))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"租户ID",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.tenantId))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"项目ID",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.itemId))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"线程池ID",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.tpId))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"通知平台",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.platform))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"通知类型",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.type))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"报警间隔",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("intervals")(t.row.interval)))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"接收者",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("ellipsis")(t.row.receives)))]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"是否启用",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-switch",{attrs:{"active-color":"#00A854","active-text":"启用","active-value":1,"inactive-color":"#F04134","inactive-text":"停用","inactive-value":0},on:{change:function(n){return e.changeEnable(t.row)}},model:{value:t.row.enable,callback:function(n){e.$set(t.row,"enable",n)},expression:"scope.row.enable"}})]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center",width:"180","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleUpdate(a)}}},[e._v("\n 编辑\n ")]),e._v(" "),"deleted"!==a.status?n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.handleDelete(a)}}},[e._v("\n 删除\n ")]):e._e()]}}])})],1),e._v(" "),n("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),n("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"1000px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[n("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"110px"}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"基本信息"}})],1)],1),e._v(" "),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"租户ID",prop:"tenantId"}},[n("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"请选择租户",disabled:"create"!==e.dialogStatus},on:{change:function(t){return e.tenantTempSelectList()}},model:{value:e.temp.tenantId,callback:function(t){e.$set(e.temp,"tenantId",t)},expression:"temp.tenantId"}},e._l(e.tenantOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"通知平台",prop:"platform"}},[n("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"通知平台"},model:{value:e.temp.platform,callback:function(t){e.$set(e.temp,"platform",t)},expression:"temp.platform"}},e._l(e.platformTypes,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1)],1),e._v(" "),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"项目ID",prop:"itemId"}},[n("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"请选择项目",disabled:"create"!==e.dialogStatus},on:{change:function(t){return e.itemTempSelectList()}},model:{value:e.temp.itemId,callback:function(t){e.$set(e.temp,"itemId",t)},expression:"temp.itemId"}},e._l(e.itemTempOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"通知类型",prop:"type"}},[n("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"通知类型"},on:{change:e.selectType},model:{value:e.temp.type,callback:function(t){e.$set(e.temp,"type",t)},expression:"temp.type"}},e._l(e.typeTypes,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1)],1),e._v(" "),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"线程池ID",prop:"tpId"}},[n("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"线程池ID",disabled:"create"!==e.dialogStatus},model:{value:e.temp.tpId,callback:function(t){e.$set(e.temp,"tpId",t)},expression:"temp.tpId"}},e._l(e.threadPoolTempOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"是否启用",prop:"enable"}},[n("el-select",{staticStyle:{display:"block"},attrs:{placeholder:"是否启用"},model:{value:e.temp.enable,callback:function(t){e.$set(e.temp,"enable",t)},expression:"temp.enable"}},e._l(e.enableTypes,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1)],1)],1),e._v(" "),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"扩展信息"}})],1)],1),e._v(" "),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Token",prop:"secretKey"}},[n("el-input",{attrs:{size:"medium",placeholder:"请输入Token"},model:{value:e.temp.secretKey,callback:function(t){e.$set(e.temp,"secretKey",t)},expression:"temp.secretKey"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"报警间隔",prop:"interval"}},[n("el-input-number",{attrs:{placeholder:"报警间隔/Min",min:0,disabled:"CONFIG"===e.temp.type},model:{value:e.temp.interval,callback:function(t){e.$set(e.temp,"interval",t)},expression:"temp.interval"}})],1)],1)],1),e._v(" "),n("el-row",{attrs:{gutter:40}},[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"接收者",prop:"receives"}},[n("el-input",{staticStyle:{width:"83%"},attrs:{autosize:{minRows:6,maxRows:10},type:"textarea",placeholder:"多个接收者使用英文逗号 , 分割 (注意不要有空格)\n钉钉:填写手机号\n企微:填写user_id会以@的消息发给用户,否则填写姓名,如:龙台\n飞书:填写ou_开头用户唯一标识会以@的消息发给用户,填写手机号则是普通的@"},model:{value:e.temp.receives,callback:function(t){e.$set(e.temp,"receives",t)},expression:"temp.receives"}})],1)],1)],1)],1),e._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确认\n ")])],1)],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),n("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("Confirm")])],1)],1)],1)},i=[],l=(n("ac6a"),n("456d"),n("bd86")),r=n("3737"),s=n("dd71"),o=n("b775");function c(e){return Object(o["a"])({url:"/hippo4j/v1/cs/notify/query/page",method:"post",data:e})}function u(e){return Object(o["a"])({url:"/hippo4j/v1/cs/notify/update",method:"post",data:e})}function d(e){return Object(o["a"])({url:"/hippo4j/v1/cs/notify/save",method:"post",data:e})}function p(e){return Object(o["a"])({url:"/hippo4j/v1/cs/notify/remove",method:"delete",data:e})}function m(e){return Object(o["a"])({url:"/hippo4j/v1/cs/notify/enable/"+e.id+"/"+e.enable,method:"post"})}var f=n("4d85"),h=n("6724"),v=n("333d"),y={name:"JobProject",components:{Pagination:v["a"]},directives:{waves:h["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]},ellipsis:function(e){return e?e.length>22?e.slice(0,22)+"...":e:""},intervals:function(e){return null==e||""==e?"-":e}},data:function(){var e;return e={list:null,listLoading:!0,total:0,listQuery:{current:1,size:10,tpId:"",itemId:""},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,tenantOptions:[],itemOptions:[],itemTempOptions:[],identifyOptions:[]},Object(l["a"])(e,"tenantOptions",[]),Object(l["a"])(e,"threadPoolTempOptions",[]),Object(l["a"])(e,"threadPoolOptions",[]),Object(l["a"])(e,"platformTypes",[{key:"DING",display_name:"DING"},{key:"LARK",display_name:"LARK"},{key:"WECHAT",display_name:"WECHAT"}]),Object(l["a"])(e,"typeTypes",[{key:"CONFIG",display_name:"CONFIG"},{key:"ALARM",display_name:"ALARM"}]),Object(l["a"])(e,"enableTypes",[{key:1,display_name:"启用"},{key:0,display_name:"停用"}]),Object(l["a"])(e,"dialogStatus",""),Object(l["a"])(e,"textMap",{update:"Edit",create:"Create"}),Object(l["a"])(e,"rules",{tenantId:[{required:!0,message:"this is required",trigger:"blur"}],itemId:[{required:!0,message:"this is required",trigger:"blur"}],tpId:[{required:!0,message:"this is required",trigger:"blur"}],receives:[{required:!0,message:"this is required",trigger:"blur"}],secretKey:[{required:!0,message:"this is required",trigger:"blur"}],platform:[{required:!0,message:"this is required",trigger:"blur"}],type:[{required:!0,message:"this is required",trigger:"blur"}],enable:[{required:!0,message:"this is required",trigger:"blur"}]}),Object(l["a"])(e,"temp",{id:void 0,tenantId:"",interval:void 0}),Object(l["a"])(e,"visible",!0),e},created:function(){this.fetchData(),this.initSelect()},methods:{fetchData:function(){var e=this;this.listLoading=!0,c(this.listQuery).then((function(t){var n=t.records,a=t.total;e.total=a,e.list=n,e.listLoading=!1}))},initSelect:function(){var e=this;s["c"]({}).then((function(t){for(var n=t.records,a=0;a0,expression:"total > 0"}],attrs:{total:t.total,page:t.listQuery.current,limit:t.listQuery.size},on:{"update:page":function(e){return t.$set(t.listQuery,"current",e)},"update:limit":function(e){return t.$set(t.listQuery,"size",e)},pagination:t.fetchData}}),t._v(" "),n("el-dialog",{attrs:{title:t.textMap[t.dialogStatus],visible:t.dialogFormVisible,width:"800px"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.temp,"label-position":"left","label-width":"100px"}},[n("el-form-item",{attrs:{label:"租户ID",prop:"tenantId"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{disabled:"create"!==t.dialogStatus,placeholder:"租户ID"},model:{value:t.temp.tenantId,callback:function(e){t.$set(t.temp,"tenantId",e)},expression:"temp.tenantId"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"租户名称",prop:"tenantName"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"租户名称"},model:{value:t.temp.tenantName,callback:function(e){t.$set(t.temp,"tenantName",e)},expression:"temp.tenantName"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"OWNER",prop:"owner"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"OWNER"},model:{value:t.temp.owner,callback:function(e){t.$set(t.temp,"owner",e)},expression:"temp.owner"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"租户描述",prop:"tenantDesc"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{autosize:{minRows:3,maxRows:6},type:"textarea",placeholder:"租户描述"},model:{value:t.temp.tenantDesc,callback:function(e){t.$set(t.temp,"tenantDesc",e)},expression:"temp.tenantDesc"}})],1)],1),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("\n 取消\n ")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.dialogStatus?t.createData():t.updateData()}}},[t._v("\n 确认\n ")])],1)],1),t._v(" "),n("el-dialog",{attrs:{visible:t.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(e){t.dialogPluginVisible=e}}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.pluginData,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{prop:"key",label:"Channel"}}),t._v(" "),n("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),t._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogPvVisible=!1}}},[t._v("Confirm")])],1)],1)],1)},i=[],l=n("dd71"),o=n("6724"),r=n("333d"),s={name:"JobProject",components:{Pagination:r["a"]},directives:{waves:o["a"]},filters:{statusFilter:function(t){var e={published:"success",draft:"gray",deleted:"danger"};return e[t]},ellipsis:function(t){return t?t.length>26?t.slice(0,26)+"...":t:""}},data:function(){return{list:null,listLoading:!0,total:0,listQuery:{current:1,size:10,tenantId:""},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],isEditDisabled:!1,dialogFormVisible:!1,dialogStatus:"",textMap:{update:"Edit",create:"Create"},rules:{tenantId:[{required:!0,message:"this is required",trigger:"blur"}],tenantName:[{required:!0,message:"this is required",trigger:"blur"}],owner:[{required:!0,message:"this is required",trigger:"blur"}],tenantDesc:[{required:!0,message:"this is required",trigger:"blur"}]},temp:{id:void 0,tenantId:"",tenantName:"",owner:"",tenantDesc:""},visible:!0}},created:function(){this.fetchData()},mounted:function(){this.isEditDisabled="admin"!==this.$cookie.get("userName")},methods:{fetchData:function(){var t=this;this.listLoading=!0,l["c"](this.listQuery).then((function(e){var n=e.records,a=e.total;t.total=a,t.list=n,t.listLoading=!1}))},resetTemp:function(){this.temp={id:void 0,tenantName:"",tenantDesc:""}},handleCreate:function(){var t=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},createData:function(){var t=this;this.$refs["dataForm"].validate((function(e){e&&l["a"](t.temp).then((function(){t.fetchData(),t.dialogFormVisible=!1,t.$notify({title:"Success",message:"Created Successfully",type:"success",duration:2e3})}))}))},handleUpdate:function(t){var e=this;this.temp=Object.assign({},t),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},updateData:function(){var t=this;this.$refs["dataForm"].validate((function(e){if(e){var n=Object.assign({},t.temp);l["d"](n).then((function(){t.fetchData(),t.dialogFormVisible=!1,t.$notify({title:"Success",message:"Update Successfully",type:"success",duration:2e3})}))}}))},openDelConfirm:function(t){return this.$confirm("此操作将删除 ".concat(t,", 是否继续?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"})},handleDelete:function(t){var e=this;this.openDelConfirm(t.tenantId).then((function(){l["b"](t.tenantId).then((function(t){e.fetchData(),e.$notify({title:"Success",message:"Delete Successfully",type:"success",duration:2e3})}))}))}}},u=s,c=n("2877"),d=Object(c["a"])(u,a,i,!1,null,null,null);e["default"]=d.exports},6724:function(t,e,n){"use strict";n("8d41");var a="@@wavesContext";function i(t,e){function n(n){var a=Object.assign({},e.value),i=Object.assign({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},a),l=i.ele;if(l){l.style.position="relative",l.style.overflow="hidden";var o=l.getBoundingClientRect(),r=l.querySelector(".waves-ripple");switch(r?r.className="waves-ripple":(r=document.createElement("span"),r.className="waves-ripple",r.style.height=r.style.width=Math.max(o.width,o.height)+"px",l.appendChild(r)),i.type){case"center":r.style.top=o.height/2-r.offsetHeight/2+"px",r.style.left=o.width/2-r.offsetWidth/2+"px";break;default:r.style.top=(n.pageY-o.top-r.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",r.style.left=(n.pageX-o.left-r.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return r.style.backgroundColor=i.color,r.className="waves-ripple z-active",!1}}return t[a]?t[a].removeHandle=n:t[a]={removeHandle:n},n}var l={bind:function(t,e){t.addEventListener("click",i(t,e),!1)},update:function(t,e){t.removeEventListener("click",t[a].removeHandle,!1),t.addEventListener("click",i(t,e),!1)},unbind:function(t){t.removeEventListener("click",t[a].removeHandle,!1),t[a]=null,delete t[a]}},o=function(t){t.directive("waves",l)};window.Vue&&(window.waves=l,Vue.use(o)),l.install=o;e["a"]=l},7456:function(t,e,n){},"8d41":function(t,e,n){},dd71:function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return r}));var a=n("b775");function i(t){return Object(a["a"])({url:"/hippo4j/v1/cs/tenant/query/page",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/hippo4j/v1/cs/tenant/update",method:"post",data:t})}function o(t){return Object(a["a"])({url:"/hippo4j/v1/cs/tenant/save",method:"post",data:t})}function r(t){return Object(a["a"])({url:"/hippo4j/v1/cs/tenant/delete/"+t,method:"delete"})}},e498:function(t,e,n){"use strict";n("7456")}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-6f742c38.47b5bb28.js b/hippo4j-console/src/main/resources/static/static/js/chunk-6f742c38.47b5bb28.js new file mode 100644 index 00000000..32fdd852 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-6f742c38.47b5bb28.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6f742c38"],{2017:function(t,n,e){"use strict";e("b12d")},9067:function(t,n,e){},9725:function(t,n,e){"use strict";e("b9c0")},"9ed6":function(t,n,e){"use strict";e.r(n);var s=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"login-container"},[e("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,autocomplete:"on","label-position":"left"}},[e("div",{staticClass:"title-container"},[e("h3",{staticClass:"title"},[t._v("Login Form")])]),t._v(" "),e("el-form-item",{attrs:{prop:"username"}},[e("span",{staticClass:"svg-container"},[e("svg-icon",{attrs:{"icon-class":"user"}})],1),t._v(" "),e("el-input",{ref:"username",attrs:{placeholder:"Username",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.loginForm.username,callback:function(n){t.$set(t.loginForm,"username",n)},expression:"loginForm.username"}})],1),t._v(" "),e("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:t.capsTooltip,callback:function(n){t.capsTooltip=n},expression:"capsTooltip"}},[e("el-form-item",{attrs:{prop:"password"}},[e("span",{staticClass:"svg-container"},[e("svg-icon",{attrs:{"icon-class":"password"}})],1),t._v(" "),e("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"Password",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(n){t.capsTooltip=!1}},nativeOn:{keyup:[function(n){return t.checkCapslock(n)},function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"enter",13,n.key,"Enter")?null:t.handleLogin(n)}]},model:{value:t.loginForm.password,callback:function(n){t.$set(t.loginForm,"password",n)},expression:"loginForm.password"}}),t._v(" "),e("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[e("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1)],1),t._v(" "),e("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(n){return n.preventDefault(),t.handleLogin(n)}}},[t._v("Login")])],1),t._v(" "),e("el-dialog",{attrs:{title:"Or connect with",visible:t.showDialog},on:{"update:visible":function(n){t.showDialog=n}}},[t._v("\n Can not be simulated on local, so please combine you own business simulation! ! !\n "),e("br"),t._v(" "),e("br"),t._v(" "),e("br"),t._v(" "),e("social-sign")],1)],1)},o=[],i=(e("ac6a"),e("456d"),function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"social-signup-container"},[e("div",{staticClass:"sign-btn",on:{click:function(n){return t.wechatHandleClick("wechat")}}},[e("span",{staticClass:"wx-svg-container"},[e("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),t._v("\n WeChat\n ")]),t._v(" "),e("div",{staticClass:"sign-btn",on:{click:function(n){return t.tencentHandleClick("tencent")}}},[e("span",{staticClass:"qq-svg-container"},[e("svg-icon",{staticClass:"icon",attrs:{"icon-class":"qq"}})],1),t._v("\n QQ\n ")])])}),a=[],r={name:"SocialSignin",methods:{wechatHandleClick:function(t){alert("ok")},tencentHandleClick:function(t){alert("ok")}}},c=r,l=(e("d9fb"),e("2877")),u=Object(l["a"])(c,i,a,!1,null,"7309fbbb",null),p=u.exports,d={name:"Login",components:{SocialSign:p},data:function(){var t=function(t,n,e){n.length<6?e(new Error("The password can not be less than 6 digits")):e()};return{loginForm:{username:"",password:""},loginRules:{password:[{required:!0,trigger:"blur",validator:t}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(t){var n=t.query;n&&(this.redirect=n.redirect,this.otherQuery=this.getOtherQuery(n))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()},destroyed:function(){},methods:{checkCapslock:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.shiftKey,e=t.key;e&&1===e.length&&(this.capsTooltip=!!(n&&e>="a"&&e<="z"||!n&&e>="A"&&e<="Z")),"CapsLock"===e&&!0===this.capsTooltip&&(this.capsTooltip=!1)},showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){t.$refs.password.focus()}))},handleLogin:function(){var t=this;this.$refs.loginForm.validate((function(n){if(!n)return console.log("error submit."),!1;t.loading=!0,t.$store.dispatch("user/login",t.loginForm).then((function(){t.$cookie.set("userName",t.loginForm.username),console.log("success submit."),t.$router.push({path:t.redirect||"/",query:t.otherQuery}),t.loading=!1})).catch((function(){console.log("error catch."),t.loading=!1}))}))},getOtherQuery:function(t){return Object.keys(t).reduce((function(n,e){return"redirect"!==e&&(n[e]=t[e]),n}),{})}}},f=d,h=(e("2017"),e("9725"),Object(l["a"])(f,s,o,!1,null,"16fd3f0c",null));n["default"]=h.exports},b12d:function(t,n,e){},b9c0:function(t,n,e){},d9fb:function(t,n,e){"use strict";e("9067")}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-7b878d9e.2665486c.js b/hippo4j-console/src/main/resources/static/static/js/chunk-7b878d9e.2665486c.js new file mode 100644 index 00000000..0e60b825 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-7b878d9e.2665486c.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7b878d9e"],{"3f2c":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.show?a("div",{staticClass:"dashboard-editor-container"},[a("github-corner",{staticClass:"github-corner"}),t._v(" "),a("panel-group",{attrs:{countSucTotal:t.countSucTotal,countRunningTotal:t.countRunningTotal,countFailTotal:t.countFailTotal,countRunningInstanceTotal:t.countRunningInstanceTotal},on:{handleSetLineChartData:t.handleSetLineChartData}}),t._v(" "),a("el-row",{staticStyle:{background:"#fff",padding:"16px 16px 0","margin-bottom":"32px"}},[a("line-chart",{attrs:{"chart-data":t.lineChartData}})],1),t._v(" "),a("el-row",{attrs:{gutter:32}},[a("el-col",{attrs:{xs:24,sm:24,lg:8}},[a("div",{staticClass:"chart-wrapper"},[a("el-form",{attrs:{"label-position":"left"}},[a("el-form-item",{attrs:{label:"登录用户","label-width":"120px"}},[a("span",[t._v(t._s(t.temp.userName))])]),t._v(" "),a("el-form-item",{attrs:{label:"用户角色","label-width":"120px"}},[a("span",[t._v(t._s(t.temp.role))])]),t._v(" "),a("el-form-item",{attrs:{label:"所属租户","label-width":"120px"}},[a("span")]),t._v(" "),a("el-form-item",{attrs:{label:"创建时间","label-width":"120px"}},[a("span",[t._v(" "+t._s(t.temp.gmtCreate))])]),t._v(" "),a("el-form-item",{attrs:{label:"修改时间","label-width":"120px"}},[a("span",[t._v(t._s(t.temp.gmtModified))])])],1)],1)]),t._v(" "),a("el-col",{attrs:{xs:24,sm:24,lg:8}},[a("div",{staticClass:"chart-wrapper"},[a("raddar-chart")],1)]),t._v(" "),a("el-col",{attrs:{xs:24,sm:24,lg:8}},[a("div",{staticClass:"chart-wrapper"},[a("pie-chart")],1)])],1),t._v(" "),a("el-row",{attrs:{gutter:8}},[a("el-col",{staticStyle:{"padding-right":"8px","margin-bottom":"30px"},attrs:{xs:{span:24},sm:{span:24},md:{span:24},lg:{span:12},xl:{span:12}}},[a("transaction-table")],1)],1)],1):t._e()},i=[],r=(a("96cf"),a("3b8d")),s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a",{staticClass:"github-corner",attrs:{href:"https://github.com/acmenlt/dynamic-threadpool",target:"_blank","aria-label":"View source on Github"}},[a("svg",{staticStyle:{fill:"#40c9c6",color:"#fff"},attrs:{width:"80",height:"80",viewBox:"0 0 250 250","aria-hidden":"true"}},[a("path",{attrs:{d:"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"}}),t._v(" "),a("path",{staticClass:"octo-arm",staticStyle:{"transform-origin":"130px 106px"},attrs:{d:"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2",fill:"currentColor"}}),t._v(" "),a("path",{staticClass:"octo-body",attrs:{d:"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z",fill:"currentColor"}})])])},o=[],l=(a("af42"),a("2877")),c={},u=Object(l["a"])(c,s,o,!1,null,"83aa39e4",null),h=u.exports,d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-row",{staticClass:"panel-group",attrs:{gutter:40}},[a("el-col",{staticClass:"card-panel-col",attrs:{xs:12,sm:12,lg:6}},[a("div",{staticClass:"card-panel",on:{click:function(e){return t.handleSetLineChartData("chartInfo")}}},[a("div",{staticClass:"card-panel-icon-wrapper "},[a("svg-icon",{attrs:{"icon-class":"tenant_logo2","class-name":"card-panel-icon"}})],1),t._v(" "),a("div",{staticClass:"card-panel-description"},[a("div",{staticClass:"card-panel-text"},[t._v("\n Tenant\n ")]),t._v(" "),a("count-to",{staticClass:"card-panel-num",attrs:{"start-val":0,"end-val":t.successCount,duration:2600}})],1)])]),t._v(" "),a("el-col",{staticClass:"card-panel-col",attrs:{xs:12,sm:12,lg:6}},[a("div",{staticClass:"card-panel"},[a("div",{staticClass:"card-panel-icon-wrapper "},[a("svg-icon",{attrs:{"icon-class":"item_logo4","class-name":"card-panel-icon"}})],1),t._v(" "),a("div",{staticClass:"card-panel-description"},[a("div",{staticClass:"card-panel-text"},[t._v("\n Item\n ")]),t._v(" "),a("count-to",{staticClass:"card-panel-num",attrs:{"start-val":0,"end-val":t.failCount,duration:3e3}})],1)])]),t._v(" "),a("el-col",{staticClass:"card-panel-col",attrs:{xs:12,sm:12,lg:6}},[a("div",{staticClass:"card-panel"},[a("div",{staticClass:"card-panel-icon-wrapper "},[a("svg-icon",{attrs:{"icon-class":"threadPool_logo1","class-name":"card-panel-icon"}})],1),t._v(" "),a("div",{staticClass:"card-panel-description"},[a("div",{staticClass:"card-panel-text"},[t._v("\n Thread Pool\n ")]),t._v(" "),a("count-to",{staticClass:"card-panel-num",attrs:{"start-val":0,"end-val":t.runningCount,duration:3200}})],1)])]),t._v(" "),a("el-col",{staticClass:"card-panel-col",attrs:{xs:12,sm:12,lg:6}},[a("div",{staticClass:"card-panel"},[a("div",{staticClass:"card-panel-icon-wrapper "},[a("svg-icon",{attrs:{"icon-class":"threadPool_logo2","class-name":"card-panel-icon"}})],1),t._v(" "),a("div",{staticClass:"card-panel-description"},[a("div",{staticClass:"card-panel-text"},[t._v("\n Pool Instance\n ")]),t._v(" "),a("count-to",{staticClass:"card-panel-num",attrs:{"start-val":0,"end-val":t.runningCountInstance,duration:3200}})],1)])])],1)},p=[],f=(a("c5f6"),a("ec1b")),m=a.n(f),v={components:{CountTo:m.a},props:{countSucTotal:{type:Number,default:0},countFailTotal:{type:Number,default:0},countRunningTotal:{type:Number,default:0},countRunningInstanceTotal:{type:Number,default:0}},data:function(){return{successCount:this.countSucTotal,failCount:this.countFailTotal,runningCount:this.countRunningTotal,runningCountInstance:this.countRunningInstanceTotal}},methods:{handleSetLineChartData:function(t){this.$emit("handleSetLineChartData",t)}}},b=v,g=(a("57c6"),Object(l["a"])(b,d,p,!1,null,"787f9ab2",null)),C=g.exports,_=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width}})},y=[],w=a("ed08"),x={data:function(){return{$_sidebarElm:null}},mounted:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},beforeDestroy:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},activated:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},deactivated:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},methods:{$_resizeHandler:function(){var t=this;return Object(w["b"])((function(){t.chart&&t.chart.resize()}),100)()},$_initResizeEvent:function(){window.addEventListener("resize",this.$_resizeHandler)},$_destroyResizeEvent:function(){window.removeEventListener("resize",this.$_resizeHandler)},$_sidebarResizeHandler:function(t){"width"===t.propertyName&&this.$_resizeHandler()},$_initSidebarResizeEvent:function(){this.$_sidebarElm=document.getElementsByClassName("sidebar-container")[0],this.$_sidebarElm&&this.$_sidebarElm.addEventListener("transitionend",this.$_sidebarResizeHandler)},$_destroySidebarResizeEvent:function(){this.$_sidebarElm&&this.$_sidebarElm.removeEventListener("transitionend",this.$_sidebarResizeHandler)}}},S={mixins:[x],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"350px"},autoResize:{type:Boolean,default:!0},chartData:{type:Object,required:!0}},data:function(){return{chart:null}},watch:{chartData:{deep:!0,handler:function(t){this.setOptions(t)}}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=a("313e");this.chart=t.init(this.$el,"macarons"),this.setOptions(this.chartData)},setOptions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.oneList,a=t.twoList,n=t.threeList,i=t.fourList;this.chart.setOption({legend:{},tooltip:{},dataset:{source:[["product","queueSize","rejectCount","completedTaskCount"],e,a,n,i]},xAxis:{type:"category"},yAxis:{},series:[{type:"bar"},{type:"bar"},{type:"bar"}]})}}},T=S,F=Object(l["a"])(T,_,y,!1,null,null,null),V=F.exports,D=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width}})},$=[],L=a("bd86"),j=a("c9fe"),O={mixins:[x],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"300px"}},data:function(){return{chart:null}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=this,e=a("313e");this.chart=e.init(this.$el,"macarons"),j["e"]({}).then((function(e){var a;t.chart.setOption({legend:{left:"center",bottom:"10"},toolbox:{show:!0,feature:{mark:{show:!0}}},series:[(a={name:"Nightingale Chart",type:"pie",roseType:"radius",radius:[15,95],center:["50%","38%"]},Object(L["a"])(a,"roseType","area"),Object(L["a"])(a,"itemStyle",{borderRadius:8}),Object(L["a"])(a,"data",e.tenantCharts),a)]})}))}}},R=O,E=Object(l["a"])(R,D,$,!1,null,null,null),A=E.exports,k=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width}})},I=[],N={itemIds:["Industries","Technology","Forex","Gold","Forecasts"],pieDataList:[{value:320,name:"Industries"},{value:240,name:"Technology"},{value:149,name:"Forex"},{value:100,name:"Gold"},{value:59,name:"Forecasts"}]},z={mixins:[x],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"300px"}},data:function(){return{chart:null}},mounted:function(){var t=this;this.pieChartInfo(),this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{pieChartInfo:function(){},initChart:function(){var t=this,e=a("313e");this.chart=e.init(this.$el,"macarons"),j["c"]({}).then((function(e){N.itemIds=e.itemIds,N.pieDataList=e.pieDataList,t.chart.setOption({tooltip:{trigger:"item",formatter:"{a}
{b} : {c} ({d}%)"},legend:{left:"center",bottom:"10",data:N.itemIds},toolbox:{show:!0,feature:{mark:{show:!0}}},series:[{name:"NUMBER OF THREAD POOLS",type:"pie",roseType:"radius",radius:[15,95],center:["50%","38%"],data:N.pieDataList,animationEasing:"cubicInOut",animationDuration:2600}]})}))}}},q=z,P=Object(l["a"])(q,k,I,!1,null,null,null),M=P.exports,B=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width}})},H=[],G=6e3,W={mixins:[x],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"300px"}},data:function(){return{chart:null}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=a("313e");this.chart=t.init(this.$el,"macarons"),this.chart.setOption({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{top:10,left:"2%",right:"2%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],axisTick:{alignWithLabel:!0}}],yAxis:[{type:"value",axisTick:{show:!1}}],series:[{name:"pageA",type:"bar",stack:"vistors",barWidth:"60%",data:[79,52,200,334,390,330,220],animationDuration:G},{name:"pageB",type:"bar",stack:"vistors",barWidth:"60%",data:[80,52,200,334,390,330,220],animationDuration:G},{name:"pageC",type:"bar",stack:"vistors",barWidth:"60%",data:[30,52,200,334,390,330,220],animationDuration:G}]})}}},J=W,Z=Object(l["a"])(J,B,H,!1,null,null,null),K=Z.exports,U=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-table",{staticStyle:{width:"100%","padding-top":"15px"},attrs:{data:t.list}},[a("el-table-column",{attrs:{label:"threadPool ID","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.groupKey)+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"taskCount",width:"195",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("toThousandFilter")(e.row.maxCompletedTaskCount))+"\n ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"inst",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("el-tag",{attrs:{type:t._f("statusFilter")(n.inst)}},[t._v("\n "+t._s(n.inst)+"\n ")])]}}])})],1)},Q=[],X={filters:{statusFilter:function(t){var e={success:"success",pending:"danger"};return e[t]},orderNoFilter:function(t){return t.substring(0,30)}},data:function(){return{list:null}},created:function(){this.fetchData()},methods:{fetchData:function(){var t=this;this.list=[{order_no:"123456",price:"4454",status:"1"}],j["d"]({}).then((function(e){t.list=e.rankingChartInfoList,console.log(e.rankingChartInfoList)}))}}},Y=X,tt=Object(l["a"])(Y,U,Q,!1,null,null,null),et=tt.exports,at=a("cc68"),nt={chartInfo:{oneList:[1,3,4,5,3,2],twoList:[1,2,3,4,1,3],threeList:[1,2,3,4,1,3],fourList:[1,2,3,4,1,3],dayList:["ten","twenty","thirty","forty","fifty","sixty"]}},it={name:"DashboardAdmin",components:{GithubCorner:h,PanelGroup:C,LineChart:V,RaddarChart:A,PieChart:M,BarChart:K,TransactionTable:et},data:function(){return{lineChartData:nt.chartInfo,countSucTotal:0,countRunningTotal:0,countFailTotal:0,countRunningInstanceTotal:0,show:!1,temp:{}}},created:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.chartInfo(),this.lintChart(),this.userInfo();case 3:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{handleSetLineChartData:function(t){this.lineChartData=nt[t]},chartInfo:function(){var t=this;j["a"]().then((function(e){t.show=!0,t.countSucTotal=e.tenantCount,t.countRunningTotal=e.threadPoolCount,t.countFailTotal=e.itemCount,t.countRunningInstanceTotal=e.threadPoolInstanceCount}))},lintChart:function(){var t=this;j["b"]({}).then((function(e){t.lineChartData.oneList=e.oneList,t.lineChartData.twoList=e.twoList,t.lineChartData.threeList=e.threeList,t.lineChartData.fourList=e.fourList}))},userInfo:function(){var t=this,e=this.$cookie.get("userName");at["c"](e).then((function(e){t.temp=e}))}}},rt=it,st=(a("bc4d"),Object(l["a"])(rt,n,i,!1,null,"384bf764",null));e["default"]=st.exports},"57c6":function(t,e,a){"use strict";a("6f36")},"6f36":function(t,e,a){},"85ce":function(t,e,a){},af42:function(t,e,a){"use strict";a("85ce")},b343:function(t,e,a){},bc4d:function(t,e,a){"use strict";a("b343")},c9fe:function(t,e,a){"use strict";a.d(e,"a",(function(){return i})),a.d(e,"b",(function(){return r})),a.d(e,"c",(function(){return s})),a.d(e,"e",(function(){return o})),a.d(e,"d",(function(){return l}));var n=a("b775");function i(){return Object(n["a"])({url:"/hippo4j/v1/cs/dashboard",method:"get"})}function r(){return Object(n["a"])({url:"/hippo4j/v1/cs/dashboard/line/chart",method:"get"})}function s(){return Object(n["a"])({url:"/hippo4j/v1/cs/dashboard/pie/chart",method:"get"})}function o(){return Object(n["a"])({url:"/hippo4j/v1/cs/dashboard/tenant/chart",method:"get"})}function l(){return Object(n["a"])({url:"/hippo4j/v1/cs/dashboard/ranking",method:"get"})}},cc68:function(t,e,a){"use strict";a.d(e,"d",(function(){return i})),a.d(e,"e",(function(){return r})),a.d(e,"a",(function(){return s})),a.d(e,"b",(function(){return o})),a.d(e,"c",(function(){return l}));var n=a("b775");function i(t){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/update",method:"put",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/add",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/remove/"+t,method:"delete"})}function l(t){return Object(n["a"])({url:"/hippo4j/v1/cs/auth/users/info/"+t,method:"get"})}},ec1b:function(t,e,a){!function(e,a){t.exports=a()}(0,(function(){return function(t){function e(n){if(a[n])return a[n].exports;var i=a[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var a={};return e.m=t,e.c=a,e.i=function(t){return t},e.d=function(t,a,n){e.o(t,a)||Object.defineProperty(t,a,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=2)}([function(t,e,a){var n=a(4)(a(1),a(5),null,null);t.exports=n.exports},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(3);e.default={props:{startVal:{type:Number,required:!1,default:0},endVal:{type:Number,required:!1,default:2017},duration:{type:Number,required:!1,default:3e3},autoplay:{type:Boolean,required:!1,default:!0},decimals:{type:Number,required:!1,default:0,validator:function(t){return t>=0}},decimal:{type:String,required:!1,default:"."},separator:{type:String,required:!1,default:","},prefix:{type:String,required:!1,default:""},suffix:{type:String,required:!1,default:""},useEasing:{type:Boolean,required:!1,default:!0},easingFn:{type:Function,default:function(t,e,a,n){return a*(1-Math.pow(2,-10*t/n))*1024/1023+e}}},data:function(){return{localStartVal:this.startVal,displayValue:this.formatNumber(this.startVal),printVal:null,paused:!1,localDuration:this.duration,startTime:null,timestamp:null,remaining:null,rAF:null}},computed:{countDown:function(){return this.startVal>this.endVal}},watch:{startVal:function(){this.autoplay&&this.start()},endVal:function(){this.autoplay&&this.start()}},mounted:function(){this.autoplay&&this.start(),this.$emit("mountedCallback")},methods:{start:function(){this.localStartVal=this.startVal,this.startTime=null,this.localDuration=this.duration,this.paused=!1,this.rAF=(0,n.requestAnimationFrame)(this.count)},pauseResume:function(){this.paused?(this.resume(),this.paused=!1):(this.pause(),this.paused=!0)},pause:function(){(0,n.cancelAnimationFrame)(this.rAF)},resume:function(){this.startTime=null,this.localDuration=+this.remaining,this.localStartVal=+this.printVal,(0,n.requestAnimationFrame)(this.count)},reset:function(){this.startTime=null,(0,n.cancelAnimationFrame)(this.rAF),this.displayValue=this.formatNumber(this.startVal)},count:function(t){this.startTime||(this.startTime=t),this.timestamp=t;var e=t-this.startTime;this.remaining=this.localDuration-e,this.useEasing?this.countDown?this.printVal=this.localStartVal-this.easingFn(e,0,this.localStartVal-this.endVal,this.localDuration):this.printVal=this.easingFn(e,this.localStartVal,this.endVal-this.localStartVal,this.localDuration):this.countDown?this.printVal=this.localStartVal-(this.localStartVal-this.endVal)*(e/this.localDuration):this.printVal=this.localStartVal+(this.localStartVal-this.startVal)*(e/this.localDuration),this.countDown?this.printVal=this.printValthis.endVal?this.endVal:this.printVal,this.displayValue=this.formatNumber(this.printVal),e1?this.decimal+e[1]:"",i=/(\d+)(\d{3})/;if(this.separator&&!this.isNumber(this.separator))for(;i.test(a);)a=a.replace(i,"$1"+this.separator+"$2");return this.prefix+a+n+this.suffix}},destroyed:function(){(0,n.cancelAnimationFrame)(this.rAF)}}},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(0),i=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=i.default,"undefined"!=typeof window&&window.Vue&&window.Vue.component("count-to",i.default)},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=0,i="webkit moz ms o".split(" "),r=void 0,s=void 0;if("undefined"==typeof window)e.requestAnimationFrame=r=function(){},e.cancelAnimationFrame=s=function(){};else{e.requestAnimationFrame=r=window.requestAnimationFrame,e.cancelAnimationFrame=s=window.cancelAnimationFrame;for(var o=void 0,l=0;l0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),a("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"800px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("el-form",{ref:"dataForm",attrs:{model:e.temp,"label-position":"left","label-width":"100px"}},[a("el-form-item",{attrs:{label:"业务类型",prop:"category"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{disabled:!0,placeholder:"业务类型"},model:{value:e.temp.category,callback:function(t){e.$set(e.temp,"category",t)},expression:"temp.category"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"业务标识",prop:"bizNo"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{disabled:!0,placeholder:"业务标识"},model:{value:e.temp.bizNo,callback:function(t){e.$set(e.temp,"bizNo",t)},expression:"temp.bizNo"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"操作人",prop:"operator"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{disabled:!0,placeholder:"操作人"},model:{value:e.temp.operator,callback:function(t){e.$set(e.temp,"operator",t)},expression:"temp.operator"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"创建时间",prop:"createTime"}},[a("el-input",{staticStyle:{width:"40%"},attrs:{disabled:!0,placeholder:"创建时间"},model:{value:e.temp.createTime,callback:function(t){e.$set(e.temp,"createTime",t)},expression:"temp.createTime"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"日志内容",prop:"action"}},[a("el-input",{staticStyle:{width:"60%"},attrs:{disabled:!0,autosize:{minRows:4,maxRows:10},type:"textarea",placeholder:"日志内容"},model:{value:e.temp.action,callback:function(t){e.$set(e.temp,"action",t)},expression:"temp.action"}})],1)],1)],1),e._v(" "),a("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("Confirm")])],1)],1)],1)},n=[],l=a("b775");function o(e){return Object(l["a"])({url:"/hippo4j/v1/cs/log/query/page",method:"post",data:e})}var r=a("6724"),s=a("333d"),c={name:"JobProject",components:{Pagination:s["a"]},directives:{waves:r["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]},ellipsis:function(e){return e?e.length>26?e.slice(0,26)+"...":e:""}},data:function(){return{list:null,listLoading:!0,total:0,listQuery:{current:1,size:10,tenantId:""},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,dialogStatus:"",textMap:{update:"Info",create:"Create"},temp:{id:void 0,tenantId:"",tenantName:"",owner:"",tenantDesc:""},visible:!0}},created:function(){this.fetchData()},methods:{fetchData:function(){var e=this;this.listLoading=!0,o(this.listQuery).then((function(t){var a=t.records,i=t.total;e.total=i,e.list=a,e.listLoading=!1}))},resetTemp:function(){this.temp={id:void 0,tenantName:"",tenantDesc:""}},handleCreate:function(){var e=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&jobProjectApi.created(e.temp).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Created Successfully",type:"success",duration:2e3})}))}))},handleUpdate:function(e){var t=this;this.temp=Object.assign({},e),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var a=Object.assign({},e.temp);jobProjectApi.updated(a).then((function(){e.fetchData(),e.dialogFormVisible=!1,e.$notify({title:"Success",message:"Update Successfully",type:"success",duration:2e3})}))}}))},handleDelete:function(e){var t=this;console.log("删除"),jobProjectApi.deleted(e.tenantId).then((function(e){t.fetchData(),t.$notify({title:"Success",message:"Delete Successfully",type:"success",duration:2e3})}))}}},u=c,d=a("2877"),p=Object(d["a"])(u,i,n,!1,null,null,null);t["default"]=p.exports},6724:function(e,t,a){"use strict";a("8d41");var i="@@wavesContext";function n(e,t){function a(a){var i=Object.assign({},t.value),n=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},i),l=n.ele;if(l){l.style.position="relative",l.style.overflow="hidden";var o=l.getBoundingClientRect(),r=l.querySelector(".waves-ripple");switch(r?r.className="waves-ripple":(r=document.createElement("span"),r.className="waves-ripple",r.style.height=r.style.width=Math.max(o.width,o.height)+"px",l.appendChild(r)),n.type){case"center":r.style.top=o.height/2-r.offsetHeight/2+"px",r.style.left=o.width/2-r.offsetWidth/2+"px";break;default:r.style.top=(a.pageY-o.top-r.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",r.style.left=(a.pageX-o.left-r.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return r.style.backgroundColor=n.color,r.className="waves-ripple z-active",!1}}return e[i]?e[i].removeHandle=a:e[i]={removeHandle:a},a}var l={bind:function(e,t){e.addEventListener("click",n(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[i].removeHandle,!1),e.addEventListener("click",n(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[i].removeHandle,!1),e[i]=null,delete e[i]}},o=function(e){e.directive("waves",l)};window.Vue&&(window.waves=l,Vue.use(o)),l.install=o;t["a"]=l},7456:function(e,t,a){},"8d41":function(e,t,a){},e498:function(e,t,a){"use strict";a("7456")}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-bc53b446.6993c4c9.js b/hippo4j-console/src/main/resources/static/static/js/chunk-bc53b446.6993c4c9.js new file mode 100644 index 00000000..1e3c635f --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-bc53b446.6993c4c9.js @@ -0,0 +1,39 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bc53b446"],{"19ab":function(e,t,n){!function(t,n){e.exports=n()}(0,(function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=19)}([function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;tn.parts.length&&(r.parts.length=n.parts.length)}else{var o=[];for(i=0;i=0},required:!0},className:String},computed:{userSelect:function(){return this.active?"none":""},cursor:function(){return this.active?"col-resize":""}},watch:{defaultPercent:function(e,t){this.percent=e}},data:function(){return{active:!1,hasMoved:!1,height:null,percent:this.defaultPercent,type:"vertical"===this.split?"width":"height",resizeType:"vertical"===this.split?"left":"top"}},methods:{onClick:function(){this.hasMoved||(this.percent=50,this.$emit("resize"))},onMouseDown:function(){this.active=!0,this.hasMoved=!1},onMouseUp:function(){this.active=!1},onMouseMove:function(e){if(0!==e.buttons&&0!==e.which||(this.active=!1),this.active){var t=0,n=e.currentTarget;if("vertical"===this.split)for(;n;)t+=n.offsetLeft,n=n.offsetParent;else for(;n;)t+=n.offsetTop,n=n.offsetParent;var r="vertical"===this.split?e.pageX:e.pageY,i="vertical"===this.split?e.currentTarget.offsetWidth:e.currentTarget.offsetHeight,o=Math.floor((r-t)/i*1e4)/100;o>this.minPercent&&o<100-this.minPercent&&(this.percent=o),this.$emit("resize"),this.hasMoved=!0}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Pane",props:{className:String},data:function(){return{classes:[this.$parent.split,this.className].join(" "),percent:50}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{split:{validator:function(e){return["vertical","horizontal"].indexOf(e)>=0},required:!0},className:String},computed:{classes:function(){return["splitter-pane-resizer",this.split,this.className].join(" ")}}}},function(e,t,n){t=e.exports=n(0)(),t.push([e.i,".splitter-pane-resizer[data-v-212fa2a4]{box-sizing:border-box;background:#000;position:absolute;opacity:.2;z-index:1;background-clip:padding-box}.splitter-pane-resizer.horizontal[data-v-212fa2a4]{height:11px;margin:-5px 0;border-top:5px solid hsla(0,0%,100%,0);border-bottom:5px solid hsla(0,0%,100%,0);cursor:row-resize;width:100%}.splitter-pane-resizer.vertical[data-v-212fa2a4]{width:11px;height:100%;margin-left:-5px;border-left:5px solid hsla(0,0%,100%,0);border-right:5px solid hsla(0,0%,100%,0);cursor:col-resize}",""])},function(e,t,n){t=e.exports=n(0)(),t.push([e.i,'.clearfix[data-v-566a42b8]:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.vue-splitter-container[data-v-566a42b8]{height:100%;position:relative}.vue-splitter-container-mask[data-v-566a42b8]{z-index:9999;width:100%;height:100%;position:absolute;top:0;left:0}',""])},function(e,t,n){t=e.exports=n(0)(),t.push([e.i,".splitter-pane.vertical.splitter-paneL[data-v-815c801c]{position:absolute;left:0;height:100%;padding-right:3px}.splitter-pane.vertical.splitter-paneR[data-v-815c801c]{position:absolute;right:0;height:100%;padding-left:3px}.splitter-pane.horizontal.splitter-paneL[data-v-815c801c]{position:absolute;top:0;width:100%}.splitter-pane.horizontal.splitter-paneR[data-v-815c801c]{position:absolute;bottom:0;width:100%;padding-top:3px}",""])},function(e,t,n){n(17);var r=n(1)(n(5),n(14),"data-v-815c801c",null);e.exports=r.exports},function(e,t,n){n(15);var r=n(1)(n(6),n(12),"data-v-212fa2a4",null);e.exports=r.exports},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{class:e.classes})},staticRenderFns:[]}},function(e,t){e.exports={render:function(){var e,t,n,r=this,i=r.$createElement,o=r._self._c||i;return o("div",{staticClass:"vue-splitter-container clearfix",style:{cursor:r.cursor,userSelect:r.userSelect},on:{mouseup:r.onMouseUp,mousemove:r.onMouseMove}},[o("pane",{staticClass:"splitter-pane splitter-paneL",style:(e={},e[r.type]=r.percent+"%",e),attrs:{split:r.split}},[r._t("paneL")],2),r._v(" "),o("resizer",{style:(t={},t[r.resizeType]=r.percent+"%",t),attrs:{className:r.className,split:r.split},nativeOn:{mousedown:function(e){r.onMouseDown(e)},click:function(e){r.onClick(e)}}}),r._v(" "),o("pane",{staticClass:"splitter-pane splitter-paneR",style:(n={},n[r.type]=100-r.percent+"%",n),attrs:{split:r.split}},[r._t("paneR")],2),r._v(" "),r.active?o("div",{staticClass:"vue-splitter-container-mask"}):r._e()],1)},staticRenderFns:[]}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{class:e.classes},[e._t("default")],2)},staticRenderFns:[]}},function(e,t,n){var r=n(7);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals),n(2)("93b24118",r,!0)},function(e,t,n){var r=n(8);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals),n(2)("084fcb29",r,!0)},function(e,t,n){var r=n(9);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals),n(2)("2e723840",r,!0)},function(e,t){e.exports=function(e,t){for(var n=[],r={},i=0;i + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var o,s="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",d=500,f="__lodash_placeholder__",p=1,m=2,g=4,v=1,y=2,w=1,b=2,_=4,x=8,E=16,C=32,j=64,S=128,k=256,N=512,A=30,O="...",T=800,R=16,L=1,I=2,D=3,M=1/0,B=9007199254740991,P=17976931348623157e292,F=NaN,$=4294967295,V=$-1,U=$>>>1,q=[["ary",S],["bind",w],["bindKey",b],["curry",x],["curryRight",E],["flip",N],["partial",C],["partialRight",j],["rearg",k]],z="[object Arguments]",H="[object Array]",W="[object AsyncFunction]",K="[object Boolean]",J="[object Date]",G="[object DOMException]",Z="[object Error]",Y="[object Function]",X="[object GeneratorFunction]",Q="[object Map]",ee="[object Number]",te="[object Null]",ne="[object Object]",re="[object Promise]",ie="[object Proxy]",oe="[object RegExp]",se="[object Set]",ae="[object String]",ce="[object Symbol]",le="[object Undefined]",ue="[object WeakMap]",he="[object WeakSet]",de="[object ArrayBuffer]",fe="[object DataView]",pe="[object Float32Array]",me="[object Float64Array]",ge="[object Int8Array]",ve="[object Int16Array]",ye="[object Int32Array]",we="[object Uint8Array]",be="[object Uint8ClampedArray]",_e="[object Uint16Array]",xe="[object Uint32Array]",Ee=/\b__p \+= '';/g,Ce=/\b(__p \+=) '' \+/g,je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Se=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Ne=RegExp(Se.source),Ae=RegExp(ke.source),Oe=/<%-([\s\S]+?)%>/g,Te=/<%([\s\S]+?)%>/g,Re=/<%=([\s\S]+?)%>/g,Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Me=/[\\^$.*+?()[\]{}|]/g,Be=RegExp(Me.source),Pe=/^\s+/,Fe=/\s/,$e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ve=/\{\n\/\* \[wrapped with (.+)\] \*/,Ue=/,? & /,qe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ze=/[()=,{}\[\]\/\s]/,He=/\\(\\)?/g,We=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,Je=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Ze=/^\[object .+?Constructor\]$/,Ye=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,Qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,et=/($^)/,tt=/['\n\r\u2028\u2029\\]/g,nt="\\ud800-\\udfff",rt="\\u0300-\\u036f",it="\\ufe20-\\ufe2f",ot="\\u20d0-\\u20ff",st=rt+it+ot,at="\\u2700-\\u27bf",ct="a-z\\xdf-\\xf6\\xf8-\\xff",lt="\\xac\\xb1\\xd7\\xf7",ut="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ht="\\u2000-\\u206f",dt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ft="A-Z\\xc0-\\xd6\\xd8-\\xde",pt="\\ufe0e\\ufe0f",mt=lt+ut+ht+dt,gt="['’]",vt="["+nt+"]",yt="["+mt+"]",wt="["+st+"]",bt="\\d+",_t="["+at+"]",xt="["+ct+"]",Et="[^"+nt+mt+bt+at+ct+ft+"]",Ct="\\ud83c[\\udffb-\\udfff]",jt="(?:"+wt+"|"+Ct+")",St="[^"+nt+"]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",At="["+ft+"]",Ot="\\u200d",Tt="(?:"+xt+"|"+Et+")",Rt="(?:"+At+"|"+Et+")",Lt="(?:"+gt+"(?:d|ll|m|re|s|t|ve))?",It="(?:"+gt+"(?:D|LL|M|RE|S|T|VE))?",Dt=jt+"?",Mt="["+pt+"]?",Bt="(?:"+Ot+"(?:"+[St,kt,Nt].join("|")+")"+Mt+Dt+")*",Pt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ft="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$t=Mt+Dt+Bt,Vt="(?:"+[_t,kt,Nt].join("|")+")"+$t,Ut="(?:"+[St+wt+"?",wt,kt,Nt,vt].join("|")+")",qt=RegExp(gt,"g"),zt=RegExp(wt,"g"),Ht=RegExp(Ct+"(?="+Ct+")|"+Ut+$t,"g"),Wt=RegExp([At+"?"+xt+"+"+Lt+"(?="+[yt,At,"$"].join("|")+")",Rt+"+"+It+"(?="+[yt,At+Tt,"$"].join("|")+")",At+"?"+Tt+"+"+Lt,At+"+"+It,Ft,Pt,bt,Vt].join("|"),"g"),Kt=RegExp("["+Ot+nt+st+pt+"]"),Jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zt=-1,Yt={};Yt[pe]=Yt[me]=Yt[ge]=Yt[ve]=Yt[ye]=Yt[we]=Yt[be]=Yt[_e]=Yt[xe]=!0,Yt[z]=Yt[H]=Yt[de]=Yt[K]=Yt[fe]=Yt[J]=Yt[Z]=Yt[Y]=Yt[Q]=Yt[ee]=Yt[ne]=Yt[oe]=Yt[se]=Yt[ae]=Yt[ue]=!1;var Xt={};Xt[z]=Xt[H]=Xt[de]=Xt[fe]=Xt[K]=Xt[J]=Xt[pe]=Xt[me]=Xt[ge]=Xt[ve]=Xt[ye]=Xt[Q]=Xt[ee]=Xt[ne]=Xt[oe]=Xt[se]=Xt[ae]=Xt[ce]=Xt[we]=Xt[be]=Xt[_e]=Xt[xe]=!0,Xt[Z]=Xt[Y]=Xt[ue]=!1;var Qt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},en={"&":"&","<":"<",">":">",'"':""","'":"'"},tn={"&":"&","<":"<",">":">",""":'"',"'":"'"},nn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rn=parseFloat,on=parseInt,sn="object"==typeof e&&e&&e.Object===Object&&e,an="object"==typeof self&&self&&self.Object===Object&&self,cn=sn||an||Function("return this")(),ln=t&&!t.nodeType&&t,un=ln&&"object"==typeof r&&r&&!r.nodeType&&r,hn=un&&un.exports===ln,dn=hn&&sn.process,fn=function(){try{var e=un&&un.require&&un.require("util").types;return e||dn&&dn.binding&&dn.binding("util")}catch(t){}}(),pn=fn&&fn.isArrayBuffer,mn=fn&&fn.isDate,gn=fn&&fn.isMap,vn=fn&&fn.isRegExp,yn=fn&&fn.isSet,wn=fn&&fn.isTypedArray;function bn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _n(e,t,n,r){var i=-1,o=null==e?0:e.length;while(++i-1}function kn(e,t,n){var r=-1,i=null==e?0:e.length;while(++r-1);return n}function er(e,t){var n=e.length;while(n--&&Pn(t,e[n],0)>-1);return n}function tr(e,t){var n=e.length,r=0;while(n--)e[n]===t&&++r;return r}var nr=qn(Qt),rr=qn(en);function ir(e){return"\\"+nn[e]}function or(e,t){return null==e?o:e[t]}function sr(e){return Kt.test(e)}function ar(e){return Jt.test(e)}function cr(e){var t,n=[];while(!(t=e.next()).done)n.push(t.value);return n}function lr(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function ur(e,t){return function(n){return e(t(n))}}function hr(e,t){var n=-1,r=e.length,i=0,o=[];while(++n-1}function Ur(e,t){var n=this.__data__,r=ui(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function qr(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t=t?e:t)),e}function vi(e,t,n,r,i,s){var a,c=t&p,l=t&m,u=t&g;if(n&&(a=i?n(e,r,i,s):n(e)),a!==o)return a;if(!Cu(e))return e;var h=cu(e);if(h){if(a=ta(e),!c)return is(e,a)}else{var d=Ys(e),f=d==Y||d==X;if(fu(e))return Jo(e,c);if(d==ne||d==z||f&&!i){if(a=l||f?{}:na(e),!c)return l?as(e,fi(a,e)):ss(e,di(a,e))}else{if(!Xt[d])return i?e:{};a=ra(e,d,c)}}s||(s=new Xr);var v=s.get(e);if(v)return v;s.set(e,a),Bu(e)?e.forEach((function(r){a.add(vi(r,t,n,r,e,s))})):Su(e)&&e.forEach((function(r,i){a.set(i,vi(r,t,n,i,e,s))}));var y=u?l?$s:Fs:l?Eh:xh,w=h?o:y(e);return xn(w||e,(function(r,i){w&&(i=r,r=e[i]),li(a,i,vi(r,t,n,i,e,s))})),a}function yi(e){var t=xh(e);return function(n){return wi(n,e,t)}}function wi(e,t,n){var r=n.length;if(null==e)return!r;e=nt(e);while(r--){var i=n[r],s=t[i],a=e[i];if(a===o&&!(i in e)||!s(a))return!1}return!0}function bi(e,t,n){if("function"!=typeof e)throw new ot(l);return ja((function(){e.apply(o,n)}),t)}function _i(e,t,n,r){var i=-1,o=Sn,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=Nn(t,Zn(n))),r?(o=kn,s=!1):t.length>=a&&(o=Xn,s=!1,t=new Gr(t));e:while(++ii?0:i+n),r=r===o||r>i?i:Ju(r),r<0&&(r+=i),r=n>r?0:Gu(r);while(n0&&n(a)?t>1?Ni(a,t-1,n,r,i):An(i,a):r||(i[i.length]=a)}return i}var Ai=hs(),Oi=hs(!0);function Ti(e,t){return e&&Ai(e,t,xh)}function Ri(e,t){return e&&Oi(e,t,xh)}function Li(e,t){return jn(t,(function(t){return _u(e[t])}))}function Ii(e,t){t=zo(t,e);var n=0,r=t.length;while(null!=e&&nt}function Pi(e,t){return null!=e&&ht.call(e,t)}function Fi(e,t){return null!=e&&t in nt(e)}function $i(e,t,n){return e>=Vt(t,n)&&e<$t(t,n)}function Vi(e,t,r){var i=r?kn:Sn,s=e[0].length,a=e.length,c=a,l=n(a),u=1/0,h=[];while(c--){var d=e[c];c&&t&&(d=Nn(d,Zn(t))),u=Vt(d.length,u),l[c]=!r&&(t||s>=120&&d.length>=120)?new Gr(c&&d):o}d=e[0];var f=-1,p=l[0];e:while(++f-1)a!==e&&jt.call(a,c,1),jt.call(e,c,1)}return e}function vo(e,t){var n=e?t.length:0,r=n-1;while(n--){var i=t[n];if(n==r||i!==o){var o=i;sa(i)?jt.call(e,i,1):Mo(e,i)}}return e}function yo(e,t){return e+It(Wt()*(t-e+1))}function wo(e,t,r,i){var o=-1,s=$t(Lt((t-e)/(r||1)),0),a=n(s);while(s--)a[i?s:++o]=e,e+=r;return a}function bo(e,t){var n="";if(!e||t<1||t>B)return n;do{t%2&&(n+=e),t=It(t/2),t&&(e+=e)}while(t);return n}function _o(e,t){return Sa(ba(e,t,Od),e+"")}function xo(e){return oi(Vh(e))}function Eo(e,t){var n=Vh(e);return Aa(n,gi(t,0,n.length))}function Co(e,t,n,r){if(!Cu(e))return e;t=zo(t,e);var i=-1,s=t.length,a=s-1,c=e;while(null!=c&&++io?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;var s=n(o);while(++i>>1,s=e[o];null!==s&&!Fu(s)&&(n?s<=t:s=a){var u=t?null:As(e);if(u)return dr(u);s=!1,i=Xn,l=new Gr}else l=t?[]:c;e:while(++r=r?e:No(e,t,n)}var Ko=Ot||function(e){return cn.clearTimeout(e)};function Jo(e,t){if(t)return e.slice();var n=e.length,r=_t?_t(n):new e.constructor(n);return e.copy(r),r}function Go(e){var t=new e.constructor(e.byteLength);return new bt(t).set(new bt(e)),t}function Zo(e,t){var n=t?Go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Yo(e){var t=new e.constructor(e.source,Ke.exec(e));return t.lastIndex=e.lastIndex,t}function Xo(e){return pr?nt(pr.call(e)):{}}function Qo(e,t){var n=t?Go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function es(e,t){if(e!==t){var n=e!==o,r=null===e,i=e===e,s=Fu(e),a=t!==o,c=null===t,l=t===t,u=Fu(t);if(!c&&!u&&!s&&e>t||s&&a&&l&&!c&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&e=a)return c;var l=n[r];return c*("desc"==l?-1:1)}}return e.index-t.index}function ns(e,t,r,i){var o=-1,s=e.length,a=r.length,c=-1,l=t.length,u=$t(s-a,0),h=n(l+u),d=!i;while(++c1?n[i-1]:o,a=i>2?n[2]:o;s=e.length>3&&"function"==typeof s?(i--,s):o,a&&aa(n[0],n[1],a)&&(s=i<3?o:s,i=1),t=nt(t);while(++r-1?i[s?t[a]:a]:o}}function ys(e){return Ps((function(t){var n=t.length,r=n,i=Sr.prototype.thru;e&&t.reverse();while(r--){var s=t[r];if("function"!=typeof s)throw new ot(l);if(i&&!a&&"wrapper"==Us(s))var a=new Sr([],!0)}r=a?r:n;while(++r1&&w.reverse(),d&&uc))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=n&y?new Gr:o;s.set(e,t),s.set(t,e);while(++d1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace($e,"{\n/* [wrapped with "+t+"] */\n")}function oa(e){return cu(e)||au(e)||!!(St&&e&&e[St])}function sa(e,t){var n=typeof e;return t=null==t?B:t,!!t&&("number"==n||"symbol"!=n&&Xe.test(e))&&e>-1&&e%1==0&&e0){if(++t>=T)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Aa(e,t){var n=-1,r=e.length,i=r-1;t=t===o?r:t;while(++n1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,Mc(e,n)}));function Hc(e){var t=_r(e);return t.__chain__=!0,t}function Wc(e,t){return t(e),e}function Kc(e,t){return t(e)}var Jc=Ps((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return mi(t,e)};return!(t>1||this.__actions__.length)&&r instanceof kr&&sa(n)?(r=r.slice(n,+n+(t?1:0)),r.__actions__.push({func:Kc,args:[i],thisArg:o}),new Sr(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));function Gc(){return Hc(this)}function Zc(){return new Sr(this.value(),this.__chain__)}function Yc(){this.__values__===o&&(this.__values__=Wu(this.value()));var e=this.__index__>=this.__values__.length,t=e?o:this.__values__[this.__index__++];return{done:e,value:t}}function Xc(){return this}function Qc(e){var t,n=this;while(n instanceof jr){var r=Ia(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t}function el(){var e=this.__wrapped__;if(e instanceof kr){var t=e;return this.__actions__.length&&(t=new kr(this)),t=t.reverse(),t.__actions__.push({func:Kc,args:[pc],thisArg:o}),new Sr(t,this.__chain__)}return this.thru(pc)}function tl(){return Fo(this.__wrapped__,this.__actions__)}var nl=cs((function(e,t,n){ht.call(e,n)?++e[n]:pi(e,n,1)}));function rl(e,t,n){var r=cu(e)?Cn:Ci;return n&&aa(e,t,n)&&(t=o),r(e,zs(t,3))}function il(e,t){var n=cu(e)?jn:ki;return n(e,zs(t,3))}var ol=vs(Wa),sl=vs(Ka);function al(e,t){return Ni(gl(e,t),1)}function cl(e,t){return Ni(gl(e,t),M)}function ll(e,t,n){return n=n===o?1:Ju(n),Ni(gl(e,t),n)}function ul(e,t){var n=cu(e)?xn:xi;return n(e,zs(t,3))}function hl(e,t){var n=cu(e)?En:Ei;return n(e,zs(t,3))}var dl=cs((function(e,t,n){ht.call(e,n)?e[n].push(t):pi(e,n,[t])}));function fl(e,t,n,r){e=uu(e)?e:Vh(e),n=n&&!r?Ju(n):0;var i=e.length;return n<0&&(n=$t(i+n,0)),Pu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Pn(e,t,n)>-1}var pl=_o((function(e,t,r){var i=-1,o="function"==typeof t,s=uu(e)?n(e.length):[];return xi(e,(function(e){s[++i]=o?bn(t,e,r):qi(e,t,r)})),s})),ml=cs((function(e,t,n){pi(e,n,t)}));function gl(e,t){var n=cu(e)?Nn:oo;return n(e,zs(t,3))}function vl(e,t,n,r){return null==e?[]:(cu(t)||(t=null==t?[]:[t]),n=r?o:n,cu(n)||(n=null==n?[]:[n]),ho(e,t,n))}var yl=cs((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function wl(e,t,n){var r=cu(e)?On:zn,i=arguments.length<3;return r(e,zs(t,4),n,i,xi)}function bl(e,t,n){var r=cu(e)?Tn:zn,i=arguments.length<3;return r(e,zs(t,4),n,i,Ei)}function _l(e,t){var n=cu(e)?jn:ki;return n(e,Vl(zs(t,3)))}function xl(e){var t=cu(e)?oi:xo;return t(e)}function El(e,t,n){t=(n?aa(e,t,n):t===o)?1:Ju(t);var r=cu(e)?si:Eo;return r(e,t)}function Cl(e){var t=cu(e)?ai:ko;return t(e)}function jl(e){if(null==e)return 0;if(uu(e))return Pu(e)?gr(e):e.length;var t=Ys(e);return t==Q||t==se?e.size:no(e).length}function Sl(e,t,n){var r=cu(e)?Rn:Ao;return n&&aa(e,t,n)&&(t=o),r(e,zs(t,3))}var kl=_o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&aa(e,t[0],t[1])?t=[]:n>2&&aa(t[0],t[1],t[2])&&(t=[t[0]]),ho(e,Ni(t,1),[])})),Nl=Tt||function(){return cn.Date.now()};function Al(e,t){if("function"!=typeof t)throw new ot(l);return e=Ju(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ol(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Ts(e,S,o,o,o,o,t)}function Tl(e,t){var n;if("function"!=typeof t)throw new ot(l);return e=Ju(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Rl=_o((function(e,t,n){var r=w;if(n.length){var i=hr(n,qs(Rl));r|=C}return Ts(e,r,t,n,i)})),Ll=_o((function(e,t,n){var r=w|b;if(n.length){var i=hr(n,qs(Ll));r|=C}return Ts(t,r,e,n,i)}));function Il(e,t,n){t=n?o:t;var r=Ts(e,x,o,o,o,o,o,t);return r.placeholder=Il.placeholder,r}function Dl(e,t,n){t=n?o:t;var r=Ts(e,E,o,o,o,o,o,t);return r.placeholder=Dl.placeholder,r}function Ml(e,t,n){var r,i,s,a,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new ot(l);function m(t){var n=r,s=i;return r=i=o,h=t,a=e.apply(s,n),a}function g(e){return h=e,c=ja(w,t),d?m(e):a}function v(e){var n=e-u,r=e-h,i=t-n;return f?Vt(i,s-r):i}function y(e){var n=e-u,r=e-h;return u===o||n>=t||n<0||f&&r>=s}function w(){var e=Nl();if(y(e))return b(e);c=ja(w,v(e))}function b(e){return c=o,p&&r?m(e):(r=i=o,a)}function _(){c!==o&&Ko(c),h=0,r=u=i=c=o}function x(){return c===o?a:b(Nl())}function E(){var e=Nl(),n=y(e);if(r=arguments,i=this,u=e,n){if(c===o)return g(u);if(f)return Ko(c),c=ja(w,t),m(u)}return c===o&&(c=ja(w,t)),a}return t=Zu(t)||0,Cu(n)&&(d=!!n.leading,f="maxWait"in n,s=f?$t(Zu(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),E.cancel=_,E.flush=x,E}var Bl=_o((function(e,t){return bi(e,1,t)})),Pl=_o((function(e,t,n){return bi(e,Zu(t)||0,n)}));function Fl(e){return Ts(e,N)}function $l(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ot(l);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new($l.Cache||qr),n}function Vl(e){if("function"!=typeof e)throw new ot(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Ul(e){return Tl(2,e)}$l.Cache=qr;var ql=Ho((function(e,t){t=1==t.length&&cu(t[0])?Nn(t[0],Zn(zs())):Nn(Ni(t,1),Zn(zs()));var n=t.length;return _o((function(r){var i=-1,o=Vt(r.length,n);while(++i=t})),au=zi(function(){return arguments}())?zi:function(e){return ju(e)&&ht.call(e,"callee")&&!Ct.call(e,"callee")},cu=n.isArray,lu=pn?Zn(pn):Hi;function uu(e){return null!=e&&Eu(e.length)&&!_u(e)}function hu(e){return ju(e)&&uu(e)}function du(e){return!0===e||!1===e||ju(e)&&Mi(e)==K}var fu=Mt||Jd,pu=mn?Zn(mn):Wi;function mu(e){return ju(e)&&1===e.nodeType&&!Iu(e)}function gu(e){if(null==e)return!0;if(uu(e)&&(cu(e)||"string"==typeof e||"function"==typeof e.splice||fu(e)||$u(e)||au(e)))return!e.length;var t=Ys(e);if(t==Q||t==se)return!e.size;if(fa(e))return!no(e).length;for(var n in e)if(ht.call(e,n))return!1;return!0}function vu(e,t){return Ki(e,t)}function yu(e,t,n){n="function"==typeof n?n:o;var r=n?n(e,t):o;return r===o?Ki(e,t,o,n):!!r}function wu(e){if(!ju(e))return!1;var t=Mi(e);return t==Z||t==G||"string"==typeof e.message&&"string"==typeof e.name&&!Iu(e)}function bu(e){return"number"==typeof e&&Bt(e)}function _u(e){if(!Cu(e))return!1;var t=Mi(e);return t==Y||t==X||t==W||t==ie}function xu(e){return"number"==typeof e&&e==Ju(e)}function Eu(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=B}function Cu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ju(e){return null!=e&&"object"==typeof e}var Su=gn?Zn(gn):Gi;function ku(e,t){return e===t||Zi(e,t,Ws(t))}function Nu(e,t,n){return n="function"==typeof n?n:o,Zi(e,t,Ws(t),n)}function Au(e){return Lu(e)&&e!=+e}function Ou(e){if(da(e))throw new i(c);return Yi(e)}function Tu(e){return null===e}function Ru(e){return null==e}function Lu(e){return"number"==typeof e||ju(e)&&Mi(e)==ee}function Iu(e){if(!ju(e)||Mi(e)!=ne)return!1;var t=xt(e);if(null===t)return!0;var n=ht.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==mt}var Du=vn?Zn(vn):Xi;function Mu(e){return xu(e)&&e>=-B&&e<=B}var Bu=yn?Zn(yn):Qi;function Pu(e){return"string"==typeof e||!cu(e)&&ju(e)&&Mi(e)==ae}function Fu(e){return"symbol"==typeof e||ju(e)&&Mi(e)==ce}var $u=wn?Zn(wn):eo;function Vu(e){return e===o}function Uu(e){return ju(e)&&Ys(e)==ue}function qu(e){return ju(e)&&Mi(e)==he}var zu=Ss(io),Hu=Ss((function(e,t){return e<=t}));function Wu(e){if(!e)return[];if(uu(e))return Pu(e)?vr(e):is(e);if(kt&&e[kt])return cr(e[kt]());var t=Ys(e),n=t==Q?lr:t==se?dr:Vh;return n(e)}function Ku(e){if(!e)return 0===e?e:0;if(e=Zu(e),e===M||e===-M){var t=e<0?-1:1;return t*P}return e===e?e:0}function Ju(e){var t=Ku(e),n=t%1;return t===t?n?t-n:t:0}function Gu(e){return e?gi(Ju(e),0,$):0}function Zu(e){if("number"==typeof e)return e;if(Fu(e))return F;if(Cu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Cu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gn(e);var n=Ge.test(e);return n||Ye.test(e)?on(e.slice(2),n?2:8):Je.test(e)?F:+e}function Yu(e){return os(e,Eh(e))}function Xu(e){return e?gi(Ju(e),-B,B):0===e?e:0}function Qu(e){return null==e?"":Io(e)}var eh=ls((function(e,t){if(fa(t)||uu(t))os(t,xh(t),e);else for(var n in t)ht.call(t,n)&&li(e,n,t[n])})),th=ls((function(e,t){os(t,Eh(t),e)})),nh=ls((function(e,t,n,r){os(t,Eh(t),e,r)})),rh=ls((function(e,t,n,r){os(t,xh(t),e,r)})),ih=Ps(mi);function oh(e,t){var n=Er(e);return null==t?n:di(n,t)}var sh=_o((function(e,t){e=nt(e);var n=-1,r=t.length,i=r>2?t[2]:o;i&&aa(t[0],t[1],i)&&(r=1);while(++n1),t})),os(e,$s(e),n),r&&(n=vi(n,p|m|g,Is));var i=t.length;while(i--)Mo(n,t[i]);return n}));function Ah(e,t){return Th(e,Vl(zs(t)))}var Oh=Ps((function(e,t){return null==e?{}:fo(e,t)}));function Th(e,t){if(null==e)return{};var n=Nn($s(e),(function(e){return[e]}));return t=zs(t),po(e,n,(function(e,n){return t(e,n[0])}))}function Rh(e,t,n){t=zo(t,e);var r=-1,i=t.length;i||(i=1,e=o);while(++rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Wt();return Vt(e+i*(t-e+rn("1e-"+((i+"").length-1))),t)}return yo(e,t)}var Wh=ps((function(e,t,n){return t=t.toLowerCase(),e+(n?Kh(t):t)}));function Kh(e){return bd(Qu(e).toLowerCase())}function Jh(e){return e=Qu(e),e&&e.replace(Qe,nr).replace(zt,"")}function Gh(e,t,n){e=Qu(e),t=Io(t);var r=e.length;n=n===o?r:gi(Ju(n),0,r);var i=n;return n-=t.length,n>=0&&e.slice(n,i)==t}function Zh(e){return e=Qu(e),e&&Ae.test(e)?e.replace(ke,rr):e}function Yh(e){return e=Qu(e),e&&Be.test(e)?e.replace(Me,"\\$&"):e}var Xh=ps((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Qh=ps((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ed=fs("toLowerCase");function td(e,t,n){e=Qu(e),t=Ju(t);var r=t?gr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Es(It(i),n)+e+Es(Lt(i),n)}function nd(e,t,n){e=Qu(e),t=Ju(t);var r=t?gr(e):0;return t&&r>>0,n?(e=Qu(e),e&&("string"==typeof t||null!=t&&!Du(t))&&(t=Io(t),!t&&sr(e))?Wo(vr(e),0,n):e.split(t,n)):[]}var ld=ps((function(e,t,n){return e+(n?" ":"")+bd(t)}));function ud(e,t,n){return e=Qu(e),n=null==n?0:gi(Ju(n),0,e.length),t=Io(t),e.slice(n,n+t.length)==t}function hd(e,t,n){var r=_r.templateSettings;n&&aa(e,t,n)&&(t=o),e=Qu(e),t=nh({},t,r,Rs);var s,a,c=nh({},t.imports,r.imports,Rs),l=xh(c),h=Yn(c,l),d=0,f=t.interpolate||et,p="__p += '",m=rt((t.escape||et).source+"|"+f.source+"|"+(f===Re?We:et).source+"|"+(t.evaluate||et).source+"|$","g"),g="//# sourceURL="+(ht.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zt+"]")+"\n";e.replace(m,(function(t,n,r,i,o,c){return r||(r=i),p+=e.slice(d,c).replace(tt,ir),n&&(s=!0,p+="' +\n__e("+n+") +\n'"),o&&(a=!0,p+="';\n"+o+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=c+t.length,t})),p+="';\n";var v=ht.call(t,"variable")&&t.variable;if(v){if(ze.test(v))throw new i(u)}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(Ee,""):p).replace(Ce,"$1").replace(je,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=xd((function(){return Fe(l,g+"return "+p).apply(o,h)}));if(y.source=p,wu(y))throw y;return y}function dd(e){return Qu(e).toLowerCase()}function fd(e){return Qu(e).toUpperCase()}function pd(e,t,n){if(e=Qu(e),e&&(n||t===o))return Gn(e);if(!e||!(t=Io(t)))return e;var r=vr(e),i=vr(t),s=Qn(r,i),a=er(r,i)+1;return Wo(r,s,a).join("")}function md(e,t,n){if(e=Qu(e),e&&(n||t===o))return e.slice(0,yr(e)+1);if(!e||!(t=Io(t)))return e;var r=vr(e),i=er(r,vr(t))+1;return Wo(r,0,i).join("")}function gd(e,t,n){if(e=Qu(e),e&&(n||t===o))return e.replace(Pe,"");if(!e||!(t=Io(t)))return e;var r=vr(e),i=Qn(r,vr(t));return Wo(r,i).join("")}function vd(e,t){var n=A,r=O;if(Cu(t)){var i="separator"in t?t.separator:i;n="length"in t?Ju(t.length):n,r="omission"in t?Io(t.omission):r}e=Qu(e);var s=e.length;if(sr(e)){var a=vr(e);s=a.length}if(n>=s)return e;var c=n-gr(r);if(c<1)return r;var l=a?Wo(a,0,c).join(""):e.slice(0,c);if(i===o)return l+r;if(a&&(c+=l.length-c),Du(i)){if(e.slice(c).search(i)){var u,h=l;i.global||(i=rt(i.source,Qu(Ke.exec(i))+"g")),i.lastIndex=0;while(u=i.exec(h))var d=u.index;l=l.slice(0,d===o?c:d)}}else if(e.indexOf(Io(i),c)!=c){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}function yd(e){return e=Qu(e),e&&Ne.test(e)?e.replace(Se,wr):e}var wd=ps((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),bd=fs("toUpperCase");function _d(e,t,n){return e=Qu(e),t=n?o:t,t===o?ar(e)?xr(e):Dn(e):e.match(t)||[]}var xd=_o((function(e,t){try{return bn(e,o,t)}catch(n){return wu(n)?n:new i(n)}})),Ed=Ps((function(e,t){return xn(t,(function(t){t=Ta(t),pi(e,t,Rl(e[t],e))})),e}));function Cd(e){var t=null==e?0:e.length,n=zs();return e=t?Nn(e,(function(e){if("function"!=typeof e[1])throw new ot(l);return[n(e[0]),e[1]]})):[],_o((function(n){var r=-1;while(++rB)return[];var n=$,r=Vt(e,$);t=zs(t),e-=$;var i=Kn(r,t);while(++n0||t<0)?new kr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(t=Ju(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},kr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},kr.prototype.toArray=function(){return this.take($)},Ti(kr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=_r[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);i&&(_r.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,c=t instanceof kr,l=a[0],u=c||cu(t),h=function(e){var t=i.apply(_r,An([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof l&&1!=l.length&&(c=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,m=c&&!f;if(!s&&u){t=m?t:new kr(this);var g=e.apply(t,a);return g.__actions__.push({func:Kc,args:[h],thisArg:o}),new Sr(g,d)}return p&&m?e.apply(this,a):(g=this.thru(h),p?r?g.value()[0]:g.value():g)})})),xn(["pop","push","shift","sort","splice","unshift"],(function(e){var t=st[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);_r.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(cu(i)?i:[],e)}return this[n]((function(n){return t.apply(cu(n)?n:[],e)}))}})),Ti(kr.prototype,(function(e,t){var n=_r[t];if(n){var r=n.name+"";ht.call(ln,r)||(ln[r]=[]),ln[r].push({name:t,func:n})}})),ln[ws(o,b).name]=[{name:"wrapper",func:o}],kr.prototype.clone=Nr,kr.prototype.reverse=Ar,kr.prototype.value=Or,_r.prototype.at=Jc,_r.prototype.chain=Gc,_r.prototype.commit=Zc,_r.prototype.next=Yc,_r.prototype.plant=Qc,_r.prototype.reverse=el,_r.prototype.toJSON=_r.prototype.valueOf=_r.prototype.value=tl,_r.prototype.first=_r.prototype.head,kt&&(_r.prototype[kt]=Xc),_r},Cr=Er();cn._=Cr,i=function(){return Cr}.call(t,n,t,r),i===o||(r.exports=i)}).call(this)}).call(this,n("c8ba"),n("62e4")(e))},"33c3":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"jsoneditor"})},i=[],o=n("b2cd"),s=n.n(o),a=(n("6014"),n("2ef0")),c=n.n(a),l={name:"json-editor",data:function(){return{editor:null}},props:{json:{required:!0},options:{type:Object,default:function(){return{}}},onChange:{type:Function}},watch:{json:{handler:function(e){this.editor&&this.editor.set(e)},deep:!0}},methods:{_onChange:function(e){this.onChange&&this.editor&&this.onChange(this.editor.get())}},mounted:function(){var e=this.$refs.jsoneditor,t=c.a.extend({onChange:this._onChange},this.options);this.editor=new s.a(e,t),this.editor.set(this.json)},beforeDestroy:function(){this.editor&&(this.editor.destroy(),this.editor=null)}},u=l,h=n("2877"),d=Object(h["a"])(u,r,i,!1,null,null,null);t["a"]=d.exports},6014:function(e,t,n){},"62e4":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},b2cd:function(e,t,n){ +/*! + * jsoneditor.js + * + * @brief + * JSONEditor is a web-based tool to view, edit, format, and validate JSON. + * It has various modes such as a tree editor, a code editor, and a plain text + * editor. + * + * Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+ + * + * @license + * 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. + * + * Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org + * + * @author Jos de Jong, + * @version 5.5.11 + * @date 2017-01-06 + */ +(function(t,n){e.exports=n()})(0,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";var r;try{r=n(!function(){var e=new Error('Cannot find module "ajv"');throw e.code="MODULE_NOT_FOUND",e}())}catch(c){}var i=n(1),o=n(12),s=n(4);function a(e,t,n){if(!(this instanceof a))throw new Error('JSONEditor constructor called without "new".');var r=s.getInternetExplorerVersion();if(-1!=r&&r<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");if(t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t)){var i=["ace","theme","ajv","schema","onChange","onEditable","onError","onModeChange","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys"];Object.keys(t).forEach((function(e){-1===i.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')}))}arguments.length&&this._create(e,t,n)}a.modes={},a.prototype.DEBOUNCE_INTERVAL=150,a.prototype._create=function(e,t,n){this.container=e,this.options=t||{},this.json=n||{};var r=this.options.mode||"tree";this.setMode(r)},a.prototype.destroy=function(){},a.prototype.set=function(e){this.json=e},a.prototype.get=function(){return this.json},a.prototype.setText=function(e){this.json=s.parse(e)},a.prototype.getText=function(){return JSON.stringify(this.json)},a.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},a.prototype.getName=function(){return this.options&&this.options.name},a.prototype.setMode=function(e){var t,n,r=this.container,i=s.extend({},this.options),o=i.mode;i.mode=e;var l=a.modes[e];if(!l)throw new Error('Unknown mode "'+i.mode+'"');try{var u="text"==l.data;if(n=this.getName(),t=this[u?"getText":"get"](),this.destroy(),s.clear(this),s.extend(this,l.mixin),this.create(r,i),this.setName(n),this[u?"setText":"set"](t),"function"===typeof l.load)try{l.load.call(this)}catch(c){console.error(c)}if("function"===typeof i.onModeChange&&e!==o)try{i.onModeChange(e,o)}catch(c){console.error(c)}}catch(c){this._onError(c)}},a.prototype.getMode=function(){return this.options.mode},a.prototype._onError=function(e){if(!this.options||"function"!==typeof this.options.onError)throw e;this.options.onError(e)},a.prototype.setSchema=function(e){if(e){var t;try{t=this.options.ajv||r({allErrors:!0,verbose:!0})}catch(c){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}t&&(this.validateSchema=t.compile(e),this.options.schema=e,this.validate()),this.refresh()}else this.validateSchema=null,this.options.schema=null,this.validate(),this.refresh()},a.prototype.validate=function(){},a.prototype.refresh=function(){},a.registerMode=function(e){var t,n;if(s.isArray(e))for(t=0;t0?this.autoScrollStep=(r+s-e)/3:e>o-s&&i+n.scrollTop3?(n.scrollTop+=i/3,r.animateCallback=t,r.animateTimeout=setTimeout(a,50)):(t&&t(!0),n.scrollTop=s,delete r.animateTimeout,delete r.animateCallback)};a()}else t&&t(!1)},_createFrame:function(){this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.container.appendChild(this.frame);var e=this;function t(t){e._onEvent&&e._onEvent(t)}this.frame.onclick=function(e){var n=e.target;t(e),"BUTTON"==n.nodeName&&e.preventDefault()},this.frame.oninput=t,this.frame.onchange=t,this.frame.onkeydown=t,this.frame.onkeyup=t,this.frame.oncut=t,this.frame.onpaste=t,this.frame.onmousedown=t,this.frame.onmouseup=t,this.frame.onmouseover=t,this.frame.onmouseout=t,l.addEventListener(this.frame,"focus",t,!0),l.addEventListener(this.frame,"blur",t,!0),this.frame.onfocusin=t,this.frame.onfocusout=t,this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu);var n=document.createElement("button");n.type="button",n.className="jsoneditor-expand-all",n.title="Expand all fields",n.onclick=function(){e.expandAll()},this.menu.appendChild(n);var r=document.createElement("button");if(r.type="button",r.title="Collapse all fields",r.className="jsoneditor-collapse-all",r.onclick=function(){e.collapseAll()},this.menu.appendChild(r),this.history){var i=document.createElement("button");i.type="button",i.className="jsoneditor-undo jsoneditor-separator",i.title="Undo last action (Ctrl+Z)",i.onclick=function(){e._onUndo()},this.menu.appendChild(i),this.dom.undo=i;var s=document.createElement("button");s.type="button",s.className="jsoneditor-redo",s.title="Redo (Ctrl+Shift+Z)",s.onclick=function(){e._onRedo()},this.menu.appendChild(s),this.dom.redo=s,this.history.onChange=function(){i.disabled=!e.history.canUndo(),s.disabled=!e.history.canRedo()},this.history.onChange()}if(this.options&&this.options.modes&&this.options.modes.length){var a=this;this.modeSwitcher=new c(this.menu,this.options.modes,this.options.mode,(function(e){a.modeSwitcher.destroy(),a.setMode(e),a.modeSwitcher.focus()}))}this.options.search&&(this.searchBox=new o(this,this.menu))},_onUndo:function(){this.history&&(this.history.undo(),this._onChange())},_onRedo:function(){this.history&&(this.history.redo(),this._onChange())},_onEvent:function(e){"keydown"==e.type&&this._onKeyDown(e),"focus"==e.type&&(this.focusTarget=e.target),"mousedown"==e.type&&this._startDragDistance(e),"mousemove"!=e.type&&"mouseup"!=e.type&&"click"!=e.type||this._updateDragDistance(e);var t=a.getNodeFromTarget(e.target);if(t&&t.selected){if("click"==e.type){if(e.target==t.dom.menu)return void this.showContextMenu(e.target);e.hasMoved||this.deselect()}"mousedown"==e.type&&a.onDragStart(this.multiselection.nodes,e)}else"mousedown"==e.type&&(this.deselect(),t&&e.target==t.dom.drag?a.onDragStart(t,e):(!t||e.target!=t.dom.field&&e.target!=t.dom.value&&e.target!=t.dom.select)&&this._onMultiSelectStart(e));t&&t.onEvent(e)},_startDragDistance:function(e){this.dragDistanceEvent={initialTarget:e.target,initialPageX:e.pageX,initialPageY:e.pageY,dragDistance:0,hasMoved:!1}},_updateDragDistance:function(e){this.dragDistanceEvent||this._startDragDistance(e);var t=e.pageX-this.dragDistanceEvent.initialPageX,n=e.pageY-this.dragDistanceEvent.initialPageY;return this.dragDistanceEvent.dragDistance=Math.sqrt(t*t+n*n),this.dragDistanceEvent.hasMoved=this.dragDistanceEvent.hasMoved||this.dragDistanceEvent.dragDistance>10,e.dragDistance=this.dragDistanceEvent.dragDistance,e.hasMoved=this.dragDistanceEvent.hasMoved,e.dragDistance},_onMultiSelectStart:function(e){var t=a.getNodeFromTarget(e.target);if("tree"===this.options.mode&&void 0===this.options.onEditable){this.multiselection={start:t||null,end:null,nodes:[]},this._startDragDistance(e);var n=this;this.mousemove||(this.mousemove=l.addEventListener(window,"mousemove",(function(e){n._onMultiSelect(e)}))),this.mouseup||(this.mouseup=l.addEventListener(window,"mouseup",(function(e){n._onMultiSelectEnd(e)})))}},_onMultiSelect:function(e){if(e.preventDefault(),this._updateDragDistance(e),e.hasMoved){var t=a.getNodeFromTarget(e.target);t&&(null==this.multiselection.start&&(this.multiselection.start=t),this.multiselection.end=t),this.deselect();var n=this.multiselection.start,r=this.multiselection.end||this.multiselection.start;n&&r&&(this.multiselection.nodes=this._findTopLevelNodes(n,r),this.select(this.multiselection.nodes))}},_onMultiSelectEnd:function(e){this.multiselection.nodes[0]&&this.multiselection.nodes[0].dom.menu.focus(),this.multiselection.start=null,this.multiselection.end=null,this.mousemove&&(l.removeEventListener(window,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&(l.removeEventListener(window,"mouseup",this.mouseup),delete this.mouseup)},deselect:function(e){this.multiselection.nodes.forEach((function(e){e.setSelected(!1)})),this.multiselection.nodes=[],e&&(this.multiselection.start=null,this.multiselection.end=null)},select:function(e){if(!Array.isArray(e))return this.select([e]);if(e){this.deselect(),this.multiselection.nodes=e.slice(0);var t=e[0];e.forEach((function(e){e.setSelected(!0,e===t)}))}},_findTopLevelNodes:function(e,t){var n=e.getNodePath(),r=t.getNodePath(),i=0;while(i=0},r.prototype.canRedo=function(){return this.index=0){var n=t[e];if(" "!==n&&"\n"!==n&&"\r"!==n&&"\t"!==n)return n;e--}return""}function c(){n+=2;while(n=0;a--){var c=s[a];!0===c.specified&&o.removeAttribute(c.name)}t.stripFormatting(o)}},t.setEndOfContentEditable=function(e){var t,n;document.createRange&&(t=document.createRange(),t.selectNodeContents(e),t.collapse(!1),n=window.getSelection(),n.removeAllRanges(),n.addRange(t))},t.selectContentEditable=function(e){var t,n;e&&"DIV"==e.nodeName&&(window.getSelection&&document.createRange&&(n=document.createRange(),n.selectNodeContents(e),t=window.getSelection(),t.removeAllRanges(),t.addRange(n)))},t.getSelection=function(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null},t.setSelection=function(e){if(e&&window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}},t.getSelectionOffset=function(){var e=t.getSelection();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer==e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null},t.setSelectionOffset=function(e){if(document.createRange&&window.getSelection){var n=window.getSelection();if(n){var r=document.createRange();e.container.firstChild||e.container.appendChild(document.createTextNode("")),r.setStart(e.container.firstChild,e.startOffset),r.setEnd(e.container.firstChild,e.endOffset),t.setSelection(r)}}},t.getInnerText=function(e,n){var r=void 0==n;if(r&&(n={text:"",flush:function(){var e=this.text;return this.text="",e},set:function(e){this.text=e}}),e.nodeValue)return n.flush()+e.nodeValue;if(e.hasChildNodes()){for(var i=e.childNodes,o="",s=0,a=i.length;s5){var n=["("+(t.length-5)+" more...)"];t=t.slice(0,5),t.push(n)}e.message="should be equal to one of: "+t.join(", ")}}return"additionalProperties"===e.keyword&&(e.message="should NOT have additional property: "+e.params.additionalProperty),e},t.insideRect=function(e,t,n){var r=void 0!==n?n:0;return t.left-r>=e.left&&t.right+r<=e.right&&t.top-r>=e.top&&t.bottom+r<=e.bottom},t.debounce=function(e,t,n){var r;return function(){var i=this,o=arguments,s=function(){r=null,n||e.apply(i,o)},a=n&&!r;clearTimeout(r),r=setTimeout(s,t),a&&e.apply(i,o)}},t.textDiff=function(e,t){var n=t.length,r=0,i=e.length,o=t.length;while(t.charAt(r)===e.charAt(r)&&rr&&i>0)o--,i--;return{start:r,end:o}}},function(e,t,n){var r=function(){var e={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,n,r,i,o,s){var a=o.length-1;switch(i){case 1:this.$=e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(e);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=o[a-1];case 13:this.$={};break;case 14:this.$=o[a-1];break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[];break;case 19:this.$=o[a-1];break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a]);break}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,n=[0],r=[null],i=[],o=this.table,s="",a=0,c=0,l=0,u=2,h=1;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;function f(e){n.length=n.length-2*e,r.length=r.length-e,i.length=i.length-e}function p(){var e;return e=t.lexer.lex()||1,"number"!==typeof e&&(e=t.symbols_[e]||e),e}i.push(d),"function"===typeof this.yy.parseError&&(this.parseError=this.yy.parseError);var m,g,v,y,w,b,_,x,E,C={};while(1){if(v=n[n.length-1],this.defaultActions[v]?y=this.defaultActions[v]:(null==m&&(m=p()),y=o[v]&&o[v][m]),"undefined"===typeof y||!y.length||!y[0]){if(!l){for(b in E=[],o[v])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");var j="";j=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+E.join(", ")+", got '"+this.terminals_[m]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(j,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:d,expected:E})}if(3==l){if(m==h)throw new Error(j||"Parsing halted.");c=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,d=this.lexer.yylloc,m=p()}while(1){if(u.toString()in o[v])break;if(0==v)throw new Error(j||"Parsing halted.");f(1),v=n[n.length-1]}g=m,m=u,v=n[n.length-1],y=o[v]&&o[v][u],l=3}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+m);switch(y[0]){case 1:n.push(m),r.push(this.lexer.yytext),i.push(this.lexer.yylloc),n.push(y[1]),m=null,g?(m=g,g=null):(c=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,d=this.lexer.yylloc,l>0&&l--);break;case 2:if(_=this.productions_[y[1]][1],C.$=r[r.length-_],C._$={first_line:i[i.length-(_||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(_||1)].first_column,last_column:i[i.length-1].last_column},w=this.performAction.call(C,s,c,a,this.yy,y[1],r,i),"undefined"!==typeof w)return w;_&&(n=n.slice(0,-1*_*2),r=r.slice(0,-1*_),i=i.slice(0,-1*_)),n.push(this.productions_[y[1]][0]),r.push(C.$),i.push(C._$),x=o[n[n.length-2]][n[n.length-1]],n.push(x);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,n,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),s=0;st[0].length)&&(t=n,r=s,!this.options.flex))break;return t?(i=t[0].match(/\n.*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return"undefined"!==typeof e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,n,r){switch(n){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return e}();return e.lexer=t,e}();t.parser=r,t.parse=r.parse.bind(r)},function(e,t){"use strict";function n(e,t){var n=this;this.editor=e,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.dom={},this.dom.container=t;var r=document.createElement("table");this.dom.table=r,r.className="jsoneditor-search",t.appendChild(r);var i=document.createElement("tbody");this.dom.tbody=i,r.appendChild(i);var o=document.createElement("tr");i.appendChild(o);var s=document.createElement("td");o.appendChild(s);var a=document.createElement("div");this.dom.results=a,a.className="jsoneditor-results",s.appendChild(a),s=document.createElement("td"),o.appendChild(s);var c=document.createElement("div");this.dom.input=c,c.className="jsoneditor-frame",c.title="Search fields and values",s.appendChild(c);var l=document.createElement("table");c.appendChild(l);var u=document.createElement("tbody");l.appendChild(u),o=document.createElement("tr"),u.appendChild(o);var h=document.createElement("button");h.type="button",h.className="jsoneditor-refresh",s=document.createElement("td"),s.appendChild(h),o.appendChild(s);var d=document.createElement("input");this.dom.search=d,d.oninput=function(e){n._onDelayedSearch(e)},d.onchange=function(e){n._onSearch()},d.onkeydown=function(e){n._onKeyDown(e)},d.onkeyup=function(e){n._onKeyUp(e)},h.onclick=function(e){d.select()},s=document.createElement("td"),s.appendChild(d),o.appendChild(s);var f=document.createElement("button");f.type="button",f.title="Next result (Enter)",f.className="jsoneditor-next",f.onclick=function(){n.next()},s=document.createElement("td"),s.appendChild(f),o.appendChild(s);var p=document.createElement("button");p.type="button",p.title="Previous result (Shift+Enter)",p.className="jsoneditor-previous",p.onclick=function(){n.previous()},s=document.createElement("td"),s.appendChild(p),o.appendChild(s)}n.prototype.next=function(e){if(void 0!=this.results){var t=void 0!=this.resultIndex?this.resultIndex+1:0;t>this.results.length-1&&(t=0),this._setActiveResult(t,e)}},n.prototype.previous=function(e){if(void 0!=this.results){var t=this.results.length-1,n=void 0!=this.resultIndex?this.resultIndex-1:t;n<0&&(n=t),this._setActiveResult(n,e)}},n.prototype._setActiveResult=function(e,t){if(this.activeResult){var n=this.activeResult.node,r=this.activeResult.elem;"field"==r?delete n.searchFieldActive:delete n.searchValueActive,n.updateDom()}if(!this.results||!this.results[e])return this.resultIndex=void 0,void(this.activeResult=void 0);this.resultIndex=e;var i=this.results[this.resultIndex].node,o=this.results[this.resultIndex].elem;"field"==o?i.searchFieldActive=!0:i.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],i.updateDom(),i.scrollTo((function(){t&&i.focus(o)}))},n.prototype._clearDelay=function(){void 0!=this.timeout&&(clearTimeout(this.timeout),delete this.timeout)},n.prototype._onDelayedSearch=function(e){this._clearDelay();var t=this;this.timeout=setTimeout((function(e){t._onSearch()}),this.delay)},n.prototype._onSearch=function(e){this._clearDelay();var t=this.dom.search.value,n=t.length>0?t:void 0;if(n!=this.lastText||e)if(this.lastText=n,this.results=this.editor.search(n),this._setActiveResult(void 0),void 0!=n){var r=this.results.length;switch(r){case 0:this.dom.results.innerHTML="no results";break;case 1:this.dom.results.innerHTML="1 result";break;default:this.dom.results.innerHTML=r+" results";break}}else this.dom.results.innerHTML=""},n.prototype._onKeyDown=function(e){var t=e.which;27==t?(this.dom.search.value="",this._onSearch(),e.preventDefault(),e.stopPropagation()):13==t&&(e.ctrlKey?this._onSearch(!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())},n.prototype._onKeyUp=function(e){var t=e.keyCode;27!=t&&13!=t&&this._onDelayedSearch(e)},n.prototype.clear=function(){this.dom.search.value="",this._onSearch()},n.prototype.destroy=function(){this.editor=null,this.dom.container.removeChild(this.dom.table),this.dom=null,this.results=null,this.activeResult=null,this._clearDelay()},e.exports=n},function(e,t,n){"use strict";var r=n(4);function i(e,t){this.dom={};var n=this,r=this.dom;this.anchor=void 0,this.items=e,this.eventListeners={},this.selection=void 0,this.onClose=t?t.close:void 0;var i=document.createElement("div");i.className="jsoneditor-contextmenu-root",r.root=i;var o=document.createElement("div");o.className="jsoneditor-contextmenu",r.menu=o,i.appendChild(o);var s=document.createElement("ul");s.className="jsoneditor-menu",o.appendChild(s),r.list=s,r.items=[];var a=document.createElement("button");a.type="button",r.focusButton=a;var c=document.createElement("li");function l(e,t,r){r.forEach((function(r){if("separator"==r.type){var i=document.createElement("div");i.className="jsoneditor-separator",s=document.createElement("li"),s.appendChild(i),e.appendChild(s)}else{var o={},s=document.createElement("li");e.appendChild(s);var a=document.createElement("button");if(a.type="button",a.className=r.className,o.button=a,r.title&&(a.title=r.title),r.click&&(a.onclick=function(e){e.preventDefault(),n.hide(),r.click()}),s.appendChild(a),r.submenu){var c,u=document.createElement("div");if(u.className="jsoneditor-icon",a.appendChild(u),a.appendChild(document.createTextNode(r.text)),r.click){a.className+=" jsoneditor-default";var h=document.createElement("button");h.type="button",o.buttonExpand=h,h.className="jsoneditor-expand",h.innerHTML='
',s.appendChild(h),r.submenuTitle&&(h.title=r.submenuTitle),c=h}else{var d=document.createElement("div");d.className="jsoneditor-expand",a.appendChild(d),c=a}c.onclick=function(e){e.preventDefault(),n._onExpandItem(o),c.focus()};var f=[];o.subItems=f;var p=document.createElement("ul");o.ul=p,p.className="jsoneditor-menu",p.style.height="0",s.appendChild(p),l(p,f,r.submenu)}else a.innerHTML='
'+r.text;t.push(o)}}))}c.style.overflow="hidden",c.style.height="0",c.appendChild(a),s.appendChild(c),l(s,this.dom.items,e),this.maxHeight=0,e.forEach((function(t){var r=24*(e.length+(t.submenu?t.submenu.length:0));n.maxHeight=Math.max(n.maxHeight,r)}))}i.prototype._getVisibleButtons=function(){var e=[],t=this;return this.dom.items.forEach((function(n){e.push(n.button),n.buttonExpand&&e.push(n.buttonExpand),n.subItems&&n==t.expandedItem&&n.subItems.forEach((function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)}))})),e},i.visibleMenu=void 0,i.prototype.show=function(e,t){this.hide();var n=!0;if(t){var o=e.getBoundingClientRect(),s=t.getBoundingClientRect();o.bottom+this.maxHeights.top&&(n=!1)}if(n){var a=e.offsetHeight;this.dom.menu.style.left="0px",this.dom.menu.style.top=a+"px",this.dom.menu.style.bottom=""}else this.dom.menu.style.left="0px",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px";var c=e.parentNode;c.insertBefore(this.dom.root,c.firstChild);var l=this,u=this.dom.list;this.eventListeners.mousedown=r.addEventListener(window,"mousedown",(function(e){var t=e.target;t==u||l._isChildOf(t,u)||(l.hide(),e.stopPropagation(),e.preventDefault())})),this.eventListeners.keydown=r.addEventListener(window,"keydown",(function(e){l._onKeyDown(e)})),this.selection=r.getSelection(),this.anchor=e,setTimeout((function(){l.dom.focusButton.focus()}),0),i.visibleMenu&&i.visibleMenu.hide(),i.visibleMenu=this},i.prototype.hide=function(){for(var e in this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose&&this.onClose()),this.eventListeners)if(this.eventListeners.hasOwnProperty(e)){var t=this.eventListeners[e];t&&r.removeEventListener(window,e,t),delete this.eventListeners[e]}i.visibleMenu==this&&(i.visibleMenu=void 0)},i.prototype._onExpandItem=function(e){var t=this,n=e==this.expandedItem,i=this.expandedItem;if(i&&(i.ul.style.height="0",i.ul.style.padding="",setTimeout((function(){t.expandedItem!=i&&(i.ul.style.display="",r.removeClassName(i.ul.parentNode,"jsoneditor-selected"))}),300),this.expandedItem=void 0),!n){var o=e.ul;o.style.display="block";o.clientHeight;setTimeout((function(){t.expandedItem==e&&(o.style.height=24*o.childNodes.length+"px",o.style.padding="5px 10px")}),0),r.addClassName(o.parentNode,"jsoneditor-selected"),this.expandedItem=e}},i.prototype._onKeyDown=function(e){var t,n,i,o,s=e.target,a=e.which,c=!1;27==a?(this.selection&&r.setSelection(this.selection),this.anchor&&this.anchor.focus(),this.hide(),c=!0):9==a?e.shiftKey?(t=this._getVisibleButtons(),n=t.indexOf(s),0==n&&(t[t.length-1].focus(),c=!0)):(t=this._getVisibleButtons(),n=t.indexOf(s),n==t.length-1&&(t[0].focus(),c=!0)):37==a?("jsoneditor-expand"==s.className&&(t=this._getVisibleButtons(),n=t.indexOf(s),i=t[n-1],i&&i.focus()),c=!0):38==a?(t=this._getVisibleButtons(),n=t.indexOf(s),i=t[n-1],i&&"jsoneditor-expand"==i.className&&(i=t[n-2]),i||(i=t[t.length-1]),i&&i.focus(),c=!0):39==a?(t=this._getVisibleButtons(),n=t.indexOf(s),o=t[n+1],o&&"jsoneditor-expand"==o.className&&o.focus(),c=!0):40==a&&(t=this._getVisibleButtons(),n=t.indexOf(s),o=t[n+1],o&&"jsoneditor-expand"==o.className&&(o=t[n+2]),o||(o=t[0]),o&&(o.focus(),c=!0),c=!0),c&&(e.stopPropagation(),e.preventDefault())},i.prototype._isChildOf=function(e,t){var n=e.parentNode;while(n){if(n==t)return!0;n=n.parentNode}return!1},e.exports=i},function(e,t,n){"use strict";var r=n(9),i=n(7),o=n(10),s=n(4);function a(e,t){this.editor=e,this.dom={},this.expanded=!1,t&&t instanceof Object?(this.setField(t.field,t.fieldEditable),this.setValue(t.value,t.type)):(this.setField(""),this.setValue(null)),this._debouncedOnChangeValue=s.debounce(this._onChangeValue.bind(this),a.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=s.debounce(this._onChangeField.bind(this),a.prototype.DEBOUNCE_INTERVAL)}a.prototype.DEBOUNCE_INTERVAL=150,a.prototype._updateEditability=function(){if(this.editable={field:!0,value:!0},this.editor&&(this.editable.field="tree"===this.editor.options.mode,this.editable.value="view"!==this.editor.options.mode,("tree"===this.editor.options.mode||"form"===this.editor.options.mode)&&"function"===typeof this.editor.options.onEditable)){var e=this.editor.options.onEditable({field:this.field,value:this.value,path:this.getPath()});"boolean"===typeof e?(this.editable.field=e,this.editable.value=e):("boolean"===typeof e.field&&(this.editable.field=e.field),"boolean"===typeof e.value&&(this.editable.value=e.value))}},a.prototype.getPath=function(){var e=this,t=[];while(e){var n=e.parent?"array"!=e.parent.type?e.field:e.index:void 0;void 0!==n&&t.unshift(n),e=e.parent}return t},a.prototype.findNode=function(e){var t=s.parsePath(e),n=this;while(n&&t.length>0){var r=t.shift();if("number"===typeof r){if("array"!==n.type)throw new Error("Cannot get child node at index "+r+": node is no array");n=n.childs[r]}else{if("object"!==n.type)throw new Error("Cannot get child node "+r+": node is no object");n=n.childs.filter((function(e){return e.field===r}))[0]}}return n},a.prototype.findParents=function(){var e=[],t=this.parent;while(t)e.unshift(t),t=t.parent;return e},a.prototype.setError=function(e,t){this.getDom(),this.error=e;var n=this.dom.tdError;if(e){n||(n=document.createElement("td"),this.dom.tdError=n,this.dom.tdValue.parentNode.appendChild(n));var r=document.createElement("div");r.className="jsoneditor-popover jsoneditor-right",r.appendChild(document.createTextNode(e.message));var i=document.createElement("button");i.type="button",i.className="jsoneditor-schema-error",i.appendChild(r),i.onmouseover=i.onfocus=function(){for(var e=["right","above","below","left"],t=0;t0&&(e=this.childs.filter((function(e){return-1!==n.indexOf(e.field)})).map((function(e){return{node:e,error:{message:'duplicate key "'+e.field+'"'}}})))}if(this.childs)for(r=0;r0&&(e=e.concat(o))}return e},a.prototype.clearDom=function(){this.dom={}},a.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;if(this._updateEditability(),e.tr=document.createElement("tr"),e.tr.node=this,"tree"===this.editor.options.mode){var t=document.createElement("td");if(this.editable.field&&this.parent){var n=document.createElement("button");n.type="button",e.drag=n,n.className="jsoneditor-dragarea",n.title="Drag to move this field (Alt+Shift+Arrows)",t.appendChild(n)}e.tr.appendChild(t);var r=document.createElement("td"),i=document.createElement("button");i.type="button",e.menu=i,i.className="jsoneditor-contextmenu",i.title="Click to open the actions menu (Ctrl+M)",r.appendChild(e.menu),e.tr.appendChild(r)}var o=document.createElement("td");return e.tr.appendChild(o),e.tree=this._createDomTree(),o.appendChild(e.tree),this.updateDom({updateIndexes:!0}),e.tr},a.onDragStart=function(e,t){if(!Array.isArray(e))return a.onDragStart([e],t);if(0!==e.length){var n=e[0],r=e[e.length-1],i=a.getNodeFromTarget(t.target),o=r._nextSibling(),c=n.editor,l=s.getAbsoluteTop(i.dom.tr)-s.getAbsoluteTop(n.dom.tr);c.mousemove||(c.mousemove=s.addEventListener(window,"mousemove",(function(t){a.onDrag(e,t)}))),c.mouseup||(c.mouseup=s.addEventListener(window,"mouseup",(function(t){a.onDragEnd(e,t)}))),c.highlighter.lock(),c.drag={oldCursor:document.body.style.cursor,oldSelection:c.getSelection(),oldBeforeNode:o,mouseX:t.pageX,offsetY:l,level:n.getLevel()},document.body.style.cursor="move",t.preventDefault()}},a.onDrag=function(e,t){if(!Array.isArray(e))return a.onDrag([e],t);if(0!==e.length){var n,r,i,o,l,u,h,d,f,p,m,g,v,y,w=e[0].editor,b=t.pageY-w.drag.offsetY,_=t.pageX,x=!1,E=e[0];if(n=E.dom.tr,f=s.getAbsoluteTop(n),g=n.offsetHeight,bp+g&&(h=void 0)),h&&(e.forEach((function(e){h.parent.moveBefore(e,h)})),x=!0)}else{var C=e[e.length-1];if(l=C.expanded&&C.append?C.append.getDom():C.dom.tr,o=l?l.nextSibling:void 0,o){m=s.getAbsoluteTop(o),i=o;do{d=a.getNodeFromTarget(i),i&&(v=i.nextSibling?s.getAbsoluteTop(i.nextSibling):0,y=i?v-m:0,d.parent.childs.length==e.length&&d.parent.childs[e.length-1]==C&&(f+=27)),i=i.nextSibling}while(i&&b>f+y);if(d&&d.parent){var j=_-w.drag.mouseX,S=Math.round(j/24/2),k=w.drag.level+S,N=d.getLevel();r=d.dom.tr.previousSibling;while(N0)return n[0].enum}return null},a._findSchema=function(e,t){for(var n=e,r=0;r0?this.editor.multiselection.nodes:[this],b=w[0],_=w[w.length-1];if(13==d){if(f==this.dom.value)this.editable.value&&!e.ctrlKey||s.isUrl(this.value)&&(window.open(this.value,"_blank"),v=!0);else if(f==this.dom.expand){var x=this._hasChilds();if(x){var E=e.ctrlKey;this._onExpand(E),f.focus(),v=!0}}}else if(68==d)p&&y&&(a.onDuplicate(w),v=!0);else if(69==d)p&&(this._onExpand(m),f.focus(),v=!0);else if(77==d&&y)p&&(this.showContextMenu(f),v=!0);else if(46==d&&y)p&&(a.onRemove(w),v=!0);else if(45==d&&y)p&&!m?(this._onInsertBefore(),v=!0):p&&m&&(this._onInsertAfter(),v=!0);else if(35==d){if(g){var C=this._lastNode();C&&C.focus(a.focusElement||this._getElementName(f)),v=!0}}else if(36==d){if(g){var j=this._firstNode();j&&j.focus(a.focusElement||this._getElementName(f)),v=!0}}else if(37==d){if(g&&!m){var S=this._previousElement(f);S&&this.focus(this._getElementName(S)),v=!0}else if(g&&m&&y){if(_.expanded){var k=_.getAppend();r=k?k.nextSibling:void 0}else{var N=_.getDom();r=N.nextSibling}r&&(n=a.getNodeFromTarget(r),i=r.nextSibling,T=a.getNodeFromTarget(i),n&&n instanceof c&&1!=_.parent.childs.length&&T&&T.parent&&(o=this.editor.getSelection(),l=_._nextSibling(),w.forEach((function(e){T.parent.moveBefore(e,T)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:w,oldBeforeNode:l,newBeforeNode:T,oldSelection:o,newSelection:this.editor.getSelection()})))}}else if(38==d)g&&!m?(t=this._previousNode(),t&&(this.editor.deselect(!0),t.focus(a.focusElement||this._getElementName(f))),v=!0):!g&&p&&m&&y?(t=this._previousNode(),t&&(h=this.editor.multiselection,h.start=h.start||this,h.end=t,u=this.editor._findTopLevelNodes(h.start,h.end),this.editor.select(u),t.focus("field")),v=!0):g&&m&&y&&(t=b._previousNode(),t&&t.parent&&(o=this.editor.getSelection(),l=_._nextSibling(),w.forEach((function(e){t.parent.moveBefore(e,t)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:w,oldBeforeNode:l,newBeforeNode:t,oldSelection:o,newSelection:this.editor.getSelection()})),v=!0);else if(39==d){if(g&&!m){var A=this._nextElement(f);A&&this.focus(this._getElementName(A)),v=!0}else if(g&&m&&y){N=b.getDom();var O=N.previousSibling;O&&(t=a.getNodeFromTarget(O),t&&t.parent&&t instanceof c&&!t.isVisible()&&(o=this.editor.getSelection(),l=_._nextSibling(),w.forEach((function(e){t.parent.moveBefore(e,t)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:w,oldBeforeNode:l,newBeforeNode:t,oldSelection:o,newSelection:this.editor.getSelection()})))}}else if(40==d)if(g&&!m)n=this._nextNode(),n&&(this.editor.deselect(!0),n.focus(a.focusElement||this._getElementName(f))),v=!0;else if(!g&&p&&m&&y)n=this._nextNode(),n&&(h=this.editor.multiselection,h.start=h.start||this,h.end=n,u=this.editor._findTopLevelNodes(h.start,h.end),this.editor.select(u),n.focus("field")),v=!0;else if(g&&m&&y){n=_.expanded?_.append?_.append._nextNode():void 0:_._nextNode();var T=n&&(n._nextNode()||n.parent.append);T&&T.parent&&(o=this.editor.getSelection(),l=_._nextSibling(),w.forEach((function(e){T.parent.moveBefore(e,T)})),this.focus(a.focusElement||this._getElementName(f)),this.editor._onAction("moveNodes",{nodes:w,oldBeforeNode:l,newBeforeNode:T,oldSelection:o,newSelection:this.editor.getSelection()})),v=!0}v&&(e.preventDefault(),e.stopPropagation())},a.prototype._onExpand=function(e){if(e){var t=this.dom.tr.parentNode,n=t.parentNode,r=n.scrollTop;n.removeChild(t)}this.expanded?this.collapse(e):this.expand(e),e&&(n.appendChild(t),n.scrollTop=r)},a.onRemove=function(e){if(!Array.isArray(e))return a.onRemove([e]);if(e&&e.length>0){var t=e[0],n=t.parent,r=t.editor,i=t.getIndex();r.highlighter.unhighlight();var o=r.getSelection();a.blurNodes(e);var s=r.getSelection();e.forEach((function(e){e.parent._remove(e)})),r._onAction("removeNodes",{nodes:e.slice(0),parent:n,index:i,oldSelection:o,newSelection:s})}},a.onDuplicate=function(e){if(!Array.isArray(e))return a.onDuplicate([e]);if(e&&e.length>0){var t=e[e.length-1],n=t.parent,r=t.editor;r.deselect(r.multiselection.nodes);var i=r.getSelection(),o=t,s=e.map((function(e){var t=e.clone();return n.insertAfter(t,o),o=t,t}));1===e.length?s[0].focus():r.select(s);var c=r.getSelection();r._onAction("duplicateNodes",{afterNode:t,nodes:s,parent:n,oldSelection:i,newSelection:c})}},a.prototype._onInsertBefore=function(e,t,n){var r=this.editor.getSelection(),i=new a(this.editor,{field:void 0!=e?e:"",value:void 0!=t?t:"",type:n});i.expand(!0),this.parent.insertBefore(i,this),this.editor.highlighter.unhighlight(),i.focus("field");var o=this.editor.getSelection();this.editor._onAction("insertBeforeNodes",{nodes:[i],beforeNode:this,parent:this.parent,oldSelection:r,newSelection:o})},a.prototype._onInsertAfter=function(e,t,n){var r=this.editor.getSelection(),i=new a(this.editor,{field:void 0!=e?e:"",value:void 0!=t?t:"",type:n});i.expand(!0),this.parent.insertAfter(i,this),this.editor.highlighter.unhighlight(),i.focus("field");var o=this.editor.getSelection();this.editor._onAction("insertAfterNodes",{nodes:[i],afterNode:this,parent:this.parent,oldSelection:r,newSelection:o})},a.prototype._onAppend=function(e,t,n){var r=this.editor.getSelection(),i=new a(this.editor,{field:void 0!=e?e:"",value:void 0!=t?t:"",type:n});i.expand(!0),this.parent.appendChild(i),this.editor.highlighter.unhighlight(),i.focus("field");var o=this.editor.getSelection();this.editor._onAction("appendNodes",{nodes:[i],parent:this.parent,oldSelection:r,newSelection:o})},a.prototype._onChangeType=function(e){var t=this.type;if(e!=t){var n=this.editor.getSelection();this.changeType(e);var r=this.editor.getSelection();this.editor._onAction("changeType",{node:this,oldType:t,newType:e,oldSelection:n,newSelection:r})}},a.prototype.sort=function(e){if(this._hasChilds()){var t="desc"==e?-1:1,n="array"==this.type?"value":"field";this.hideChilds();var i=this.childs,o=this.sortOrder;this.childs=this.childs.concat(),this.childs.sort((function(e,i){return t*r(e[n],i[n])})),this.sortOrder=1==t?"asc":"desc",this.editor._onAction("sort",{node:this,oldChilds:i,oldSort:o,newChilds:this.childs,newSort:this.sortOrder}),this.showChilds()}},a.prototype.getAppend=function(){return this.append||(this.append=new c(this.editor),this.append.setParent(this)),this.append.getDom()},a.getNodeFromTarget=function(e){while(e){if(e.node)return e.node;e=e.parentNode}},a.blurNodes=function(e){if(Array.isArray(e)){var t=e[0],n=t.parent,r=t.getIndex();n.childs[r+e.length]?n.childs[r+e.length].focus():n.childs[r-1]?n.childs[r-1].focus():n.focus()}else a.blurNodes([e])},a.prototype._nextSibling=function(){var e=this.parent.childs.indexOf(this);return this.parent.childs[e+1]||this.parent.append},a.prototype._previousNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var n=t;do{n=n.previousSibling,e=a.getNodeFromTarget(n)}while(n&&e instanceof c&&!e.isVisible())}return e},a.prototype._nextNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var n=t;do{n=n.nextSibling,e=a.getNodeFromTarget(n)}while(n&&e instanceof c&&!e.isVisible())}return e},a.prototype._firstNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var n=t.parentNode.firstChild;e=a.getNodeFromTarget(n)}return e},a.prototype._lastNode=function(){var e=null,t=this.getDom();if(t&&t.parentNode){var n=t.parentNode.lastChild;e=a.getNodeFromTarget(n);while(n&&e instanceof c&&!e.isVisible())n=n.previousSibling,e=a.getNodeFromTarget(n)}return e},a.prototype._previousElement=function(e){var t=this.dom;switch(e){case t.value:if(this.fieldEditable)return t.field;case t.field:if(this._hasChilds())return t.expand;case t.expand:return t.menu;case t.menu:if(t.drag)return t.drag;default:return null}},a.prototype._nextElement=function(e){var t=this.dom;switch(e){case t.drag:return t.menu;case t.menu:if(this._hasChilds())return t.expand;case t.expand:if(this.fieldEditable)return t.field;case t.field:if(!this._hasChilds())return t.value;default:return null}},a.prototype._getElementName=function(e){var t=this.dom;for(var n in t)if(t.hasOwnProperty(n)&&t[n]==e)return n;return null},a.prototype._hasChilds=function(){return"array"==this.type||"object"==this.type},a.TYPE_TITLES={auto:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',object:'Field type "object". An object contains an unordered set of key/value pairs.',array:'Field type "array". An array contains an ordered collection of values.',string:'Field type "string". Field type is not determined from the value, but always returned as string.'},a.prototype.showContextMenu=function(e,t){var n=this,r=a.TYPE_TITLES,o=[];if(this.editable.value&&o.push({text:"Type",title:"Change the type of this field",className:"jsoneditor-type-"+this.type,submenu:[{text:"Auto",className:"jsoneditor-type-auto"+("auto"==this.type?" jsoneditor-selected":""),title:r.auto,click:function(){n._onChangeType("auto")}},{text:"Array",className:"jsoneditor-type-array"+("array"==this.type?" jsoneditor-selected":""),title:r.array,click:function(){n._onChangeType("array")}},{text:"Object",className:"jsoneditor-type-object"+("object"==this.type?" jsoneditor-selected":""),title:r.object,click:function(){n._onChangeType("object")}},{text:"String",className:"jsoneditor-type-string"+("string"==this.type?" jsoneditor-selected":""),title:r.string,click:function(){n._onChangeType("string")}}]}),this._hasChilds()){var s="asc"==this.sortOrder?"desc":"asc";o.push({text:"Sort",title:"Sort the childs of this "+this.type,className:"jsoneditor-sort-"+s,click:function(){n.sort(s)},submenu:[{text:"Ascending",className:"jsoneditor-sort-asc",title:"Sort the childs of this "+this.type+" in ascending order",click:function(){n.sort("asc")}},{text:"Descending",className:"jsoneditor-sort-desc",title:"Sort the childs of this "+this.type+" in descending order",click:function(){n.sort("desc")}}]})}if(this.parent&&this.parent._hasChilds()){o.length&&o.push({type:"separator"});var c=n.parent.childs;n==c[c.length-1]&&o.push({text:"Append",title:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"jsoneditor-append",click:function(){n._onAppend("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:r.auto,click:function(){n._onAppend("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:r.array,click:function(){n._onAppend("",[])}},{text:"Object",className:"jsoneditor-type-object",title:r.object,click:function(){n._onAppend("",{})}},{text:"String",className:"jsoneditor-type-string",title:r.string,click:function(){n._onAppend("","","string")}}]}),o.push({text:"Insert",title:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",submenuTitle:"Select the type of the field to be inserted",className:"jsoneditor-insert",click:function(){n._onInsertBefore("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:r.auto,click:function(){n._onInsertBefore("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:r.array,click:function(){n._onInsertBefore("",[])}},{text:"Object",className:"jsoneditor-type-object",title:r.object,click:function(){n._onInsertBefore("",{})}},{text:"String",className:"jsoneditor-type-string",title:r.string,click:function(){n._onInsertBefore("","","string")}}]}),this.editable.field&&(o.push({text:"Duplicate",title:"Duplicate this field (Ctrl+D)",className:"jsoneditor-duplicate",click:function(){a.onDuplicate(n)}}),o.push({text:"Remove",title:"Remove this field (Ctrl+Del)",className:"jsoneditor-remove",click:function(){a.onRemove(n)}}))}var l=new i(o,{close:t});l.show(e,this.editor.content)},a.prototype._getType=function(e){return e instanceof Array?"array":e instanceof Object?"object":"string"==typeof e&&"string"!=typeof this._stringCast(e)?"string":"auto"},a.prototype._stringCast=function(e){var t=e.toLowerCase(),n=Number(e),r=parseFloat(e);return""==e?"":"null"==t?null:"true"==t||"false"!=t&&(isNaN(n)||isNaN(r)?e:n)},a.prototype._escapeHTML=function(e){if("string"!==typeof e)return String(e);var t=String(e).replace(/&/g,"&").replace(//g,">").replace(/ /g,"  ").replace(/^ /," ").replace(/ $/," "),n=JSON.stringify(t),r=n.substring(1,n.length-1);return!0===this.editor.options.escapeUnicode&&(r=s.escapeUnicodeChars(r)),r},a.prototype._unescapeHTML=function(e){var t='"'+this._escapeJSON(e)+'"',n=s.parse(t);return n.replace(/</g,"<").replace(/>/g,">").replace(/ |\u00A0/g," ").replace(/&/g,"&")},a.prototype._escapeJSON=function(e){var t="",n=0;while(ng)return 1}for(var v=0,y=Math.max(f.length,p.length);vi)return 1}return 0}},function(e,t,n){"use strict";var r=n(4),i=n(7);function o(e){function t(e){this.editor=e,this.dom={}}return t.prototype=new e,t.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;this._updateEditability();var t=document.createElement("tr");if(t.node=this,e.tr=t,"tree"===this.editor.options.mode){e.tdDrag=document.createElement("td");var n=document.createElement("td");e.tdMenu=n;var r=document.createElement("button");r.type="button",r.className="jsoneditor-contextmenu",r.title="Click to open the actions menu (Ctrl+M)",e.menu=r,n.appendChild(e.menu)}var i=document.createElement("td"),o=document.createElement("div");return o.innerHTML="(empty)",o.className="jsoneditor-readonly",i.appendChild(o),e.td=i,e.text=o,this.updateDom(),t},t.prototype.updateDom=function(){var e=this.dom,t=e.td;t&&(t.style.paddingLeft=24*this.getLevel()+26+"px");var n=e.text;n&&(n.innerHTML="(empty "+this.parent.type+")");var r=e.tr;this.isVisible()?e.tr.firstChild||(e.tdDrag&&r.appendChild(e.tdDrag),e.tdMenu&&r.appendChild(e.tdMenu),r.appendChild(t)):e.tr.firstChild&&(e.tdDrag&&r.removeChild(e.tdDrag),e.tdMenu&&r.removeChild(e.tdMenu),r.removeChild(t))},t.prototype.isVisible=function(){return 0==this.parent.childs.length},t.prototype.showContextMenu=function(t,n){var r=this,o=e.TYPE_TITLES,s=[{text:"Append",title:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"jsoneditor-insert",click:function(){r._onAppend("","","auto")},submenu:[{text:"Auto",className:"jsoneditor-type-auto",title:o.auto,click:function(){r._onAppend("","","auto")}},{text:"Array",className:"jsoneditor-type-array",title:o.array,click:function(){r._onAppend("",[])}},{text:"Object",className:"jsoneditor-type-object",title:o.object,click:function(){r._onAppend("",{})}},{text:"String",className:"jsoneditor-type-string",title:o.string,click:function(){r._onAppend("","","string")}}]}],a=new i(s,{close:n});a.show(t,this.editor.content)},t.prototype.onEvent=function(e){var t=e.type,n=e.target||e.srcElement,i=this.dom,o=i.menu;if(n==o&&("mouseover"==t?this.editor.highlighter.highlight(this.parent):"mouseout"==t&&this.editor.highlighter.unhighlight()),"click"==t&&n==i.menu){var s=this.editor.highlighter;s.highlight(this.parent),s.lock(),r.addClassName(i.menu,"jsoneditor-selected"),this.showContextMenu(i.menu,(function(){r.removeClassName(i.menu,"jsoneditor-selected"),s.unlock(),s.unhighlight()}))}"keydown"==t&&this.onKeyDown(e)},t}e.exports=o},function(e,t,n){"use strict";var r=n(7);function i(e,t,n,i){for(var o={code:{text:"Code",title:"Switch to code highlighter",click:function(){i("code")}},form:{text:"Form",title:"Switch to form editor",click:function(){i("form")}},text:{text:"Text",title:"Switch to plain text editor",click:function(){i("text")}},tree:{text:"Tree",title:"Switch to tree editor",click:function(){i("tree")}},view:{text:"View",title:"Switch to tree view",click:function(){i("view")}}},s=[],a=0;a0){var i=n.length>a;if(i){n=n.slice(0,a);var s=this.validateSchema.errors.length-a;n.push("("+s+" more errors...)")}var c=document.createElement("div");c.innerHTML=''+n.map((function(e){var t;return t="string"===typeof e?'":"",''+t+""})).join("")+"
'+e+"
"+e.dataPath+""+e.message+"
",this.dom.validationErrors=c,this.frame.appendChild(c);var u=c.clientHeight;this.content.style.marginBottom=-u+"px",this.content.style.paddingBottom=u+"px"}if(this.aceEditor){var h=!1;this.aceEditor.resize(h)}},e.exports=[{mode:"text",mixin:s,data:"text",load:s.format},{mode:"code",mixin:s,data:"text",load:s.format}]},function(e,t,n){var r=n(!function(){var e=new Error('Cannot find module "brace"');throw e.code="MODULE_NOT_FOUND",e}());n(14),n(16),e.exports=r},function(e,t,n){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:'"',next:"start"},{token:"string",regex:"",next:"start"}]}};r.inherits(o,i),t.JsonHighlightRules=o})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var o=i[1].length,s=e.findMatchingBracket({row:t,column:o});if(!s||s.row==t)return 0;var a=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,o-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,n){"use strict";var r,i=e("../../lib/oop"),o=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),c=["text","paren.rparen","punctuation.operator"],l=["text","paren.rparen","punctuation.operator","comment"],u={},h=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,u.rangeCount!=e.multiSelect.rangeCount&&(u={rangeCount:e.multiSelect.rangeCount})),u[t])return r=u[t];r=u[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},d=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},f=function(){this.add("braces","insertion",(function(e,t,n,i,o){var s=n.getCursorPosition(),c=i.doc.getLine(s.row);if("{"==o){h(n);var l=n.getSelectionRange(),u=i.doc.getTextRange(l);if(""!==u&&"{"!==u&&n.getWrapBehavioursEnabled())return d(l,u,"{","}");if(f.isSaneInsertion(n,i))return/[\]\}\)]/.test(c[s.column])||n.inMultiSelectMode?(f.recordAutoInsert(n,i,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(n,i,"{"),{text:"{",selection:[1,1]})}else if("}"==o){h(n);var p=c.substring(s.column,s.column+1);if("}"==p){var m=i.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(null!==m&&f.isAutoInsertedClosing(s,c,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if("\n"==o||"\r\n"==o){h(n);var g="";f.isMaybeInsertedClosing(s,c)&&(g=a.stringRepeat("}",r.maybeInsertedBrackets),f.clearMaybeInsertedClosing());p=c.substring(s.column,s.column+1);if("}"===p){var v=i.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!v)return null;var y=this.$getIndent(i.getLine(v.row))}else{if(!g)return void f.clearMaybeInsertedClosing();y=this.$getIndent(c)}var w=y+i.getTabString();return{text:"\n"+w+"\n"+y+g,selection:[1,w.length,1,w.length]}}f.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,n,i,o){var s=i.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==s){h(n);var a=i.doc.getLine(o.start.row),c=a.substring(o.end.column,o.end.column+1);if("}"==c)return o.end.column++,o;r.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,n,r,i){if("("==i){h(n);var o=n.getSelectionRange(),s=r.doc.getTextRange(o);if(""!==s&&n.getWrapBehavioursEnabled())return d(o,s,"(",")");if(f.isSaneInsertion(n,r))return f.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){h(n);var a=n.getCursorPosition(),c=r.doc.getLine(a.row),l=c.substring(a.column,a.column+1);if(")"==l){var u=r.$findOpeningBracket(")",{column:a.column+1,row:a.row});if(null!==u&&f.isAutoInsertedClosing(a,c,i))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}})),this.add("parens","deletion",(function(e,t,n,r,i){var o=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==o){h(n);var s=r.doc.getLine(i.start.row),a=s.substring(i.start.column+1,i.start.column+2);if(")"==a)return i.end.column++,i}})),this.add("brackets","insertion",(function(e,t,n,r,i){if("["==i){h(n);var o=n.getSelectionRange(),s=r.doc.getTextRange(o);if(""!==s&&n.getWrapBehavioursEnabled())return d(o,s,"[","]");if(f.isSaneInsertion(n,r))return f.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){h(n);var a=n.getCursorPosition(),c=r.doc.getLine(a.row),l=c.substring(a.column,a.column+1);if("]"==l){var u=r.$findOpeningBracket("]",{column:a.column+1,row:a.row});if(null!==u&&f.isAutoInsertedClosing(a,c,i))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}})),this.add("brackets","deletion",(function(e,t,n,r,i){var o=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==o){h(n);var s=r.doc.getLine(i.start.row),a=s.substring(i.start.column+1,i.start.column+2);if("]"==a)return i.end.column++,i}})),this.add("string_dquotes","insertion",(function(e,t,n,r,i){if('"'==i||"'"==i){h(n);var o=i,s=n.getSelectionRange(),a=r.doc.getTextRange(s);if(""!==a&&"'"!==a&&'"'!=a&&n.getWrapBehavioursEnabled())return d(s,a,o,o);if(!a){var c=n.getCursorPosition(),l=r.doc.getLine(c.row),u=l.substring(c.column-1,c.column),f=l.substring(c.column,c.column+1),p=r.getTokenAt(c.row,c.column),m=r.getTokenAt(c.row,c.column+1);if("\\"==u&&p&&/escape/.test(p.type))return null;var g,v=p&&/string|escape/.test(p.type),y=!m||/string|escape/.test(m.type);if(f==o)g=v!==y;else{if(v&&!y)return null;if(v&&y)return null;var w=r.$mode.tokenRe;w.lastIndex=0;var b=w.test(u);w.lastIndex=0;var _=w.test(u);if(b||_)return null;if(f&&!/[\s;,.})\]\\]/.test(f))return null;g=!0}return{text:g?o+o:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,n,r,i){var o=r.doc.getTextRange(i);if(!i.isMultiLine()&&('"'==o||"'"==o)){h(n);var s=r.doc.getLine(i.start.row),a=s.substring(i.start.column+1,i.start.column+2);if(a==o)return i.end.column++,i}}))};f.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",c)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",c))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",l)},f.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},f.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),o=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,o,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+o.substr(i.column),r.autoInsertedBrackets++},f.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),o=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,o)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=o.substr(0,i.column)+n,r.maybeInsertedLineEnd=o.substr(i.column),r.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(f,o),t.CstyleBehaviour=f})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,o=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(s,o),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var o=i.match(this.foldingStartMarker);if(o){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}if("markbegin"!==t){o=i.match(this.foldingStopMarker);if(o){s=o.index+o[0].length;return o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),o=t,s=n.length;t+=1;var a=t,c=e.getLength();while(++tl)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=o)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}a=t}}return new i(o,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),o=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,c=1;while(++ns)return new i(s,r,u,t.length)}}.call(s.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,r){"use strict";var i=e("../lib/oop"),o=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,c=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,u=e("../worker/worker_client").WorkerClient,h=function(){this.HighlightRules=s,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new l};i.inherits(h,o),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if("start"==e){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],n(15),"JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/json"}.call(h.prototype),t.Mode=h}))},function(e,t){e.exports.id="ace/mode/json_worker",e.exports.src='"no use strict";(function(window){function resolveModuleId(id,paths){for(var testPath=id,tail="";testPath;){var alias=paths[testPath];if("string"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,"/")+(tail||alias.main||alias.name);if(alias===!1)return"";var i=testPath.lastIndexOf("/");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:"error",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf("!")){var chunks=moduleName.split("!");return window.normalizeModule(parentId,chunks[0])+"!"+window.normalizeModule(parentId,chunks[1])}if("."==moduleName.charAt(0)){var base=parentId.split("/").slice(0,-1).join("/");for(moduleName=(base?base+"/":"")+moduleName;-1!==moduleName.indexOf(".")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,"").replace(/\\/\\.\\//,"/").replace(/[^\\/]+\\/\\.\\.\\//,"")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error("worker.js acequire() accepts only (parentId, id) as arguments");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log("unable to load "+id);var path=resolveModuleId(id,window.acequire.tlns);return".js"!=path.slice(-3)&&(path+=".js"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,"string"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),"function"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=["require","exports","module"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case"require":return req;case"exports":return module.exports;case"module":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire("ace/lib/event_emitter").EventEmitter,oop=window.acequire("ace/lib/oop"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:"call",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:"event",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error("Unknown command:"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire("ace/lib/es5-shim"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}})(this),ace.define("ace/lib/oop",["require","exports","module"],function(acequire,exports){"use strict";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define("ace/range",["require","exports","module"],function(acequire,exports){"use strict";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){"object"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){"object"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define("ace/apply_delta",["require","exports","module"],function(acequire,exports){"use strict";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||"";switch(delta.action){case"insert":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case"remove":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(acequire,exports){"use strict";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){"object"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?"unshift":"push"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),EventEmitter=acequire("./lib/event_emitter").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.columnthis.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal("change",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),applyDelta=acequire("./apply_delta").applyDelta,EventEmitter=acequire("./lib/event_emitter").EventEmitter,Range=acequire("./range").Range,Anchor=acequire("./anchor").Anchor,Document=function(textOrLines){this.$lines=[""],0===textOrLines.length?this.$lines=[""]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0==="aaa".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,"\\n").split("\\n")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:"\\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\\r\\n";case"unix":return"\\n";default:return this.$autoNewLine||"\\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return"\\r\\n"==text||"\\r"==text||"\\n"==text},this.getLine=function(row){return this.$lines[row]||""},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||"").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."),this.insertMergedLines(position,["",""])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:"insert",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([""]),column=0):(lines=[""].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:"insert",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:"remove",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:"remove",lines:["",""]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert="insert"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal("change",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(""),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:"insert"==delta.action?"remove":"insert",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define("ace/lib/lang",["require","exports","module"],function(acequire,exports){"use strict";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split("").reverse().join("")},exports.stringRepeat=function(string,count){for(var result="";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,"")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,"")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&"object"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if("object"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}var cons=obj.constructor;if(cons===RegExp)return obj;copy=cons();for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,"\\\\$1")},exports.escapeHTML=function(str){return str.replace(/&/g,"&").replace(/"/g,""").replace(/\'/g,"'").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:"insert",start:data[i],lines:data[i+1]};else var d={action:"remove",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define("ace/mode/json/json_parse",["require","exports","module"],function(){"use strict";var at,ch,text,value,escapee={\'"\':\'"\',"\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:"\\n",r:"\\r",t:"\t"},error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error("Expected \'"+c+"\' instead of \'"+ch+"\'"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string="";for("-"===ch&&(string="-",next("-"));ch>="0"&&"9">=ch;)string+=ch,next();if("."===ch)for(string+=".";next()&&ch>="0"&&"9">=ch;)string+=ch;if("e"===ch||"E"===ch)for(string+=ch,next(),("-"===ch||"+"===ch)&&(string+=ch,next());ch>="0"&&"9">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error("Bad number"),void 0):number},string=function(){var hex,i,uffff,string="";if(\'"\'===ch)for(;next();){if(\'"\'===ch)return next(),string;if("\\\\"===ch)if(next(),"u"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if("string"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error("Bad string")},white=function(){for(;ch&&" ">=ch;)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected \'"+ch+"\'")},array=function(){var array=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),array;for(;ch;){if(array.push(value()),white(),"]"===ch)return next("]"),array;next(","),white()}}error("Bad array")},object=function(){var key,object={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),object;for(;ch;){if(key=string(),white(),next(":"),Object.hasOwnProperty.call(object,key)&&error(\'Duplicate key "\'+key+\'"\'),object[key]=value(),white(),"}"===ch)return next("}"),object;next(","),white()}}error("Bad object")};return value=function(){switch(white(),ch){case"{":return object();case"[":return array();case\'"\':return string();case"-":return number();default:return ch>="0"&&"9">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),"function"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&"object"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({"":result},""):result}}),ace.define("ace/mode/json_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/json/json_parse"],function(acequire,exports){"use strict";var oop=acequire("../lib/oop"),Mirror=acequire("../worker/mirror").Mirror,parse=acequire("./json/json_parse"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:"error"})}this.sender.emit("annotate",errors)}}.call(JsonWorker.prototype)}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,"sentinel",{}),"sentinel"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if("function"!=typeof target)throw new TypeError("Function.prototype.bind called on incompatible "+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,"__defineGetter__"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,"XXX"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0\n}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return"[object Array]"==_toString(obj)});var boxedString=Object("a"),splitString="a"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=[],thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError("reduceRight of empty array with no initial value")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(object,property){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if("object"!=typeof prototype)throw new TypeError("typeof prototype["+typeof prototype+"] != \'object\'");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom="undefined"==typeof document||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR="Property description must be an object: ",ERR_NON_OBJECT_TARGET="Object.defineProperty called on non-object: ",ERR_ACCESSORS_NOT_SUPPORTED="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(object,property,descriptor){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if("object"!=typeof descriptor&&"function"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,"value"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,"get")&&defineGetter(object,property,descriptor.get),owns(descriptor,"set")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return"function"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name="";owns(object,name);)name+="?";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError("Object.keys called on a non-object");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws="\t\\n\v\\f\\r   ᠎              \\u2028\\u2029\ufeff";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=RegExp("^"+ws+ws+"*"),trimEndRegexp=RegExp(ws+ws+"*$");String.prototype.trim=function(){return(this+"").replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}var toObject=function(o){if(null==o)throw new TypeError("can\'t convert "+o+" to object");return Object(o)}});'},function(e,t){ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],(function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),o=e("../lib/event"),s="\t.ace_search {\tbackground-color: #ddd;\tborder: 1px solid #cbcbcb;\tborder-top: 0 none;\tmax-width: 325px;\toverflow: hidden;\tmargin: 0;\tpadding: 4px;\tpadding-right: 6px;\tpadding-bottom: 0;\tposition: absolute;\ttop: 0px;\tz-index: 99;\twhite-space: normal;\t}\t.ace_search.left {\tborder-left: 0 none;\tborder-radius: 0px 0px 5px 0px;\tleft: 0;\t}\t.ace_search.right {\tborder-radius: 0px 0px 0px 5px;\tborder-right: 0 none;\tright: 0;\t}\t.ace_search_form, .ace_replace_form {\tborder-radius: 3px;\tborder: 1px solid #cbcbcb;\tfloat: left;\tmargin-bottom: 4px;\toverflow: hidden;\t}\t.ace_search_form.ace_nomatch {\toutline: 1px solid red;\t}\t.ace_search_field {\tbackground-color: white;\tborder-right: 1px solid #cbcbcb;\tborder: 0 none;\t-webkit-box-sizing: border-box;\t-moz-box-sizing: border-box;\tbox-sizing: border-box;\tfloat: left;\theight: 22px;\toutline: 0;\tpadding: 0 7px;\twidth: 214px;\tmargin: 0;\t}\t.ace_searchbtn,\t.ace_replacebtn {\tbackground: #fff;\tborder: 0 none;\tborder-left: 1px solid #dcdcdc;\tcursor: pointer;\tfloat: left;\theight: 22px;\tmargin: 0;\tposition: relative;\t}\t.ace_searchbtn:last-child,\t.ace_replacebtn:last-child {\tborder-top-right-radius: 3px;\tborder-bottom-right-radius: 3px;\t}\t.ace_searchbtn:disabled {\tbackground: none;\tcursor: default;\t}\t.ace_searchbtn {\tbackground-position: 50% 50%;\tbackground-repeat: no-repeat;\twidth: 27px;\t}\t.ace_searchbtn.prev {\tbackground-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \t}\t.ace_searchbtn.next {\tbackground-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \t}\t.ace_searchbtn_close {\tbackground: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\tborder-radius: 50%;\tborder: 0 none;\tcolor: #656565;\tcursor: pointer;\tfloat: right;\tfont: 16px/16px Arial;\theight: 14px;\tmargin: 5px 1px 9px 5px;\tpadding: 0;\ttext-align: center;\twidth: 14px;\t}\t.ace_searchbtn_close:hover {\tbackground-color: #656565;\tbackground-position: 50% 100%;\tcolor: white;\t}\t.ace_replacebtn.prev {\twidth: 54px\t}\t.ace_replacebtn.next {\twidth: 27px\t}\t.ace_button {\tmargin-left: 2px;\tcursor: pointer;\t-webkit-user-select: none;\t-moz-user-select: none;\t-o-user-select: none;\t-ms-user-select: none;\tuser-select: none;\toverflow: hidden;\topacity: 0.7;\tborder: 1px solid rgba(100,100,100,0.23);\tpadding: 1px;\t-moz-box-sizing: border-box;\tbox-sizing: border-box;\tcolor: black;\t}\t.ace_button:hover {\tbackground-color: #eee;\topacity:1;\t}\t.ace_button:active {\tbackground-color: #ddd;\t}\t.ace_button.checked {\tborder-color: #3399ff;\topacity:1;\t}\t.ace_search_options{\tmargin-bottom: 3px;\ttext-align: right;\t-webkit-user-select: none;\t-moz-user-select: none;\t-o-user-select: none;\t-ms-user-select: none;\tuser-select: none;\t}",a=e("../keyboard/hash_handler").HashHandler,c=e("../lib/keys");r.importCssString(s,"ace_searchbox");var l=''.replace(/>\s+/g,">"),u=function(e,t,n){var i=r.createElement("div");i.innerHTML=l,this.element=i.firstChild,this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.container.appendChild(this.element),this.editor=e},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOptions=e.querySelector(".ace_search_options"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;o.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),o.stopPropagation(e)})),o.addListener(e,"click",(function(e){var n=e.target||e.srcElement,r=n.getAttribute("action");r&&t[r]?t[r]():t.$searchBarKb.commands[r]&&t.$searchBarKb.commands[r].exec(t),o.stopPropagation(e)})),o.addCommandKeyListener(e,(function(e,n,r){var i=c.keyCodeToString(r),s=t.$searchBarKb.findKeyCommand(n,i);s&&s.exec&&(s.exec(t),o.stopEvent(e))})),this.$onChange=i.delayedCall((function(){t.find(!1,!1)})),o.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),o.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),o.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.replaceBox.style.display="",e.replaceInput.focus()},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout((function(){e.hide()}))},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}}]),this.$syncOptions=function(){r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.find(!1,!1)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n}),o=!i&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",o),this.editor._emit("findSearchBox",{match:!o}),this.highlight()},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),t=!e&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",t),this.editor._emit("findSearchBox",{match:!t}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.element.style.display="",this.replaceBox.style.display=t?"":"none",this.isReplace=t,e&&(this.searchInput.value=e),this.find(!1,!1,!0),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){var n=e.searchBox||new u(e);n.show(e.session.getTextRange(),t)}})),function(){ace.acequire(["ace/ext/searchbox"],(function(){}))}()},function(e,t){ace.define("ace/theme/jsoneditor",["require","exports","module","ace/lib/dom"],(function(e,t,n){t.isDark=!1,t.cssClass="ace-jsoneditor",t.cssText='.ace-jsoneditor .ace_gutter {\tbackground: #ebebeb;\tcolor: #333\t}\t\t.ace-jsoneditor.ace_editor {\tfont-family: droid sans mono, consolas, monospace, courier new, courier, sans-serif;\tline-height: 1.3;\t}\t.ace-jsoneditor .ace_print-margin {\twidth: 1px;\tbackground: #e8e8e8\t}\t.ace-jsoneditor .ace_scroller {\tbackground-color: #FFFFFF\t}\t.ace-jsoneditor .ace_text-layer {\tcolor: gray\t}\t.ace-jsoneditor .ace_variable {\tcolor: #1a1a1a\t}\t.ace-jsoneditor .ace_cursor {\tborder-left: 2px solid #000000\t}\t.ace-jsoneditor .ace_overwrite-cursors .ace_cursor {\tborder-left: 0px;\tborder-bottom: 1px solid #000000\t}\t.ace-jsoneditor .ace_marker-layer .ace_selection {\tbackground: lightgray\t}\t.ace-jsoneditor.ace_multiselect .ace_selection.ace_start {\tbox-shadow: 0 0 3px 0px #FFFFFF;\tborder-radius: 2px\t}\t.ace-jsoneditor .ace_marker-layer .ace_step {\tbackground: rgb(255, 255, 0)\t}\t.ace-jsoneditor .ace_marker-layer .ace_bracket {\tmargin: -1px 0 0 -1px;\tborder: 1px solid #BFBFBF\t}\t.ace-jsoneditor .ace_marker-layer .ace_active-line {\tbackground: #FFFBD1\t}\t.ace-jsoneditor .ace_gutter-active-line {\tbackground-color : #dcdcdc\t}\t.ace-jsoneditor .ace_marker-layer .ace_selected-word {\tborder: 1px solid lightgray\t}\t.ace-jsoneditor .ace_invisible {\tcolor: #BFBFBF\t}\t.ace-jsoneditor .ace_keyword,\t.ace-jsoneditor .ace_meta,\t.ace-jsoneditor .ace_support.ace_constant.ace_property-value {\tcolor: #AF956F\t}\t.ace-jsoneditor .ace_keyword.ace_operator {\tcolor: #484848\t}\t.ace-jsoneditor .ace_keyword.ace_other.ace_unit {\tcolor: #96DC5F\t}\t.ace-jsoneditor .ace_constant.ace_language {\tcolor: darkorange\t}\t.ace-jsoneditor .ace_constant.ace_numeric {\tcolor: red\t}\t.ace-jsoneditor .ace_constant.ace_character.ace_entity {\tcolor: #BF78CC\t}\t.ace-jsoneditor .ace_invalid {\tcolor: #FFFFFF;\tbackground-color: #FF002A;\t}\t.ace-jsoneditor .ace_fold {\tbackground-color: #AF956F;\tborder-color: #000000\t}\t.ace-jsoneditor .ace_storage,\t.ace-jsoneditor .ace_support.ace_class,\t.ace-jsoneditor .ace_support.ace_function,\t.ace-jsoneditor .ace_support.ace_other,\t.ace-jsoneditor .ace_support.ace_type {\tcolor: #C52727\t}\t.ace-jsoneditor .ace_string {\tcolor: green\t}\t.ace-jsoneditor .ace_comment {\tcolor: #BCC8BA\t}\t.ace-jsoneditor .ace_entity.ace_name.ace_tag,\t.ace-jsoneditor .ace_entity.ace_other.ace_attribute-name {\tcolor: #606060\t}\t.ace-jsoneditor .ace_markup.ace_underline {\ttext-decoration: underline\t}\t.ace-jsoneditor .ace_indent-guide {\tbackground: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y\t}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}))}])}))}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-e25b23da.cd797eb1.js b/hippo4j-console/src/main/resources/static/static/js/chunk-e25b23da.cd797eb1.js new file mode 100644 index 00000000..b1bc3540 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-e25b23da.cd797eb1.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e25b23da"],{"333d":function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[n("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},a=[];n("c5f6");Math.easeInOutQuad=function(e,t,n,i){return e/=i/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var l=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function r(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(e,t,n){var i=o(),a=e-i,s=20,u=0;t="undefined"===typeof t?500:t;var c=function e(){u+=s;var o=Math.easeInOutQuad(u,i,a,t);r(o),u0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.current,limit:e.listQuery.size},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:e.fetchData}}),e._v(" "),n("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,width:"800px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[n("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"100px"}},[n("el-form-item",{attrs:{label:"租户ID",prop:"tenantId"}},[n("el-select",{staticClass:"filter-item",staticStyle:{width:"40%"},attrs:{placeholder:"租户ID",filterable:"",clearable:"",disabled:"create"!==e.dialogStatus},model:{value:e.temp.tenantId,callback:function(t){e.$set(e.temp,"tenantId",t)},expression:"temp.tenantId"}},e._l(e.tenantOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"项目ID",prop:"itemId"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{disabled:"create"!==e.dialogStatus,placeholder:"项目ID"},model:{value:e.temp.itemId,callback:function(t){e.$set(e.temp,"itemId",t)},expression:"temp.itemId"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"项目名称",prop:"itemName"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"项目名称"},model:{value:e.temp.itemName,callback:function(t){e.$set(e.temp,"itemName",t)},expression:"temp.itemName"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"OWNER",prop:"owner"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{placeholder:"OWNER"},model:{value:e.temp.owner,callback:function(t){e.$set(e.temp,"owner",t)},expression:"temp.owner"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"项目描述",prop:"itemDesc"}},[n("el-input",{staticStyle:{width:"40%"},attrs:{autosize:{minRows:3,maxRows:6},type:"textarea",placeholder:"项目描述"},model:{value:e.temp.itemDesc,callback:function(t){e.$set(e.temp,"itemDesc",t)},expression:"temp.itemDesc"}})],1)],1),e._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v("\n 确认\n ")])],1)],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogPluginVisible,title:"Reading statistics"},on:{"update:visible":function(t){e.dialogPluginVisible=t}}},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.pluginData,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{prop:"key",label:"Channel"}}),e._v(" "),n("el-table-column",{attrs:{prop:"pv",label:"Pv"}})],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dialogPvVisible=!1}}},[e._v("Confirm")])],1)],1)],1)},a=[],l=n("3737"),r=n("dd71"),o=n("6724"),s=n("333d"),u={name:"JobProject",components:{Pagination:s["a"]},directives:{waves:o["a"]},filters:{statusFilter:function(e){var t={published:"success",draft:"gray",deleted:"danger"};return t[e]},ellipsis:function(e){return e?e.length>26?e.slice(0,26)+"...":e:""}},data:function(){return{list:null,listLoading:!0,total:0,listQuery:{current:1,size:10,itemId:""},pluginTypeOptions:["reader","writer"],dialogPluginVisible:!1,pluginData:[],dialogFormVisible:!1,tenantOptions:[],dialogStatus:"",isEditDisabled:!1,textMap:{update:"Edit",create:"Create"},rules:{tenantId:[{required:!0,message:"this is required",trigger:"blur"}],itemId:[{required:!0,message:"this is required",trigger:"blur"}],itemName:[{required:!0,message:"this is required",trigger:"blur"}],owner:[{required:!0,message:"this is required",trigger:"blur"}],itemDesc:[{required:!0,message:"this is required",trigger:"blur"}]},temp:{id:void 0,tenantId:"",tenantName:"",owner:"",tenantDesc:""},visible:!0}},created:function(){this.fetchData(),this.initSelect()},mounted:function(){this.isEditDisabled="admin"!==this.$cookie.get("userName")},methods:{fetchData:function(){var e=this;this.listLoading=!0,l["c"](this.listQuery).then((function(t){var n=t.records,i=t.total;e.total=i,e.list=n,e.listLoading=!1}))},initSelect:function(){var e=this;r["c"]({}).then((function(t){for(var n=t.records,i=0;i0&&(this.timeoutPending=setTimeout((function(){e.showPopper=!1}),this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,i=0;il&&(e.scrollTop=a-e.clientHeight)}else e.scrollTop=0}},"2bb5":function(e,t,i){"use strict";t.__esModule=!0;i("8122");t.default={mounted:function(){},methods:{getMigratingConfig:function(){return{props:{},events:{}}}}}},4010:function(e,t,i){"use strict";t.__esModule=!0,t.removeResizeListener=t.addResizeListener=void 0;var n=i("6dd8"),s=a(n),r=i("9619");function a(e){return e&&e.__esModule?e:{default:e}}var o="undefined"===typeof window,l=function(e){var t=e,i=Array.isArray(t),n=0;for(t=i?t:t[Symbol.iterator]();;){var s;if(i){if(n>=t.length)break;s=t[n++]}else{if(n=t.next(),n.done)break;s=n.value}var r=s,a=r.target.__resizeListeners__||[];a.length&&a.forEach((function(e){e()}))}};t.addResizeListener=function(e,t){o||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new s.default((0,r.debounce)(16,l)),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},t.removeResizeListener=function(e,t){e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||e.__ro__.disconnect())}},"417f":function(e,t,i){"use strict";t.__esModule=!0;var n=i("2b0e"),s=a(n),r=i("5924");function a(e){return e&&e.__esModule?e:{default:e}}var o=[],l="@@clickoutsideContext",c=void 0,u=0;function h(e,t,i){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(i&&i.context&&n.target&&s.target)||e.contains(n.target)||e.contains(s.target)||e===n.target||i.context.popperElm&&(i.context.popperElm.contains(n.target)||i.context.popperElm.contains(s.target))||(t.expression&&e[l].methodName&&i.context[e[l].methodName]?i.context[e[l].methodName]():e[l].bindingFn&&e[l].bindingFn())}}!s.default.prototype.$isServer&&(0,r.on)(document,"mousedown",(function(e){return c=e})),!s.default.prototype.$isServer&&(0,r.on)(document,"mouseup",(function(e){o.forEach((function(t){return t[l].documentHandler(e,c)}))})),t.default={bind:function(e,t,i){o.push(e);var n=u++;e[l]={id:n,documentHandler:h(e,t,i),methodName:t.expression,bindingFn:t.value}},update:function(e,t,i){e[l].documentHandler=h(e,t,i),e[l].methodName=t.expression,e[l].bindingFn=t.value},unbind:function(e){for(var t=o.length,i=0;i\n \n '}else i||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var e=this.$refs.hoverZone;e&&(e.innerHTML="")},renderEmptyText:function(e){return e("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(e){var t=this.menuId,i=this.panel.isHoverMenu,n={on:{}};i&&(n.on.expand=this.handleExpand);var s=this.nodes.map((function(i,s){var r=i.hasChildren;return e("cascader-node",l()([{key:i.uid,attrs:{node:i,"node-id":t+"-"+s,"aria-haspopup":r,"aria-owns":r?t:null}},n]))}));return[].concat(s,[i?e("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(e){var t=this.isEmpty,i=this.menuId,n={nativeOn:{}};return this.panel.isHoverMenu&&(n.nativeOn.mousemove=this.handleMouseMove),e("el-scrollbar",l()([{attrs:{tag:"ul",role:"menu",id:i,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":t}},class:"el-cascader-menu"},n]),[t?this.renderEmptyText(e):this.renderNodeList(e)])}},$=D,O=Object(y["a"])($,x,C,!1,null,null,null);O.options.__file="packages/cascader-panel/src/cascader-menu.vue";var E=O.exports,T=i(21),P=function(){function e(e,t){for(var i=0;i1?t-1:0),n=1;n1?n-1:0),r=1;r0},e.prototype.syncCheckState=function(e){var t=this.getValueByOption(),i=this.isSameNode(e,t);this.doCheck(i)},e.prototype.doCheck=function(e){this.checked!==e&&(this.config.checkStrictly?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check")))},P(e,[{key:"isDisabled",get:function(){var e=this.data,t=this.parent,i=this.config,n=i.disabled,s=i.checkStrictly;return e[n]||!s&&t&&t.isDisabled}},{key:"isLeaf",get:function(){var e=this.data,t=this.loaded,i=this.hasChildren,n=this.children,s=this.config,r=s.lazy,a=s.leaf;if(r){var o=Object(T["isDef"])(e[a])?e[a]:!!t&&!n.length;return this.hasChildren=!o,o}return!i}}]),e}(),j=I;function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var L=function e(t,i){return t.reduce((function(t,n){return n.isLeaf?t.push(n):(!i&&t.push(n),t=t.concat(e(n.children,i))),t}),[])},A=function(){function e(t,i){F(this,e),this.config=i,this.initNodes(t)}return e.prototype.initNodes=function(e){var t=this;e=Object(m["coerceTruthyValueToArray"])(e),this.nodes=e.map((function(e){return new j(e,t.config)})),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},e.prototype.appendNode=function(e,t){var i=new j(e,this.config,t),n=t?t.children:this.nodes;n.push(i)},e.prototype.appendNodes=function(e,t){var i=this;e=Object(m["coerceTruthyValueToArray"])(e),e.forEach((function(e){return i.appendNode(e,t)}))},e.prototype.getNodes=function(){return this.nodes},e.prototype.getFlattedNodes=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e?this.leafNodes:this.flattedNodes;return t?i:L(this.nodes,e)},e.prototype.getNodeByValue=function(e){var t=this.getFlattedNodes(!1,!this.config.lazy).filter((function(t){return Object(m["valueEquals"])(t.path,e)||t.value===e}));return t&&t.length?t[0]:null},e}(),V=A,B=i(9),z=i.n(B),R=i(40),H=i.n(R),W=i(31),q=i.n(W),Y=Object.assign||function(e){for(var t=1;t0){var l=i.store.getNodeByValue(r);l.data[o]||i.lazyLoad(l,(function(){i.handleExpand(l)})),i.loadCount===i.checkedValue.length&&i.$parent.computePresentText()}}t&&t(n)};n.lazyLoad(e,s)},calculateMultiCheckedValue:function(){this.checkedValue=this.getCheckedNodes(this.leafOnly).map((function(e){return e.getValueByOption()}))},scrollIntoView:function(){if(!this.$isServer){var e=this.$refs.menu||[];e.forEach((function(e){var t=e.$el;if(t){var i=t.querySelector(".el-scrollbar__wrap"),n=t.querySelector(".el-cascader-node.is-active")||t.querySelector(".el-cascader-node.in-active-path");q()(i,n)}}))}},getNodeByValue:function(e){return this.store.getNodeByValue(e)},getFlattedNodes:function(e){var t=!this.config.lazy;return this.store.getFlattedNodes(e,t)},getCheckedNodes:function(e){var t=this.checkedValue,i=this.multiple;if(i){var n=this.getFlattedNodes(e);return n.filter((function(e){return e.checked}))}return this.isEmptyValue(t)?[]:[this.getNodeByValue(t)]},clearCheckedNodes:function(){var e=this.config,t=this.leafOnly,i=e.multiple,n=e.emitPath;i?(this.getCheckedNodes(t).filter((function(e){return!e.isDisabled})).forEach((function(e){return e.doCheck(!1)})),this.calculateMultiCheckedValue()):this.checkedValue=n?[]:null}}},te=ee,ie=Object(y["a"])(te,n,s,!1,null,null,null);ie.options.__file="packages/cascader-panel/src/cascader-panel.vue";var ne=ie.exports;ne.install=function(e){e.component(ne.name,ne)};t["default"]=ne},6:function(e,t){e.exports=i("6b7c")},9:function(e,t){e.exports=i("7f4d")}})},4897:function(e,t,i){"use strict";t.__esModule=!0,t.i18n=t.use=t.t=void 0;var n=i("f0d9"),s=h(n),r=i("2b0e"),a=h(r),o=i("3c4e"),l=h(o),c=i("9d7e"),u=h(c);function h(e){return e&&e.__esModule?e:{default:e}}var d=(0,u.default)(a.default),p=s.default,f=!1,m=function(){var e=Object.getPrototypeOf(this||a.default).$t;if("function"===typeof e&&a.default.locale)return f||(f=!0,a.default.locale(a.default.config.lang,(0,l.default)(p,a.default.locale(a.default.config.lang)||{},{clone:!0}))),e.apply(this,arguments)},v=t.t=function(e,t){var i=m.apply(this,arguments);if(null!==i&&void 0!==i)return i;for(var n=e.split("."),s=p,r=0,a=n.length;r0){var n=t[t.length-1];if(n.id===e){if(n.modalClass){var s=n.modalClass.trim().split(/\s+/);s.forEach((function(e){return(0,r.removeClass)(i,e)}))}t.pop(),t.length>0&&(i.style.zIndex=t[t.length-1].zIndex)}else for(var a=t.length-1;a>=0;a--)if(t[a].id===e){t.splice(a,1);break}}0===t.length&&(this.modalFade&&(0,r.addClass)(i,"v-modal-leave"),setTimeout((function(){0===t.length&&(i.parentNode&&i.parentNode.removeChild(i),i.style.display="none",d.modalDom=void 0),(0,r.removeClass)(i,"v-modal-leave")}),200))}};Object.defineProperty(d,"zIndex",{configurable:!0,get:function(){return l||(c=c||(s.default.prototype.$ELEMENT||{}).zIndex||2e3,l=!0),c},set:function(e){c=e}});var p=function(){if(!s.default.prototype.$isServer&&d.modalStack.length>0){var e=d.modalStack[d.modalStack.length-1];if(!e)return;var t=d.getInstance(e.id);return t}};s.default.prototype.$isServer||window.addEventListener("keydown",(function(e){if(27===e.keyCode){var t=p();t&&t.closeOnPressEscape&&(t.handleClose?t.handleClose():t.handleAction?t.handleAction("cancel"):t.close())}})),t.default=d},"4e4b":function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=61)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},10:function(e,t){e.exports=i("f3ad")},12:function(e,t){e.exports=i("417f")},15:function(e,t){e.exports=i("14e9")},16:function(e,t){e.exports=i("4010")},18:function(e,t){e.exports=i("0e15")},21:function(e,t){e.exports=i("d397")},22:function(e,t){e.exports=i("12f2")},3:function(e,t){e.exports=i("8122")},31:function(e,t){e.exports=i("2a5e")},33:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){return t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[i("span",[e._v(e._s(e.currentLabel))])])],2)},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o=i(3),l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c={mixins:[a.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var i=this.select,n=i.remote,s=i.valueKey;if(!this.created&&!n){if(s&&"object"===("undefined"===typeof e?"undefined":l(e))&&"object"===("undefined"===typeof t?"undefined":l(t))&&e[s]===t[s])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var i=this.select.valueKey;return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var i=this.select.valueKey;return e&&e.some((function(e){return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)}))}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(o["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var e=this.select,t=e.selected,i=e.multiple,n=i?t:[t],s=this.select.cachedOptions.indexOf(this),r=n.indexOf(this);s>-1&&r<0&&this.select.cachedOptions.splice(s,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},u=c,h=i(0),d=Object(h["a"])(u,n,s,!1,null,null,null);d.options.__file="packages/select/src/option.vue";t["a"]=d.exports},37:function(e,t){e.exports=i("8bbc")},4:function(e,t){e.exports=i("d010")},5:function(e,t){e.exports=i("e974")},6:function(e,t){e.exports=i("6b7c")},61:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""],on:{click:function(t){return t.stopPropagation(),e.toggleMenu(t)}}},[e.multiple?i("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px",width:"100%"}},[e.collapseTags&&e.selected.length?i("span",[i("el-tag",{attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?i("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[i("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():i("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,(function(t){return i("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(i){e.deleteTag(i,t)}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])})),1),e.filterable?i("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{"flex-grow":"1",width:e.inputLength/(e.inputWidth-32)+"%","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.selectDisabled,autocomplete:e.autoComplete||e.autocomplete},domProps:{value:e.query},on:{focus:e.handleFocus,blur:function(t){e.softFocus=!1},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.handleNavigate("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.handleNavigate("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){return!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.deletePrevTag(t)},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition,input:[function(t){t.target.composing||(e.query=t.target.value)},e.debouncedQueryChange]}}):e._e()],1):e._e(),i("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,autocomplete:e.autoComplete||e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,tabindex:e.multiple&&e.filterable?"-1":null},on:{focus:e.handleFocus,blur:e.handleBlur,input:e.debouncedOnInputChange,compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition},nativeOn:{keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.handleNavigate("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.handleNavigate("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[e.$slots.prefix?i("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),i("template",{slot:"suffix"},[i("i",{directives:[{name:"show",rawName:"v-show",value:!e.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass]}),e.showClose?i("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:e.handleClearClick}}):e._e()])],2),i("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[i("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":e.popperAppendToBody}},[i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?i("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.length)?[e.$slots.empty?e._t("empty"):i("p",{staticClass:"el-select-dropdown__empty"},[e._v("\n "+e._s(e.emptyText)+"\n ")])]:e._e()],2)],1)],1)},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o=i(22),l=i.n(o),c=i(6),u=i.n(c),h=i(10),d=i.n(h),p=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":e.$parent.multiple},e.popperClass],style:{minWidth:e.minWidth}},[e._t("default")],2)},f=[];p._withStripped=!0;var m=i(5),v=i.n(m),g={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[v.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",(function(){e.$parent.visible&&e.updatePopper()})),this.$on("destroyPopper",this.destroyPopper)}},b=g,y=i(0),_=Object(y["a"])(b,p,f,!1,null,null,null);_.options.__file="packages/select/src/select-dropdown.vue";var x=_.exports,C=i(33),w=i(37),k=i.n(w),S=i(15),D=i.n(S),$=i(18),O=i.n($),E=i(12),T=i.n(E),P=i(16),M=i(31),N=i.n(M),I=i(3),j={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter((function(e){return e.visible})).every((function(e){return e.disabled}))}},watch:{hoverIndex:function(e){var t=this;"number"===typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach((function(e){e.hover=t.hoverOption===e}))}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var i=this.options[this.hoverIndex];!0!==i.disabled&&!0!==i.groupDisabled&&i.visible||this.navigateOptions(e),this.$nextTick((function(){return t.scrollToOption(t.hoverOption)}))}}else this.visible=!0}}},F=i(21),L={mixins:[a.a,u.a,l()("reference"),j],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(I["isIE"])()&&!Object(I["isEdge"])()&&!this.visible},showClose:function(){var e=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value,t=this.clearable&&!this.selectDisabled&&this.inputHovering&&e;return t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter((function(e){return!e.created})).some((function(t){return t.currentLabel===e.query}));return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"},propPlaceholder:function(){return"undefined"!==typeof this.placeholder?this.placeholder:this.t("el.select.placeholder")}},components:{ElInput:d.a,ElSelectMenu:x,ElOption:C["a"],ElTag:k.a,ElScrollbar:D.a},directives:{Clickoutside:T.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,required:!1},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var e=this;this.$nextTick((function(){e.resetInputHeight()}))},propPlaceholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e,t){this.multiple&&(this.resetInputHeight(),e&&e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(I["valueEquals"])(e,t)||this.dispatch("ElFormItem","el.form.change",e)},visible:function(e){var t=this;e?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick((function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)})),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",e)},options:function(){var e=this;if(!this.$isServer){this.$nextTick((function(){e.broadcast("ElSelectDropdown","updatePopper")})),this.multiple&&this.resetInputHeight();var t=this.$el.querySelectorAll("input");-1===[].indexOf.call(t,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleNavigate:function(e){this.isOnComposition||this.navigateOptions(e)},handleComposition:function(e){var t=this,i=e.target.value;if("compositionend"===e.type)this.isOnComposition=!1,this.$nextTick((function(e){return t.handleQueryChange(i)}));else{var n=i[i.length-1]||"";this.isOnComposition=!Object(F["isKorean"])(n)}},handleQueryChange:function(e){var t=this;this.previousQuery===e||this.isOnComposition||(null!==this.previousQuery||"function"!==typeof this.filterMethod&&"function"!==typeof this.remoteMethod?(this.previousQuery=e,this.$nextTick((function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")})),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick((function(){var e=15*t.$refs.input.value.length+20;t.inputLength=t.collapseTags?Math.min(50,e):e,t.managePlaceholder(),t.resetInputHeight()})),this.remote&&"function"===typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"===typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=e)},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var i=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");N()(i,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick((function(){return e.scrollToOption(e.selected)}))},emitChange:function(e){Object(I["valueEquals"])(this.value,e)||this.$emit("change",e)},getOption:function(e){for(var t=void 0,i="[object object]"===Object.prototype.toString.call(e).toLowerCase(),n="[object null]"===Object.prototype.toString.call(e).toLowerCase(),s="[object undefined]"===Object.prototype.toString.call(e).toLowerCase(),r=this.cachedOptions.length-1;r>=0;r--){var a=this.cachedOptions[r],o=i?Object(I["getValueByPath"])(a.value,this.valueKey)===Object(I["getValueByPath"])(e,this.valueKey):a.value===e;if(o){t=a;break}}if(t)return t;var l=i||n||s?"":String(e),c={value:e,currentLabel:l};return this.multiple&&(c.hitState=!1),c},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var i=[];Array.isArray(this.value)&&this.value.forEach((function(t){i.push(e.getOption(t))})),this.selected=i,this.$nextTick((function(){e.resetInputHeight()}))},handleFocus:function(e){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.filterable&&!this.visible&&(this.menuVisibleOnFocus=!0),this.visible=!0),this.$emit("focus",e))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(e){var t=this;setTimeout((function(){t.isSilentBlur?t.isSilentBlur=!1:t.$emit("blur",e)}),50),this.softFocus=!1},handleClearClick:function(e){this.deleteSelected(e)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags&&!this.filterable||this.$nextTick((function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,i=[].filter.call(t,(function(e){return"INPUT"===e.tagName}))[0],n=e.$refs.tags,s=n?Math.round(n.getBoundingClientRect().height):0,r=e.initialInputHeight||40;i.style.height=0===e.selected.length?r+"px":Math.max(n?s+(s>r?6:0):0,r)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}}))},resetHoverIndex:function(){var e=this;setTimeout((function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map((function(t){return e.options.indexOf(t)}))):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)}),300)},handleOptionSelect:function(e,t){var i=this;if(this.multiple){var n=(this.value||[]).slice(),s=this.getValueIndex(n,e.value);s>-1?n.splice(s,1):(this.multipleLimit<=0||n.length0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],i="[object object]"===Object.prototype.toString.call(t).toLowerCase();if(i){var n=this.valueKey,s=-1;return e.some((function(e,i){return Object(I["getValueByPath"])(e,n)===Object(I["getValueByPath"])(t,n)&&(s=i,!0)})),s}return e.indexOf(t)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(e){e.stopPropagation();var t=this.multiple?[]:"";this.$emit("input",t),this.emitChange(t),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var i=this.selected.indexOf(t);if(i>-1&&!this.selectDisabled){var n=this.value.slice();n.splice(i,1),this.$emit("input",n),this.emitChange(n),this.$emit("remove-tag",t.value)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var i=0;i!==this.options.length;++i){var n=this.options[i];if(this.query){if(!n.disabled&&!n.groupDisabled&&n.visible){this.hoverIndex=i;break}}else if(n.itemSelected){this.hoverIndex=i;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:Object(I["getValueByPath"])(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.propPlaceholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=O()(this.debounce,(function(){e.onInputChange()})),this.debouncedQueryChange=O()(this.debounce,(function(t){e.handleQueryChange(t.target.value)})),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(P["addResizeListener"])(this.$el,this.handleResize);var t=this.$refs.reference;if(t&&t.$el){var i={medium:36,small:32,mini:28},n=t.$el.querySelector("input");this.initialInputHeight=n.getBoundingClientRect().height||i[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick((function(){t&&t.$el&&(e.inputWidth=t.$el.getBoundingClientRect().width)})),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(P["removeResizeListener"])(this.$el,this.handleResize)}},A=L,V=Object(y["a"])(A,n,s,!1,null,null,null);V.options.__file="packages/select/src/select.vue";var B=V.exports;B.install=function(e){e.component(B.name,B)};t["default"]=B}})},5128:function(e,t,i){"use strict";t.__esModule=!0,t.PopupManager=void 0;var n=i("2b0e"),s=d(n),r=i("7f4d"),a=d(r),o=i("4b26"),l=d(o),c=i("e62d"),u=d(c),h=i("5924");function d(e){return e&&e.__esModule?e:{default:e}}var p=1,f=void 0;t.default={props:{visible:{type:Boolean,default:!1},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},beforeMount:function(){this._popupId="popup-"+p++,l.default.register(this._popupId,this)},beforeDestroy:function(){l.default.deregister(this._popupId),l.default.closeModal(this._popupId),this.restoreBodyStyle()},data:function(){return{opened:!1,bodyPaddingRight:null,computedBodyPaddingRight:0,withoutHiddenClass:!0,rendered:!1}},watch:{visible:function(e){var t=this;if(e){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,s.default.nextTick((function(){t.open()})))}else this.close()}},methods:{open:function(e){var t=this;this.rendered||(this.rendered=!0);var i=(0,a.default)({},this.$props||this,e);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var n=Number(i.openDelay);n>0?this._openTimer=setTimeout((function(){t._openTimer=null,t.doOpen(i)}),n):this.doOpen(i)},doOpen:function(e){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var t=this.$el,i=e.modal,n=e.zIndex;if(n&&(l.default.zIndex=n),i&&(this._closing&&(l.default.closeModal(this._popupId),this._closing=!1),l.default.openModal(this._popupId,l.default.nextZIndex(),this.modalAppendToBody?void 0:t,e.modalClass,e.modalFade),e.lockScroll)){this.withoutHiddenClass=!(0,h.hasClass)(document.body,"el-popup-parent--hidden"),this.withoutHiddenClass&&(this.bodyPaddingRight=document.body.style.paddingRight,this.computedBodyPaddingRight=parseInt((0,h.getStyle)(document.body,"paddingRight"),10)),f=(0,u.default)();var s=document.documentElement.clientHeight0&&(s||"scroll"===r)&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.computedBodyPaddingRight+f+"px"),(0,h.addClass)(document.body,"el-popup-parent--hidden")}"static"===getComputedStyle(t).position&&(t.style.position="absolute"),t.style.zIndex=l.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var e=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var t=Number(this.closeDelay);t>0?this._closeTimer=setTimeout((function(){e._closeTimer=null,e.doClose()}),t):this.doClose()}},doClose:function(){this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose()},doAfterClose:function(){l.default.closeModal(this._popupId),this._closing=!1},restoreBodyStyle:function(){this.modal&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.bodyPaddingRight,(0,h.removeClass)(document.body,"el-popup-parent--hidden")),this.withoutHiddenClass=!0}}},t.PopupManager=l.default},5488:function(e,t,i){"use strict";t.__esModule=!0;var n=i("5924");function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(){s(this,e)}return e.prototype.beforeEnter=function(e){(0,n.addClass)(e,"collapse-transition"),e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.style.height="0",e.style.paddingTop=0,e.style.paddingBottom=0},e.prototype.enter=function(e){e.dataset.oldOverflow=e.style.overflow,0!==e.scrollHeight?(e.style.height=e.scrollHeight+"px",e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom):(e.style.height="",e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom),e.style.overflow="hidden"},e.prototype.afterEnter=function(e){(0,n.removeClass)(e,"collapse-transition"),e.style.height="",e.style.overflow=e.dataset.oldOverflow},e.prototype.beforeLeave=function(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.height=e.scrollHeight+"px",e.style.overflow="hidden"},e.prototype.leave=function(e){0!==e.scrollHeight&&((0,n.addClass)(e,"collapse-transition"),e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0)},e.prototype.afterLeave=function(e){(0,n.removeClass)(e,"collapse-transition"),e.style.height="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom},e}();t.default={name:"ElCollapseTransition",functional:!0,render:function(e,t){var i=t.children,n={on:new r};return e("transition",n,i)}}},5924:function(e,t,i){"use strict";t.__esModule=!0,t.isInContainer=t.getScrollContainer=t.isScroll=t.getStyle=t.once=t.off=t.on=void 0;var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.hasClass=m,t.addClass=v,t.removeClass=g,t.setStyle=y;var s=i("2b0e"),r=a(s);function a(e){return e&&e.__esModule?e:{default:e}}var o=r.default.prototype.$isServer,l=/([\:\-\_]+(.))/g,c=/^moz([A-Z])/,u=o?0:Number(document.documentMode),h=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},d=function(e){return e.replace(l,(function(e,t,i,n){return n?i.toUpperCase():i})).replace(c,"Moz$1")},p=t.on=function(){return!o&&document.addEventListener?function(e,t,i){e&&t&&i&&e.addEventListener(t,i,!1)}:function(e,t,i){e&&t&&i&&e.attachEvent("on"+t,i)}}(),f=t.off=function(){return!o&&document.removeEventListener?function(e,t,i){e&&t&&e.removeEventListener(t,i,!1)}:function(e,t,i){e&&t&&e.detachEvent("on"+t,i)}}();t.once=function(e,t,i){var n=function n(){i&&i.apply(this,arguments),f(e,t,n)};p(e,t,n)};function m(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}function v(e,t){if(e){for(var i=e.className,n=(t||"").split(" "),s=0,r=n.length;sn.top&&i.right>n.left&&i.left0?i("li",{staticClass:"number",class:{active:1===e.currentPage,disabled:e.disabled}},[e._v("1")]):e._e(),e.showPrevMore?i("li",{staticClass:"el-icon more btn-quickprev",class:[e.quickprevIconClass,{disabled:e.disabled}],on:{mouseenter:function(t){e.onMouseenter("left")},mouseleave:function(t){e.quickprevIconClass="el-icon-more"}}}):e._e(),e._l(e.pagers,(function(t){return i("li",{key:t,staticClass:"number",class:{active:e.currentPage===t,disabled:e.disabled}},[e._v(e._s(t))])})),e.showNextMore?i("li",{staticClass:"el-icon more btn-quicknext",class:[e.quicknextIconClass,{disabled:e.disabled}],on:{mouseenter:function(t){e.onMouseenter("right")},mouseleave:function(t){e.quicknextIconClass="el-icon-more"}}}):e._e(),e.pageCount>1?i("li",{staticClass:"number",class:{active:e.currentPage===e.pageCount,disabled:e.disabled}},[e._v(e._s(e.pageCount))]):e._e()],2)},s=[];n._withStripped=!0;var r={name:"ElPager",props:{currentPage:Number,pageCount:Number,pagerCount:Number,disabled:Boolean},watch:{showPrevMore:function(e){e||(this.quickprevIconClass="el-icon-more")},showNextMore:function(e){e||(this.quicknextIconClass="el-icon-more")}},methods:{onPagerClick:function(e){var t=e.target;if("UL"!==t.tagName&&!this.disabled){var i=Number(e.target.textContent),n=this.pageCount,s=this.currentPage,r=this.pagerCount-2;-1!==t.className.indexOf("more")&&(-1!==t.className.indexOf("quickprev")?i=s-r:-1!==t.className.indexOf("quicknext")&&(i=s+r)),isNaN(i)||(i<1&&(i=1),i>n&&(i=n)),i!==s&&this.$emit("change",i)}},onMouseenter:function(e){this.disabled||("left"===e?this.quickprevIconClass="el-icon-d-arrow-left":this.quicknextIconClass="el-icon-d-arrow-right")}},computed:{pagers:function(){var e=this.pagerCount,t=(e-1)/2,i=Number(this.currentPage),n=Number(this.pageCount),s=!1,r=!1;n>e&&(i>e-t&&(s=!0),i4&&e<22&&e%2===1},default:7},currentPage:{type:Number,default:1},layout:{default:"prev, pager, next, jumper, ->, total"},pageSizes:{type:Array,default:function(){return[10,20,30,40,50,100]}},popperClass:String,prevText:String,nextText:String,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean},data:function(){return{internalCurrentPage:1,internalPageSize:0,lastEmittedPage:-1,userChangePageSize:!1}},render:function(e){var t=this.layout;if(!t)return null;if(this.hideOnSinglePage&&(!this.internalPageCount||1===this.internalPageCount))return null;var i=e("div",{class:["el-pagination",{"is-background":this.background,"el-pagination--small":this.small}]}),n={prev:e("prev"),jumper:e("jumper"),pager:e("pager",{attrs:{currentPage:this.internalCurrentPage,pageCount:this.internalPageCount,pagerCount:this.pagerCount,disabled:this.disabled},on:{change:this.handleCurrentChange}}),next:e("next"),sizes:e("sizes",{attrs:{pageSizes:this.pageSizes}}),slot:e("slot",[this.$slots.default?this.$slots.default:""]),total:e("total")},s=t.split(",").map((function(e){return e.trim()})),r=e("div",{class:"el-pagination__rightwrapper"}),a=!1;return i.children=i.children||[],r.children=r.children||[],s.forEach((function(e){"->"!==e?a?r.children.push(n[e]):i.children.push(n[e]):a=!0})),a&&i.children.unshift(r),i},components:{Prev:{render:function(e){return e("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage<=1},class:"btn-prev",on:{click:this.$parent.prev}},[this.$parent.prevText?e("span",[this.$parent.prevText]):e("i",{class:"el-icon el-icon-arrow-left"})])}},Next:{render:function(e){return e("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage===this.$parent.internalPageCount||0===this.$parent.internalPageCount},class:"btn-next",on:{click:this.$parent.next}},[this.$parent.nextText?e("span",[this.$parent.nextText]):e("i",{class:"el-icon el-icon-arrow-right"})])}},Sizes:{mixins:[g.a],props:{pageSizes:Array},watch:{pageSizes:{immediate:!0,handler:function(e,t){Object(b["valueEquals"])(e,t)||Array.isArray(e)&&(this.$parent.internalPageSize=e.indexOf(this.$parent.pageSize)>-1?this.$parent.pageSize:this.pageSizes[0])}}},render:function(e){var t=this;return e("span",{class:"el-pagination__sizes"},[e("el-select",{attrs:{value:this.$parent.internalPageSize,popperClass:this.$parent.popperClass||"",size:"mini",disabled:this.$parent.disabled},on:{input:this.handleChange}},[this.pageSizes.map((function(i){return e("el-option",{attrs:{value:i,label:i+t.t("el.pagination.pagesize")}})}))])])},components:{ElSelect:h.a,ElOption:p.a},methods:{handleChange:function(e){e!==this.$parent.internalPageSize&&(this.$parent.internalPageSize=e=parseInt(e,10),this.$parent.userChangePageSize=!0,this.$parent.$emit("update:pageSize",e),this.$parent.$emit("size-change",e))}}},Jumper:{mixins:[g.a],components:{ElInput:m.a},data:function(){return{userInput:null}},watch:{"$parent.internalCurrentPage":function(){this.userInput=null}},methods:{handleKeyup:function(e){var t=e.keyCode,i=e.target;13===t&&this.handleChange(i.value)},handleInput:function(e){this.userInput=e},handleChange:function(e){this.$parent.internalCurrentPage=this.$parent.getValidCurrentPage(e),this.$parent.emitChange(),this.userInput=null}},render:function(e){return e("span",{class:"el-pagination__jump"},[this.t("el.pagination.goto"),e("el-input",{class:"el-pagination__editor is-in-pagination",attrs:{min:1,max:this.$parent.internalPageCount,value:null!==this.userInput?this.userInput:this.$parent.internalCurrentPage,type:"number",disabled:this.$parent.disabled},nativeOn:{keyup:this.handleKeyup},on:{input:this.handleInput,change:this.handleChange}}),this.t("el.pagination.pageClassifier")])}},Total:{mixins:[g.a],render:function(e){return"number"===typeof this.$parent.total?e("span",{class:"el-pagination__total"},[this.t("el.pagination.total",{total:this.$parent.total})]):""}},Pager:c},methods:{handleCurrentChange:function(e){this.internalCurrentPage=this.getValidCurrentPage(e),this.userChangePageSize=!0,this.emitChange()},prev:function(){if(!this.disabled){var e=this.internalCurrentPage-1;this.internalCurrentPage=this.getValidCurrentPage(e),this.$emit("prev-click",this.internalCurrentPage),this.emitChange()}},next:function(){if(!this.disabled){var e=this.internalCurrentPage+1;this.internalCurrentPage=this.getValidCurrentPage(e),this.$emit("next-click",this.internalCurrentPage),this.emitChange()}},getValidCurrentPage:function(e){e=parseInt(e,10);var t="number"===typeof this.internalPageCount,i=void 0;return t?e<1?i=1:e>this.internalPageCount&&(i=this.internalPageCount):(isNaN(e)||e<1)&&(i=1),(void 0===i&&isNaN(e)||0===i)&&(i=1),void 0===i?e:i},emitChange:function(){var e=this;this.$nextTick((function(){(e.internalCurrentPage!==e.lastEmittedPage||e.userChangePageSize)&&(e.$emit("current-change",e.internalCurrentPage),e.lastEmittedPage=e.internalCurrentPage,e.userChangePageSize=!1)}))}},computed:{internalPageCount:function(){return"number"===typeof this.total?Math.max(1,Math.ceil(this.total/this.internalPageSize)):"number"===typeof this.pageCount?Math.max(1,this.pageCount):null}},watch:{currentPage:{immediate:!0,handler:function(e){this.internalCurrentPage=this.getValidCurrentPage(e)}},pageSize:{immediate:!0,handler:function(e){this.internalPageSize=isNaN(e)?10:e}},internalCurrentPage:{immediate:!0,handler:function(e){this.$emit("update:currentPage",e),this.lastEmittedPage=-1}},internalPageCount:function(e){var t=this.internalCurrentPage;e>0&&0===t?this.internalCurrentPage=1:t>e&&(this.internalCurrentPage=0===e?1:e,this.userChangePageSize&&this.emitChange()),this.userChangePageSize=!1}},install:function(e){e.component(y.name,y)}},_=y,x=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"dialog-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-dialog__wrapper",on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[i("div",{key:e.key,ref:"dialog",class:["el-dialog",{"is-fullscreen":e.fullscreen,"el-dialog--center":e.center},e.customClass],style:e.style,attrs:{role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"}},[i("div",{staticClass:"el-dialog__header"},[e._t("title",[i("span",{staticClass:"el-dialog__title"},[e._v(e._s(e.title))])]),e.showClose?i("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:e.handleClose}},[i("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):e._e()],2),e.rendered?i("div",{staticClass:"el-dialog__body"},[e._t("default")],2):e._e(),e.$slots.footer?i("div",{staticClass:"el-dialog__footer"},[e._t("footer")],2):e._e()])])])},C=[];x._withStripped=!0;var w=i(11),k=i.n(w),S=i(9),D=i.n(S),$=i(3),O=i.n($),E={name:"ElDialog",mixins:[k.a,O.a,D.a],props:{title:{type:String,default:""},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},width:String,fullscreen:Boolean,customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:Function,center:{type:Boolean,default:!1},destroyOnClose:Boolean},data:function(){return{closed:!1,key:0}},watch:{visible:function(e){var t=this;e?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick((function(){t.$refs.dialog.scrollTop=0})),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"),this.destroyOnClose&&this.$nextTick((function(){t.key++})))}},computed:{style:function(){var e={};return this.fullscreen||(e.marginTop=this.top,this.width&&(e.width=this.width)),e}},methods:{getMigratingConfig:function(){return{props:{size:"size is removed."}}},handleWrapperClick:function(){this.closeOnClickModal&&this.handleClose()},handleClose:function(){"function"===typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},hide:function(e){!1!==e&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper:function(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")},afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")}},mounted:function(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},T=E,P=o(T,x,C,!1,null,null,null);P.options.__file="packages/dialog/src/component.vue";var M=P.exports;M.install=function(e){e.component(M.name,M)};var N=M,I=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.close,expression:"close"}],staticClass:"el-autocomplete",attrs:{"aria-haspopup":"listbox",role:"combobox","aria-expanded":e.suggestionVisible,"aria-owns":e.id}},[i("el-input",e._b({ref:"input",on:{input:e.handleInput,change:e.handleChange,focus:e.handleFocus,blur:e.handleBlur,clear:e.handleClear},nativeOn:{keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.highlight(e.highlightedIndex-1)},function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.highlight(e.highlightedIndex+1)},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleKeyEnter(t)},function(t){return!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:e.close(t)}]}},"el-input",[e.$props,e.$attrs],!1),[e.$slots.prepend?i("template",{slot:"prepend"},[e._t("prepend")],2):e._e(),e.$slots.append?i("template",{slot:"append"},[e._t("append")],2):e._e(),e.$slots.prefix?i("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),e.$slots.suffix?i("template",{slot:"suffix"},[e._t("suffix")],2):e._e()],2),i("el-autocomplete-suggestions",{ref:"suggestions",class:[e.popperClass?e.popperClass:""],attrs:{"visible-arrow":"","popper-options":e.popperOptions,"append-to-body":e.popperAppendToBody,placement:e.placement,id:e.id}},e._l(e.suggestions,(function(t,n){return i("li",{key:n,class:{highlighted:e.highlightedIndex===n},attrs:{id:e.id+"-item-"+n,role:"option","aria-selected":e.highlightedIndex===n},on:{click:function(i){e.select(t)}}},[e._t("default",[e._v("\n "+e._s(t[e.valueKey])+"\n ")],{item:t})],2)})),0)],1)},j=[];I._withStripped=!0;var F=i(16),L=i.n(F),A=i(10),V=i.n(A),B=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-autocomplete-suggestion el-popper",class:{"is-loading":!e.parent.hideLoading&&e.parent.loading},style:{width:e.dropdownWidth},attrs:{role:"region"}},[i("el-scrollbar",{attrs:{tag:"ul","wrap-class":"el-autocomplete-suggestion__wrap","view-class":"el-autocomplete-suggestion__list"}},[!e.parent.hideLoading&&e.parent.loading?i("li",[i("i",{staticClass:"el-icon-loading"})]):e._t("default")],2)],1)])},z=[];B._withStripped=!0;var R=i(6),H=i.n(R),W=i(18),q=i.n(W),Y={components:{ElScrollbar:q.a},mixins:[H.a,O.a],componentName:"ElAutocompleteSuggestions",data:function(){return{parent:this.$parent,dropdownWidth:""}},props:{options:{default:function(){return{gpuAcceleration:!1}}},id:String},methods:{select:function(e){this.dispatch("ElAutocomplete","item-click",e)}},updated:function(){var e=this;this.$nextTick((function(t){e.popperJS&&e.updatePopper()}))},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$refs.input.$refs.input||this.$parent.$refs.input.$refs.textarea,this.referenceList=this.$el.querySelector(".el-autocomplete-suggestion__list"),this.referenceList.setAttribute("role","listbox"),this.referenceList.setAttribute("id",this.id)},created:function(){var e=this;this.$on("visible",(function(t,i){e.dropdownWidth=i+"px",e.showPopper=t}))}},K=Y,U=o(K,B,z,!1,null,null,null);U.options.__file="packages/autocomplete/src/autocomplete-suggestions.vue";var G=U.exports,X=i(23),Z=i.n(X),Q={name:"ElAutocomplete",mixins:[O.a,Z()("input"),D.a],inheritAttrs:!1,componentName:"ElAutocomplete",components:{ElInput:m.a,ElAutocompleteSuggestions:G},directives:{Clickoutside:V.a},props:{valueKey:{type:String,default:"value"},popperClass:String,popperOptions:Object,placeholder:String,clearable:{type:Boolean,default:!1},disabled:Boolean,name:String,size:String,value:String,maxlength:Number,minlength:Number,autofocus:Boolean,fetchSuggestions:Function,triggerOnFocus:{type:Boolean,default:!0},customItem:String,selectWhenUnmatched:{type:Boolean,default:!1},prefixIcon:String,suffixIcon:String,label:String,debounce:{type:Number,default:300},placement:{type:String,default:"bottom-start"},hideLoading:Boolean,popperAppendToBody:{type:Boolean,default:!0},highlightFirstItem:{type:Boolean,default:!1}},data:function(){return{activated:!1,suggestions:[],loading:!1,highlightedIndex:-1,suggestionDisabled:!1}},computed:{suggestionVisible:function(){var e=this.suggestions,t=Array.isArray(e)&&e.length>0;return(t||this.loading)&&this.activated},id:function(){return"el-autocomplete-"+Object(b["generateId"])()}},watch:{suggestionVisible:function(e){var t=this.getInput();t&&this.broadcast("ElAutocompleteSuggestions","visible",[e,t.offsetWidth])}},methods:{getMigratingConfig:function(){return{props:{"custom-item":"custom-item is removed, use scoped slot instead.",props:"props is removed, use value-key instead."}}},getData:function(e){var t=this;this.suggestionDisabled||(this.loading=!0,this.fetchSuggestions(e,(function(e){t.loading=!1,t.suggestionDisabled||(Array.isArray(e)?(t.suggestions=e,t.highlightedIndex=t.highlightFirstItem?0:-1):console.error("[Element Error][Autocomplete]autocomplete suggestions must be an array"))})))},handleInput:function(e){if(this.$emit("input",e),this.suggestionDisabled=!1,!this.triggerOnFocus&&!e)return this.suggestionDisabled=!0,void(this.suggestions=[]);this.debouncedGetData(e)},handleChange:function(e){this.$emit("change",e)},handleFocus:function(e){this.activated=!0,this.$emit("focus",e),this.triggerOnFocus&&this.debouncedGetData(this.value)},handleBlur:function(e){this.$emit("blur",e)},handleClear:function(){this.activated=!1,this.$emit("clear")},close:function(e){this.activated=!1},handleKeyEnter:function(e){var t=this;this.suggestionVisible&&this.highlightedIndex>=0&&this.highlightedIndex=this.suggestions.length&&(e=this.suggestions.length-1);var t=this.$refs.suggestions.$el.querySelector(".el-autocomplete-suggestion__wrap"),i=t.querySelectorAll(".el-autocomplete-suggestion__list li"),n=i[e],s=t.scrollTop,r=n.offsetTop;r+n.scrollHeight>s+t.clientHeight&&(t.scrollTop+=n.scrollHeight),r=0&&this.resetTabindex(this.triggerElm),clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.visible=!1}),"click"===this.trigger?0:this.hideTimeout))},handleClick:function(){this.disabled||(this.visible?this.hide():this.show())},handleTriggerKeyDown:function(e){var t=e.keyCode;[38,40].indexOf(t)>-1?(this.removeTabindex(),this.resetTabindex(this.menuItems[0]),this.menuItems[0].focus(),e.preventDefault(),e.stopPropagation()):13===t?this.handleClick():[9,27].indexOf(t)>-1&&this.hide()},handleItemKeyDown:function(e){var t=e.keyCode,i=e.target,n=this.menuItemsArray.indexOf(i),s=this.menuItemsArray.length-1,r=void 0;[38,40].indexOf(t)>-1?(r=38===t?0!==n?n-1:0:n-1&&(this.hide(),this.triggerElmFocus())},resetTabindex:function(e){this.removeTabindex(),e.setAttribute("tabindex","0")},removeTabindex:function(){this.triggerElm.setAttribute("tabindex","-1"),this.menuItemsArray.forEach((function(e){e.setAttribute("tabindex","-1")}))},initAria:function(){this.dropdownElm.setAttribute("id",this.listId),this.triggerElm.setAttribute("aria-haspopup","list"),this.triggerElm.setAttribute("aria-controls",this.listId),this.splitButton||(this.triggerElm.setAttribute("role","button"),this.triggerElm.setAttribute("tabindex",this.tabindex),this.triggerElm.setAttribute("class",(this.triggerElm.getAttribute("class")||"")+" el-dropdown-selfdefine"))},initEvent:function(){var e=this,t=this.trigger,i=this.show,n=this.hide,s=this.handleClick,r=this.splitButton,a=this.handleTriggerKeyDown,o=this.handleItemKeyDown;this.triggerElm=r?this.$refs.trigger.$el:this.$slots.default[0].elm;var l=this.dropdownElm;this.triggerElm.addEventListener("keydown",a),l.addEventListener("keydown",o,!0),r||(this.triggerElm.addEventListener("focus",(function(){e.focusing=!0})),this.triggerElm.addEventListener("blur",(function(){e.focusing=!1})),this.triggerElm.addEventListener("click",(function(){e.focusing=!1}))),"hover"===t?(this.triggerElm.addEventListener("mouseenter",i),this.triggerElm.addEventListener("mouseleave",n),l.addEventListener("mouseenter",i),l.addEventListener("mouseleave",n)):"click"===t&&this.triggerElm.addEventListener("click",s)},handleMenuItemClick:function(e,t){this.hideOnClick&&(this.visible=!1),this.$emit("command",e,t)},triggerElmFocus:function(){this.triggerElm.focus&&this.triggerElm.focus()},initDomOperation:function(){this.dropdownElm=this.popperElm,this.menuItems=this.dropdownElm.querySelectorAll("[tabindex='-1']"),this.menuItemsArray=[].slice.call(this.menuItems),this.initEvent(),this.initAria()}},render:function(e){var t=this,i=this.hide,n=this.splitButton,s=this.type,r=this.dropdownSize,a=this.disabled,o=function(e){t.$emit("click",e),i()},l=null;if(n)l=e("el-button-group",[e("el-button",{attrs:{type:s,size:r,disabled:a},nativeOn:{click:o}},[this.$slots.default]),e("el-button",{ref:"trigger",attrs:{type:s,size:r,disabled:a},class:"el-dropdown__caret-button"},[e("i",{class:"el-dropdown__icon el-icon-arrow-down"})])]);else{l=this.$slots.default;var c=l[0].data||{},u=c.attrs,h=void 0===u?{}:u;a&&!h.disabled&&(h.disabled=!0,c.attrs=h)}var d=a?null:this.$slots.dropdown;return e("div",{class:"el-dropdown",directives:[{name:"clickoutside",value:i}],attrs:{"aria-disabled":a}},[l,d])}},ue=ce,he=o(ue,ie,ne,!1,null,null,null);he.options.__file="packages/dropdown/src/dropdown.vue";var de=he.exports;de.install=function(e){e.component(de.name,de)};var pe=de,fe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[i("ul",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-dropdown-menu el-popper",class:[e.size&&"el-dropdown-menu--"+e.size]},[e._t("default")],2)])},me=[];fe._withStripped=!0;var ve={name:"ElDropdownMenu",componentName:"ElDropdownMenu",mixins:[H.a],props:{visibleArrow:{type:Boolean,default:!0},arrowOffset:{type:Number,default:0}},data:function(){return{size:this.dropdown.dropdownSize}},inject:["dropdown"],created:function(){var e=this;this.$on("updatePopper",(function(){e.showPopper&&e.updatePopper()})),this.$on("visible",(function(t){e.showPopper=t}))},mounted:function(){this.dropdown.popperElm=this.popperElm=this.$el,this.referenceElm=this.dropdown.$el,this.dropdown.initDomOperation()},watch:{"dropdown.placement":{immediate:!0,handler:function(e){this.currentPlacement=e}}}},ge=ve,be=o(ge,fe,me,!1,null,null,null);be.options.__file="packages/dropdown/src/dropdown-menu.vue";var ye=be.exports;ye.install=function(e){e.component(ye.name,ye)};var _e=ye,xe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-dropdown-menu__item",class:{"is-disabled":e.disabled,"el-dropdown-menu__item--divided":e.divided},attrs:{"aria-disabled":e.disabled,tabindex:e.disabled?null:-1},on:{click:e.handleClick}},[e.icon?i("i",{class:e.icon}):e._e(),e._t("default")],2)},Ce=[];xe._withStripped=!0;var we={name:"ElDropdownItem",mixins:[O.a],props:{command:{},disabled:Boolean,divided:Boolean,icon:String},methods:{handleClick:function(e){this.dispatch("ElDropdown","menu-item-click",[this.command,this])}}},ke=we,Se=o(ke,xe,Ce,!1,null,null,null);Se.options.__file="packages/dropdown/src/dropdown-item.vue";var De=Se.exports;De.install=function(e){e.component(De.name,De)};var $e=De,Oe=Oe||{};Oe.Utils=Oe.Utils||{},Oe.Utils.focusFirstDescendant=function(e){for(var t=0;t=0;t--){var i=e.childNodes[t];if(Oe.Utils.attemptFocus(i)||Oe.Utils.focusLastDescendant(i))return!0}return!1},Oe.Utils.attemptFocus=function(e){if(!Oe.Utils.isFocusable(e))return!1;Oe.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(t){}return Oe.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},Oe.Utils.isFocusable=function(e){if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type&&"file"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Oe.Utils.triggerEvent=function(e,t){var i=void 0;i=/^mouse|click/.test(t)?"MouseEvents":/^key/.test(t)?"KeyboardEvent":"HTMLEvents";for(var n=document.createEvent(i),s=arguments.length,r=Array(s>2?s-2:0),a=2;a=0;t--)e.splice(t,0,e[t]);e=e.join("")}return/^[0-9a-fA-F]{6}$/.test(e)?{red:parseInt(e.slice(0,2),16),green:parseInt(e.slice(2,4),16),blue:parseInt(e.slice(4,6),16)}:{red:255,green:255,blue:255}},mixColor:function(e,t){var i=this.getColorChannels(e),n=i.red,s=i.green,r=i.blue;return t>0?(n*=1-t,s*=1-t,r*=1-t):(n+=(255-n)*t,s+=(255-s)*t,r+=(255-r)*t),"rgb("+Math.round(n)+", "+Math.round(s)+", "+Math.round(r)+")"},addItem:function(e){this.$set(this.items,e.index,e)},removeItem:function(e){delete this.items[e.index]},addSubmenu:function(e){this.$set(this.submenus,e.index,e)},removeSubmenu:function(e){delete this.submenus[e.index]},openMenu:function(e,t){var i=this.openedMenus;-1===i.indexOf(e)&&(this.uniqueOpened&&(this.openedMenus=i.filter((function(e){return-1!==t.indexOf(e)}))),this.openedMenus.push(e))},closeMenu:function(e){var t=this.openedMenus.indexOf(e);-1!==t&&this.openedMenus.splice(t,1)},handleSubmenuClick:function(e){var t=e.index,i=e.indexPath,n=-1!==this.openedMenus.indexOf(t);n?(this.closeMenu(t),this.$emit("close",t,i)):(this.openMenu(t,i),this.$emit("open",t,i))},handleItemClick:function(e){var t=this,i=e.index,n=e.indexPath,s=this.activeIndex,r=null!==e.index;r&&(this.activeIndex=e.index),this.$emit("select",i,n,e),("horizontal"===this.mode||this.collapse)&&(this.openedMenus=[]),this.router&&r&&this.routeToItem(e,(function(e){if(t.activeIndex=s,e){if("NavigationDuplicated"===e.name)return;console.error(e)}}))},initOpenedMenu:function(){var e=this,t=this.activeIndex,i=this.items[t];if(i&&"horizontal"!==this.mode&&!this.collapse){var n=i.indexPath;n.forEach((function(t){var i=e.submenus[t];i&&e.openMenu(t,i.indexPath)}))}},routeToItem:function(e,t){var i=e.route||e.index;try{this.$router.push(i,(function(){}),t)}catch(n){console.error(n)}},open:function(e){var t=this,i=this.submenus[e.toString()].indexPath;i.forEach((function(e){return t.openMenu(e,i)}))},close:function(e){this.closeMenu(e)}},mounted:function(){this.initOpenedMenu(),this.$on("item-click",this.handleItemClick),this.$on("submenu-click",this.handleSubmenuClick),"horizontal"===this.mode&&new Le(this.$el),this.$watch("items",this.updateActiveIndex)}},Be=Ve,ze=o(Be,je,Fe,!1,null,null,null);ze.options.__file="packages/menu/src/menu.vue";var Re=ze.exports;Re.install=function(e){e.component(Re.name,Re)};var He,We,qe=Re,Ye=i(21),Ke=i.n(Ye),Ue={inject:["rootMenu"],computed:{indexPath:function(){var e=[this.index],t=this.$parent;while("ElMenu"!==t.$options.componentName)t.index&&e.unshift(t.index),t=t.$parent;return e},parentMenu:function(){var e=this.$parent;while(e&&-1===["ElMenu","ElSubmenu"].indexOf(e.$options.componentName))e=e.$parent;return e},paddingStyle:function(){if("vertical"!==this.rootMenu.mode)return{};var e=20,t=this.$parent;if(this.rootMenu.collapse)e=20;else while(t&&"ElMenu"!==t.$options.componentName)"ElSubmenu"===t.$options.componentName&&(e+=20),t=t.$parent;return{paddingLeft:e+"px"}}}},Ge={props:{transformOrigin:{type:[Boolean,String],default:!1},offset:H.a.props.offset,boundariesPadding:H.a.props.boundariesPadding,popperOptions:H.a.props.popperOptions},data:H.a.data,methods:H.a.methods,beforeDestroy:H.a.beforeDestroy,deactivated:H.a.deactivated},Xe={name:"ElSubmenu",componentName:"ElSubmenu",mixins:[Ue,O.a,Ge],components:{ElCollapseTransition:Ke.a},props:{index:{type:String,required:!0},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},popperClass:String,disabled:Boolean,popperAppendToBody:{type:Boolean,default:void 0}},data:function(){return{popperJS:null,timeout:null,items:{},submenus:{},mouseInChild:!1}},watch:{opened:function(e){var t=this;this.isMenuPopup&&this.$nextTick((function(e){t.updatePopper()}))}},computed:{appendToBody:function(){return void 0===this.popperAppendToBody?this.isFirstLevel:this.popperAppendToBody},menuTransitionName:function(){return this.rootMenu.collapse?"el-zoom-in-left":"el-zoom-in-top"},opened:function(){return this.rootMenu.openedMenus.indexOf(this.index)>-1},active:function(){var e=!1,t=this.submenus,i=this.items;return Object.keys(i).forEach((function(t){i[t].active&&(e=!0)})),Object.keys(t).forEach((function(i){t[i].active&&(e=!0)})),e},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},isMenuPopup:function(){return this.rootMenu.isMenuPopup},titleStyle:function(){return"horizontal"!==this.mode?{color:this.textColor}:{borderBottomColor:this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent",color:this.active?this.activeTextColor:this.textColor}},isFirstLevel:function(){var e=!0,t=this.$parent;while(t&&t!==this.rootMenu){if(["ElSubmenu","ElMenuItemGroup"].indexOf(t.$options.componentName)>-1){e=!1;break}t=t.$parent}return e}},methods:{handleCollapseToggle:function(e){e?this.initPopper():this.doDestroy()},addItem:function(e){this.$set(this.items,e.index,e)},removeItem:function(e){delete this.items[e.index]},addSubmenu:function(e){this.$set(this.submenus,e.index,e)},removeSubmenu:function(e){delete this.submenus[e.index]},handleClick:function(){var e=this.rootMenu,t=this.disabled;"hover"===e.menuTrigger&&"horizontal"===e.mode||e.collapse&&"vertical"===e.mode||t||this.dispatch("ElMenu","submenu-click",this)},handleMouseenter:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.showTimeout;if("ActiveXObject"in window||"focus"!==e.type||e.relatedTarget){var n=this.rootMenu,s=this.disabled;"click"===n.menuTrigger&&"horizontal"===n.mode||!n.collapse&&"vertical"===n.mode||s||(this.dispatch("ElSubmenu","mouse-enter-child"),clearTimeout(this.timeout),this.timeout=setTimeout((function(){t.rootMenu.openMenu(t.index,t.indexPath)}),i),this.appendToBody&&this.$parent.$el.dispatchEvent(new MouseEvent("mouseenter")))}},handleMouseleave:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.rootMenu;"click"===i.menuTrigger&&"horizontal"===i.mode||!i.collapse&&"vertical"===i.mode||(this.dispatch("ElSubmenu","mouse-leave-child"),clearTimeout(this.timeout),this.timeout=setTimeout((function(){!e.mouseInChild&&e.rootMenu.closeMenu(e.index)}),this.hideTimeout),this.appendToBody&&t&&"ElSubmenu"===this.$parent.$options.name&&this.$parent.handleMouseleave(!0))},handleTitleMouseenter:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var e=this.$refs["submenu-title"];e&&(e.style.backgroundColor=this.rootMenu.hoverBackground)}},handleTitleMouseleave:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var e=this.$refs["submenu-title"];e&&(e.style.backgroundColor=this.rootMenu.backgroundColor||"")}},updatePlacement:function(){this.currentPlacement="horizontal"===this.mode&&this.isFirstLevel?"bottom-start":"right-start"},initPopper:function(){this.referenceElm=this.$el,this.popperElm=this.$refs.menu,this.updatePlacement()}},created:function(){var e=this;this.$on("toggle-collapse",this.handleCollapseToggle),this.$on("mouse-enter-child",(function(){e.mouseInChild=!0,clearTimeout(e.timeout)})),this.$on("mouse-leave-child",(function(){e.mouseInChild=!1,clearTimeout(e.timeout)}))},mounted:function(){this.parentMenu.addSubmenu(this),this.rootMenu.addSubmenu(this),this.initPopper()},beforeDestroy:function(){this.parentMenu.removeSubmenu(this),this.rootMenu.removeSubmenu(this)},render:function(e){var t=this,i=this.active,n=this.opened,s=this.paddingStyle,r=this.titleStyle,a=this.backgroundColor,o=this.rootMenu,l=this.currentPlacement,c=this.menuTransitionName,u=this.mode,h=this.disabled,d=this.popperClass,p=this.$slots,f=this.isFirstLevel,m=e("transition",{attrs:{name:c}},[e("div",{ref:"menu",directives:[{name:"show",value:n}],class:["el-menu--"+u,d],on:{mouseenter:function(e){return t.handleMouseenter(e,100)},mouseleave:function(){return t.handleMouseleave(!0)},focus:function(e){return t.handleMouseenter(e,100)}}},[e("ul",{attrs:{role:"menu"},class:["el-menu el-menu--popup","el-menu--popup-"+l],style:{backgroundColor:o.backgroundColor||""}},[p.default])])]),v=e("el-collapse-transition",[e("ul",{attrs:{role:"menu"},class:"el-menu el-menu--inline",directives:[{name:"show",value:n}],style:{backgroundColor:o.backgroundColor||""}},[p.default])]),g="horizontal"===o.mode&&f||"vertical"===o.mode&&!o.collapse?"el-icon-arrow-down":"el-icon-arrow-right";return e("li",{class:{"el-submenu":!0,"is-active":i,"is-opened":n,"is-disabled":h},attrs:{role:"menuitem","aria-haspopup":"true","aria-expanded":n},on:{mouseenter:this.handleMouseenter,mouseleave:function(){return t.handleMouseleave(!1)},focus:this.handleMouseenter}},[e("div",{class:"el-submenu__title",ref:"submenu-title",on:{click:this.handleClick,mouseenter:this.handleTitleMouseenter,mouseleave:this.handleTitleMouseleave},style:[s,r,{backgroundColor:a}]},[p.title,e("i",{class:["el-submenu__icon-arrow",g]})]),this.isMenuPopup?m:v])}},Ze=Xe,Qe=o(Ze,He,We,!1,null,null,null);Qe.options.__file="packages/menu/src/submenu.vue";var Je=Qe.exports;Je.install=function(e){e.component(Je.name,Je)};var et=Je,tt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-menu-item",class:{"is-active":e.active,"is-disabled":e.disabled},style:[e.paddingStyle,e.itemStyle,{backgroundColor:e.backgroundColor}],attrs:{role:"menuitem",tabindex:"-1"},on:{click:e.handleClick,mouseenter:e.onMouseEnter,focus:e.onMouseEnter,blur:e.onMouseLeave,mouseleave:e.onMouseLeave}},["ElMenu"===e.parentMenu.$options.componentName&&e.rootMenu.collapse&&e.$slots.title?i("el-tooltip",{attrs:{effect:"dark",placement:"right"}},[i("div",{attrs:{slot:"content"},slot:"content"},[e._t("title")],2),i("div",{staticStyle:{position:"absolute",left:"0",top:"0",height:"100%",width:"100%",display:"inline-block","box-sizing":"border-box",padding:"0 20px"}},[e._t("default")],2)]):[e._t("default"),e._t("title")]],2)},it=[];tt._withStripped=!0;var nt=i(26),st=i.n(nt),rt={name:"ElMenuItem",componentName:"ElMenuItem",mixins:[Ue,O.a],components:{ElTooltip:st.a},props:{index:{default:null,validator:function(e){return"string"===typeof e||null===e}},route:[String,Object],disabled:Boolean},computed:{active:function(){return this.index===this.rootMenu.activeIndex},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},itemStyle:function(){var e={color:this.active?this.activeTextColor:this.textColor};return"horizontal"!==this.mode||this.isNested||(e.borderBottomColor=this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent"),e},isNested:function(){return this.parentMenu!==this.rootMenu}},methods:{onMouseEnter:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.hoverBackground)},onMouseLeave:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.backgroundColor)},handleClick:function(){this.disabled||(this.dispatch("ElMenu","item-click",this),this.$emit("click",this))}},mounted:function(){this.parentMenu.addItem(this),this.rootMenu.addItem(this)},beforeDestroy:function(){this.parentMenu.removeItem(this),this.rootMenu.removeItem(this)}},at=rt,ot=o(at,tt,it,!1,null,null,null);ot.options.__file="packages/menu/src/menu-item.vue";var lt=ot.exports;lt.install=function(e){e.component(lt.name,lt)};var ct=lt,ut=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-menu-item-group"},[i("div",{staticClass:"el-menu-item-group__title",style:{paddingLeft:e.levelPadding+"px"}},[e.$slots.title?e._t("title"):[e._v(e._s(e.title))]],2),i("ul",[e._t("default")],2)])},ht=[];ut._withStripped=!0;var dt={name:"ElMenuItemGroup",componentName:"ElMenuItemGroup",inject:["rootMenu"],props:{title:{type:String}},data:function(){return{paddingLeft:20}},computed:{levelPadding:function(){var e=20,t=this.$parent;if(this.rootMenu.collapse)return 20;while(t&&"ElMenu"!==t.$options.componentName)"ElSubmenu"===t.$options.componentName&&(e+=20),t=t.$parent;return e}}},pt=dt,ft=o(pt,ut,ht,!1,null,null,null);ft.options.__file="packages/menu/src/menu-item-group.vue";var mt=ft.exports;mt.install=function(e){e.component(mt.name,mt)};var vt=mt,gt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["textarea"===e.type?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",{"is-disabled":e.inputDisabled,"is-exceed":e.inputExceed,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable||e.showPassword}],on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},["textarea"!==e.type?[e.$slots.prepend?i("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),"textarea"!==e.type?i("input",e._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:e.tabindex,type:e.showPassword?e.passwordVisible?"text":"password":e.type,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionupdate:e.handleCompositionUpdate,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"input",e.$attrs,!1)):e._e(),e.$slots.prefix||e.prefixIcon?i("span",{staticClass:"el-input__prefix"},[e._t("prefix"),e.prefixIcon?i("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.getSuffixVisible()?i("span",{staticClass:"el-input__suffix"},[i("span",{staticClass:"el-input__suffix-inner"},[e.showClear&&e.showPwdVisible&&e.isWordLimitVisible?e._e():[e._t("suffix"),e.suffixIcon?i("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()],e.showClear?i("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{mousedown:function(e){e.preventDefault()},click:e.clear}}):e._e(),e.showPwdVisible?i("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:e.handlePasswordVisible}}):e._e(),e.isWordLimitVisible?i("span",{staticClass:"el-input__count"},[i("span",{staticClass:"el-input__count-inner"},[e._v("\n "+e._s(e.textLength)+"/"+e._s(e.upperLimit)+"\n ")])]):e._e()],2),e.validateState?i("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?i("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:i("textarea",e._b({ref:"textarea",staticClass:"el-textarea__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionupdate:e.handleCompositionUpdate,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"textarea",e.$attrs,!1)),e.isWordLimitVisible&&"textarea"===e.type?i("span",{staticClass:"el-input__count"},[e._v(e._s(e.textLength)+"/"+e._s(e.upperLimit))]):e._e()],2)},bt=[];gt._withStripped=!0;var yt=void 0,_t="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",xt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function Ct(e){var t=window.getComputedStyle(e),i=t.getPropertyValue("box-sizing"),n=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),s=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width")),r=xt.map((function(e){return e+":"+t.getPropertyValue(e)})).join(";");return{contextStyle:r,paddingSize:n,borderSize:s,boxSizing:i}}function wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;yt||(yt=document.createElement("textarea"),document.body.appendChild(yt));var n=Ct(e),s=n.paddingSize,r=n.borderSize,a=n.boxSizing,o=n.contextStyle;yt.setAttribute("style",o+";"+_t),yt.value=e.value||e.placeholder||"";var l=yt.scrollHeight,c={};"border-box"===a?l+=r:"content-box"===a&&(l-=s),yt.value="";var u=yt.scrollHeight-s;if(null!==t){var h=u*t;"border-box"===a&&(h=h+s+r),l=Math.max(h,l),c.minHeight=h+"px"}if(null!==i){var d=u*i;"border-box"===a&&(d=d+s+r),l=Math.min(d,l)}return c.height=l+"px",yt.parentNode&&yt.parentNode.removeChild(yt),yt=null,c}var kt=i(7),St=i.n(kt),Dt=i(19),$t={name:"ElInput",componentName:"ElInput",mixins:[O.a,D.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return St()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"===typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(e){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[e])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var e=this;this.$nextTick((function(){e.setNativeInputValue(),e.resizeTextarea(),e.updateIconOffset()}))}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(e){this.focused=!1,this.$emit("blur",e),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var e=this.autosize,t=this.type;if("textarea"===t)if(e){var i=e.minRows,n=e.maxRows;this.textareaCalcStyle=wt(this.$refs.textarea,i,n)}else this.textareaCalcStyle={minHeight:wt(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var e=this.getInput();e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)},handleFocus:function(e){this.focused=!0,this.$emit("focus",e)},handleCompositionStart:function(e){this.$emit("compositionstart",e),this.isComposing=!0},handleCompositionUpdate:function(e){this.$emit("compositionupdate",e);var t=e.target.value,i=t[t.length-1]||"";this.isComposing=!Object(Dt["isKorean"])(i)},handleCompositionEnd:function(e){this.$emit("compositionend",e),this.isComposing&&(this.isComposing=!1,this.handleInput(e))},handleInput:function(e){this.isComposing||e.target.value!==this.nativeInputValue&&(this.$emit("input",e.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(e){this.$emit("change",e.target.value)},calcIconOffset:function(e){var t=[].slice.call(this.$el.querySelectorAll(".el-input__"+e)||[]);if(t.length){for(var i=null,n=0;n=0&&e===parseInt(e,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(e){var t=void 0===e?e:Number(e);if(void 0!==t){if(isNaN(t))return;if(this.stepStrictly){var i=this.getPrecision(this.step),n=Math.pow(10,i);t=Math.round(t/this.step)*n*this.step/n}void 0!==this.precision&&(t=this.toPrecision(t,this.precision))}t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),this.currentValue=t,this.userInput=null,this.$emit("input",t)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)this.max},numPrecision:function(){var e=this.value,t=this.step,i=this.getPrecision,n=this.precision,s=i(t);return void 0!==n?(s>n&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),n):Math.max(i(e),s)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||!!(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var e=this.currentValue;if("number"===typeof e){if(this.stepStrictly){var t=this.getPrecision(this.step),i=Math.pow(10,t);e=Math.round(e/this.step)*i*this.step/i}void 0!==this.precision&&(e=e.toFixed(this.precision))}return e}},methods:{toPrecision:function(e,t){return void 0===t&&(t=this.numPrecision),parseFloat(Math.round(e*Math.pow(10,t))/Math.pow(10,t))},getPrecision:function(e){if(void 0===e)return 0;var t=e.toString(),i=t.indexOf("."),n=0;return-1!==i&&(n=t.length-i-1),n},_increase:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e+i*t)/i)},_decrease:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e-i*t)/i)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var e=this.value||0,t=this._increase(e,this.step);this.setCurrentValue(t)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var e=this.value||0,t=this._decrease(e,this.step);this.setCurrentValue(t)}},handleBlur:function(e){this.$emit("blur",e)},handleFocus:function(e){this.$emit("focus",e)},setCurrentValue:function(e){var t=this.currentValue;"number"===typeof e&&void 0!==this.precision&&(e=this.toPrecision(e,this.precision)),e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),t!==e&&(this.userInput=null,this.$emit("input",e),this.$emit("change",e,t),this.currentValue=e)},handleInput:function(e){this.userInput=e},handleInputChange:function(e){var t=""===e?void 0:Number(e);isNaN(t)&&""!==e||this.setCurrentValue(t),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var e=this.$refs.input.$refs.input;e.setAttribute("role","spinbutton"),e.setAttribute("aria-valuemax",this.max),e.setAttribute("aria-valuemin",this.min),e.setAttribute("aria-valuenow",this.currentValue),e.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){if(this.$refs&&this.$refs.input){var e=this.$refs.input.$refs.input;e.setAttribute("aria-valuenow",this.currentValue)}}},Ft=jt,Lt=o(Ft,Mt,Nt,!1,null,null,null);Lt.options.__file="packages/input-number/src/input-number.vue";var At=Lt.exports;At.install=function(e){e.component(At.name,At)};var Vt=At,Bt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-radio",class:[e.border&&e.radioSize?"el-radio--"+e.radioSize:"",{"is-disabled":e.isDisabled},{"is-focus":e.focus},{"is-bordered":e.border},{"is-checked":e.model===e.label}],attrs:{role:"radio","aria-checked":e.model===e.label,"aria-disabled":e.isDisabled,tabindex:e.tabIndex},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"]))return null;t.stopPropagation(),t.preventDefault(),e.model=e.isDisabled?e.model:e.label}}},[i("span",{staticClass:"el-radio__input",class:{"is-disabled":e.isDisabled,"is-checked":e.model===e.label}},[i("span",{staticClass:"el-radio__inner"}),i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],ref:"radio",staticClass:"el-radio__original",attrs:{type:"radio","aria-hidden":"true",name:e.name,disabled:e.isDisabled,tabindex:"-1",autocomplete:"off"},domProps:{value:e.label,checked:e._q(e.model,e.label)},on:{focus:function(t){e.focus=!0},blur:function(t){e.focus=!1},change:[function(t){e.model=e.label},e.handleChange]}})]),i("span",{staticClass:"el-radio__label",on:{keydown:function(e){e.stopPropagation()}}},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2)])},zt=[];Bt._withStripped=!0;var Rt={name:"ElRadio",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElRadio",props:{value:{},label:{},disabled:Boolean,name:String,border:Boolean,size:String},data:function(){return{focus:!1}},computed:{isGroup:function(){var e=this.$parent;while(e){if("ElRadioGroup"===e.$options.componentName)return this._radioGroup=e,!0;e=e.$parent}return!1},model:{get:function(){return this.isGroup?this._radioGroup.value:this.value},set:function(e){this.isGroup?this.dispatch("ElRadioGroup","input",[e]):this.$emit("input",e),this.$refs.radio&&(this.$refs.radio.checked=this.model===this.label)}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},radioSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._radioGroup.radioGroupSize||e},isDisabled:function(){return this.isGroup?this._radioGroup.disabled||this.disabled||(this.elForm||{}).disabled:this.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this.isGroup&&this.model!==this.label?-1:0}},methods:{handleChange:function(){var e=this;this.$nextTick((function(){e.$emit("change",e.model),e.isGroup&&e.dispatch("ElRadioGroup","handleChange",e.model)}))}}},Ht=Rt,Wt=o(Ht,Bt,zt,!1,null,null,null);Wt.options.__file="packages/radio/src/radio.vue";var qt=Wt.exports;qt.install=function(e){e.component(qt.name,qt)};var Yt=qt,Kt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i(e._elTag,{tag:"component",staticClass:"el-radio-group",attrs:{role:"radiogroup"},on:{keydown:e.handleKeydown}},[e._t("default")],2)},Ut=[];Kt._withStripped=!0;var Gt=Object.freeze({LEFT:37,UP:38,RIGHT:39,DOWN:40}),Xt={name:"ElRadioGroup",componentName:"ElRadioGroup",inject:{elFormItem:{default:""}},mixins:[O.a],props:{value:{},size:String,fill:String,textColor:String,disabled:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},_elTag:function(){var e=(this.$vnode.data||{}).tag;return e&&"component"!==e||(e="div"),e},radioGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},created:function(){var e=this;this.$on("handleChange",(function(t){e.$emit("change",t)}))},mounted:function(){var e=this.$el.querySelectorAll("[type=radio]"),t=this.$el.querySelectorAll("[role=radio]")[0];![].some.call(e,(function(e){return e.checked}))&&t&&(t.tabIndex=0)},methods:{handleKeydown:function(e){var t=e.target,i="INPUT"===t.nodeName?"[type=radio]":"[role=radio]",n=this.$el.querySelectorAll(i),s=n.length,r=[].indexOf.call(n,t),a=this.$el.querySelectorAll("[role=radio]");switch(e.keyCode){case Gt.LEFT:case Gt.UP:e.stopPropagation(),e.preventDefault(),0===r?(a[s-1].click(),a[s-1].focus()):(a[r-1].click(),a[r-1].focus());break;case Gt.RIGHT:case Gt.DOWN:r===s-1?(e.stopPropagation(),e.preventDefault(),a[0].click(),a[0].focus()):(a[r+1].click(),a[r+1].focus());break;default:break}}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",[this.value])}}},Zt=Xt,Qt=o(Zt,Kt,Ut,!1,null,null,null);Qt.options.__file="packages/radio/src/radio-group.vue";var Jt=Qt.exports;Jt.install=function(e){e.component(Jt.name,Jt)};var ei=Jt,ti=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-radio-button",class:[e.size?"el-radio-button--"+e.size:"",{"is-active":e.value===e.label},{"is-disabled":e.isDisabled},{"is-focus":e.focus}],attrs:{role:"radio","aria-checked":e.value===e.label,"aria-disabled":e.isDisabled,tabindex:e.tabIndex},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"]))return null;t.stopPropagation(),t.preventDefault(),e.value=e.isDisabled?e.value:e.label}}},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"el-radio-button__orig-radio",attrs:{type:"radio",name:e.name,disabled:e.isDisabled,tabindex:"-1",autocomplete:"off"},domProps:{value:e.label,checked:e._q(e.value,e.label)},on:{change:[function(t){e.value=e.label},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}),i("span",{staticClass:"el-radio-button__inner",style:e.value===e.label?e.activeStyle:null,on:{keydown:function(e){e.stopPropagation()}}},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2)])},ii=[];ti._withStripped=!0;var ni={name:"ElRadioButton",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},props:{label:{},disabled:Boolean,name:String},data:function(){return{focus:!1}},computed:{value:{get:function(){return this._radioGroup.value},set:function(e){this._radioGroup.$emit("input",e)}},_radioGroup:function(){var e=this.$parent;while(e){if("ElRadioGroup"===e.$options.componentName)return e;e=e.$parent}return!1},activeStyle:function(){return{backgroundColor:this._radioGroup.fill||"",borderColor:this._radioGroup.fill||"",boxShadow:this._radioGroup.fill?"-1px 0 0 0 "+this._radioGroup.fill:"",color:this._radioGroup.textColor||""}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._radioGroup.radioGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isDisabled:function(){return this.disabled||this._radioGroup.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this._radioGroup&&this.value!==this.label?-1:0}},methods:{handleChange:function(){var e=this;this.$nextTick((function(){e.dispatch("ElRadioGroup","handleChange",e.value)}))}}},si=ni,ri=o(si,ti,ii,!1,null,null,null);ri.options.__file="packages/radio/src/radio-button.vue";var ai=ri.exports;ai.install=function(e){e.component(ai.name,ai)};var oi=ai,li=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-checkbox",class:[e.border&&e.checkboxSize?"el-checkbox--"+e.checkboxSize:"",{"is-disabled":e.isDisabled},{"is-bordered":e.border},{"is-checked":e.isChecked}],attrs:{id:e.id}},[i("span",{staticClass:"el-checkbox__input",class:{"is-disabled":e.isDisabled,"is-checked":e.isChecked,"is-indeterminate":e.indeterminate,"is-focus":e.focus},attrs:{tabindex:!!e.indeterminate&&0,role:!!e.indeterminate&&"checkbox","aria-checked":!!e.indeterminate&&"mixed"}},[i("span",{staticClass:"el-checkbox__inner"}),e.trueLabel||e.falseLabel?i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var i=e.model,n=t.target,s=n.checked?e.trueLabel:e.falseLabel;if(Array.isArray(i)){var r=null,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",disabled:e.isDisabled,name:e.name},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var i=e.model,n=t.target,s=!!n.checked;if(Array.isArray(i)){var r=e.label,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})]),e.$slots.default||e.label?i("span",{staticClass:"el-checkbox__label"},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2):e._e()])},ci=[];li._withStripped=!0;var ui={name:"ElCheckbox",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):(this.$emit("input",e),this.selfModel=e)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return this._checkboxGroup=e,!0;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,i=e.min;return!(!t&&!i)&&this.model.length>=t&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||e}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var i=void 0;i=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,e),this.$nextTick((function(){t.isGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])}))}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}}},hi=ui,di=o(hi,li,ci,!1,null,null,null);di.options.__file="packages/checkbox/src/checkbox.vue";var pi=di.exports;pi.install=function(e){e.component(pi.name,pi)};var fi=pi,mi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-checkbox-button",class:[e.size?"el-checkbox-button--"+e.size:"",{"is-disabled":e.isDisabled},{"is-checked":e.isChecked},{"is-focus":e.focus}],attrs:{role:"checkbox","aria-checked":e.isChecked,"aria-disabled":e.isDisabled}},[e.trueLabel||e.falseLabel?i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var i=e.model,n=t.target,s=n.checked?e.trueLabel:e.falseLabel;if(Array.isArray(i)){var r=null,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:e.name,disabled:e.isDisabled},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var i=e.model,n=t.target,s=!!n.checked;if(Array.isArray(i)){var r=e.label,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}),e.$slots.default||e.label?i("span",{staticClass:"el-checkbox-button__inner",style:e.isChecked?e.activeStyle:null},[e._t("default",[e._v(e._s(e.label))])],2):e._e()])},vi=[];mi._withStripped=!0;var gi={name:"ElCheckboxButton",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},props:{value:{},label:{},disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number]},computed:{model:{get:function(){return this._checkboxGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this._checkboxGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):void 0!==this.value?this.$emit("input",e):this.selfModel=e}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},_checkboxGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return e;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},activeStyle:function(){return{backgroundColor:this._checkboxGroup.fill||"",borderColor:this._checkboxGroup.fill||"",color:this._checkboxGroup.textColor||"","box-shadow":"-1px 0 0 0 "+this._checkboxGroup.fill}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._checkboxGroup.checkboxGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,i=e.min;return!(!t&&!i)&&this.model.length>=t&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this._checkboxGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled}},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var i=void 0;i=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,e),this.$nextTick((function(){t._checkboxGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])}))}}},created:function(){this.checked&&this.addToStore()}},bi=gi,yi=o(bi,mi,vi,!1,null,null,null);yi.options.__file="packages/checkbox/src/checkbox-button.vue";var _i=yi.exports;_i.install=function(e){e.component(_i.name,_i)};var xi=_i,Ci=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-checkbox-group",attrs:{role:"group","aria-label":"checkbox-group"}},[e._t("default")],2)},wi=[];Ci._withStripped=!0;var ki={name:"ElCheckboxGroup",componentName:"ElCheckboxGroup",mixins:[O.a],inject:{elFormItem:{default:""}},props:{value:{},disabled:Boolean,min:Number,max:Number,size:String,fill:String,textColor:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",[e])}}},Si=ki,Di=o(Si,Ci,wi,!1,null,null,null);Di.options.__file="packages/checkbox/src/checkbox-group.vue";var $i=Di.exports;$i.install=function(e){e.component($i.name,$i)};var Oi=$i,Ei=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-switch",class:{"is-disabled":e.switchDisabled,"is-checked":e.checked},attrs:{role:"switch","aria-checked":e.checked,"aria-disabled":e.switchDisabled},on:{click:function(t){return t.preventDefault(),e.switchValue(t)}}},[i("input",{ref:"input",staticClass:"el-switch__input",attrs:{type:"checkbox",id:e.id,name:e.name,"true-value":e.activeValue,"false-value":e.inactiveValue,disabled:e.switchDisabled},on:{change:e.handleChange,keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.switchValue(t)}}}),e.inactiveIconClass||e.inactiveText?i("span",{class:["el-switch__label","el-switch__label--left",e.checked?"":"is-active"]},[e.inactiveIconClass?i("i",{class:[e.inactiveIconClass]}):e._e(),!e.inactiveIconClass&&e.inactiveText?i("span",{attrs:{"aria-hidden":e.checked}},[e._v(e._s(e.inactiveText))]):e._e()]):e._e(),i("span",{ref:"core",staticClass:"el-switch__core",style:{width:e.coreWidth+"px"}}),e.activeIconClass||e.activeText?i("span",{class:["el-switch__label","el-switch__label--right",e.checked?"is-active":""]},[e.activeIconClass?i("i",{class:[e.activeIconClass]}):e._e(),!e.activeIconClass&&e.activeText?i("span",{attrs:{"aria-hidden":!e.checked}},[e._v(e._s(e.activeText))]):e._e()]):e._e()])},Ti=[];Ei._withStripped=!0;var Pi={name:"ElSwitch",mixins:[Z()("input"),D.a,O.a],inject:{elForm:{default:""}},props:{value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeIconClass:{type:String,default:""},inactiveIconClass:{type:String,default:""},activeText:String,inactiveText:String,activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String},data:function(){return{coreWidth:this.width}},created:function(){~[this.activeValue,this.inactiveValue].indexOf(this.value)||this.$emit("input",this.inactiveValue)},computed:{checked:function(){return this.value===this.activeValue},switchDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{checked:function(){this.$refs.input.checked=this.checked,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[this.value])}},methods:{handleChange:function(e){var t=this,i=this.checked?this.inactiveValue:this.activeValue;this.$emit("input",i),this.$emit("change",i),this.$nextTick((function(){t.$refs.input.checked=t.checked}))},setBackgroundColor:function(){var e=this.checked?this.activeColor:this.inactiveColor;this.$refs.core.style.borderColor=e,this.$refs.core.style.backgroundColor=e},switchValue:function(){!this.switchDisabled&&this.handleChange()},getMigratingConfig:function(){return{props:{"on-color":"on-color is renamed to active-color.","off-color":"off-color is renamed to inactive-color.","on-text":"on-text is renamed to active-text.","off-text":"off-text is renamed to inactive-text.","on-value":"on-value is renamed to active-value.","off-value":"off-value is renamed to inactive-value.","on-icon-class":"on-icon-class is renamed to active-icon-class.","off-icon-class":"off-icon-class is renamed to inactive-icon-class."}}}},mounted:function(){this.coreWidth=this.width||40,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.$refs.input.checked=this.checked}},Mi=Pi,Ni=o(Mi,Ei,Ti,!1,null,null,null);Ni.options.__file="packages/switch/src/component.vue";var Ii=Ni.exports;Ii.install=function(e){e.component(Ii.name,Ii)};var ji=Ii,Fi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""],on:{click:function(t){return t.stopPropagation(),e.toggleMenu(t)}}},[e.multiple?i("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px",width:"100%"}},[e.collapseTags&&e.selected.length?i("span",[i("el-tag",{attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?i("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[i("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():i("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,(function(t){return i("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(i){e.deleteTag(i,t)}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])})),1),e.filterable?i("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{"flex-grow":"1",width:e.inputLength/(e.inputWidth-32)+"%","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.selectDisabled,autocomplete:e.autoComplete||e.autocomplete},domProps:{value:e.query},on:{focus:e.handleFocus,blur:function(t){e.softFocus=!1},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.handleNavigate("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.handleNavigate("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){return!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.deletePrevTag(t)},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition,input:[function(t){t.target.composing||(e.query=t.target.value)},e.debouncedQueryChange]}}):e._e()],1):e._e(),i("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,autocomplete:e.autoComplete||e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,tabindex:e.multiple&&e.filterable?"-1":null},on:{focus:e.handleFocus,blur:e.handleBlur,input:e.debouncedOnInputChange,compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition},nativeOn:{keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.handleNavigate("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.handleNavigate("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[e.$slots.prefix?i("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),i("template",{slot:"suffix"},[i("i",{directives:[{name:"show",rawName:"v-show",value:!e.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass]}),e.showClose?i("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:e.handleClearClick}}):e._e()])],2),i("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[i("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":e.popperAppendToBody}},[i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?i("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.length)?[e.$slots.empty?e._t("empty"):i("p",{staticClass:"el-select-dropdown__empty"},[e._v("\n "+e._s(e.emptyText)+"\n ")])]:e._e()],2)],1)],1)},Li=[];Fi._withStripped=!0;var Ai=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":e.$parent.multiple},e.popperClass],style:{minWidth:e.minWidth}},[e._t("default")],2)},Vi=[];Ai._withStripped=!0;var Bi={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[H.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",(function(){e.$parent.visible&&e.updatePopper()})),this.$on("destroyPopper",this.destroyPopper)}},zi=Bi,Ri=o(zi,Ai,Vi,!1,null,null,null);Ri.options.__file="packages/select/src/select-dropdown.vue";var Hi=Ri.exports,Wi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){return t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[i("span",[e._v(e._s(e.currentLabel))])])],2)},qi=[];Wi._withStripped=!0;var Yi="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ki={mixins:[O.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var i=this.select,n=i.remote,s=i.valueKey;if(!this.created&&!n){if(s&&"object"===("undefined"===typeof e?"undefined":Yi(e))&&"object"===("undefined"===typeof t?"undefined":Yi(t))&&e[s]===t[s])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var i=this.select.valueKey;return Object(b["getValueByPath"])(e,i)===Object(b["getValueByPath"])(t,i)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var i=this.select.valueKey;return e&&e.some((function(e){return Object(b["getValueByPath"])(e,i)===Object(b["getValueByPath"])(t,i)}))}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(b["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var e=this.select,t=e.selected,i=e.multiple,n=i?t:[t],s=this.select.cachedOptions.indexOf(this),r=n.indexOf(this);s>-1&&r<0&&this.select.cachedOptions.splice(s,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},Ui=Ki,Gi=o(Ui,Wi,qi,!1,null,null,null);Gi.options.__file="packages/select/src/option.vue";var Xi=Gi.exports,Zi=i(29),Qi=i.n(Zi),Ji=i(14),en=i(27),tn=i.n(en),nn={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter((function(e){return e.visible})).every((function(e){return e.disabled}))}},watch:{hoverIndex:function(e){var t=this;"number"===typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach((function(e){e.hover=t.hoverOption===e}))}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var i=this.options[this.hoverIndex];!0!==i.disabled&&!0!==i.groupDisabled&&i.visible||this.navigateOptions(e),this.$nextTick((function(){return t.scrollToOption(t.hoverOption)}))}}else this.visible=!0}}},sn={mixins:[O.a,g.a,Z()("reference"),nn],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(b["isIE"])()&&!Object(b["isEdge"])()&&!this.visible},showClose:function(){var e=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value,t=this.clearable&&!this.selectDisabled&&this.inputHovering&&e;return t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter((function(e){return!e.created})).some((function(t){return t.currentLabel===e.query}));return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"},propPlaceholder:function(){return"undefined"!==typeof this.placeholder?this.placeholder:this.t("el.select.placeholder")}},components:{ElInput:m.a,ElSelectMenu:Hi,ElOption:Xi,ElTag:Qi.a,ElScrollbar:q.a},directives:{Clickoutside:V.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,required:!1},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var e=this;this.$nextTick((function(){e.resetInputHeight()}))},propPlaceholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e,t){this.multiple&&(this.resetInputHeight(),e&&e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(b["valueEquals"])(e,t)||this.dispatch("ElFormItem","el.form.change",e)},visible:function(e){var t=this;e?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick((function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)})),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",e)},options:function(){var e=this;if(!this.$isServer){this.$nextTick((function(){e.broadcast("ElSelectDropdown","updatePopper")})),this.multiple&&this.resetInputHeight();var t=this.$el.querySelectorAll("input");-1===[].indexOf.call(t,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleNavigate:function(e){this.isOnComposition||this.navigateOptions(e)},handleComposition:function(e){var t=this,i=e.target.value;if("compositionend"===e.type)this.isOnComposition=!1,this.$nextTick((function(e){return t.handleQueryChange(i)}));else{var n=i[i.length-1]||"";this.isOnComposition=!Object(Dt["isKorean"])(n)}},handleQueryChange:function(e){var t=this;this.previousQuery===e||this.isOnComposition||(null!==this.previousQuery||"function"!==typeof this.filterMethod&&"function"!==typeof this.remoteMethod?(this.previousQuery=e,this.$nextTick((function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")})),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick((function(){var e=15*t.$refs.input.value.length+20;t.inputLength=t.collapseTags?Math.min(50,e):e,t.managePlaceholder(),t.resetInputHeight()})),this.remote&&"function"===typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"===typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=e)},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var i=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");tn()(i,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick((function(){return e.scrollToOption(e.selected)}))},emitChange:function(e){Object(b["valueEquals"])(this.value,e)||this.$emit("change",e)},getOption:function(e){for(var t=void 0,i="[object object]"===Object.prototype.toString.call(e).toLowerCase(),n="[object null]"===Object.prototype.toString.call(e).toLowerCase(),s="[object undefined]"===Object.prototype.toString.call(e).toLowerCase(),r=this.cachedOptions.length-1;r>=0;r--){var a=this.cachedOptions[r],o=i?Object(b["getValueByPath"])(a.value,this.valueKey)===Object(b["getValueByPath"])(e,this.valueKey):a.value===e;if(o){t=a;break}}if(t)return t;var l=i||n||s?"":String(e),c={value:e,currentLabel:l};return this.multiple&&(c.hitState=!1),c},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var i=[];Array.isArray(this.value)&&this.value.forEach((function(t){i.push(e.getOption(t))})),this.selected=i,this.$nextTick((function(){e.resetInputHeight()}))},handleFocus:function(e){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.filterable&&!this.visible&&(this.menuVisibleOnFocus=!0),this.visible=!0),this.$emit("focus",e))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(e){var t=this;setTimeout((function(){t.isSilentBlur?t.isSilentBlur=!1:t.$emit("blur",e)}),50),this.softFocus=!1},handleClearClick:function(e){this.deleteSelected(e)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags&&!this.filterable||this.$nextTick((function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,i=[].filter.call(t,(function(e){return"INPUT"===e.tagName}))[0],n=e.$refs.tags,s=n?Math.round(n.getBoundingClientRect().height):0,r=e.initialInputHeight||40;i.style.height=0===e.selected.length?r+"px":Math.max(n?s+(s>r?6:0):0,r)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}}))},resetHoverIndex:function(){var e=this;setTimeout((function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map((function(t){return e.options.indexOf(t)}))):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)}),300)},handleOptionSelect:function(e,t){var i=this;if(this.multiple){var n=(this.value||[]).slice(),s=this.getValueIndex(n,e.value);s>-1?n.splice(s,1):(this.multipleLimit<=0||n.length0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],i="[object object]"===Object.prototype.toString.call(t).toLowerCase();if(i){var n=this.valueKey,s=-1;return e.some((function(e,i){return Object(b["getValueByPath"])(e,n)===Object(b["getValueByPath"])(t,n)&&(s=i,!0)})),s}return e.indexOf(t)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(e){e.stopPropagation();var t=this.multiple?[]:"";this.$emit("input",t),this.emitChange(t),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var i=this.selected.indexOf(t);if(i>-1&&!this.selectDisabled){var n=this.value.slice();n.splice(i,1),this.$emit("input",n),this.emitChange(n),this.$emit("remove-tag",t.value)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var i=0;i!==this.options.length;++i){var n=this.options[i];if(this.query){if(!n.disabled&&!n.groupDisabled&&n.visible){this.hoverIndex=i;break}}else if(n.itemSelected){this.hoverIndex=i;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:Object(b["getValueByPath"])(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.propPlaceholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=L()(this.debounce,(function(){e.onInputChange()})),this.debouncedQueryChange=L()(this.debounce,(function(t){e.handleQueryChange(t.target.value)})),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(Ji["addResizeListener"])(this.$el,this.handleResize);var t=this.$refs.reference;if(t&&t.$el){var i={medium:36,small:32,mini:28},n=t.$el.querySelector("input");this.initialInputHeight=n.getBoundingClientRect().height||i[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick((function(){t&&t.$el&&(e.inputWidth=t.$el.getBoundingClientRect().width)})),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(Ji["removeResizeListener"])(this.$el,this.handleResize)}},rn=sn,an=o(rn,Fi,Li,!1,null,null,null);an.options.__file="packages/select/src/select.vue";var on=an.exports;on.install=function(e){e.component(on.name,on)};var ln=on;Xi.install=function(e){e.component(Xi.name,Xi)};var cn=Xi,un=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-group__wrap"},[i("li",{staticClass:"el-select-group__title"},[e._v(e._s(e.label))]),i("li",[i("ul",{staticClass:"el-select-group"},[e._t("default")],2)])])},hn=[];un._withStripped=!0;var dn={mixins:[O.a],name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},data:function(){return{visible:!0}},watch:{disabled:function(e){this.broadcast("ElOption","handleGroupDisabled",e)}},methods:{queryChange:function(){this.visible=this.$children&&Array.isArray(this.$children)&&this.$children.some((function(e){return!0===e.visible}))}},created:function(){this.$on("queryChange",this.queryChange)},mounted:function(){this.disabled&&this.broadcast("ElOption","handleGroupDisabled",this.disabled)}},pn=dn,fn=o(pn,un,hn,!1,null,null,null);fn.options.__file="packages/select/src/option-group.vue";var mn=fn.exports;mn.install=function(e){e.component(mn.name,mn)};var vn=mn,gn=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("button",{staticClass:"el-button",class:[e.type?"el-button--"+e.type:"",e.buttonSize?"el-button--"+e.buttonSize:"",{"is-disabled":e.buttonDisabled,"is-loading":e.loading,"is-plain":e.plain,"is-round":e.round,"is-circle":e.circle}],attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?i("i",{staticClass:"el-icon-loading"}):e._e(),e.icon&&!e.loading?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",[e._t("default")],2):e._e()])},bn=[];gn._withStripped=!0;var yn={name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.$options.propsData.hasOwnProperty("disabled")?this.disabled:(this.elForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},_n=yn,xn=o(_n,gn,bn,!1,null,null,null);xn.options.__file="packages/button/src/button.vue";var Cn=xn.exports;Cn.install=function(e){e.component(Cn.name,Cn)};var wn=Cn,kn=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-button-group"},[e._t("default")],2)},Sn=[];kn._withStripped=!0;var Dn={name:"ElButtonGroup"},$n=Dn,On=o($n,kn,Sn,!1,null,null,null);On.options.__file="packages/button/src/button-group.vue";var En=On.exports;En.install=function(e){e.component(En.name,En)};var Tn=En,Pn=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-table",class:[{"el-table--fit":e.fit,"el-table--striped":e.stripe,"el-table--border":e.border||e.isGroup,"el-table--hidden":e.isHidden,"el-table--group":e.isGroup,"el-table--fluid-height":e.maxHeight,"el-table--scrollable-x":e.layout.scrollX,"el-table--scrollable-y":e.layout.scrollY,"el-table--enable-row-hover":!e.store.states.isComplex,"el-table--enable-row-transition":0!==(e.store.states.data||[]).length&&(e.store.states.data||[]).length<100},e.tableSize?"el-table--"+e.tableSize:""],on:{mouseleave:function(t){e.handleMouseLeave(t)}}},[i("div",{ref:"hiddenColumns",staticClass:"hidden-columns"},[e._t("default")],2),e.showHeader?i("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"headerWrapper",staticClass:"el-table__header-wrapper"},[i("table-header",{ref:"tableHeader",style:{width:e.layout.bodyWidth?e.layout.bodyWidth+"px":""},attrs:{store:e.store,border:e.border,"default-sort":e.defaultSort}})],1):e._e(),i("div",{ref:"bodyWrapper",staticClass:"el-table__body-wrapper",class:[e.layout.scrollX?"is-scrolling-"+e.scrollPosition:"is-scrolling-none"],style:[e.bodyHeight]},[i("table-body",{style:{width:e.bodyWidth},attrs:{context:e.context,store:e.store,stripe:e.stripe,"row-class-name":e.rowClassName,"row-style":e.rowStyle,highlight:e.highlightCurrentRow}}),e.data&&0!==e.data.length?e._e():i("div",{ref:"emptyBlock",staticClass:"el-table__empty-block",style:e.emptyBlockStyle},[i("span",{staticClass:"el-table__empty-text"},[e._t("empty",[e._v(e._s(e.emptyText||e.t("el.table.emptyText")))])],2)]),e.$slots.append?i("div",{ref:"appendWrapper",staticClass:"el-table__append-wrapper"},[e._t("append")],2):e._e()],1),e.showSummary?i("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"},{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"footerWrapper",staticClass:"el-table__footer-wrapper"},[i("table-footer",{style:{width:e.layout.bodyWidth?e.layout.bodyWidth+"px":""},attrs:{store:e.store,border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,"default-sort":e.defaultSort}})],1):e._e(),e.fixedColumns.length>0?i("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"fixedWrapper",staticClass:"el-table__fixed",style:[{width:e.layout.fixedWidth?e.layout.fixedWidth+"px":""},e.fixedHeight]},[e.showHeader?i("div",{ref:"fixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[i("table-header",{ref:"fixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,store:e.store}})],1):e._e(),i("div",{ref:"fixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[i("table-body",{style:{width:e.layout.fixedWidth?e.layout.fixedWidth+"px":""},attrs:{fixed:"left",store:e.store,stripe:e.stripe,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"row-style":e.rowStyle}}),e.$slots.append?i("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?i("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"}],ref:"fixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[i("table-footer",{style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,store:e.store}})],1):e._e()]):e._e(),e.rightFixedColumns.length>0?i("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"rightFixedWrapper",staticClass:"el-table__fixed-right",style:[{width:e.layout.rightFixedWidth?e.layout.rightFixedWidth+"px":"",right:e.layout.scrollY?(e.border?e.layout.gutterWidth:e.layout.gutterWidth||0)+"px":""},e.fixedHeight]},[e.showHeader?i("div",{ref:"rightFixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[i("table-header",{ref:"rightFixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,store:e.store}})],1):e._e(),i("div",{ref:"rightFixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[i("table-body",{style:{width:e.layout.rightFixedWidth?e.layout.rightFixedWidth+"px":""},attrs:{fixed:"right",store:e.store,stripe:e.stripe,"row-class-name":e.rowClassName,"row-style":e.rowStyle,highlight:e.highlightCurrentRow}}),e.$slots.append?i("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?i("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"}],ref:"rightFixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[i("table-footer",{style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,store:e.store}})],1):e._e()]):e._e(),e.rightFixedColumns.length>0?i("div",{ref:"rightFixedPatch",staticClass:"el-table__fixed-right-patch",style:{width:e.layout.scrollY?e.layout.gutterWidth+"px":"0",height:e.layout.headerHeight+"px"}}):e._e(),i("div",{directives:[{name:"show",rawName:"v-show",value:e.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"})])},Mn=[];Pn._withStripped=!0;var Nn=i(17),In=i.n(Nn),jn=i(35),Fn=i(38),Ln=i.n(Fn),An="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Vn=function(e,t){e&&e.addEventListener&&e.addEventListener(An?"DOMMouseScroll":"mousewheel",(function(e){var i=Ln()(e);t&&t.apply(this,[e,i])}))},Bn={bind:function(e,t){Vn(e,t.value)}},zn=i(5),Rn=i.n(zn),Hn="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn=function(e){var t=e.target;while(t&&"HTML"!==t.tagName.toUpperCase()){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},qn=function(e){return null!==e&&"object"===("undefined"===typeof e?"undefined":Hn(e))},Yn=function(e,t,i,n,s){if(!t&&!n&&(!s||Array.isArray(s)&&!s.length))return e;i="string"===typeof i?"descending"===i?-1:1:i&&i<0?-1:1;var r=n?null:function(i,n){return s?(Array.isArray(s)||(s=[s]),s.map((function(t){return"string"===typeof t?Object(b["getValueByPath"])(i,t):t(i,n,e)}))):("$key"!==t&&qn(i)&&"$value"in i&&(i=i.$value),[qn(i)?Object(b["getValueByPath"])(i,t):i])},a=function(e,t){if(n)return n(e.value,t.value);for(var i=0,s=e.key.length;it.key[i])return 1}return 0};return e.map((function(e,t){return{value:e,index:t,key:r?r(e,t):null}})).sort((function(e,t){var n=a(e,t);return n||(n=e.index-t.index),n*i})).map((function(e){return e.value}))},Kn=function(e,t){var i=null;return e.columns.forEach((function(e){e.id===t&&(i=e)})),i},Un=function(e,t){for(var i=null,n=0;n2&&void 0!==arguments[2]?arguments[2]:"children",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hasChildren",s=function(e){return!(Array.isArray(e)&&e.length)};function r(e,a,o){t(e,a,o),a.forEach((function(e){if(e[n])t(e,null,o+1);else{var a=e[i];s(a)||r(e,a,o+1)}}))}e.forEach((function(e){if(e[n])t(e,null,0);else{var a=e[i];s(a)||r(e,a,0)}}))}var as={data:function(){return{states:{defaultExpandAll:!1,expandRows:[]}}},methods:{updateExpandRows:function(){var e=this.states,t=e.data,i=void 0===t?[]:t,n=e.rowKey,s=e.defaultExpandAll,r=e.expandRows;if(s)this.states.expandRows=i.slice();else if(n){var a=Zn(r,n);this.states.expandRows=i.reduce((function(e,t){var i=Xn(t,n),s=a[i];return s&&e.push(t),e}),[])}else this.states.expandRows=[]},toggleRowExpansion:function(e,t){var i=ss(this.states.expandRows,e,t);i&&(this.table.$emit("expand-change",e,this.states.expandRows.slice()),this.scheduleLayout())},setExpandRowKeys:function(e){this.assertRowKey();var t=this.states,i=t.data,n=t.rowKey,s=Zn(i,n);this.states.expandRows=e.reduce((function(e,t){var i=s[t];return i&&e.push(i.row),e}),[])},isRowExpanded:function(e){var t=this.states,i=t.expandRows,n=void 0===i?[]:i,s=t.rowKey;if(s){var r=Zn(n,s);return!!r[Xn(e,s)]}return-1!==n.indexOf(e)}}},os={data:function(){return{states:{_currentRowKey:null,currentRow:null}}},methods:{setCurrentRowKey:function(e){this.assertRowKey(),this.states._currentRowKey=e,this.setCurrentRowByKey(e)},restoreCurrentRowKey:function(){this.states._currentRowKey=null},setCurrentRowByKey:function(e){var t=this.states,i=t.data,n=void 0===i?[]:i,s=t.rowKey,r=null;s&&(r=Object(b["arrayFind"])(n,(function(t){return Xn(t,s)===e}))),t.currentRow=r},updateCurrentRow:function(e){var t=this.states,i=this.table,n=t.currentRow;if(e&&e!==n)return t.currentRow=e,void i.$emit("current-change",e,n);!e&&n&&(t.currentRow=null,i.$emit("current-change",null,n))},updateCurrentRowData:function(){var e=this.states,t=this.table,i=e.rowKey,n=e._currentRowKey,s=e.data||[],r=e.currentRow;if(-1===s.indexOf(r)&&r){if(i){var a=Xn(r,i);this.setCurrentRowByKey(a)}else e.currentRow=null;null===e.currentRow&&t.$emit("current-change",null,r)}else n&&(this.setCurrentRowByKey(n),this.restoreCurrentRowKey())}}},ls=Object.assign||function(e){for(var t=1;t0&&t[0]&&"selection"===t[0].type&&!t[0].fixed&&(t[0].fixed=!0,e.fixedColumns.unshift(t[0]));var i=t.filter((function(e){return!e.fixed}));e.originColumns=[].concat(e.fixedColumns).concat(i).concat(e.rightFixedColumns);var n=hs(i),s=hs(e.fixedColumns),r=hs(e.rightFixedColumns);e.leafColumnsLength=n.length,e.fixedLeafColumnsLength=s.length,e.rightFixedLeafColumnsLength=r.length,e.columns=[].concat(s).concat(n).concat(r),e.isComplex=e.fixedColumns.length>0||e.rightFixedColumns.length>0},scheduleLayout:function(e){e&&this.updateColumns(),this.table.debouncedUpdateLayout()},isSelected:function(e){var t=this.states.selection,i=void 0===t?[]:t;return i.indexOf(e)>-1},clearSelection:function(){var e=this.states;e.isAllSelected=!1;var t=e.selection;t.length&&(e.selection=[],this.table.$emit("selection-change",[]))},cleanSelection:function(){var e=this.states,t=e.data,i=e.rowKey,n=e.selection,s=void 0;if(i){s=[];var r=Zn(n,i),a=Zn(t,i);for(var o in r)r.hasOwnProperty(o)&&!a[o]&&s.push(r[o].row)}else s=n.filter((function(e){return-1===t.indexOf(e)}));if(s.length){var l=n.filter((function(e){return-1===s.indexOf(e)}));e.selection=l,this.table.$emit("selection-change",l.slice())}},toggleRowSelection:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=ss(this.states.selection,e,t);if(n){var s=(this.states.selection||[]).slice();i&&this.table.$emit("select",s,e),this.table.$emit("selection-change",s)}},_toggleAllSelection:function(){var e=this.states,t=e.data,i=void 0===t?[]:t,n=e.selection,s=e.selectOnIndeterminate?!e.isAllSelected:!(e.isAllSelected||n.length);e.isAllSelected=s;var r=!1;i.forEach((function(t,i){e.selectable?e.selectable.call(null,t,i)&&ss(n,t,s)&&(r=!0):ss(n,t,s)&&(r=!0)})),r&&this.table.$emit("selection-change",n?n.slice():[]),this.table.$emit("select-all",n)},updateSelectionByRowKey:function(){var e=this.states,t=e.selection,i=e.rowKey,n=e.data,s=Zn(t,i);n.forEach((function(e){var n=Xn(e,i),r=s[n];r&&(t[r.index]=e)}))},updateAllSelected:function(){var e=this.states,t=e.selection,i=e.rowKey,n=e.selectable,s=e.data||[];if(0!==s.length){var r=void 0;i&&(r=Zn(t,i));for(var a=function(e){return r?!!r[Xn(e,i)]:-1!==t.indexOf(e)},o=!0,l=0,c=0,u=s.length;c1?i-1:0),s=1;s1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw new Error("Table is required.");var i=new ps;return i.table=e,i.toggleAllSelection=L()(10,i._toggleAllSelection),Object.keys(t).forEach((function(e){i.states[e]=t[e]})),i}function ms(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i],s=void 0;"string"===typeof n?s=function(){return this.store.states[n]}:"function"===typeof n?s=function(){return n.call(this,this.store.states)}:console.error("invalid value type"),s&&(t[i]=s)})),t}var vs=i(30),gs=i.n(vs);function bs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ys=function(){function e(t){for(var i in bs(this,e),this.observers=[],this.table=null,this.store=null,this.columns=null,this.fit=!0,this.showHeader=!0,this.height=null,this.scrollX=!1,this.scrollY=!1,this.bodyWidth=null,this.fixedWidth=null,this.rightFixedWidth=null,this.tableHeight=null,this.headerHeight=44,this.appendHeight=0,this.footerHeight=44,this.viewportHeight=null,this.bodyHeight=null,this.fixedBodyHeight=null,this.gutterWidth=gs()(),this.fixedColumnsBodyRowsHeight={},t)t.hasOwnProperty(i)&&(this[i]=t[i]);if(!this.table)throw new Error("table is required for Table Layout");if(!this.store)throw new Error("store is required for Table Layout")}return e.prototype.updateScrollY=function(){var e=this.height;if(null===e)return!1;var t=this.table.bodyWrapper;if(this.table.$el&&t){var i=t.querySelector(".el-table__body"),n=this.scrollY,s=i.offsetHeight>this.bodyHeight;return this.scrollY=s,n!==s}return!1},e.prototype.setHeight=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"height";if(!Rn.a.prototype.$isServer){var n=this.table.$el;if(e=is(e),this.height=e,!n&&(e||0===e))return Rn.a.nextTick((function(){return t.setHeight(e,i)}));"number"===typeof e?(n.style[i]=e+"px",this.updateElsHeight()):"string"===typeof e&&(n.style[i]=e,this.updateElsHeight())}},e.prototype.setMaxHeight=function(e){this.setHeight(e,"max-height")},e.prototype.getFlattenColumns=function(){var e=[],t=this.table.columns;return t.forEach((function(t){t.isColumnGroup?e.push.apply(e,t.columns):e.push(t)})),e},e.prototype.updateElsHeight=function(){var e=this;if(!this.table.$ready)return Rn.a.nextTick((function(){return e.updateElsHeight()}));var t=this.table.$refs,i=t.headerWrapper,n=t.appendWrapper,s=t.footerWrapper;if(this.appendHeight=n?n.offsetHeight:0,!this.showHeader||i){var r=i?i.querySelector(".el-table__header tr"):null,a=this.headerDisplayNone(r),o=this.headerHeight=this.showHeader?i.offsetHeight:0;if(this.showHeader&&!a&&i.offsetWidth>0&&(this.table.columns||[]).length>0&&o<2)return Rn.a.nextTick((function(){return e.updateElsHeight()}));var l=this.tableHeight=this.table.$el.clientHeight,c=this.footerHeight=s?s.offsetHeight:0;null!==this.height&&(this.bodyHeight=l-o-c+(s?1:0)),this.fixedBodyHeight=this.scrollX?this.bodyHeight-this.gutterWidth:this.bodyHeight;var u=!(this.store.states.data&&this.store.states.data.length);this.viewportHeight=this.scrollX?l-(u?0:this.gutterWidth):l,setTimeout((function(){e.syncFixedTableRowHeight()})),this.updateScrollY(),this.notifyObservers("scrollable")}},e.prototype.syncFixedTableRowHeight=function(){var e=this.store.states.fixedColumns,t=this.store.states.rightFixedColumns;if(e.length+t.length!==0){var i=this.table.$refs.bodyWrapper,n=i.getBoundingClientRect();if(!(void 0!==n.height&&n.height<=0)){var s=i.querySelectorAll(".el-table__row")||[],r=[].reduce.call(s,(function(e,t,i){var n=t.getBoundingClientRect().height||"auto";return e[i]=n,e}),{});this.fixedColumnsBodyRowsHeight=r}}},e.prototype.headerDisplayNone=function(e){if(!e)return!0;var t=e;while("DIV"!==t.tagName){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1},e.prototype.updateColumnsWidth=function(){if(!Rn.a.prototype.$isServer){var e=this.fit,t=this.table.$el.clientWidth,i=0,n=this.getFlattenColumns(),s=n.filter((function(e){return"number"!==typeof e.width}));if(n.forEach((function(e){"number"===typeof e.width&&e.realWidth&&(e.realWidth=null)})),s.length>0&&e){n.forEach((function(e){i+=e.width||e.minWidth||80}));var r=this.scrollY?this.gutterWidth:0;if(i<=t-r){this.scrollX=!1;var a=t-r-i;if(1===s.length)s[0].realWidth=(s[0].minWidth||80)+a;else{var o=s.reduce((function(e,t){return e+(t.minWidth||80)}),0),l=a/o,c=0;s.forEach((function(e,t){if(0!==t){var i=Math.floor((e.minWidth||80)*l);c+=i,e.realWidth=(e.minWidth||80)+i}})),s[0].realWidth=(s[0].minWidth||80)+a-c}}else this.scrollX=!0,s.forEach((function(e){e.realWidth=e.minWidth}));this.bodyWidth=Math.max(i,t),this.table.resizeState.width=this.bodyWidth}else n.forEach((function(e){e.width||e.minWidth?e.realWidth=e.width||e.minWidth:e.realWidth=80,i+=e.realWidth})),this.scrollX=i>t,this.bodyWidth=i;var u=this.store.states.fixedColumns;if(u.length>0){var h=0;u.forEach((function(e){h+=e.realWidth||e.width})),this.fixedWidth=h}var d=this.store.states.rightFixedColumns;if(d.length>0){var p=0;d.forEach((function(e){p+=e.realWidth||e.width})),this.rightFixedWidth=p}this.notifyObservers("columns")}},e.prototype.addObserver=function(e){this.observers.push(e)},e.prototype.removeObserver=function(e){var t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)},e.prototype.notifyObservers=function(e){var t=this,i=this.observers;i.forEach((function(i){switch(e){case"columns":i.onColumnsChange(t);break;case"scrollable":i.onScrollableChange(t);break;default:throw new Error("Table Layout don't have event "+e+".")}}))},e}(),_s=ys,xs={created:function(){this.tableLayout.addObserver(this)},destroyed:function(){this.tableLayout.removeObserver(this)},computed:{tableLayout:function(){var e=this.layout;if(!e&&this.table&&(e=this.table.layout),!e)throw new Error("Can not find table layout.");return e}},mounted:function(){this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout)},updated:function(){this.__updated__||(this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout),this.__updated__=!0)},methods:{onColumnsChange:function(e){var t=this.$el.querySelectorAll("colgroup > col");if(t.length){var i=e.getFlattenColumns(),n={};i.forEach((function(e){n[e.id]=e}));for(var s=0,r=t.length;s col[name=gutter]"),i=0,n=t.length;i-1;return e.concat(t.wrappedRowRender({row:i,$index:e.length,isSelected:n,isExpanded:s}))}),[]),e("el-tooltip",{attrs:{effect:this.table.tooltipEffect,placement:"top",content:this.tooltipContent},ref:"tooltip"})])])},computed:Ss({table:function(){return this.$parent}},ms({data:"data",columns:"columns",treeIndent:"indent",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(e){return e.columns.length},leftFixedCount:function(e){return e.fixedColumns.length},rightFixedCount:function(e){return e.rightFixedColumns.length},hasExpandColumn:function(e){return e.columns.some((function(e){var t=e.type;return"expand"===t}))}}),{columnsHidden:function(){var e=this;return this.columns.map((function(t,i){return e.isColumnHidden(i)}))},firstDefaultColumnIndex:function(){return Object(b["arrayFindIndex"])(this.columns,(function(e){var t=e.type;return"default"===t}))}}),watch:{"store.states.hoverRow":function(e,t){var i=this;if(this.store.states.isComplex&&!this.$isServer){var n=window.requestAnimationFrame;n||(n=function(e){return setTimeout(e,16)}),n((function(){var n=i.$el.querySelectorAll(".el-table__row"),s=n[t],r=n[e];s&&Object(Ae["removeClass"])(s,"hover-row"),r&&Object(Ae["addClass"])(r,"hover-row")}))}}},data:function(){return{tooltipContent:""}},created:function(){this.activateTooltip=L()(50,(function(e){return e.handleShowPopper()}))},methods:{getKeyOfRow:function(e,t){var i=this.table.rowKey;return i?Xn(e,i):t},isColumnHidden:function(e){return!0===this.fixed||"left"===this.fixed?e>=this.leftFixedLeafCount:"right"===this.fixed?e=this.columnsCount-this.rightFixedLeafCount},getSpan:function(e,t,i,n){var s=1,r=1,a=this.table.spanMethod;if("function"===typeof a){var o=a({row:e,column:t,rowIndex:i,columnIndex:n});Array.isArray(o)?(s=o[0],r=o[1]):"object"===("undefined"===typeof o?"undefined":ks(o))&&(s=o.rowspan,r=o.colspan)}return{rowspan:s,colspan:r}},getRowStyle:function(e,t){var i=this.table.rowStyle;return"function"===typeof i?i.call(null,{row:e,rowIndex:t}):i||null},getRowClass:function(e,t){var i=["el-table__row"];this.table.highlightCurrentRow&&e===this.store.states.currentRow&&i.push("current-row"),this.stripe&&t%2===1&&i.push("el-table__row--striped");var n=this.table.rowClassName;return"string"===typeof n?i.push(n):"function"===typeof n&&i.push(n.call(null,{row:e,rowIndex:t})),this.store.states.expandRows.indexOf(e)>-1&&i.push("expanded"),i},getCellStyle:function(e,t,i,n){var s=this.table.cellStyle;return"function"===typeof s?s.call(null,{rowIndex:e,columnIndex:t,row:i,column:n}):s},getCellClass:function(e,t,i,n){var s=[n.id,n.align,n.className];this.isColumnHidden(t)&&s.push("is-hidden");var r=this.table.cellClassName;return"string"===typeof r?s.push(r):"function"===typeof r&&s.push(r.call(null,{rowIndex:e,columnIndex:t,row:i,column:n})),s.push("el-table__cell"),s.join(" ")},getColspanRealWidth:function(e,t,i){if(t<1)return e[i].realWidth;var n=e.map((function(e){var t=e.realWidth;return t})).slice(i,i+t);return n.reduce((function(e,t){return e+t}),-1)},handleCellMouseEnter:function(e,t){var i=this.table,n=Wn(e);if(n){var s=Gn(i,n),r=i.hoverState={cell:n,column:s,row:t};i.$emit("cell-mouse-enter",r.row,r.column,r.cell,e)}var a=e.target.querySelector(".cell");if(Object(Ae["hasClass"])(a,"el-tooltip")&&a.childNodes.length){var o=document.createRange();o.setStart(a,0),o.setEnd(a,a.childNodes.length);var l=o.getBoundingClientRect().width,c=(parseInt(Object(Ae["getStyle"])(a,"paddingLeft"),10)||0)+(parseInt(Object(Ae["getStyle"])(a,"paddingRight"),10)||0);if((l+c>a.offsetWidth||a.scrollWidth>a.offsetWidth)&&this.$refs.tooltip){var u=this.$refs.tooltip;this.tooltipContent=n.innerText||n.textContent,u.referenceElm=n,u.$refs.popper&&(u.$refs.popper.style.display="none"),u.doDestroy(),u.setExpectedState(!0),this.activateTooltip(u)}}},handleCellMouseLeave:function(e){var t=this.$refs.tooltip;t&&(t.setExpectedState(!1),t.handleClosePopper());var i=Wn(e);if(i){var n=this.table.hoverState||{};this.table.$emit("cell-mouse-leave",n.row,n.column,n.cell,e)}},handleMouseEnter:L()(30,(function(e){this.store.commit("setHoverRow",e)})),handleMouseLeave:L()(30,(function(){this.store.commit("setHoverRow",null)})),handleContextMenu:function(e,t){this.handleEvent(e,t,"contextmenu")},handleDoubleClick:function(e,t){this.handleEvent(e,t,"dblclick")},handleClick:function(e,t){this.store.commit("setCurrentRow",t),this.handleEvent(e,t,"click")},handleEvent:function(e,t,i){var n=this.table,s=Wn(e),r=void 0;s&&(r=Gn(n,s),r&&n.$emit("cell-"+i,t,r,s,e)),n.$emit("row-"+i,t,r,e)},getRowHeight:function(e){var t=this.fixed;if(!t)return null;var i=(this.tableLayout.fixedColumnsBodyRowsHeight||{})[e];return"number"===typeof i?i+"px":i},rowRender:function(e){var t=this,i=e.row,n=e.$index,s=e.treeRowData,r=e.isSelected,a=e.isExpanded,o=this.$createElement,l=this.treeIndent,c=this.columns,u=this.firstDefaultColumnIndex,h=this.getRowClass(i,n),d=!0;s&&(h.push("el-table__row--level-"+s.level),d=s.display);var p=d?null:{display:"none"},f=this.getRowHeight(n),m=f?{height:f}:null;return o(ws,{style:[p,this.getRowStyle(i,n),m],class:h,key:this.getKeyOfRow(i,n),nativeOn:{dblclick:function(e){return t.handleDoubleClick(e,i)},click:function(e){return t.handleClick(e,i)},contextmenu:function(e){return t.handleContextMenu(e,i)},mouseenter:function(e){return t.handleMouseEnter(n)},mouseleave:this.handleMouseLeave},attrs:{columns:c,row:i,index:n,store:this.store,context:this.context||this.table.$vnode.context,firstDefaultColumnIndex:u,treeRowData:s,treeIndent:l,columnsHidden:this.columnsHidden,getSpan:this.getSpan,getColspanRealWidth:this.getColspanRealWidth,getCellStyle:this.getCellStyle,getCellClass:this.getCellClass,handleCellMouseEnter:this.handleCellMouseEnter,handleCellMouseLeave:this.handleCellMouseLeave,isSelected:r,isExpanded:a,fixed:this.fixed}})},wrappedRowRender:function(e){var t=this,i=e.row,n=e.$index,s=e.isSelected,r=e.isExpanded,a=this.$createElement,o=this.store,l=o.isRowExpanded,c=o.assertRowKey,u=o.states,h=u.treeData,d=u.lazyTreeNodeMap,p=u.childrenColumnName,f=u.rowKey;if(this.hasExpandColumn&&l(i)){var m=this.table.renderExpanded,v=this.rowRender({row:i,$index:n,isSelected:s,isExpanded:r});return m?[[v,a("tr",{key:"expanded-row__"+v.key},[a("td",{attrs:{colspan:this.columnsCount},class:"el-table__cell el-table__expanded-cell"},[m(this.$createElement,{row:i,$index:n,store:this.store})])])]]:(console.error("[Element Error]renderExpanded is required."),v)}if(Object.keys(h).length){c();var g=Xn(i,f),b=h[g],y=null;b&&(y={expanded:b.expanded,level:b.level,display:!0},"boolean"===typeof b.lazy&&("boolean"===typeof b.loaded&&b.loaded&&(y.noLazyChildren=!(b.children&&b.children.length)),y.loading=b.loading));var _=[this.rowRender({row:i,$index:n,treeRowData:y,isSelected:s,isExpanded:r})];if(b){var x=0,C=function e(i,a){i&&i.length&&a&&i.forEach((function(i){var o={display:a.display&&a.expanded,level:a.level+1},l=Xn(i,f);if(void 0===l||null===l)throw new Error("for nested data item, row-key is required.");if(b=Ss({},h[l]),b&&(o.expanded=b.expanded,b.level=b.level||o.level,b.display=!(!b.expanded||!o.display),"boolean"===typeof b.lazy&&("boolean"===typeof b.loaded&&b.loaded&&(o.noLazyChildren=!(b.children&&b.children.length)),o.loading=b.loading)),x++,_.push(t.rowRender({row:i,$index:n+x,treeRowData:o,isSelected:s,isExpanded:r})),b){var c=d[l]||i[p];e(c,b)}}))};b.display=!0;var w=d[g]||i[p];C(w,b)}return _}return this.rowRender({row:i,$index:n,isSelected:s,isExpanded:r})}}},$s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"}},[e.multiple?i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[i("div",{staticClass:"el-table-filter__content"},[i("el-scrollbar",{attrs:{"wrap-class":"el-table-filter__wrap"}},[i("el-checkbox-group",{staticClass:"el-table-filter__checkbox-group",model:{value:e.filteredValue,callback:function(t){e.filteredValue=t},expression:"filteredValue"}},e._l(e.filters,(function(t){return i("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.text))])})),1)],1)],1),i("div",{staticClass:"el-table-filter__bottom"},[i("button",{class:{"is-disabled":0===e.filteredValue.length},attrs:{disabled:0===e.filteredValue.length},on:{click:e.handleConfirm}},[e._v(e._s(e.t("el.table.confirmFilter")))]),i("button",{on:{click:e.handleReset}},[e._v(e._s(e.t("el.table.resetFilter")))])])]):i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[i("ul",{staticClass:"el-table-filter__list"},[i("li",{staticClass:"el-table-filter__list-item",class:{"is-active":void 0===e.filterValue||null===e.filterValue},on:{click:function(t){e.handleSelect(null)}}},[e._v(e._s(e.t("el.table.clearFilter")))]),e._l(e.filters,(function(t){return i("li",{key:t.value,staticClass:"el-table-filter__list-item",class:{"is-active":e.isActive(t)},attrs:{label:t.value},on:{click:function(i){e.handleSelect(t.value)}}},[e._v(e._s(t.text))])}))],2)])])},Os=[];$s._withStripped=!0;var Es=[];!Rn.a.prototype.$isServer&&document.addEventListener("click",(function(e){Es.forEach((function(t){var i=e.target;t&&t.$el&&(i===t.$el||t.$el.contains(i)||t.handleOutsideClick&&t.handleOutsideClick(e))}))}));var Ts={open:function(e){e&&Es.push(e)},close:function(e){var t=Es.indexOf(e);-1!==t&&Es.splice(e,1)}},Ps=i(31),Ms=i.n(Ps),Ns={name:"ElTableFilterPanel",mixins:[H.a,g.a],directives:{Clickoutside:V.a},components:{ElCheckbox:In.a,ElCheckboxGroup:Ms.a,ElScrollbar:q.a},props:{placement:{type:String,default:"bottom-end"}},methods:{isActive:function(e){return e.value===this.filterValue},handleOutsideClick:function(){var e=this;setTimeout((function(){e.showPopper=!1}),16)},handleConfirm:function(){this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleReset:function(){this.filteredValue=[],this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleSelect:function(e){this.filterValue=e,"undefined"!==typeof e&&null!==e?this.confirmFilter(this.filteredValue):this.confirmFilter([]),this.handleOutsideClick()},confirmFilter:function(e){this.table.store.commit("filterChange",{column:this.column,values:e}),this.table.store.updateAllSelected()}},data:function(){return{table:null,cell:null,column:null}},computed:{filters:function(){return this.column&&this.column.filters},filterValue:{get:function(){return(this.column.filteredValue||[])[0]},set:function(e){this.filteredValue&&("undefined"!==typeof e&&null!==e?this.filteredValue.splice(0,1,e):this.filteredValue.splice(0,1))}},filteredValue:{get:function(){return this.column&&this.column.filteredValue||[]},set:function(e){this.column&&(this.column.filteredValue=e)}},multiple:function(){return!this.column||this.column.filterMultiple}},mounted:function(){var e=this;this.popperElm=this.$el,this.referenceElm=this.cell,this.table.bodyWrapper.addEventListener("scroll",(function(){e.updatePopper()})),this.$watch("showPopper",(function(t){e.column&&(e.column.filterOpened=t),t?Ts.open(e):Ts.close(e)}))},watch:{showPopper:function(e){!0===e&&parseInt(this.popperJS._popper.style.zIndex,10)1;return s&&(this.$parent.isGroup=!0),e("table",{class:"el-table__header",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[e("colgroup",[this.columns.map((function(t){return e("col",{attrs:{name:t.id},key:t.id})})),this.hasGutter?e("col",{attrs:{name:"gutter"}}):""]),e("thead",{class:[{"is-group":s,"has-gutter":this.hasGutter}]},[this._l(n,(function(i,n){return e("tr",{style:t.getHeaderRowStyle(n),class:t.getHeaderRowClass(n)},[i.map((function(s,r){return e("th",{attrs:{colspan:s.colSpan,rowspan:s.rowSpan},on:{mousemove:function(e){return t.handleMouseMove(e,s)},mouseout:t.handleMouseOut,mousedown:function(e){return t.handleMouseDown(e,s)},click:function(e){return t.handleHeaderClick(e,s)},contextmenu:function(e){return t.handleHeaderContextMenu(e,s)}},style:t.getHeaderCellStyle(n,r,i,s),class:t.getHeaderCellClass(n,r,i,s),key:s.id},[e("div",{class:["cell",s.filteredValue&&s.filteredValue.length>0?"highlight":"",s.labelClassName]},[s.renderHeader?s.renderHeader.call(t._renderProxy,e,{column:s,$index:r,store:t.store,_self:t.$parent.$vnode.context}):s.label,s.sortable?e("span",{class:"caret-wrapper",on:{click:function(e){return t.handleSortClick(e,s)}}},[e("i",{class:"sort-caret ascending",on:{click:function(e){return t.handleSortClick(e,s,"ascending")}}}),e("i",{class:"sort-caret descending",on:{click:function(e){return t.handleSortClick(e,s,"descending")}}})]):"",s.filterable?e("span",{class:"el-table__column-filter-trigger",on:{click:function(e){return t.handleFilterClick(e,s)}}},[e("i",{class:["el-icon-arrow-down",s.filterOpened?"el-icon-arrow-up":""]})]):""])])})),t.hasGutter?e("th",{class:"el-table__cell gutter"}):""])}))])])},props:{fixed:String,store:{required:!0},border:Boolean,defaultSort:{type:Object,default:function(){return{prop:"",order:""}}}},components:{ElCheckbox:In.a},computed:Ls({table:function(){return this.$parent},hasGutter:function(){return!this.fixed&&this.tableLayout.gutterWidth}},ms({columns:"columns",isAllSelected:"isAllSelected",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(e){return e.columns.length},leftFixedCount:function(e){return e.fixedColumns.length},rightFixedCount:function(e){return e.rightFixedColumns.length}})),created:function(){this.filterPanels={}},mounted:function(){var e=this;this.$nextTick((function(){var t=e.defaultSort,i=t.prop,n=t.order,s=!0;e.store.commit("sort",{prop:i,order:n,init:s})}))},beforeDestroy:function(){var e=this.filterPanels;for(var t in e)e.hasOwnProperty(t)&&e[t]&&e[t].$destroy(!0)},methods:{isCellHidden:function(e,t){for(var i=0,n=0;n=this.leftFixedLeafCount:"right"===this.fixed?i=this.columnsCount-this.rightFixedLeafCount},getHeaderRowStyle:function(e){var t=this.table.headerRowStyle;return"function"===typeof t?t.call(null,{rowIndex:e}):t},getHeaderRowClass:function(e){var t=[],i=this.table.headerRowClassName;return"string"===typeof i?t.push(i):"function"===typeof i&&t.push(i.call(null,{rowIndex:e})),t.join(" ")},getHeaderCellStyle:function(e,t,i,n){var s=this.table.headerCellStyle;return"function"===typeof s?s.call(null,{rowIndex:e,columnIndex:t,row:i,column:n}):s},getHeaderCellClass:function(e,t,i,n){var s=[n.id,n.order,n.headerAlign,n.className,n.labelClassName];0===e&&this.isCellHidden(t,i)&&s.push("is-hidden"),n.children||s.push("is-leaf"),n.sortable&&s.push("is-sortable");var r=this.table.headerCellClassName;return"string"===typeof r?s.push(r):"function"===typeof r&&s.push(r.call(null,{rowIndex:e,columnIndex:t,row:i,column:n})),s.push("el-table__cell"),s.join(" ")},toggleAllSelection:function(){this.store.commit("toggleAllSelection")},handleFilterClick:function(e,t){e.stopPropagation();var i=e.target,n="TH"===i.tagName?i:i.parentNode;if(!Object(Ae["hasClass"])(n,"noclick")){n=n.querySelector(".el-table__column-filter-trigger")||n;var s=this.$parent,r=this.filterPanels[t.id];r&&t.filterOpened?r.showPopper=!1:(r||(r=new Rn.a(Fs),this.filterPanels[t.id]=r,t.filterPlacement&&(r.placement=t.filterPlacement),r.table=s,r.cell=n,r.column=t,!this.$isServer&&r.$mount(document.createElement("div"))),setTimeout((function(){r.showPopper=!0}),16))}},handleHeaderClick:function(e,t){!t.filters&&t.sortable?this.handleSortClick(e,t):t.filterable&&!t.sortable&&this.handleFilterClick(e,t),this.$parent.$emit("header-click",t,e)},handleHeaderContextMenu:function(e,t){this.$parent.$emit("header-contextmenu",t,e)},handleMouseDown:function(e,t){var i=this;if(!this.$isServer&&!(t.children&&t.children.length>0)&&this.draggingColumn&&this.border){this.dragging=!0,this.$parent.resizeProxyVisible=!0;var n=this.$parent,s=n.$el,r=s.getBoundingClientRect().left,a=this.$el.querySelector("th."+t.id),o=a.getBoundingClientRect(),l=o.left-r+30;Object(Ae["addClass"])(a,"noclick"),this.dragState={startMouseLeft:e.clientX,startLeft:o.right-r,startColumnLeft:o.left-r,tableLeft:r};var c=n.$refs.resizeProxy;c.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var u=function(e){var t=e.clientX-i.dragState.startMouseLeft,n=i.dragState.startLeft+t;c.style.left=Math.max(l,n)+"px"},h=function s(){if(i.dragging){var r=i.dragState,o=r.startColumnLeft,l=r.startLeft,h=parseInt(c.style.left,10),d=h-o;t.width=t.realWidth=d,n.$emit("header-dragend",t.width,l-o,t,e),i.store.scheduleLayout(),document.body.style.cursor="",i.dragging=!1,i.draggingColumn=null,i.dragState={},n.resizeProxyVisible=!1}document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",s),document.onselectstart=null,document.ondragstart=null,setTimeout((function(){Object(Ae["removeClass"])(a,"noclick")}),0)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",h)}},handleMouseMove:function(e,t){if(!(t.children&&t.children.length>0)){var i=e.target;while(i&&"TH"!==i.tagName)i=i.parentNode;if(t&&t.resizable&&!this.dragging&&this.border){var n=i.getBoundingClientRect(),s=document.body.style;n.width>12&&n.right-e.pageX<8?(s.cursor="col-resize",Object(Ae["hasClass"])(i,"is-sortable")&&(i.style.cursor="col-resize"),this.draggingColumn=t):this.dragging||(s.cursor="",Object(Ae["hasClass"])(i,"is-sortable")&&(i.style.cursor="pointer"),this.draggingColumn=null)}}},handleMouseOut:function(){this.$isServer||(document.body.style.cursor="")},toggleOrder:function(e){var t=e.order,i=e.sortOrders;if(""===t)return i[0];var n=i.indexOf(t||null);return i[n>i.length-2?0:n+1]},handleSortClick:function(e,t,i){e.stopPropagation();var n=t.order===i?null:i||this.toggleOrder(t),s=e.target;while(s&&"TH"!==s.tagName)s=s.parentNode;if(s&&"TH"===s.tagName&&Object(Ae["hasClass"])(s,"noclick"))Object(Ae["removeClass"])(s,"noclick");else if(t.sortable){var r=this.store.states,a=r.sortProp,o=void 0,l=r.sortingColumn;(l!==t||l===t&&null===l.order)&&(l&&(l.order=null),r.sortingColumn=t,a=t.property),o=t.order=n||null,r.sortProp=a,r.sortOrder=o,this.store.commit("changeSortCondition")}}},data:function(){return{draggingColumn:null,dragging:!1,dragState:{}}}},zs=Object.assign||function(e){for(var t=1;t=this.leftFixedLeafCount;if("right"===this.fixed){for(var n=0,s=0;s=this.columnsCount-this.rightFixedCount)},getRowClasses:function(e,t){var i=[e.id,e.align,e.labelClassName];return e.className&&i.push(e.className),this.isCellHidden(t,this.columns,e)&&i.push("is-hidden"),e.children||i.push("is-leaf"),i}}},Hs=Object.assign||function(e){for(var t=1;t0){var n=i.scrollTop;t.pixelY<0&&0!==n&&e.preventDefault(),t.pixelY>0&&i.scrollHeight-i.clientHeight>n&&e.preventDefault(),i.scrollTop+=Math.ceil(t.pixelY/5)}else i.scrollLeft+=Math.ceil(t.pixelX/5)},handleHeaderFooterMousewheel:function(e,t){var i=t.pixelX,n=t.pixelY;Math.abs(i)>=Math.abs(n)&&(this.bodyWrapper.scrollLeft+=t.pixelX/5)},syncPostion:Object(jn["throttle"])(20,(function(){var e=this.bodyWrapper,t=e.scrollLeft,i=e.scrollTop,n=e.offsetWidth,s=e.scrollWidth,r=this.$refs,a=r.headerWrapper,o=r.footerWrapper,l=r.fixedBodyWrapper,c=r.rightFixedBodyWrapper;a&&(a.scrollLeft=t),o&&(o.scrollLeft=t),l&&(l.scrollTop=i),c&&(c.scrollTop=i);var u=s-n-1;this.scrollPosition=t>=u?"right":0===t?"left":"middle"})),bindEvents:function(){this.bodyWrapper.addEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(Ji["addResizeListener"])(this.$el,this.resizeListener)},unbindEvents:function(){this.bodyWrapper.removeEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(Ji["removeResizeListener"])(this.$el,this.resizeListener)},resizeListener:function(){if(this.$ready){var e=!1,t=this.$el,i=this.resizeState,n=i.width,s=i.height,r=t.offsetWidth;n!==r&&(e=!0);var a=t.offsetHeight;(this.height||this.shouldUpdateHeight)&&s!==a&&(e=!0),e&&(this.resizeState.width=r,this.resizeState.height=a,this.doLayout())}},doLayout:function(){this.shouldUpdateHeight&&this.layout.updateElsHeight(),this.layout.updateColumnsWidth()},sort:function(e,t){this.store.commit("sort",{prop:e,order:t})},toggleAllSelection:function(){this.store.commit("toggleAllSelection")}},computed:Hs({tableSize:function(){return this.size||(this.$ELEMENT||{}).size},bodyWrapper:function(){return this.$refs.bodyWrapper},shouldUpdateHeight:function(){return this.height||this.maxHeight||this.fixedColumns.length>0||this.rightFixedColumns.length>0},bodyWidth:function(){var e=this.layout,t=e.bodyWidth,i=e.scrollY,n=e.gutterWidth;return t?t-(i?n:0)+"px":""},bodyHeight:function(){var e=this.layout,t=e.headerHeight,i=void 0===t?0:t,n=e.bodyHeight,s=e.footerHeight,r=void 0===s?0:s;if(this.height)return{height:n?n+"px":""};if(this.maxHeight){var a=is(this.maxHeight);if("number"===typeof a)return{"max-height":a-r-(this.showHeader?i:0)+"px"}}return{}},fixedBodyHeight:function(){if(this.height)return{height:this.layout.fixedBodyHeight?this.layout.fixedBodyHeight+"px":""};if(this.maxHeight){var e=is(this.maxHeight);if("number"===typeof e)return e=this.layout.scrollX?e-this.layout.gutterWidth:e,this.showHeader&&(e-=this.layout.headerHeight),e-=this.layout.footerHeight,{"max-height":e+"px"}}return{}},fixedHeight:function(){return this.maxHeight?this.showSummary?{bottom:0}:{bottom:this.layout.scrollX&&this.data.length?this.layout.gutterWidth+"px":""}:this.showSummary?{height:this.layout.tableHeight?this.layout.tableHeight+"px":""}:{height:this.layout.viewportHeight?this.layout.viewportHeight+"px":""}},emptyBlockStyle:function(){if(this.data&&this.data.length)return null;var e="100%";return this.layout.appendHeight&&(e="calc(100% - "+this.layout.appendHeight+"px)"),{width:this.bodyWidth,height:e}}},ms({selection:"selection",columns:"columns",tableData:"data",fixedColumns:"fixedColumns",rightFixedColumns:"rightFixedColumns"})),watch:{height:{immediate:!0,handler:function(e){this.layout.setHeight(e)}},maxHeight:{immediate:!0,handler:function(e){this.layout.setMaxHeight(e)}},currentRowKey:{immediate:!0,handler:function(e){this.rowKey&&this.store.setCurrentRowKey(e)}},data:{immediate:!0,handler:function(e){this.store.commit("setData",e)}},expandRowKeys:{immediate:!0,handler:function(e){e&&this.store.setExpandRowKeysAdapter(e)}}},created:function(){var e=this;this.tableId="el-table_"+Ws++,this.debouncedUpdateLayout=Object(jn["debounce"])(50,(function(){return e.doLayout()}))},mounted:function(){var e=this;this.bindEvents(),this.store.updateColumns(),this.doLayout(),this.resizeState={width:this.$el.offsetWidth,height:this.$el.offsetHeight},this.store.states.columns.forEach((function(t){t.filteredValue&&t.filteredValue.length&&e.store.commit("filterChange",{column:t,values:t.filteredValue,silent:!0})})),this.$ready=!0},destroyed:function(){this.unbindEvents()},data:function(){var e=this.treeProps,t=e.hasChildren,i=void 0===t?"hasChildren":t,n=e.children,s=void 0===n?"children":n;this.store=fs(this,{rowKey:this.rowKey,defaultExpandAll:this.defaultExpandAll,selectOnIndeterminate:this.selectOnIndeterminate,indent:this.indent,lazy:this.lazy,lazyColumnIdentifier:i,childrenColumnName:s});var r=new _s({store:this.store,table:this,fit:this.fit,showHeader:this.showHeader});return{layout:r,isHidden:!1,renderExpanded:null,resizeProxyVisible:!1,resizeState:{width:null,height:null},isGroup:!1,scrollPosition:"left"}}},Ys=qs,Ks=o(Ys,Pn,Mn,!1,null,null,null);Ks.options.__file="packages/table/src/table.vue";var Us=Ks.exports;Us.install=function(e){e.component(Us.name,Us)};var Gs=Us,Xs={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:"",className:"el-table-column--selection"},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Zs={selection:{renderHeader:function(e,t){var i=t.store;return e("el-checkbox",{attrs:{disabled:i.states.data&&0===i.states.data.length,indeterminate:i.states.selection.length>0&&!this.isAllSelected,value:this.isAllSelected},on:{input:this.toggleAllSelection}})},renderCell:function(e,t){var i=t.row,n=t.column,s=t.isSelected,r=t.store,a=t.$index;return e("el-checkbox",{nativeOn:{click:function(e){return e.stopPropagation()}},attrs:{value:s,disabled:!!n.selectable&&!n.selectable.call(null,i,a)},on:{input:function(){r.commit("rowSelectedChanged",i)}}})},sortable:!1,resizable:!1},index:{renderHeader:function(e,t){var i=t.column;return i.label||"#"},renderCell:function(e,t){var i=t.$index,n=t.column,s=i+1,r=n.index;return"number"===typeof r?s=i+r:"function"===typeof r&&(s=r(i)),e("div",[s])},sortable:!1},expand:{renderHeader:function(e,t){var i=t.column;return i.label||""},renderCell:function(e,t){var i=t.row,n=t.store,s=t.isExpanded,r=["el-table__expand-icon"];s&&r.push("el-table__expand-icon--expanded");var a=function(e){e.stopPropagation(),n.toggleRowExpansion(i)};return e("div",{class:r,on:{click:a}},[e("i",{class:"el-icon el-icon-arrow-right"})])},sortable:!1,resizable:!1,className:"el-table__expand-column"}};function Qs(e,t){var i=t.row,n=t.column,s=t.$index,r=n.property,a=r&&Object(b["getPropByPath"])(i,r).v;return n&&n.formatter?n.formatter(i,n,a,s):a}function Js(e,t){var i=t.row,n=t.treeNode,s=t.store;if(!n)return null;var r=[],a=function(e){e.stopPropagation(),s.loadOrToggle(i)};if(n.indent&&r.push(e("span",{class:"el-table__indent",style:{"padding-left":n.indent+"px"}})),"boolean"!==typeof n.expanded||n.noLazyChildren)r.push(e("span",{class:"el-table__placeholder"}));else{var o=["el-table__expand-icon",n.expanded?"el-table__expand-icon--expanded":""],l=["el-icon-arrow-right"];n.loading&&(l=["el-icon-loading"]),r.push(e("div",{class:o,on:{click:a}},[e("i",{class:l})]))}return r}var er=Object.assign||function(e){for(var t=1;t-1}))}}},data:function(){return{isSubColumn:!1,columns:[]}},computed:{owner:function(){var e=this.$parent;while(e&&!e.tableId)e=e.$parent;return e},columnOrTableParent:function(){var e=this.$parent;while(e&&!e.tableId&&!e.columnId)e=e.$parent;return e},realWidth:function(){return es(this.width)},realMinWidth:function(){return ts(this.minWidth)},realAlign:function(){return this.align?"is-"+this.align:null},realHeaderAlign:function(){return this.headerAlign?"is-"+this.headerAlign:this.realAlign}},methods:{getPropsData:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n3&&void 0!==arguments[3]?arguments[3]:"-";if(!e)return null;var s=(fr[i]||fr["default"]).parser,r=t||lr[i];return s(e,r,n)},gr=function(e,t,i){if(!e)return null;var n=(fr[i]||fr["default"]).formatter,s=t||lr[i];return n(e,s)},br=function(e,t){var i=function(e,t){var i=e instanceof Date,n=t instanceof Date;return i&&n?e.getTime()===t.getTime():!i&&!n&&e===t},n=e instanceof Array,s=t instanceof Array;return n&&s?e.length===t.length&&e.every((function(e,n){return i(e,t[n])})):!n&&!s&&i(e,t)},yr=function(e){return"string"===typeof e||e instanceof String},_r=function(e){return null===e||void 0===e||yr(e)||Array.isArray(e)&&2===e.length&&e.every(yr)},xr={mixins:[O.a,or],inject:{elForm:{default:""},elFormItem:{default:""}},props:{size:String,format:String,valueFormat:String,readonly:Boolean,placeholder:String,startPlaceholder:String,endPlaceholder:String,prefixIcon:String,clearIcon:{type:String,default:"el-icon-circle-close"},name:{default:"",validator:_r},disabled:Boolean,clearable:{type:Boolean,default:!0},id:{default:"",validator:_r},popperClass:String,editable:{type:Boolean,default:!0},align:{type:String,default:"left"},value:{},defaultValue:{},defaultTime:{},rangeSeparator:{default:"-"},pickerOptions:{},unlinkPanels:Boolean,validateEvent:{type:Boolean,default:!0}},components:{ElInput:m.a},directives:{Clickoutside:V.a},data:function(){return{pickerVisible:!1,showClose:!1,userInput:null,valueOnOpen:null,unwatchPickerOptions:null}},watch:{pickerVisible:function(e){this.readonly||this.pickerDisabled||(e?(this.showPicker(),this.valueOnOpen=Array.isArray(this.value)?[].concat(this.value):this.value):(this.hidePicker(),this.emitChange(this.value),this.userInput=null,this.validateEvent&&this.dispatch("ElFormItem","el.form.blur"),this.$emit("blur",this),this.blur()))},parsedValue:{immediate:!0,handler:function(e){this.picker&&(this.picker.value=e)}},defaultValue:function(e){this.picker&&(this.picker.defaultValue=e)},value:function(e,t){br(e,t)||this.pickerVisible||!this.validateEvent||this.dispatch("ElFormItem","el.form.change",e)}},computed:{ranged:function(){return this.type.indexOf("range")>-1},reference:function(){var e=this.$refs.reference;return e.$el||e},refInput:function(){return this.reference?[].slice.call(this.reference.querySelectorAll("input")):[]},valueIsEmpty:function(){var e=this.value;if(Array.isArray(e)){for(var t=0,i=e.length;t0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.userInput=null,e.pickerVisible=e.picker.visible=i,e.emitInput(t),e.picker.resetView&&e.picker.resetView()})),this.picker.$on("select-range",(function(t,i,n){0!==e.refInput.length&&(n&&"min"!==n?"max"===n&&(e.refInput[1].setSelectionRange(t,i),e.refInput[1].focus()):(e.refInput[0].setSelectionRange(t,i),e.refInput[0].focus()))}))},unmountPicker:function(){this.picker&&(this.picker.$destroy(),this.picker.$off(),"function"===typeof this.unwatchPickerOptions&&this.unwatchPickerOptions(),this.picker.$el.parentNode.removeChild(this.picker.$el))},emitChange:function(e){br(e,this.valueOnOpen)||(this.$emit("change",e),this.valueOnOpen=e,this.validateEvent&&this.dispatch("ElFormItem","el.form.change",e))},emitInput:function(e){var t=this.formatToValue(e);br(this.value,t)||this.$emit("input",t)},isValidValue:function(e){return this.picker||this.mountPicker(),!this.picker.isValidValue||e&&this.picker.isValidValue(e)}}},Cr=xr,wr=o(Cr,sr,rr,!1,null,null,null);wr.options.__file="packages/date-picker/src/picker.vue";var kr=wr.exports,Sr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-enter":e.handleEnter,"after-leave":e.handleLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts,"has-time":e.showTime},e.popperClass]},[i("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?i("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,(function(t,n){return i("button",{key:n,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(i){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])})),0):e._e(),i("div",{staticClass:"el-picker-panel__body"},[e.showTime?i("div",{staticClass:"el-date-picker__time-header"},[i("span",{staticClass:"el-date-picker__editor-wrap"},[i("el-input",{attrs:{placeholder:e.t("el.datepicker.selectDate"),value:e.visibleDate,size:"small"},on:{input:function(t){return e.userInputDate=t},change:e.handleVisibleDateChange}})],1),i("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleTimePickClose,expression:"handleTimePickClose"}],staticClass:"el-date-picker__editor-wrap"},[i("el-input",{ref:"input",attrs:{placeholder:e.t("el.datepicker.selectTime"),value:e.visibleTime,size:"small"},on:{focus:function(t){e.timePickerVisible=!0},input:function(t){return e.userInputTime=t},change:e.handleVisibleTimeChange}}),i("time-picker",{ref:"timepicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.timePickerVisible},on:{pick:e.handleTimePick,mounted:e.proxyTimePickerDataProperties}})],1)]):e._e(),i("div",{directives:[{name:"show",rawName:"v-show",value:"time"!==e.currentView,expression:"currentView !== 'time'"}],staticClass:"el-date-picker__header",class:{"el-date-picker__header--bordered":"year"===e.currentView||"month"===e.currentView}},[i("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",attrs:{type:"button","aria-label":e.t("el.datepicker.prevYear")},on:{click:e.prevYear}}),i("button",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",attrs:{type:"button","aria-label":e.t("el.datepicker.prevMonth")},on:{click:e.prevMonth}}),i("span",{staticClass:"el-date-picker__header-label",attrs:{role:"button"},on:{click:e.showYearPicker}},[e._v(e._s(e.yearLabel))]),i("span",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-date-picker__header-label",class:{active:"month"===e.currentView},attrs:{role:"button"},on:{click:e.showMonthPicker}},[e._v(e._s(e.t("el.datepicker.month"+(e.month+1))))]),i("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",attrs:{type:"button","aria-label":e.t("el.datepicker.nextYear")},on:{click:e.nextYear}}),i("button",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",attrs:{type:"button","aria-label":e.t("el.datepicker.nextMonth")},on:{click:e.nextMonth}})]),i("div",{staticClass:"el-picker-panel__content"},[i("date-table",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],attrs:{"selection-mode":e.selectionMode,"first-day-of-week":e.firstDayOfWeek,value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"cell-class-name":e.cellClassName,"disabled-date":e.disabledDate},on:{pick:e.handleDatePick}}),i("year-table",{directives:[{name:"show",rawName:"v-show",value:"year"===e.currentView,expression:"currentView === 'year'"}],attrs:{value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleYearPick}}),i("month-table",{directives:[{name:"show",rawName:"v-show",value:"month"===e.currentView,expression:"currentView === 'month'"}],attrs:{value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleMonthPick}})],1)])],2),i("div",{directives:[{name:"show",rawName:"v-show",value:e.footerVisible&&"date"===e.currentView,expression:"footerVisible && currentView === 'date'"}],staticClass:"el-picker-panel__footer"},[i("el-button",{directives:[{name:"show",rawName:"v-show",value:"dates"!==e.selectionMode,expression:"selectionMode !== 'dates'"}],staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:e.changeToNow}},[e._v("\n "+e._s(e.t("el.datepicker.now"))+"\n ")]),i("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini"},on:{click:e.confirm}},[e._v("\n "+e._s(e.t("el.datepicker.confirm"))+"\n ")])],1)])])},Dr=[];Sr._withStripped=!0;var $r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-time-panel el-popper",class:e.popperClass},[i("div",{staticClass:"el-time-panel__content",class:{"has-seconds":e.showSeconds}},[i("time-spinner",{ref:"spinner",attrs:{"arrow-control":e.useArrow,"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,date:e.date},on:{change:e.handleChange,"select-range":e.setSelectionRange}})],1),i("div",{staticClass:"el-time-panel__footer"},[i("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:e.handleCancel}},[e._v(e._s(e.t("el.datepicker.cancel")))]),i("button",{staticClass:"el-time-panel__btn",class:{confirm:!e.disabled},attrs:{type:"button"},on:{click:function(t){e.handleConfirm()}}},[e._v(e._s(e.t("el.datepicker.confirm")))])])])])},Or=[];$r._withStripped=!0;var Er=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-time-spinner",class:{"has-seconds":e.showSeconds}},[e.arrowControl?e._e():[i("el-scrollbar",{ref:"hours",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("hours")},mousemove:function(t){e.adjustCurrentSpinner("hours")}}},e._l(e.hoursList,(function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:n===e.hours,disabled:t},on:{click:function(i){e.handleClick("hours",{value:n,disabled:t})}}},[e._v(e._s(("0"+(e.amPmMode?n%12||12:n)).slice(-2))+e._s(e.amPm(n)))])})),0),i("el-scrollbar",{ref:"minutes",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("minutes")},mousemove:function(t){e.adjustCurrentSpinner("minutes")}}},e._l(e.minutesList,(function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:n===e.minutes,disabled:!t},on:{click:function(t){e.handleClick("minutes",{value:n,disabled:!1})}}},[e._v(e._s(("0"+n).slice(-2)))])})),0),i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.showSeconds,expression:"showSeconds"}],ref:"seconds",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("seconds")},mousemove:function(t){e.adjustCurrentSpinner("seconds")}}},e._l(60,(function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:n===e.seconds},on:{click:function(t){e.handleClick("seconds",{value:n,disabled:!1})}}},[e._v(e._s(("0"+n).slice(-2)))])})),0)],e.arrowControl?[i("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("hours")}}},[i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),i("ul",{ref:"hours",staticClass:"el-time-spinner__list"},e._l(e.arrowHourList,(function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:t===e.hours,disabled:e.hoursList[t]}},[e._v(e._s(void 0===t?"":("0"+(e.amPmMode?t%12||12:t)).slice(-2)+e.amPm(t)))])})),0)]),i("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("minutes")}}},[i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),i("ul",{ref:"minutes",staticClass:"el-time-spinner__list"},e._l(e.arrowMinuteList,(function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:t===e.minutes}},[e._v("\n "+e._s(void 0===t?"":("0"+t).slice(-2))+"\n ")])})),0)]),e.showSeconds?i("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("seconds")}}},[i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),i("ul",{ref:"seconds",staticClass:"el-time-spinner__list"},e._l(e.arrowSecondList,(function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:t===e.seconds}},[e._v("\n "+e._s(void 0===t?"":("0"+t).slice(-2))+"\n ")])})),0)]):e._e()]:e._e()],2)},Tr=[];Er._withStripped=!0;var Pr={components:{ElScrollbar:q.a},directives:{repeatClick:It},props:{date:{},defaultValue:{},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:String,default:""}},computed:{hours:function(){return this.date.getHours()},minutes:function(){return this.date.getMinutes()},seconds:function(){return this.date.getSeconds()},hoursList:function(){return Object(ar["getRangeHours"])(this.selectableRange)},minutesList:function(){return Object(ar["getRangeMinutes"])(this.selectableRange,this.hours)},arrowHourList:function(){var e=this.hours;return[e>0?e-1:void 0,e,e<23?e+1:void 0]},arrowMinuteList:function(){var e=this.minutes;return[e>0?e-1:void 0,e,e<59?e+1:void 0]},arrowSecondList:function(){var e=this.seconds;return[e>0?e-1:void 0,e,e<59?e+1:void 0]}},data:function(){return{selectableRange:[],currentScrollbar:null}},mounted:function(){var e=this;this.$nextTick((function(){!e.arrowControl&&e.bindScrollEvent()}))},methods:{increase:function(){this.scrollDown(1)},decrease:function(){this.scrollDown(-1)},modifyDateField:function(e,t){switch(e){case"hours":this.$emit("change",Object(ar["modifyTime"])(this.date,t,this.minutes,this.seconds));break;case"minutes":this.$emit("change",Object(ar["modifyTime"])(this.date,this.hours,t,this.seconds));break;case"seconds":this.$emit("change",Object(ar["modifyTime"])(this.date,this.hours,this.minutes,t));break}},handleClick:function(e,t){var i=t.value,n=t.disabled;n||(this.modifyDateField(e,i),this.emitSelectRange(e),this.adjustSpinner(e,i))},emitSelectRange:function(e){"hours"===e?this.$emit("select-range",0,2):"minutes"===e?this.$emit("select-range",3,5):"seconds"===e&&this.$emit("select-range",6,8),this.currentScrollbar=e},bindScrollEvent:function(){var e=this,t=function(t){e.$refs[t].wrap.onscroll=function(i){e.handleScroll(t,i)}};t("hours"),t("minutes"),t("seconds")},handleScroll:function(e){var t=Math.min(Math.round((this.$refs[e].wrap.scrollTop-(.5*this.scrollBarHeight(e)-10)/this.typeItemHeight(e)+3)/this.typeItemHeight(e)),"hours"===e?23:59);this.modifyDateField(e,t)},adjustSpinners:function(){this.adjustSpinner("hours",this.hours),this.adjustSpinner("minutes",this.minutes),this.adjustSpinner("seconds",this.seconds)},adjustCurrentSpinner:function(e){this.adjustSpinner(e,this[e])},adjustSpinner:function(e,t){if(!this.arrowControl){var i=this.$refs[e].wrap;i&&(i.scrollTop=Math.max(0,t*this.typeItemHeight(e)))}},scrollDown:function(e){var t=this;this.currentScrollbar||this.emitSelectRange("hours");var i=this.currentScrollbar,n=this.hoursList,s=this[i];if("hours"===this.currentScrollbar){var r=Math.abs(e);e=e>0?1:-1;var a=n.length;while(a--&&r)s=(s+e+n.length)%n.length,n[s]||r--;if(n[s])return}else s=(s+e+60)%60;this.modifyDateField(i,s),this.adjustSpinner(i,s),this.$nextTick((function(){return t.emitSelectRange(t.currentScrollbar)}))},amPm:function(e){var t="a"===this.amPmMode.toLowerCase();if(!t)return"";var i="A"===this.amPmMode,n=e<12?" am":" pm";return i&&(n=n.toUpperCase()),n},typeItemHeight:function(e){return this.$refs[e].$el.querySelector("li").offsetHeight},scrollBarHeight:function(e){return this.$refs[e].$el.offsetHeight}}},Mr=Pr,Nr=o(Mr,Er,Tr,!1,null,null,null);Nr.options.__file="packages/date-picker/src/basic/time-spinner.vue";var Ir=Nr.exports,jr={mixins:[g.a],components:{TimeSpinner:Ir},props:{visible:Boolean,timeArrowControl:Boolean},watch:{visible:function(e){var t=this;e?(this.oldValue=this.value,this.$nextTick((function(){return t.$refs.spinner.emitSelectRange("hours")}))):this.needInitAdjust=!0},value:function(e){var t=this,i=void 0;e instanceof Date?i=Object(ar["limitTimeRange"])(e,this.selectableRange,this.format):e||(i=this.defaultValue?new Date(this.defaultValue):new Date),this.date=i,this.visible&&this.needInitAdjust&&(this.$nextTick((function(e){return t.adjustSpinners()})),this.needInitAdjust=!1)},selectableRange:function(e){this.$refs.spinner.selectableRange=e},defaultValue:function(e){Object(ar["isDate"])(this.value)||(this.date=e?new Date(e):new Date)}},data:function(){return{popperClass:"",format:"HH:mm:ss",value:"",defaultValue:null,date:new Date,oldValue:new Date,selectableRange:[],selectionRange:[0,2],disabled:!1,arrowControl:!1,needInitAdjust:!0}},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},useArrow:function(){return this.arrowControl||this.timeArrowControl||!1},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},methods:{handleCancel:function(){this.$emit("pick",this.oldValue,!1)},handleChange:function(e){this.visible&&(this.date=Object(ar["clearMilliseconds"])(e),this.isValidValue(this.date)&&this.$emit("pick",this.date,!0))},setSelectionRange:function(e,t){this.$emit("select-range",e,t),this.selectionRange=[e,t]},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(!t){var i=Object(ar["clearMilliseconds"])(Object(ar["limitTimeRange"])(this.date,this.selectableRange,this.format));this.$emit("pick",i,e,t)}},handleKeydown:function(e){var t=e.keyCode,i={38:-1,40:1,37:-1,39:1};if(37===t||39===t){var n=i[t];return this.changeSelectionRange(n),void e.preventDefault()}if(38===t||40===t){var s=i[t];return this.$refs.spinner.scrollDown(s),void e.preventDefault()}},isValidValue:function(e){return Object(ar["timeWithinRange"])(e,this.selectableRange,this.format)},adjustSpinners:function(){return this.$refs.spinner.adjustSpinners()},changeSelectionRange:function(e){var t=[0,3].concat(this.showSeconds?[6]:[]),i=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),n=t.indexOf(this.selectionRange[0]),s=(n+e+t.length)%t.length;this.$refs.spinner.emitSelectRange(i[s])}},mounted:function(){var e=this;this.$nextTick((function(){return e.handleConfirm(!0,!0)})),this.$emit("mounted")}},Fr=jr,Lr=o(Fr,$r,Or,!1,null,null,null);Lr.options.__file="packages/date-picker/src/panel/time.vue";var Ar=Lr.exports,Vr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("table",{staticClass:"el-year-table",on:{click:e.handleYearTableClick}},[i("tbody",[i("tr",[i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+0)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+1)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+1))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+2)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+2))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+3)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+3))])])]),i("tr",[i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+4)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+4))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+5)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+5))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+6)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+6))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+7)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+7))])])]),i("tr",[i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+8)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+8))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+9)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+9))])]),i("td"),i("td")])])])},Br=[];Vr._withStripped=!0;var zr=function(e){var t=Object(ar["getDayCountOfYear"])(e),i=new Date(e,0,1);return Object(ar["range"])(t).map((function(e){return Object(ar["nextDate"])(i,e)}))},Rr={props:{disabledDate:{},value:{},defaultValue:{validator:function(e){return null===e||e instanceof Date&&Object(ar["isDate"])(e)}},date:{}},computed:{startYear:function(){return 10*Math.floor(this.date.getFullYear()/10)}},methods:{getCellStyle:function(e){var t={},i=new Date;return t.disabled="function"===typeof this.disabledDate&&zr(e).every(this.disabledDate),t.current=Object(b["arrayFindIndex"])(Object(b["coerceTruthyValueToArray"])(this.value),(function(t){return t.getFullYear()===e}))>=0,t.today=i.getFullYear()===e,t.default=this.defaultValue&&this.defaultValue.getFullYear()===e,t},handleYearTableClick:function(e){var t=e.target;if("A"===t.tagName){if(Object(Ae["hasClass"])(t.parentNode,"disabled"))return;var i=t.textContent||t.innerText;this.$emit("pick",Number(i))}}}},Hr=Rr,Wr=o(Hr,Vr,Br,!1,null,null,null);Wr.options.__file="packages/date-picker/src/basic/year-table.vue";var qr=Wr.exports,Yr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("table",{staticClass:"el-month-table",on:{click:e.handleMonthTableClick,mousemove:e.handleMouseMove}},[i("tbody",e._l(e.rows,(function(t,n){return i("tr",{key:n},e._l(t,(function(t,n){return i("td",{key:n,class:e.getCellStyle(t)},[i("div",[i("a",{staticClass:"cell"},[e._v(e._s(e.t("el.datepicker.months."+e.months[t.text])))])])])})),0)})),0)])},Kr=[];Yr._withStripped=!0;var Ur=function(e,t){var i=Object(ar["getDayCountOfMonth"])(e,t),n=new Date(e,t,1);return Object(ar["range"])(i).map((function(e){return Object(ar["nextDate"])(n,e)}))},Gr=function(e){return new Date(e.getFullYear(),e.getMonth())},Xr=function(e){return"number"===typeof e||"string"===typeof e?Gr(new Date(e)).getTime():e instanceof Date?Gr(e).getTime():NaN},Zr={props:{disabledDate:{},value:{},selectionMode:{default:"month"},minDate:{},maxDate:{},defaultValue:{validator:function(e){return null===e||Object(ar["isDate"])(e)||Array.isArray(e)&&e.every(ar["isDate"])}},date:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},mixins:[g.a],watch:{"rangeState.endDate":function(e){this.markRange(this.minDate,e)},minDate:function(e,t){Xr(e)!==Xr(t)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(e,t){Xr(e)!==Xr(t)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{months:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],tableRows:[[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(e,t){var i=new Date(t);return this.date.getFullYear()===i.getFullYear()&&Number(e.text)===i.getMonth()},getCellStyle:function(e){var t=this,i={},n=this.date.getFullYear(),s=new Date,r=e.text,a=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[];return i.disabled="function"===typeof this.disabledDate&&Ur(n,r).every(this.disabledDate),i.current=Object(b["arrayFindIndex"])(Object(b["coerceTruthyValueToArray"])(this.value),(function(e){return e.getFullYear()===n&&e.getMonth()===r}))>=0,i.today=s.getFullYear()===n&&s.getMonth()===r,i.default=a.some((function(i){return t.cellMatchesDate(e,i)})),e.inRange&&(i["in-range"]=!0,e.start&&(i["start-date"]=!0),e.end&&(i["end-date"]=!0)),i},getMonthOfCell:function(e){var t=this.date.getFullYear();return new Date(t,e,1)},markRange:function(e,t){e=Xr(e),t=Xr(t)||e;var i=[Math.min(e,t),Math.max(e,t)];e=i[0],t=i[1];for(var n=this.rows,s=0,r=n.length;s=e&&h<=t,c.start=e&&h===e,c.end=t&&h===t}},handleMouseMove:function(e){if(this.rangeState.selecting){var t=e.target;if("A"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var i=t.parentNode.rowIndex,n=t.cellIndex;this.rows[i][n].disabled||i===this.lastRow&&n===this.lastColumn||(this.lastRow=i,this.lastColumn=n,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getMonthOfCell(4*i+n)}}))}}},handleMonthTableClick:function(e){var t=e.target;if("A"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName&&!Object(Ae["hasClass"])(t,"disabled")){var i=t.cellIndex,n=t.parentNode.rowIndex,s=4*n+i,r=this.getMonthOfCell(s);"range"===this.selectionMode?this.rangeState.selecting?(r>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:r}):this.$emit("pick",{minDate:r,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:r,maxDate:null}),this.rangeState.selecting=!0):this.$emit("pick",s)}}},computed:{rows:function(){for(var e=this,t=this.tableRows,i=this.disabledDate,n=[],s=Xr(new Date),r=0;r<3;r++)for(var a=t[r],o=function(t){var o=a[t];o||(o={row:r,column:t,type:"normal",inRange:!1,start:!1,end:!1}),o.type="normal";var l=4*r+t,c=new Date(e.date.getFullYear(),l).getTime();o.inRange=c>=Xr(e.minDate)&&c<=Xr(e.maxDate),o.start=e.minDate&&c===Xr(e.minDate),o.end=e.maxDate&&c===Xr(e.maxDate);var u=c===s;u&&(o.type="today"),o.text=l;var h=new Date(c);o.disabled="function"===typeof i&&i(h),o.selected=Object(b["arrayFind"])(n,(function(e){return e.getTime()===h.getTime()})),e.$set(a,t,o)},l=0;l<4;l++)o(l);return t}}},Qr=Zr,Jr=o(Qr,Yr,Kr,!1,null,null,null);Jr.options.__file="packages/date-picker/src/basic/month-table.vue";var ea=Jr.exports,ta=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("table",{staticClass:"el-date-table",class:{"is-week-mode":"week"===e.selectionMode},attrs:{cellspacing:"0",cellpadding:"0"},on:{click:e.handleClick,mousemove:e.handleMouseMove}},[i("tbody",[i("tr",[e.showWeekNumber?i("th",[e._v(e._s(e.t("el.datepicker.week")))]):e._e(),e._l(e.WEEKS,(function(t,n){return i("th",{key:n},[e._v(e._s(e.t("el.datepicker.weeks."+t)))])}))],2),e._l(e.rows,(function(t,n){return i("tr",{key:n,staticClass:"el-date-table__row",class:{current:e.isWeekActive(t[1])}},e._l(t,(function(t,n){return i("td",{key:n,class:e.getCellClasses(t)},[i("div",[i("span",[e._v("\n "+e._s(t.text)+"\n ")])])])})),0)}))],2)])},ia=[];ta._withStripped=!0;var na=["sun","mon","tue","wed","thu","fri","sat"],sa=function(e){return"number"===typeof e||"string"===typeof e?Object(ar["clearTime"])(new Date(e)).getTime():e instanceof Date?Object(ar["clearTime"])(e).getTime():NaN},ra=function(e,t){var i="function"===typeof t?Object(b["arrayFindIndex"])(e,t):e.indexOf(t);return i>=0?[].concat(e.slice(0,i),e.slice(i+1)):e},aa={mixins:[g.a],props:{firstDayOfWeek:{default:7,type:Number,validator:function(e){return e>=1&&e<=7}},value:{},defaultValue:{validator:function(e){return null===e||Object(ar["isDate"])(e)||Array.isArray(e)&&e.every(ar["isDate"])}},date:{},selectionMode:{default:"day"},showWeekNumber:{type:Boolean,default:!1},disabledDate:{},cellClassName:{},minDate:{},maxDate:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},computed:{offsetDay:function(){var e=this.firstDayOfWeek;return e>3?7-e:-e},WEEKS:function(){var e=this.firstDayOfWeek;return na.concat(na).slice(e,e+7)},year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},startDate:function(){return Object(ar["getStartDateOfMonth"])(this.year,this.month)},rows:function(){var e=this,t=new Date(this.year,this.month,1),i=Object(ar["getFirstDayOfMonth"])(t),n=Object(ar["getDayCountOfMonth"])(t.getFullYear(),t.getMonth()),s=Object(ar["getDayCountOfMonth"])(t.getFullYear(),0===t.getMonth()?11:t.getMonth()-1);i=0===i?7:i;for(var r=this.offsetDay,a=this.tableRows,o=1,l=this.startDate,c=this.disabledDate,u=this.cellClassName,h="dates"===this.selectionMode?Object(b["coerceTruthyValueToArray"])(this.value):[],d=sa(new Date),p=0;p<6;p++){var f=a[p];this.showWeekNumber&&(f[0]||(f[0]={type:"week",text:Object(ar["getWeekNumber"])(Object(ar["nextDate"])(l,7*p+1))}));for(var m=function(t){var a=f[e.showWeekNumber?t+1:t];a||(a={row:p,column:t,type:"normal",inRange:!1,start:!1,end:!1}),a.type="normal";var m=7*p+t,v=Object(ar["nextDate"])(l,m-r).getTime();a.inRange=v>=sa(e.minDate)&&v<=sa(e.maxDate),a.start=e.minDate&&v===sa(e.minDate),a.end=e.maxDate&&v===sa(e.maxDate);var g=v===d;if(g&&(a.type="today"),p>=0&&p<=1){var y=i+r<0?7+i+r:i+r;t+7*p>=y?a.text=o++:(a.text=s-(y-t%7)+1+7*p,a.type="prev-month")}else o<=n?a.text=o++:(a.text=o++-n,a.type="next-month");var _=new Date(v);a.disabled="function"===typeof c&&c(_),a.selected=Object(b["arrayFind"])(h,(function(e){return e.getTime()===_.getTime()})),a.customClass="function"===typeof u&&u(_),e.$set(f,e.showWeekNumber?t+1:t,a)},v=0;v<7;v++)m(v);if("week"===this.selectionMode){var g=this.showWeekNumber?1:0,y=this.showWeekNumber?7:6,_=this.isWeekActive(f[g+1]);f[g].inRange=_,f[g].start=_,f[y].inRange=_,f[y].end=_}}return a}},watch:{"rangeState.endDate":function(e){this.markRange(this.minDate,e)},minDate:function(e,t){sa(e)!==sa(t)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(e,t){sa(e)!==sa(t)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{tableRows:[[],[],[],[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(e,t){var i=new Date(t);return this.year===i.getFullYear()&&this.month===i.getMonth()&&Number(e.text)===i.getDate()},getCellClasses:function(e){var t=this,i=this.selectionMode,n=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[],s=[];return"normal"!==e.type&&"today"!==e.type||e.disabled?s.push(e.type):(s.push("available"),"today"===e.type&&s.push("today")),"normal"===e.type&&n.some((function(i){return t.cellMatchesDate(e,i)}))&&s.push("default"),"day"!==i||"normal"!==e.type&&"today"!==e.type||!this.cellMatchesDate(e,this.value)||s.push("current"),!e.inRange||"normal"!==e.type&&"today"!==e.type&&"week"!==this.selectionMode||(s.push("in-range"),e.start&&s.push("start-date"),e.end&&s.push("end-date")),e.disabled&&s.push("disabled"),e.selected&&s.push("selected"),e.customClass&&s.push(e.customClass),s.join(" ")},getDateOfCell:function(e,t){var i=7*e+(t-(this.showWeekNumber?1:0))-this.offsetDay;return Object(ar["nextDate"])(this.startDate,i)},isWeekActive:function(e){if("week"!==this.selectionMode)return!1;var t=new Date(this.year,this.month,1),i=t.getFullYear(),n=t.getMonth();if("prev-month"===e.type&&(t.setMonth(0===n?11:n-1),t.setFullYear(0===n?i-1:i)),"next-month"===e.type&&(t.setMonth(11===n?0:n+1),t.setFullYear(11===n?i+1:i)),t.setDate(parseInt(e.text,10)),Object(ar["isDate"])(this.value)){var s=(this.value.getDay()-this.firstDayOfWeek+7)%7-1,r=Object(ar["prevDate"])(this.value,s);return r.getTime()===t.getTime()}return!1},markRange:function(e,t){e=sa(e),t=sa(t)||e;var i=[Math.min(e,t),Math.max(e,t)];e=i[0],t=i[1];for(var n=this.startDate,s=this.rows,r=0,a=s.length;r=e&&d<=t,u.start=e&&d===e,u.end=t&&d===t}},handleMouseMove:function(e){if(this.rangeState.selecting){var t=e.target;if("SPAN"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var i=t.parentNode.rowIndex-1,n=t.cellIndex;this.rows[i][n].disabled||i===this.lastRow&&n===this.lastColumn||(this.lastRow=i,this.lastColumn=n,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getDateOfCell(i,n)}}))}}},handleClick:function(e){var t=e.target;if("SPAN"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var i=t.parentNode.rowIndex-1,n="week"===this.selectionMode?1:t.cellIndex,s=this.rows[i][n];if(!s.disabled&&"week"!==s.type){var r=this.getDateOfCell(i,n);if("range"===this.selectionMode)this.rangeState.selecting?(r>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:r}):this.$emit("pick",{minDate:r,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:r,maxDate:null}),this.rangeState.selecting=!0);else if("day"===this.selectionMode)this.$emit("pick",r);else if("week"===this.selectionMode){var a=Object(ar["getWeekNumber"])(r),o=r.getFullYear()+"w"+a;this.$emit("pick",{year:r.getFullYear(),week:a,value:o,date:r})}else if("dates"===this.selectionMode){var l=this.value||[],c=s.selected?ra(l,(function(e){return e.getTime()===r.getTime()})):[].concat(l,[r]);this.$emit("pick",c)}}}}}},oa=aa,la=o(oa,ta,ia,!1,null,null,null);la.options.__file="packages/date-picker/src/basic/date-table.vue";var ca=la.exports,ua={mixins:[g.a],directives:{Clickoutside:V.a},watch:{showTime:function(e){var t=this;e&&this.$nextTick((function(e){var i=t.$refs.input.$el;i&&(t.pickerWidth=i.getBoundingClientRect().width+10)}))},value:function(e){"dates"===this.selectionMode&&this.value||(Object(ar["isDate"])(e)?this.date=new Date(e):this.date=this.getDefaultValue())},defaultValue:function(e){Object(ar["isDate"])(this.value)||(this.date=e?new Date(e):new Date)},timePickerVisible:function(e){var t=this;e&&this.$nextTick((function(){return t.$refs.timepicker.adjustSpinners()}))},selectionMode:function(e){"month"===e?"year"===this.currentView&&"month"===this.currentView||(this.currentView="month"):"dates"===e&&(this.currentView="date")}},methods:{proxyTimePickerDataProperties:function(){var e=this,t=function(t){e.$refs.timepicker.format=t},i=function(t){e.$refs.timepicker.value=t},n=function(t){e.$refs.timepicker.date=t},s=function(t){e.$refs.timepicker.selectableRange=t};this.$watch("value",i),this.$watch("date",n),this.$watch("selectableRange",s),t(this.timeFormat),i(this.value),n(this.date),s(this.selectableRange)},handleClear:function(){this.date=this.getDefaultValue(),this.$emit("pick",null)},emit:function(e){for(var t=this,i=arguments.length,n=Array(i>1?i-1:0),s=1;s0)||Object(ar["timeWithinRange"])(e,this.selectableRange,this.format||"HH:mm:ss")}},components:{TimePicker:Ar,YearTable:qr,MonthTable:ea,DateTable:ca,ElInput:m.a,ElButton:ae.a},data:function(){return{popperClass:"",date:new Date,value:"",defaultValue:null,defaultTime:null,showTime:!1,selectionMode:"day",shortcuts:"",visible:!1,currentView:"date",disabledDate:"",cellClassName:"",selectableRange:[],firstDayOfWeek:7,showWeekNumber:!1,timePickerVisible:!1,format:"",arrowControl:!1,userInputDate:null,userInputTime:null}},computed:{year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},week:function(){return Object(ar["getWeekNumber"])(this.date)},monthDate:function(){return this.date.getDate()},footerVisible:function(){return this.showTime||"dates"===this.selectionMode},visibleTime:function(){return null!==this.userInputTime?this.userInputTime:Object(ar["formatDate"])(this.value||this.defaultValue,this.timeFormat)},visibleDate:function(){return null!==this.userInputDate?this.userInputDate:Object(ar["formatDate"])(this.value||this.defaultValue,this.dateFormat)},yearLabel:function(){var e=this.t("el.datepicker.year");if("year"===this.currentView){var t=10*Math.floor(this.year/10);return e?t+" "+e+" - "+(t+9)+" "+e:t+" - "+(t+9)}return this.year+" "+e},timeFormat:function(){return this.format?Object(ar["extractTimeFormat"])(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(ar["extractDateFormat"])(this.format):"yyyy-MM-dd"}}},ha=ua,da=o(ha,Sr,Dr,!1,null,null,null);da.options.__file="packages/date-picker/src/panel/date.vue";var pa=da.exports,fa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts,"has-time":e.showTime},e.popperClass]},[i("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?i("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,(function(t,n){return i("button",{key:n,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(i){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])})),0):e._e(),i("div",{staticClass:"el-picker-panel__body"},[e.showTime?i("div",{staticClass:"el-date-range-picker__time-header"},[i("span",{staticClass:"el-date-range-picker__editors-wrap"},[i("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{ref:"minInput",staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.startDate"),value:e.minVisibleDate},on:{input:function(t){return e.handleDateInput(t,"min")},change:function(t){return e.handleDateChange(t,"min")}}})],1),i("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleMinTimeClose,expression:"handleMinTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.startTime"),value:e.minVisibleTime},on:{focus:function(t){e.minTimePickerVisible=!0},input:function(t){return e.handleTimeInput(t,"min")},change:function(t){return e.handleTimeChange(t,"min")}}}),i("time-picker",{ref:"minTimePicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.minTimePickerVisible},on:{pick:e.handleMinTimePick,mounted:function(t){e.$refs.minTimePicker.format=e.timeFormat}}})],1)]),i("span",{staticClass:"el-icon-arrow-right"}),i("span",{staticClass:"el-date-range-picker__editors-wrap is-right"},[i("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.endDate"),value:e.maxVisibleDate,readonly:!e.minDate},on:{input:function(t){return e.handleDateInput(t,"max")},change:function(t){return e.handleDateChange(t,"max")}}})],1),i("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleMaxTimeClose,expression:"handleMaxTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.endTime"),value:e.maxVisibleTime,readonly:!e.minDate},on:{focus:function(t){e.minDate&&(e.maxTimePickerVisible=!0)},input:function(t){return e.handleTimeInput(t,"max")},change:function(t){return e.handleTimeChange(t,"max")}}}),i("time-picker",{ref:"maxTimePicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.maxTimePickerVisible},on:{pick:e.handleMaxTimePick,mounted:function(t){e.$refs.maxTimePicker.format=e.timeFormat}}})],1)])]):e._e(),i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[i("div",{staticClass:"el-date-range-picker__header"},[i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevYear}}),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevMonth}}),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.leftNextYear}}):e._e(),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",class:{"is-disabled":!e.enableMonthArrow},attrs:{type:"button",disabled:!e.enableMonthArrow},on:{click:e.leftNextMonth}}):e._e(),i("div",[e._v(e._s(e.leftLabel))])]),i("date-table",{attrs:{"selection-mode":"range",date:e.leftDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate,"cell-class-name":e.cellClassName,"first-day-of-week":e.firstDayOfWeek},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1),i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[i("div",{staticClass:"el-date-range-picker__header"},[e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.rightPrevYear}}):e._e(),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",class:{"is-disabled":!e.enableMonthArrow},attrs:{type:"button",disabled:!e.enableMonthArrow},on:{click:e.rightPrevMonth}}):e._e(),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:e.rightNextYear}}),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",attrs:{type:"button"},on:{click:e.rightNextMonth}}),i("div",[e._v(e._s(e.rightLabel))])]),i("date-table",{attrs:{"selection-mode":"range",date:e.rightDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate,"cell-class-name":e.cellClassName,"first-day-of-week":e.firstDayOfWeek},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1)])],2),e.showTime?i("div",{staticClass:"el-picker-panel__footer"},[i("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:e.handleClear}},[e._v("\n "+e._s(e.t("el.datepicker.clear"))+"\n ")]),i("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini",disabled:e.btnDisabled},on:{click:function(t){e.handleConfirm(!1)}}},[e._v("\n "+e._s(e.t("el.datepicker.confirm"))+"\n ")])],1):e._e()])])},ma=[];fa._withStripped=!0;var va=function(e){return Array.isArray(e)?[new Date(e[0]),new Date(e[1])]:e?[new Date(e),Object(ar["nextDate"])(new Date(e),1)]:[new Date,Object(ar["nextDate"])(new Date,1)]},ga={mixins:[g.a],directives:{Clickoutside:V.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.leftDate.getMonth()+1))},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.rightDate.getMonth()+1))},leftYear:function(){return this.leftDate.getFullYear()},leftMonth:function(){return this.leftDate.getMonth()},leftMonthDate:function(){return this.leftDate.getDate()},rightYear:function(){return this.rightDate.getFullYear()},rightMonth:function(){return this.rightDate.getMonth()},rightMonthDate:function(){return this.rightDate.getDate()},minVisibleDate:function(){return null!==this.dateUserInput.min?this.dateUserInput.min:this.minDate?Object(ar["formatDate"])(this.minDate,this.dateFormat):""},maxVisibleDate:function(){return null!==this.dateUserInput.max?this.dateUserInput.max:this.maxDate||this.minDate?Object(ar["formatDate"])(this.maxDate||this.minDate,this.dateFormat):""},minVisibleTime:function(){return null!==this.timeUserInput.min?this.timeUserInput.min:this.minDate?Object(ar["formatDate"])(this.minDate,this.timeFormat):""},maxVisibleTime:function(){return null!==this.timeUserInput.max?this.timeUserInput.max:this.maxDate||this.minDate?Object(ar["formatDate"])(this.maxDate||this.minDate,this.timeFormat):""},timeFormat:function(){return this.format?Object(ar["extractTimeFormat"])(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(ar["extractDateFormat"])(this.format):"yyyy-MM-dd"},enableMonthArrow:function(){var e=(this.leftMonth+1)%12,t=this.leftMonth+1>=12?1:0;return this.unlinkPanels&&new Date(this.leftYear+t,e)=12}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(ar["nextMonth"])(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},showTime:!1,shortcuts:"",visible:"",disabledDate:"",cellClassName:"",firstDayOfWeek:7,minTimePickerVisible:!1,maxTimePickerVisible:!1,format:"",arrowControl:!1,unlinkPanels:!1,dateUserInput:{min:null,max:null},timeUserInput:{min:null,max:null}}},watch:{minDate:function(e){var t=this;this.dateUserInput.min=null,this.timeUserInput.min=null,this.$nextTick((function(){if(t.$refs.maxTimePicker&&t.maxDate&&t.maxDatethis.maxDate&&(this.maxDate=this.minDate)):(this.maxDate=Object(ar["modifyDate"])(this.maxDate,i.getFullYear(),i.getMonth(),i.getDate()),this.maxDatethis.maxDate&&(this.maxDate=this.minDate),this.$refs.minTimePicker.value=this.minDate,this.minTimePickerVisible=!1):(this.maxDate=Object(ar["modifyTime"])(this.maxDate,i.getHours(),i.getMinutes(),i.getSeconds()),this.maxDate1&&void 0!==arguments[1])||arguments[1],n=this.defaultTime||[],s=Object(ar["modifyWithTimeString"])(e.minDate,n[0]),r=Object(ar["modifyWithTimeString"])(e.maxDate,n[1]);this.maxDate===r&&this.minDate===s||(this.onPick&&this.onPick(e),this.maxDate=r,this.minDate=s,setTimeout((function(){t.maxDate=r,t.minDate=s}),10),i&&!this.showTime&&this.handleConfirm())},handleShortcutClick:function(e){e.onClick&&e.onClick(this)},handleMinTimePick:function(e,t,i){this.minDate=this.minDate||new Date,e&&(this.minDate=Object(ar["modifyTime"])(this.minDate,e.getHours(),e.getMinutes(),e.getSeconds())),i||(this.minTimePickerVisible=t),(!this.maxDate||this.maxDate&&this.maxDate.getTime()this.maxDate.getTime()&&(this.minDate=new Date(this.maxDate))},handleMaxTimeClose:function(){this.maxTimePickerVisible=!1},leftPrevYear:function(){this.leftDate=Object(ar["prevYear"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(ar["nextMonth"])(this.leftDate))},leftPrevMonth:function(){this.leftDate=Object(ar["prevMonth"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(ar["nextMonth"])(this.leftDate))},rightNextYear:function(){this.unlinkPanels?this.rightDate=Object(ar["nextYear"])(this.rightDate):(this.leftDate=Object(ar["nextYear"])(this.leftDate),this.rightDate=Object(ar["nextMonth"])(this.leftDate))},rightNextMonth:function(){this.unlinkPanels?this.rightDate=Object(ar["nextMonth"])(this.rightDate):(this.leftDate=Object(ar["nextMonth"])(this.leftDate),this.rightDate=Object(ar["nextMonth"])(this.leftDate))},leftNextYear:function(){this.leftDate=Object(ar["nextYear"])(this.leftDate)},leftNextMonth:function(){this.leftDate=Object(ar["nextMonth"])(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(ar["prevYear"])(this.rightDate)},rightPrevMonth:function(){this.rightDate=Object(ar["prevMonth"])(this.rightDate)},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],e)},isValidValue:function(e){return Array.isArray(e)&&e&&e[0]&&e[1]&&Object(ar["isDate"])(e[0])&&Object(ar["isDate"])(e[1])&&e[0].getTime()<=e[1].getTime()&&("function"!==typeof this.disabledDate||!this.disabledDate(e[0])&&!this.disabledDate(e[1]))},resetView:function(){this.minDate&&null==this.maxDate&&(this.rangeState.selecting=!1),this.minDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[1]):null}},components:{TimePicker:Ar,DateTable:ca,ElInput:m.a,ElButton:ae.a}},ba=ga,ya=o(ba,fa,ma,!1,null,null,null);ya.options.__file="packages/date-picker/src/panel/date-range.vue";var _a=ya.exports,xa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts},e.popperClass]},[i("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?i("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,(function(t,n){return i("button",{key:n,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(i){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])})),0):e._e(),i("div",{staticClass:"el-picker-panel__body"},[i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[i("div",{staticClass:"el-date-range-picker__header"},[i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevYear}}),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.leftNextYear}}):e._e(),i("div",[e._v(e._s(e.leftLabel))])]),i("month-table",{attrs:{"selection-mode":"range",date:e.leftDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1),i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[i("div",{staticClass:"el-date-range-picker__header"},[e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.rightPrevYear}}):e._e(),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:e.rightNextYear}}),i("div",[e._v(e._s(e.rightLabel))])]),i("month-table",{attrs:{"selection-mode":"range",date:e.rightDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1)])],2)])])},Ca=[];xa._withStripped=!0;var wa=function(e){return Array.isArray(e)?[new Date(e[0]),new Date(e[1])]:e?[new Date(e),Object(ar["nextMonth"])(new Date(e))]:[new Date,Object(ar["nextMonth"])(new Date)]},ka={mixins:[g.a],directives:{Clickoutside:V.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")},leftYear:function(){return this.leftDate.getFullYear()},rightYear:function(){return this.rightDate.getFullYear()===this.leftDate.getFullYear()?this.leftDate.getFullYear()+1:this.rightDate.getFullYear()},enableYearArrow:function(){return this.unlinkPanels&&this.rightYear>this.leftYear+1}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(ar["nextYear"])(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},shortcuts:"",visible:"",disabledDate:"",format:"",arrowControl:!1,unlinkPanels:!1}},watch:{value:function(e){if(e){if(Array.isArray(e))if(this.minDate=Object(ar["isDate"])(e[0])?new Date(e[0]):null,this.maxDate=Object(ar["isDate"])(e[1])?new Date(e[1]):null,this.minDate)if(this.leftDate=this.minDate,this.unlinkPanels&&this.maxDate){var t=this.minDate.getFullYear(),i=this.maxDate.getFullYear();this.rightDate=t===i?Object(ar["nextYear"])(this.maxDate):this.maxDate}else this.rightDate=Object(ar["nextYear"])(this.leftDate);else this.leftDate=wa(this.defaultValue)[0],this.rightDate=Object(ar["nextYear"])(this.leftDate)}else this.minDate=null,this.maxDate=null},defaultValue:function(e){if(!Array.isArray(this.value)){var t=wa(e),i=t[0],n=t[1];this.leftDate=i,this.rightDate=e&&e[1]&&i.getFullYear()!==n.getFullYear()&&this.unlinkPanels?n:Object(ar["nextYear"])(this.leftDate)}}},methods:{handleClear:function(){this.minDate=null,this.maxDate=null,this.leftDate=wa(this.defaultValue)[0],this.rightDate=Object(ar["nextYear"])(this.leftDate),this.$emit("pick",null)},handleChangeRange:function(e){this.minDate=e.minDate,this.maxDate=e.maxDate,this.rangeState=e.rangeState},handleRangePick:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.defaultTime||[],s=Object(ar["modifyWithTimeString"])(e.minDate,n[0]),r=Object(ar["modifyWithTimeString"])(e.maxDate,n[1]);this.maxDate===r&&this.minDate===s||(this.onPick&&this.onPick(e),this.maxDate=r,this.minDate=s,setTimeout((function(){t.maxDate=r,t.minDate=s}),10),i&&this.handleConfirm())},handleShortcutClick:function(e){e.onClick&&e.onClick(this)},leftPrevYear:function(){this.leftDate=Object(ar["prevYear"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(ar["prevYear"])(this.rightDate))},rightNextYear:function(){this.unlinkPanels||(this.leftDate=Object(ar["nextYear"])(this.leftDate)),this.rightDate=Object(ar["nextYear"])(this.rightDate)},leftNextYear:function(){this.leftDate=Object(ar["nextYear"])(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(ar["prevYear"])(this.rightDate)},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],e)},isValidValue:function(e){return Array.isArray(e)&&e&&e[0]&&e[1]&&Object(ar["isDate"])(e[0])&&Object(ar["isDate"])(e[1])&&e[0].getTime()<=e[1].getTime()&&("function"!==typeof this.disabledDate||!this.disabledDate(e[0])&&!this.disabledDate(e[1]))},resetView:function(){this.minDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[1]):null}},components:{MonthTable:ea,ElInput:m.a,ElButton:ae.a}},Sa=ka,Da=o(Sa,xa,Ca,!1,null,null,null);Da.options.__file="packages/date-picker/src/panel/month-range.vue";var $a=Da.exports,Oa=function(e){return"daterange"===e||"datetimerange"===e?_a:"monthrange"===e?$a:pa},Ea={mixins:[kr],name:"ElDatePicker",props:{type:{type:String,default:"date"},timeArrowControl:Boolean},watch:{type:function(e){this.picker?(this.unmountPicker(),this.panel=Oa(e),this.mountPicker()):this.panel=Oa(e)}},created:function(){this.panel=Oa(this.type)},install:function(e){e.component(Ea.name,Ea)}},Ta=Ea,Pa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"popper",staticClass:"el-picker-panel time-select el-popper",class:e.popperClass,style:{width:e.width+"px"}},[i("el-scrollbar",{attrs:{noresize:"","wrap-class":"el-picker-panel__content"}},e._l(e.items,(function(t){return i("div",{key:t.value,staticClass:"time-select-item",class:{selected:e.value===t.value,disabled:t.disabled,default:t.value===e.defaultValue},attrs:{disabled:t.disabled},on:{click:function(i){e.handleClick(t)}}},[e._v(e._s(t.value))])})),0)],1)])},Ma=[];Pa._withStripped=!0;var Na=function(e){var t=(e||"").split(":");if(t.length>=2){var i=parseInt(t[0],10),n=parseInt(t[1],10);return{hours:i,minutes:n}}return null},Ia=function(e,t){var i=Na(e),n=Na(t),s=i.minutes+60*i.hours,r=n.minutes+60*n.hours;return s===r?0:s>r?1:-1},ja=function(e){return(e.hours<10?"0"+e.hours:e.hours)+":"+(e.minutes<10?"0"+e.minutes:e.minutes)},Fa=function(e,t){var i=Na(e),n=Na(t),s={hours:i.hours,minutes:i.minutes};return s.minutes+=n.minutes,s.hours+=n.hours,s.hours+=Math.floor(s.minutes/60),s.minutes=s.minutes%60,ja(s)},La={components:{ElScrollbar:q.a},watch:{value:function(e){var t=this;e&&this.$nextTick((function(){return t.scrollToOption()}))}},methods:{handleClick:function(e){e.disabled||this.$emit("pick",e.value)},handleClear:function(){this.$emit("pick",null)},scrollToOption:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".selected",t=this.$refs.popper.querySelector(".el-picker-panel__content");tn()(t,t.querySelector(e))},handleMenuEnter:function(){var e=this,t=-1!==this.items.map((function(e){return e.value})).indexOf(this.value),i=-1!==this.items.map((function(e){return e.value})).indexOf(this.defaultValue),n=(t?".selected":i&&".default")||".time-select-item:not(.disabled)";this.$nextTick((function(){return e.scrollToOption(n)}))},scrollDown:function(e){var t=this.items,i=t.length,n=t.length,s=t.map((function(e){return e.value})).indexOf(this.value);while(n--)if(s=(s+e+i)%i,!t[s].disabled)return void this.$emit("pick",t[s].value,!0)},isValidValue:function(e){return-1!==this.items.filter((function(e){return!e.disabled})).map((function(e){return e.value})).indexOf(e)},handleKeydown:function(e){var t=e.keyCode;if(38===t||40===t){var i={40:1,38:-1},n=i[t.toString()];return this.scrollDown(n),void e.stopPropagation()}}},data:function(){return{popperClass:"",start:"09:00",end:"18:00",step:"00:30",value:"",defaultValue:"",visible:!1,minTime:"",maxTime:"",width:0}},computed:{items:function(){var e=this.start,t=this.end,i=this.step,n=[];if(e&&t&&i){var s=e;while(Ia(s,t)<=0)n.push({value:s,disabled:Ia(s,this.minTime||"-1:-1")<=0||Ia(s,this.maxTime||"100:100")>=0}),s=Fa(s,i)}return n}}},Aa=La,Va=o(Aa,Pa,Ma,!1,null,null,null);Va.options.__file="packages/date-picker/src/panel/time-select.vue";var Ba=Va.exports,za={mixins:[kr],name:"ElTimeSelect",componentName:"ElTimeSelect",props:{type:{type:String,default:"time-select"}},beforeCreate:function(){this.panel=Ba},install:function(e){e.component(za.name,za)}},Ra=za,Ha=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-time-range-picker el-picker-panel el-popper",class:e.popperClass},[i("div",{staticClass:"el-time-range-picker__content"},[i("div",{staticClass:"el-time-range-picker__cell"},[i("div",{staticClass:"el-time-range-picker__header"},[e._v(e._s(e.t("el.datepicker.startTime")))]),i("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":e.showSeconds,"is-arrow":e.arrowControl}},[i("time-spinner",{ref:"minSpinner",attrs:{"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,"arrow-control":e.arrowControl,date:e.minDate},on:{change:e.handleMinChange,"select-range":e.setMinSelectionRange}})],1)]),i("div",{staticClass:"el-time-range-picker__cell"},[i("div",{staticClass:"el-time-range-picker__header"},[e._v(e._s(e.t("el.datepicker.endTime")))]),i("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":e.showSeconds,"is-arrow":e.arrowControl}},[i("time-spinner",{ref:"maxSpinner",attrs:{"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,"arrow-control":e.arrowControl,date:e.maxDate},on:{change:e.handleMaxChange,"select-range":e.setMaxSelectionRange}})],1)])]),i("div",{staticClass:"el-time-panel__footer"},[i("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:function(t){e.handleCancel()}}},[e._v(e._s(e.t("el.datepicker.cancel")))]),i("button",{staticClass:"el-time-panel__btn confirm",attrs:{type:"button",disabled:e.btnDisabled},on:{click:function(t){e.handleConfirm()}}},[e._v(e._s(e.t("el.datepicker.confirm")))])])])])},Wa=[];Ha._withStripped=!0;var qa=Object(ar["parseDate"])("00:00:00","HH:mm:ss"),Ya=Object(ar["parseDate"])("23:59:59","HH:mm:ss"),Ka=function(e){return Object(ar["modifyDate"])(qa,e.getFullYear(),e.getMonth(),e.getDate())},Ua=function(e){return Object(ar["modifyDate"])(Ya,e.getFullYear(),e.getMonth(),e.getDate())},Ga=function(e,t){return new Date(Math.min(e.getTime()+t,Ua(e).getTime()))},Xa={mixins:[g.a],components:{TimeSpinner:Ir},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},offset:function(){return this.showSeconds?11:8},spinner:function(){return this.selectionRange[0]this.maxDate.getTime()},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},data:function(){return{popperClass:"",minDate:new Date,maxDate:new Date,value:[],oldValue:[new Date,new Date],defaultValue:null,format:"HH:mm:ss",visible:!1,selectionRange:[0,2],arrowControl:!1}},watch:{value:function(e){Array.isArray(e)?(this.minDate=new Date(e[0]),this.maxDate=new Date(e[1])):Array.isArray(this.defaultValue)?(this.minDate=new Date(this.defaultValue[0]),this.maxDate=new Date(this.defaultValue[1])):this.defaultValue?(this.minDate=new Date(this.defaultValue),this.maxDate=Ga(new Date(this.defaultValue),36e5)):(this.minDate=new Date,this.maxDate=Ga(new Date,36e5))},visible:function(e){var t=this;e&&(this.oldValue=this.value,this.$nextTick((function(){return t.$refs.minSpinner.emitSelectRange("hours")})))}},methods:{handleClear:function(){this.$emit("pick",null)},handleCancel:function(){this.$emit("pick",this.oldValue)},handleMinChange:function(e){this.minDate=Object(ar["clearMilliseconds"])(e),this.handleChange()},handleMaxChange:function(e){this.maxDate=Object(ar["clearMilliseconds"])(e),this.handleChange()},handleChange:function(){this.isValidValue([this.minDate,this.maxDate])&&(this.$refs.minSpinner.selectableRange=[[Ka(this.minDate),this.maxDate]],this.$refs.maxSpinner.selectableRange=[[this.minDate,Ua(this.maxDate)]],this.$emit("pick",[this.minDate,this.maxDate],!0))},setMinSelectionRange:function(e,t){this.$emit("select-range",e,t,"min"),this.selectionRange=[e,t]},setMaxSelectionRange:function(e,t){this.$emit("select-range",e,t,"max"),this.selectionRange=[e+this.offset,t+this.offset]},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.$refs.minSpinner.selectableRange,i=this.$refs.maxSpinner.selectableRange;this.minDate=Object(ar["limitTimeRange"])(this.minDate,t,this.format),this.maxDate=Object(ar["limitTimeRange"])(this.maxDate,i,this.format),this.$emit("pick",[this.minDate,this.maxDate],e)},adjustSpinners:function(){this.$refs.minSpinner.adjustSpinners(),this.$refs.maxSpinner.adjustSpinners()},changeSelectionRange:function(e){var t=this.showSeconds?[0,3,6,11,14,17]:[0,3,8,11],i=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),n=t.indexOf(this.selectionRange[0]),s=(n+e+t.length)%t.length,r=t.length/2;s-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(b["generateId"])()}},watch:{showPopper:function(e){this.disabled||(e?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var e=this,t=this.referenceElm=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!t&&this.$refs.wrapper.children&&(t=this.referenceElm=this.$refs.wrapper.children[0]),t&&(Object(Ae["addClass"])(t,"el-popover__reference"),t.setAttribute("aria-describedby",this.tooltipId),t.setAttribute("tabindex",this.tabindex),i.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(Ae["on"])(t,"focusin",(function(){e.handleFocus();var i=t.__vue__;i&&"function"===typeof i.focus&&i.focus()})),Object(Ae["on"])(i,"focusin",this.handleFocus),Object(Ae["on"])(t,"focusout",this.handleBlur),Object(Ae["on"])(i,"focusout",this.handleBlur)),Object(Ae["on"])(t,"keydown",this.handleKeydown),Object(Ae["on"])(t,"click",this.handleClick)),"click"===this.trigger?(Object(Ae["on"])(t,"click",this.doToggle),Object(Ae["on"])(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(Ae["on"])(t,"mouseenter",this.handleMouseEnter),Object(Ae["on"])(i,"mouseenter",this.handleMouseEnter),Object(Ae["on"])(t,"mouseleave",this.handleMouseLeave),Object(Ae["on"])(i,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),t.querySelector("input, textarea")?(Object(Ae["on"])(t,"focusin",this.doShow),Object(Ae["on"])(t,"focusout",this.doClose)):(Object(Ae["on"])(t,"mousedown",this.doShow),Object(Ae["on"])(t,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(Ae["addClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(Ae["removeClass"])(this.referenceElm,"focusing")},handleBlur:function(){Object(Ae["removeClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var e=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout((function(){e.showPopper=!0}),this.openDelay):this.showPopper=!0},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var e=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout((function(){e.showPopper=!1}),this.closeDelay):this.showPopper=!1},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!t&&this.$refs.wrapper.children&&(t=this.referenceElm=this.$refs.wrapper.children[0]),this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&i&&!i.contains(e.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var e=this.reference;Object(Ae["off"])(e,"click",this.doToggle),Object(Ae["off"])(e,"mouseup",this.doClose),Object(Ae["off"])(e,"mousedown",this.doShow),Object(Ae["off"])(e,"focusin",this.doShow),Object(Ae["off"])(e,"focusout",this.doClose),Object(Ae["off"])(e,"mousedown",this.doShow),Object(Ae["off"])(e,"mouseup",this.doClose),Object(Ae["off"])(e,"mouseleave",this.handleMouseLeave),Object(Ae["off"])(e,"mouseenter",this.handleMouseEnter),Object(Ae["off"])(document,"click",this.handleDocumentClick)}},ro=so,ao=o(ro,io,no,!1,null,null,null);ao.options.__file="packages/popover/src/main.vue";var oo=ao.exports,lo=function(e,t,i){var n=t.expression?t.value:t.arg,s=i.context.$refs[n];s&&(Array.isArray(s)?s[0].$refs.reference=e:s.$refs.reference=e)},co={bind:function(e,t,i){lo(e,t,i)},inserted:function(e,t,i){lo(e,t,i)}};Rn.a.directive("popover",co),oo.install=function(e){e.directive("popover",co),e.component(oo.name,oo)},oo.directive=co;var uo=oo,ho={name:"ElTooltip",mixins:[H.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(b["generateId"])(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new Rn.a({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=L()(200,(function(){return e.handleClosePopper()})))},render:function(e){var t=this;this.popperVM&&(this.popperVM.node=e("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e("div",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var i=this.getFirstElement();if(!i)return null;var n=i.data=i.data||{};return n.staticClass=this.addTooltipClass(n.staticClass),i},mounted:function(){var e=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(Ae["on"])(this.referenceElm,"mouseenter",this.show),Object(Ae["on"])(this.referenceElm,"mouseleave",this.hide),Object(Ae["on"])(this.referenceElm,"focus",(function(){if(e.$slots.default&&e.$slots.default.length){var t=e.$slots.default[0].componentInstance;t&&t.focus?t.focus():e.handleFocus()}else e.handleFocus()})),Object(Ae["on"])(this.referenceElm,"blur",this.handleBlur),Object(Ae["on"])(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick((function(){e.value&&e.updatePopper()}))},watch:{focusing:function(e){e?Object(Ae["addClass"])(this.referenceElm,"focusing"):Object(Ae["removeClass"])(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(e){return e?"el-tooltip "+e.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.showPopper=!0}),this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout((function(){e.showPopper=!1}),this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,i=0;i0){To=Mo.shift();var t=To.options;for(var i in t)t.hasOwnProperty(i)&&(Po[i]=t[i]);void 0===t.callback&&(Po.callback=No);var n=Po.callback;Po.callback=function(t,i){n(t,i),e()},Object(Do["isVNode"])(Po.message)?(Po.$slots.default=[Po.message],Po.message=null):delete Po.$slots.default,["modal","showClose","closeOnClickModal","closeOnPressEscape","closeOnHashChange"].forEach((function(e){void 0===Po[e]&&(Po[e]=!0)})),document.body.appendChild(Po.$el),Rn.a.nextTick((function(){Po.visible=!0}))}},Fo=function e(t,i){if(!Rn.a.prototype.$isServer){if("string"===typeof t||Object(Do["isVNode"])(t)?(t={message:t},"string"===typeof arguments[1]&&(t.title=arguments[1])):t.callback&&!i&&(i=t.callback),"undefined"!==typeof Promise)return new Promise((function(n,s){Mo.push({options:St()({},Oo,e.defaults,t),callback:i,resolve:n,reject:s}),jo()}));Mo.push({options:St()({},Oo,e.defaults,t),callback:i}),jo()}};Fo.setDefaults=function(e){Fo.defaults=e},Fo.alert=function(e,t,i){return"object"===("undefined"===typeof t?"undefined":$o(t))?(i=t,t=""):void 0===t&&(t=""),Fo(St()({title:t,message:e,$type:"alert",closeOnPressEscape:!1,closeOnClickModal:!1},i))},Fo.confirm=function(e,t,i){return"object"===("undefined"===typeof t?"undefined":$o(t))?(i=t,t=""):void 0===t&&(t=""),Fo(St()({title:t,message:e,$type:"confirm",showCancelButton:!0},i))},Fo.prompt=function(e,t,i){return"object"===("undefined"===typeof t?"undefined":$o(t))?(i=t,t=""):void 0===t&&(t=""),Fo(St()({title:t,message:e,showCancelButton:!0,showInput:!0,$type:"prompt"},i))},Fo.close=function(){Po.doClose(),Po.visible=!1,Mo=[],To=null};var Lo=Fo,Ao=Lo,Vo=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-breadcrumb",attrs:{"aria-label":"Breadcrumb",role:"navigation"}},[e._t("default")],2)},Bo=[];Vo._withStripped=!0;var zo={name:"ElBreadcrumb",props:{separator:{type:String,default:"/"},separatorClass:{type:String,default:""}},provide:function(){return{elBreadcrumb:this}},mounted:function(){var e=this.$el.querySelectorAll(".el-breadcrumb__item");e.length&&e[e.length-1].setAttribute("aria-current","page")}},Ro=zo,Ho=o(Ro,Vo,Bo,!1,null,null,null);Ho.options.__file="packages/breadcrumb/src/breadcrumb.vue";var Wo=Ho.exports;Wo.install=function(e){e.component(Wo.name,Wo)};var qo=Wo,Yo=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{staticClass:"el-breadcrumb__item"},[i("span",{ref:"link",class:["el-breadcrumb__inner",e.to?"is-link":""],attrs:{role:"link"}},[e._t("default")],2),e.separatorClass?i("i",{staticClass:"el-breadcrumb__separator",class:e.separatorClass}):i("span",{staticClass:"el-breadcrumb__separator",attrs:{role:"presentation"}},[e._v(e._s(e.separator))])])},Ko=[];Yo._withStripped=!0;var Uo={name:"ElBreadcrumbItem",props:{to:{},replace:Boolean},data:function(){return{separator:"",separatorClass:""}},inject:["elBreadcrumb"],mounted:function(){var e=this;this.separator=this.elBreadcrumb.separator,this.separatorClass=this.elBreadcrumb.separatorClass;var t=this.$refs.link;t.setAttribute("role","link"),t.addEventListener("click",(function(t){var i=e.to,n=e.$router;i&&n&&(e.replace?n.replace(i):n.push(i))}))}},Go=Uo,Xo=o(Go,Yo,Ko,!1,null,null,null);Xo.options.__file="packages/breadcrumb/src/breadcrumb-item.vue";var Zo=Xo.exports;Zo.install=function(e){e.component(Zo.name,Zo)};var Qo=Zo,Jo=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("form",{staticClass:"el-form",class:[e.labelPosition?"el-form--label-"+e.labelPosition:"",{"el-form--inline":e.inline}]},[e._t("default")],2)},el=[];Jo._withStripped=!0;var tl={name:"ElForm",componentName:"ElForm",provide:function(){return{elForm:this}},props:{model:Object,rules:Object,labelPosition:String,labelWidth:String,labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},size:String,disabled:Boolean,validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1}},watch:{rules:function(){this.fields.forEach((function(e){e.removeValidateEvents(),e.addValidateEvents()})),this.validateOnRuleChange&&this.validate((function(){}))}},computed:{autoLabelWidth:function(){if(!this.potentialLabelWidthArr.length)return 0;var e=Math.max.apply(Math,this.potentialLabelWidthArr);return e?e+"px":""}},data:function(){return{fields:[],potentialLabelWidthArr:[]}},created:function(){var e=this;this.$on("el.form.addField",(function(t){t&&e.fields.push(t)})),this.$on("el.form.removeField",(function(t){t.prop&&e.fields.splice(e.fields.indexOf(t),1)}))},methods:{resetFields:function(){this.model?this.fields.forEach((function(e){e.resetField()})):console.warn("[Element Warn][Form]model is required for resetFields to work.")},clearValidate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length?"string"===typeof e?this.fields.filter((function(t){return e===t.prop})):this.fields.filter((function(t){return e.indexOf(t.prop)>-1})):this.fields;t.forEach((function(e){e.clearValidate()}))},validate:function(e){var t=this;if(this.model){var i=void 0;"function"!==typeof e&&window.Promise&&(i=new window.Promise((function(t,i){e=function(e,n){e?t(e):i(n)}})));var n=!0,s=0;0===this.fields.length&&e&&e(!0);var r={};return this.fields.forEach((function(i){i.validate("",(function(i,a){i&&(n=!1),r=St()({},r,a),"function"===typeof e&&++s===t.fields.length&&e(n,r)}))})),i||void 0}console.warn("[Element Warn][Form]model is required for validate to work!")},validateField:function(e,t){e=[].concat(e);var i=this.fields.filter((function(t){return-1!==e.indexOf(t.prop)}));i.length?i.forEach((function(e){e.validate("",t)})):console.warn("[Element Warn]please pass correct props!")},getLabelWidthIndex:function(e){var t=this.potentialLabelWidthArr.indexOf(e);if(-1===t)throw new Error("[ElementForm]unpected width ",e);return t},registerLabelWidth:function(e,t){if(e&&t){var i=this.getLabelWidthIndex(t);this.potentialLabelWidthArr.splice(i,1,e)}else e&&this.potentialLabelWidthArr.push(e)},deregisterLabelWidth:function(e){var t=this.getLabelWidthIndex(e);this.potentialLabelWidthArr.splice(t,1)}}},il=tl,nl=o(il,Jo,el,!1,null,null,null);nl.options.__file="packages/form/src/form.vue";var sl=nl.exports;sl.install=function(e){e.component(sl.name,sl)};var rl=sl,al=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-form-item",class:[{"el-form-item--feedback":e.elForm&&e.elForm.statusIcon,"is-error":"error"===e.validateState,"is-validating":"validating"===e.validateState,"is-success":"success"===e.validateState,"is-required":e.isRequired||e.required,"is-no-asterisk":e.elForm&&e.elForm.hideRequiredAsterisk},e.sizeClass?"el-form-item--"+e.sizeClass:""]},[i("label-wrap",{attrs:{"is-auto-width":e.labelStyle&&"auto"===e.labelStyle.width,"update-all":"auto"===e.form.labelWidth}},[e.label||e.$slots.label?i("label",{staticClass:"el-form-item__label",style:e.labelStyle,attrs:{for:e.labelFor}},[e._t("label",[e._v(e._s(e.label+e.form.labelSuffix))])],2):e._e()]),i("div",{staticClass:"el-form-item__content",style:e.contentStyle},[e._t("default"),i("transition",{attrs:{name:"el-zoom-in-top"}},["error"===e.validateState&&e.showMessage&&e.form.showMessage?e._t("error",[i("div",{staticClass:"el-form-item__error",class:{"el-form-item__error--inline":"boolean"===typeof e.inlineMessage?e.inlineMessage:e.elForm&&e.elForm.inlineMessage||!1}},[e._v("\n "+e._s(e.validateMessage)+"\n ")])],{error:e.validateMessage}):e._e()],2)],2)],1)},ol=[];al._withStripped=!0;var ll,cl,ul=i(40),hl=i.n(ul),dl={props:{isAutoWidth:Boolean,updateAll:Boolean},inject:["elForm","elFormItem"],render:function(){var e=arguments[0],t=this.$slots.default;if(!t)return null;if(this.isAutoWidth){var i=this.elForm.autoLabelWidth,n={};if(i&&"auto"!==i){var s=parseInt(i,10)-this.computedWidth;s&&(n.marginLeft=s+"px")}return e("div",{class:"el-form-item__label-wrap",style:n},[t])}return t[0]},methods:{getLabelWidth:function(){if(this.$el&&this.$el.firstElementChild){var e=window.getComputedStyle(this.$el.firstElementChild).width;return Math.ceil(parseFloat(e))}return 0},updateLabelWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update";this.$slots.default&&this.isAutoWidth&&this.$el.firstElementChild&&("update"===e?this.computedWidth=this.getLabelWidth():"remove"===e&&this.elForm.deregisterLabelWidth(this.computedWidth))}},watch:{computedWidth:function(e,t){this.updateAll&&(this.elForm.registerLabelWidth(e,t),this.elFormItem.updateComputedLabelWidth(e))}},data:function(){return{computedWidth:0}},mounted:function(){this.updateLabelWidth("update")},updated:function(){this.updateLabelWidth("update")},beforeDestroy:function(){this.updateLabelWidth("remove")}},pl=dl,fl=o(pl,ll,cl,!1,null,null,null);fl.options.__file="packages/form/src/label-wrap.vue";var ml=fl.exports,vl={name:"ElFormItem",componentName:"ElFormItem",mixins:[O.a],provide:function(){return{elFormItem:this}},inject:["elForm"],props:{label:String,labelWidth:String,prop:String,required:{type:Boolean,default:void 0},rules:[Object,Array],error:String,validateStatus:String,for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:String},components:{LabelWrap:ml},watch:{error:{immediate:!0,handler:function(e){this.validateMessage=e,this.validateState=e?"error":""}},validateStatus:function(e){this.validateState=e}},computed:{labelFor:function(){return this.for||this.prop},labelStyle:function(){var e={};if("top"===this.form.labelPosition)return e;var t=this.labelWidth||this.form.labelWidth;return t&&(e.width=t),e},contentStyle:function(){var e={},t=this.label;if("top"===this.form.labelPosition||this.form.inline)return e;if(!t&&!this.labelWidth&&this.isNested)return e;var i=this.labelWidth||this.form.labelWidth;return"auto"===i?"auto"===this.labelWidth?e.marginLeft=this.computedLabelWidth:"auto"===this.form.labelWidth&&(e.marginLeft=this.elForm.autoLabelWidth):e.marginLeft=i,e},form:function(){var e=this.$parent,t=e.$options.componentName;while("ElForm"!==t)"ElFormItem"===t&&(this.isNested=!0),e=e.$parent,t=e.$options.componentName;return e},fieldValue:function(){var e=this.form.model;if(e&&this.prop){var t=this.prop;return-1!==t.indexOf(":")&&(t=t.replace(/:/,".")),Object(b["getPropByPath"])(e,t,!0).v}},isRequired:function(){var e=this.getRules(),t=!1;return e&&e.length&&e.every((function(e){return!e.required||(t=!0,!1)})),t},_formSize:function(){return this.elForm.size},elFormItemSize:function(){return this.size||this._formSize},sizeClass:function(){return this.elFormItemSize||(this.$ELEMENT||{}).size}},data:function(){return{validateState:"",validateMessage:"",validateDisabled:!1,validator:{},isNested:!1,computedLabelWidth:""}},methods:{validate:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b["noop"];this.validateDisabled=!1;var n=this.getFilteredRule(e);if((!n||0===n.length)&&void 0===this.required)return i(),!0;this.validateState="validating";var s={};n&&n.length>0&&n.forEach((function(e){delete e.trigger})),s[this.prop]=n;var r=new hl.a(s),a={};a[this.prop]=this.fieldValue,r.validate(a,{firstFields:!0},(function(e,n){t.validateState=e?"error":"success",t.validateMessage=e?e[0].message:"",i(t.validateMessage,n),t.elForm&&t.elForm.$emit("validate",t.prop,!e,t.validateMessage||null)}))},clearValidate:function(){this.validateState="",this.validateMessage="",this.validateDisabled=!1},resetField:function(){var e=this;this.validateState="",this.validateMessage="";var t=this.form.model,i=this.fieldValue,n=this.prop;-1!==n.indexOf(":")&&(n=n.replace(/:/,"."));var s=Object(b["getPropByPath"])(t,n,!0);this.validateDisabled=!0,Array.isArray(i)?s.o[s.k]=[].concat(this.initialValue):s.o[s.k]=this.initialValue,this.$nextTick((function(){e.validateDisabled=!1})),this.broadcast("ElTimeSelect","fieldReset",this.initialValue)},getRules:function(){var e=this.form.rules,t=this.rules,i=void 0!==this.required?{required:!!this.required}:[],n=Object(b["getPropByPath"])(e,this.prop||"");return e=e?n.o[this.prop||""]||n.v:[],[].concat(t||e||[]).concat(i)},getFilteredRule:function(e){var t=this.getRules();return t.filter((function(t){return!t.trigger||""===e||(Array.isArray(t.trigger)?t.trigger.indexOf(e)>-1:t.trigger===e)})).map((function(e){return St()({},e)}))},onFieldBlur:function(){this.validate("blur")},onFieldChange:function(){this.validateDisabled?this.validateDisabled=!1:this.validate("change")},updateComputedLabelWidth:function(e){this.computedLabelWidth=e?e+"px":""},addValidateEvents:function(){var e=this.getRules();(e.length||void 0!==this.required)&&(this.$on("el.form.blur",this.onFieldBlur),this.$on("el.form.change",this.onFieldChange))},removeValidateEvents:function(){this.$off()}},mounted:function(){if(this.prop){this.dispatch("ElForm","el.form.addField",[this]);var e=this.fieldValue;Array.isArray(e)&&(e=[].concat(e)),Object.defineProperty(this,"initialValue",{value:e}),this.addValidateEvents()}},beforeDestroy:function(){this.dispatch("ElForm","el.form.removeField",[this])}},gl=vl,bl=o(gl,al,ol,!1,null,null,null);bl.options.__file="packages/form/src/form-item.vue";var yl=bl.exports;yl.install=function(e){e.component(yl.name,yl)};var _l=yl,xl=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-tabs__active-bar",class:"is-"+e.rootTabs.tabPosition,style:e.barStyle})},Cl=[];xl._withStripped=!0;var wl={name:"TabBar",props:{tabs:Array},inject:["rootTabs"],computed:{barStyle:{get:function(){var e=this,t={},i=0,n=0,s=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height",r="width"===s?"x":"y",a=function(e){return e.toLowerCase().replace(/( |^)[a-z]/g,(function(e){return e.toUpperCase()}))};this.tabs.every((function(t,r){var o=Object(b["arrayFind"])(e.$parent.$refs.tabs||[],(function(e){return e.id.replace("tab-","")===t.paneName}));if(!o)return!1;if(t.active){n=o["client"+a(s)];var l=window.getComputedStyle(o);return"width"===s&&e.tabs.length>1&&(n-=parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),"width"===s&&(i+=parseFloat(l.paddingLeft)),!1}return i+=o["client"+a(s)],!0}));var o="translate"+a(r)+"("+i+"px)";return t[s]=n+"px",t.transform=o,t.msTransform=o,t.webkitTransform=o,t}}}},kl=wl,Sl=o(kl,xl,Cl,!1,null,null,null);Sl.options.__file="packages/tabs/src/tab-bar.vue";var Dl=Sl.exports;function $l(){}var Ol,El,Tl=function(e){return e.toLowerCase().replace(/( |^)[a-z]/g,(function(e){return e.toUpperCase()}))},Pl={name:"TabNav",components:{TabBar:Dl},inject:["rootTabs"],props:{panes:Array,currentName:String,editable:Boolean,onTabClick:{type:Function,default:$l},onTabRemove:{type:Function,default:$l},type:String,stretch:Boolean},data:function(){return{scrollable:!1,navOffset:0,isFocus:!1,focusable:!0}},computed:{navStyle:function(){var e=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"X":"Y";return{transform:"translate"+e+"(-"+this.navOffset+"px)"}},sizeName:function(){return-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height"}},methods:{scrollPrev:function(){var e=this.$refs.navScroll["offset"+Tl(this.sizeName)],t=this.navOffset;if(t){var i=t>e?t-e:0;this.navOffset=i}},scrollNext:function(){var e=this.$refs.nav["offset"+Tl(this.sizeName)],t=this.$refs.navScroll["offset"+Tl(this.sizeName)],i=this.navOffset;if(!(e-i<=t)){var n=e-i>2*t?i+t:e-t;this.navOffset=n}},scrollToActiveTab:function(){if(this.scrollable){var e=this.$refs.nav,t=this.$el.querySelector(".is-active");if(t){var i=this.$refs.navScroll,n=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition),s=t.getBoundingClientRect(),r=i.getBoundingClientRect(),a=n?e.offsetWidth-r.width:e.offsetHeight-r.height,o=this.navOffset,l=o;n?(s.leftr.right&&(l=o+s.right-r.right)):(s.topr.bottom&&(l=o+(s.bottom-r.bottom))),l=Math.max(l,0),this.navOffset=Math.min(l,a)}}},update:function(){if(this.$refs.nav){var e=this.sizeName,t=this.$refs.nav["offset"+Tl(e)],i=this.$refs.navScroll["offset"+Tl(e)],n=this.navOffset;if(i0&&(this.navOffset=0)}},changeTab:function(e){var t=e.keyCode,i=void 0,n=void 0,s=void 0;-1!==[37,38,39,40].indexOf(t)&&(s=e.currentTarget.querySelectorAll("[role=tab]"),n=Array.prototype.indexOf.call(s,e.target),i=37===t||38===t?0===n?s.length-1:n-1:n0&&void 0!==arguments[0]&&arguments[0];if(this.$slots.default){var i=this.$slots.default.filter((function(e){return e.tag&&e.componentOptions&&"ElTabPane"===e.componentOptions.Ctor.options.name})),n=i.map((function(e){var t=e.componentInstance;return t})),s=!(n.length===this.panes.length&&n.every((function(t,i){return t===e.panes[i]})));(t||s)&&(this.panes=n)}else 0!==this.panes.length&&(this.panes=[])},handleTabClick:function(e,t,i){e.disabled||(this.setCurrentName(t),this.$emit("tab-click",e,i))},handleTabRemove:function(e,t){e.disabled||(t.stopPropagation(),this.$emit("edit",e.name,"remove"),this.$emit("tab-remove",e.name))},handleTabAdd:function(){this.$emit("edit",null,"add"),this.$emit("tab-add")},setCurrentName:function(e){var t=this,i=function(){t.currentName=e,t.$emit("input",e)};if(this.currentName!==e&&this.beforeLeave){var n=this.beforeLeave(e,this.currentName);n&&n.then?n.then((function(){i(),t.$refs.nav&&t.$refs.nav.removeFocus()}),(function(){})):!1!==n&&i()}else i()}},render:function(e){var t,i=this.type,n=this.handleTabClick,s=this.handleTabRemove,r=this.handleTabAdd,a=this.currentName,o=this.panes,l=this.editable,c=this.addable,u=this.tabPosition,h=this.stretch,d=l||c?e("span",{class:"el-tabs__new-tab",on:{click:r,keydown:function(e){13===e.keyCode&&r()}},attrs:{tabindex:"0"}},[e("i",{class:"el-icon-plus"})]):null,p={props:{currentName:a,onTabClick:n,onTabRemove:s,editable:l,type:i,panes:o,stretch:h},ref:"nav"},f=e("div",{class:["el-tabs__header","is-"+u]},[d,e("tab-nav",p)]),m=e("div",{class:"el-tabs__content"},[this.$slots.default]);return e("div",{class:(t={"el-tabs":!0,"el-tabs--card":"card"===i},t["el-tabs--"+u]=!0,t["el-tabs--border-card"]="border-card"===i,t)},["bottom"!==u?[f,m]:[m,f]])},created:function(){this.currentName||this.setCurrentName("0"),this.$on("tab-nav-update",this.calcPaneInstances.bind(null,!0))},mounted:function(){this.calcPaneInstances()},updated:function(){this.calcPaneInstances()}},Al=Ll,Vl=o(Al,Il,jl,!1,null,null,null);Vl.options.__file="packages/tabs/src/tabs.vue";var Bl=Vl.exports;Bl.install=function(e){e.component(Bl.name,Bl)};var zl=Bl,Rl=function(){var e=this,t=e.$createElement,i=e._self._c||t;return!e.lazy||e.loaded||e.active?i("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}],staticClass:"el-tab-pane",attrs:{role:"tabpanel","aria-hidden":!e.active,id:"pane-"+e.paneName,"aria-labelledby":"tab-"+e.paneName}},[e._t("default")],2):e._e()},Hl=[];Rl._withStripped=!0;var Wl={name:"ElTabPane",componentName:"ElTabPane",props:{label:String,labelContent:Function,name:String,closable:Boolean,disabled:Boolean,lazy:Boolean},data:function(){return{index:null,loaded:!1}},computed:{isClosable:function(){return this.closable||this.$parent.closable},active:function(){var e=this.$parent.currentName===(this.name||this.index);return e&&(this.loaded=!0),e},paneName:function(){return this.name||this.index}},updated:function(){this.$parent.$emit("tab-nav-update")}},ql=Wl,Yl=o(ql,Rl,Hl,!1,null,null,null);Yl.options.__file="packages/tabs/src/tab-pane.vue";var Kl=Yl.exports;Kl.install=function(e){e.component(Kl.name,Kl)};var Ul,Gl,Xl=Kl,Zl={name:"ElTag",props:{text:String,closable:Boolean,type:String,hit:Boolean,disableTransitions:Boolean,color:String,size:String,effect:{type:String,default:"light",validator:function(e){return-1!==["dark","light","plain"].indexOf(e)}}},methods:{handleClose:function(e){e.stopPropagation(),this.$emit("close",e)},handleClick:function(e){this.$emit("click",e)}},computed:{tagSize:function(){return this.size||(this.$ELEMENT||{}).size}},render:function(e){var t=this.type,i=this.tagSize,n=this.hit,s=this.effect,r=["el-tag",t?"el-tag--"+t:"",i?"el-tag--"+i:"",s?"el-tag--"+s:"",n&&"is-hit"],a=e("span",{class:r,style:{backgroundColor:this.color},on:{click:this.handleClick}},[this.$slots.default,this.closable&&e("i",{class:"el-tag__close el-icon-close",on:{click:this.handleClose}})]);return this.disableTransitions?a:e("transition",{attrs:{name:"el-zoom-in-center"}},[a])}},Ql=Zl,Jl=o(Ql,Ul,Gl,!1,null,null,null);Jl.options.__file="packages/tag/src/tag.vue";var ec=Jl.exports;ec.install=function(e){e.component(ec.name,ec)};var tc=ec,ic=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-tree",class:{"el-tree--highlight-current":e.highlightCurrent,"is-dragging":!!e.dragState.draggingNode,"is-drop-not-allow":!e.dragState.allowDrop,"is-drop-inner":"inner"===e.dragState.dropType},attrs:{role:"tree"}},[e._l(e.root.childNodes,(function(t){return i("el-tree-node",{key:e.getNodeKey(t),attrs:{node:t,props:e.props,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent},on:{"node-expand":e.handleNodeExpand}})})),e.isEmpty?i("div",{staticClass:"el-tree__empty-block"},[i("span",{staticClass:"el-tree__empty-text"},[e._v(e._s(e.emptyText))])]):e._e(),i("div",{directives:[{name:"show",rawName:"v-show",value:e.dragState.showDropIndicator,expression:"dragState.showDropIndicator"}],ref:"dropIndicator",staticClass:"el-tree__drop-indicator"})],2)},nc=[];ic._withStripped=!0;var sc="$treeNodeId",rc=function(e,t){t&&!t[sc]&&Object.defineProperty(t,sc,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},ac=function(e,t){return e?t[e]:t[sc]},oc=function(e,t){var i=e;while(i&&"BODY"!==i.tagName){if(i.__vue__&&i.__vue__.$options.name===t)return i.__vue__;i=i.parentNode}return null},lc=function(){function e(e,t){for(var i=0;i0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||rc(this,this.data),this.data){var a=n.defaultExpandedKeys,o=n.key;o&&a&&-1!==a.indexOf(this.key)&&this.expand(null,n.autoExpandParent),o&&void 0!==n.currentNodeKey&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState()}}return e.prototype.setData=function(e){Array.isArray(e)||rc(this,e),this.data=e,this.childNodes=[];var t=void 0;t=0===this.level&&this.data instanceof Array?this.data:dc(this,"children")||[];for(var i=0,n=t.length;i1&&void 0!==arguments[1])||arguments[1],i=function i(n){for(var s=n.childNodes||[],r=!1,a=0,o=s.length;a-1&&t.splice(i,1);var n=this.childNodes.indexOf(e);n>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(n,1)),this.updateLeafState()},e.prototype.removeChildByData=function(e){for(var t=null,i=0;i0)n.expanded=!0,n=n.parent}i.expanded=!0,e&&e()};this.shouldLoadData()?this.loadData((function(e){e instanceof Array&&(i.checked?i.setChecked(!0,!0):i.store.checkStrictly||hc(i),n())})):n()},e.prototype.doCreateChildren=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach((function(e){t.insertChild(St()({data:e},i),void 0,!0)}))},e.prototype.collapse=function(){this.expanded=!1},e.prototype.shouldLoadData=function(){return!0===this.store.lazy&&this.store.load&&!this.loaded},e.prototype.updateLeafState=function(){if(!0!==this.store.lazy||!0===this.loaded||"undefined"===typeof this.isLeafByUser){var e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}else this.isLeaf=this.isLeafByUser},e.prototype.setChecked=function(e,t,i,n){var s=this;if(this.indeterminate="half"===e,this.checked=!0===e,!this.store.checkStrictly){if(!this.shouldLoadData()||this.store.checkDescendants){var r=uc(this.childNodes),a=r.all,o=r.allWithoutDisable;this.isLeaf||a||!o||(this.checked=!1,e=!1);var l=function(){if(t){for(var i=s.childNodes,r=0,a=i.length;r0&&void 0!==arguments[0]&&arguments[0];if(0===this.level)return this.data;var t=this.data;if(!t)return null;var i=this.store.props,n="children";return i&&(n=i.children||"children"),void 0===t[n]&&(t[n]=null),e&&!t[n]&&(t[n]=[]),t[n]},e.prototype.updateChildren=function(){var e=this,t=this.getChildren()||[],i=this.childNodes.map((function(e){return e.data})),n={},s=[];t.forEach((function(e,t){var r=e[sc],a=!!r&&Object(b["arrayFindIndex"])(i,(function(e){return e[sc]===r}))>=0;a?n[r]={index:t,data:e}:s.push({index:t,data:e})})),this.store.lazy||i.forEach((function(t){n[t[sc]]||e.removeChildByData(t)})),s.forEach((function(t){var i=t.index,n=t.data;e.insertChild({data:n},i)})),this.updateLeafState()},e.prototype.loadData=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(i).length)e&&e.call(this);else{this.loading=!0;var n=function(n){t.loaded=!0,t.loading=!1,t.childNodes=[],t.doCreateChildren(n,i),t.updateLeafState(),e&&e.call(t,n)};this.store.load(this,n)}},lc(e,[{key:"label",get:function(){return dc(this,"label")}},{key:"key",get:function(){var e=this.store.key;return this.data?this.data[e]:null}},{key:"disabled",get:function(){return dc(this,"disabled")}},{key:"nextSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}},{key:"previousSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}}]),e}(),mc=fc,vc="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function gc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var bc=function(){function e(t){var i=this;for(var n in gc(this,e),this.currentNode=null,this.currentNodeKey=null,t)t.hasOwnProperty(n)&&(this[n]=t[n]);if(this.nodesMap={},this.root=new mc({data:this.data,store:this}),this.lazy&&this.load){var s=this.load;s(this.root,(function(e){i.root.doCreateChildren(e),i._initDefaultCheckedNodes()}))}else this._initDefaultCheckedNodes()}return e.prototype.filter=function(e){var t=this.filterNodeMethod,i=this.lazy,n=function n(s){var r=s.root?s.root.childNodes:s.childNodes;if(r.forEach((function(i){i.visible=t.call(i,e,i.data,i),n(i)})),!s.visible&&r.length){var a=!0;a=!r.some((function(e){return e.visible})),s.root?s.root.visible=!1===a:s.visible=!1===a}e&&(!s.visible||s.isLeaf||i||s.expand())};n(this)},e.prototype.setData=function(e){var t=e!==this.root.data;t?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()},e.prototype.getNode=function(e){if(e instanceof mc)return e;var t="object"!==("undefined"===typeof e?"undefined":vc(e))?e:ac(this.key,e);return this.nodesMap[t]||null},e.prototype.insertBefore=function(e,t){var i=this.getNode(t);i.parent.insertBefore({data:e},i)},e.prototype.insertAfter=function(e,t){var i=this.getNode(t);i.parent.insertAfter({data:e},i)},e.prototype.remove=function(e){var t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))},e.prototype.append=function(e,t){var i=t?this.getNode(t):this.root;i&&i.insertChild({data:e})},e.prototype._initDefaultCheckedNodes=function(){var e=this,t=this.defaultCheckedKeys||[],i=this.nodesMap;t.forEach((function(t){var n=i[t];n&&n.setChecked(!0,!e.checkStrictly)}))},e.prototype._initDefaultCheckedNode=function(e){var t=this.defaultCheckedKeys||[];-1!==t.indexOf(e.key)&&e.setChecked(!0,!this.checkStrictly)},e.prototype.setDefaultCheckedKey=function(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())},e.prototype.registerNode=function(e){var t=this.key;if(t&&e&&e.data){var i=e.key;void 0!==i&&(this.nodesMap[e.key]=e)}},e.prototype.deregisterNode=function(e){var t=this,i=this.key;i&&e&&e.data&&(e.childNodes.forEach((function(e){t.deregisterNode(e)})),delete this.nodesMap[e.key])},e.prototype.getCheckedNodes=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[],n=function n(s){var r=s.root?s.root.childNodes:s.childNodes;r.forEach((function(s){(s.checked||t&&s.indeterminate)&&(!e||e&&s.isLeaf)&&i.push(s.data),n(s)}))};return n(this),i},e.prototype.getCheckedKeys=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCheckedNodes(t).map((function(t){return(t||{})[e.key]}))},e.prototype.getHalfCheckedNodes=function(){var e=[],t=function t(i){var n=i.root?i.root.childNodes:i.childNodes;n.forEach((function(i){i.indeterminate&&e.push(i.data),t(i)}))};return t(this),e},e.prototype.getHalfCheckedKeys=function(){var e=this;return this.getHalfCheckedNodes().map((function(t){return(t||{})[e.key]}))},e.prototype._getAllNodes=function(){var e=[],t=this.nodesMap;for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.prototype.updateChildren=function(e,t){var i=this.nodesMap[e];if(i){for(var n=i.childNodes,s=n.length-1;s>=0;s--){var r=n[s];this.remove(r.data)}for(var a=0,o=t.length;a1&&void 0!==arguments[1]&&arguments[1],i=arguments[2],n=this._getAllNodes().sort((function(e,t){return t.level-e.level})),s=Object.create(null),r=Object.keys(i);n.forEach((function(e){return e.setChecked(!1,!1)}));for(var a=0,o=n.length;a-1;if(u){var h=l.parent;while(h&&h.level>0)s[h.data[e]]=!0,h=h.parent;l.isLeaf||this.checkStrictly?l.setChecked(!0,!1):(l.setChecked(!0,!0),t&&function(){l.setChecked(!1,!1);var e=function e(t){var i=t.childNodes;i.forEach((function(t){t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(l)}())}else l.checked&&!s[c]&&l.setChecked(!1,!1)}},e.prototype.setCheckedNodes=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.key,n={};e.forEach((function(e){n[(e||{})[i]]=!0})),this._setCheckedKeys(i,t,n)},e.prototype.setCheckedKeys=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.defaultCheckedKeys=e;var i=this.key,n={};e.forEach((function(e){n[e]=!0})),this._setCheckedKeys(i,t,n)},e.prototype.setDefaultExpandedKeys=function(e){var t=this;e=e||[],this.defaultExpandedKeys=e,e.forEach((function(e){var i=t.getNode(e);i&&i.expand(null,t.autoExpandParent)}))},e.prototype.setChecked=function(e,t,i){var n=this.getNode(e);n&&n.setChecked(!!t,i)},e.prototype.getCurrentNode=function(){return this.currentNode},e.prototype.setCurrentNode=function(e){var t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0},e.prototype.setUserCurrentNode=function(e){var t=e[this.key],i=this.nodesMap[t];this.setCurrentNode(i)},e.prototype.setCurrentNodeKey=function(e){if(null===e||void 0===e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);var t=this.getNode(e);t&&this.setCurrentNode(t)},e}(),yc=bc,_c=function(){var e=this,t=this,i=t.$createElement,n=t._self._c||i;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.node.visible,expression:"node.visible"}],ref:"node",staticClass:"el-tree-node",class:{"is-expanded":t.expanded,"is-current":t.node.isCurrent,"is-hidden":!t.node.visible,"is-focusable":!t.node.disabled,"is-checked":!t.node.disabled&&t.node.checked},attrs:{role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.draggable},on:{click:function(e){return e.stopPropagation(),t.handleClick(e)},contextmenu:function(t){return e.handleContextMenu(t)},dragstart:function(e){return e.stopPropagation(),t.handleDragStart(e)},dragover:function(e){return e.stopPropagation(),t.handleDragOver(e)},dragend:function(e){return e.stopPropagation(),t.handleDragEnd(e)},drop:function(e){return e.stopPropagation(),t.handleDrop(e)}}},[n("div",{staticClass:"el-tree-node__content",style:{"padding-left":(t.node.level-1)*t.tree.indent+"px"}},[n("span",{class:[{"is-leaf":t.node.isLeaf,expanded:!t.node.isLeaf&&t.expanded},"el-tree-node__expand-icon",t.tree.iconClass?t.tree.iconClass:"el-icon-caret-right"],on:{click:function(e){return e.stopPropagation(),t.handleExpandIconClick(e)}}}),t.showCheckbox?n("el-checkbox",{attrs:{indeterminate:t.node.indeterminate,disabled:!!t.node.disabled},on:{change:t.handleCheckChange},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:t.node.checked,callback:function(e){t.$set(t.node,"checked",e)},expression:"node.checked"}}):t._e(),t.node.loading?n("span",{staticClass:"el-tree-node__loading-icon el-icon-loading"}):t._e(),n("node-content",{attrs:{node:t.node}})],1),n("el-collapse-transition",[!t.renderAfterExpand||t.childNodeRendered?n("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"el-tree-node__children",attrs:{role:"group","aria-expanded":t.expanded}},t._l(t.node.childNodes,(function(e){return n("el-tree-node",{key:t.getNodeKey(e),attrs:{"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:e},on:{"node-expand":t.handleChildNodeExpand}})})),1):t._e()])],1)},xc=[];_c._withStripped=!0;var Cc={name:"ElTreeNode",componentName:"ElTreeNode",mixins:[O.a],props:{node:{default:function(){return{}}},props:{},renderContent:Function,renderAfterExpand:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1}},components:{ElCollapseTransition:Ke.a,ElCheckbox:In.a,NodeContent:{props:{node:{required:!0}},render:function(e){var t=this.$parent,i=t.tree,n=this.node,s=n.data,r=n.store;return t.renderContent?t.renderContent.call(t._renderProxy,e,{_self:i.$vnode.context,node:n,data:s,store:r}):i.$scopedSlots.default?i.$scopedSlots.default({node:n,data:s}):e("span",{class:"el-tree-node__label"},[n.label])}}},data:function(){return{tree:null,expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null}},watch:{"node.indeterminate":function(e){this.handleSelectChange(this.node.checked,e)},"node.checked":function(e){this.handleSelectChange(e,this.node.indeterminate)},"node.expanded":function(e){var t=this;this.$nextTick((function(){return t.expanded=e})),e&&(this.childNodeRendered=!0)}},methods:{getNodeKey:function(e){return ac(this.tree.nodeKey,e.data)},handleSelectChange:function(e,t){this.oldChecked!==e&&this.oldIndeterminate!==t&&this.tree.$emit("check-change",this.node.data,e,t),this.oldChecked=e,this.indeterminate=t},handleClick:function(){var e=this.tree.store;e.setCurrentNode(this.node),this.tree.$emit("current-change",e.currentNode?e.currentNode.data:null,e.currentNode),this.tree.currentNode=this,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&this.handleCheckChange(null,{target:{checked:!this.node.checked}}),this.tree.$emit("node-click",this.node.data,this.node,this)},handleContextMenu:function(e){this.tree._events["node-contextmenu"]&&this.tree._events["node-contextmenu"].length>0&&(e.stopPropagation(),e.preventDefault()),this.tree.$emit("node-contextmenu",e,this.node.data,this.node,this)},handleExpandIconClick:function(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node.data,this.node,this),this.node.collapse()):(this.node.expand(),this.$emit("node-expand",this.node.data,this.node,this)))},handleCheckChange:function(e,t){var i=this;this.node.setChecked(t.target.checked,!this.tree.checkStrictly),this.$nextTick((function(){var e=i.tree.store;i.tree.$emit("check",i.node.data,{checkedNodes:e.getCheckedNodes(),checkedKeys:e.getCheckedKeys(),halfCheckedNodes:e.getHalfCheckedNodes(),halfCheckedKeys:e.getHalfCheckedKeys()})}))},handleChildNodeExpand:function(e,t,i){this.broadcast("ElTreeNode","tree-node-expand",t),this.tree.$emit("node-expand",e,t,i)},handleDragStart:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-start",e,this)},handleDragOver:function(e){this.tree.draggable&&(this.tree.$emit("tree-node-drag-over",e,this),e.preventDefault())},handleDrop:function(e){e.preventDefault()},handleDragEnd:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-end",e,this)}},created:function(){var e=this,t=this.$parent;t.isTree?this.tree=t:this.tree=t.tree;var i=this.tree;i||console.warn("Can not find node's tree.");var n=i.props||{},s=n["children"]||"children";this.$watch("node.data."+s,(function(){e.node.updateChildren()})),this.node.expanded&&(this.expanded=!0,this.childNodeRendered=!0),this.tree.accordion&&this.$on("tree-node-expand",(function(t){e.node!==t&&e.node.collapse()}))}},wc=Cc,kc=o(wc,_c,xc,!1,null,null,null);kc.options.__file="packages/tree/src/tree-node.vue";var Sc=kc.exports,Dc={name:"ElTree",mixins:[O.a],components:{ElTreeNode:Sc},data:function(){return{store:null,root:null,currentNode:null,treeItems:null,checkboxItems:[],dragState:{showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0}}},props:{data:{type:Array},emptyText:{type:String,default:function(){return Object(vo["t"])("el.tree.emptyText")}},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{default:function(){return{children:"children",label:"label",disabled:"disabled"}}},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},iconClass:String},computed:{children:{set:function(e){this.data=e},get:function(){return this.data}},treeItemArray:function(){return Array.prototype.slice.call(this.treeItems)},isEmpty:function(){var e=this.root.childNodes;return!e||0===e.length||e.every((function(e){var t=e.visible;return!t}))}},watch:{defaultCheckedKeys:function(e){this.store.setDefaultCheckedKey(e)},defaultExpandedKeys:function(e){this.store.defaultExpandedKeys=e,this.store.setDefaultExpandedKeys(e)},data:function(e){this.store.setData(e)},checkboxItems:function(e){Array.prototype.forEach.call(e,(function(e){e.setAttribute("tabindex",-1)}))},checkStrictly:function(e){this.store.checkStrictly=e}},methods:{filter:function(e){if(!this.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");this.store.filter(e)},getNodeKey:function(e){return ac(this.nodeKey,e.data)},getNodePath:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");var t=this.store.getNode(e);if(!t)return[];var i=[t.data],n=t.parent;while(n&&n!==this.root)i.push(n.data),n=n.parent;return i.reverse()},getCheckedNodes:function(e,t){return this.store.getCheckedNodes(e,t)},getCheckedKeys:function(e){return this.store.getCheckedKeys(e)},getCurrentNode:function(){var e=this.store.getCurrentNode();return e?e.data:null},getCurrentKey:function(){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");var e=this.getCurrentNode();return e?e[this.nodeKey]:null},setCheckedNodes:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");this.store.setCheckedNodes(e,t)},setCheckedKeys:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");this.store.setCheckedKeys(e,t)},setChecked:function(e,t,i){this.store.setChecked(e,t,i)},getHalfCheckedNodes:function(){return this.store.getHalfCheckedNodes()},getHalfCheckedKeys:function(){return this.store.getHalfCheckedKeys()},setCurrentNode:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");this.store.setUserCurrentNode(e)},setCurrentKey:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");this.store.setCurrentNodeKey(e)},getNode:function(e){return this.store.getNode(e)},remove:function(e){this.store.remove(e)},append:function(e,t){this.store.append(e,t)},insertBefore:function(e,t){this.store.insertBefore(e,t)},insertAfter:function(e,t){this.store.insertAfter(e,t)},handleNodeExpand:function(e,t,i){this.broadcast("ElTreeNode","tree-node-expand",t),this.$emit("node-expand",e,t,i)},updateKeyChildren:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");this.store.updateChildren(e,t)},initTabIndex:function(){this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]");var e=this.$el.querySelectorAll(".is-checked[role=treeitem]");e.length?e[0].setAttribute("tabindex",0):this.treeItems[0]&&this.treeItems[0].setAttribute("tabindex",0)},handleKeydown:function(e){var t=e.target;if(-1!==t.className.indexOf("el-tree-node")){var i=e.keyCode;this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]");var n=this.treeItemArray.indexOf(t),s=void 0;[38,40].indexOf(i)>-1&&(e.preventDefault(),s=38===i?0!==n?n-1:0:n-1&&(e.preventDefault(),t.click());var r=t.querySelector('[type="checkbox"]');[13,32].indexOf(i)>-1&&r&&(e.preventDefault(),r.click())}}},created:function(){var e=this;this.isTree=!0,this.store=new yc({key:this.nodeKey,data:this.data,lazy:this.lazy,props:this.props,load:this.load,currentNodeKey:this.currentNodeKey,checkStrictly:this.checkStrictly,checkDescendants:this.checkDescendants,defaultCheckedKeys:this.defaultCheckedKeys,defaultExpandedKeys:this.defaultExpandedKeys,autoExpandParent:this.autoExpandParent,defaultExpandAll:this.defaultExpandAll,filterNodeMethod:this.filterNodeMethod}),this.root=this.store.root;var t=this.dragState;this.$on("tree-node-drag-start",(function(i,n){if("function"===typeof e.allowDrag&&!e.allowDrag(n.node))return i.preventDefault(),!1;i.dataTransfer.effectAllowed="move";try{i.dataTransfer.setData("text/plain","")}catch(s){}t.draggingNode=n,e.$emit("node-drag-start",n.node,i)})),this.$on("tree-node-drag-over",(function(i,n){var s=oc(i.target,"ElTreeNode"),r=t.dropNode;r&&r!==s&&Object(Ae["removeClass"])(r.$el,"is-drop-inner");var a=t.draggingNode;if(a&&s){var o=!0,l=!0,c=!0,u=!0;"function"===typeof e.allowDrop&&(o=e.allowDrop(a.node,s.node,"prev"),u=l=e.allowDrop(a.node,s.node,"inner"),c=e.allowDrop(a.node,s.node,"next")),i.dataTransfer.dropEffect=l?"move":"none",(o||l||c)&&r!==s&&(r&&e.$emit("node-drag-leave",a.node,r.node,i),e.$emit("node-drag-enter",a.node,s.node,i)),(o||l||c)&&(t.dropNode=s),s.node.nextSibling===a.node&&(c=!1),s.node.previousSibling===a.node&&(o=!1),s.node.contains(a.node,!1)&&(l=!1),(a.node===s.node||a.node.contains(s.node))&&(o=!1,l=!1,c=!1);var h=s.$el.getBoundingClientRect(),d=e.$el.getBoundingClientRect(),p=void 0,f=o?l?.25:c?.45:1:-1,m=c?l?.75:o?.55:0:1,v=-9999,g=i.clientY-h.top;p=gh.height*m?"after":l?"inner":"none";var b=s.$el.querySelector(".el-tree-node__expand-icon").getBoundingClientRect(),y=e.$refs.dropIndicator;"before"===p?v=b.top-d.top:"after"===p&&(v=b.bottom-d.top),y.style.top=v+"px",y.style.left=b.right-d.left+"px","inner"===p?Object(Ae["addClass"])(s.$el,"is-drop-inner"):Object(Ae["removeClass"])(s.$el,"is-drop-inner"),t.showDropIndicator="before"===p||"after"===p,t.allowDrop=t.showDropIndicator||u,t.dropType=p,e.$emit("node-drag-over",a.node,s.node,i)}})),this.$on("tree-node-drag-end",(function(i){var n=t.draggingNode,s=t.dropType,r=t.dropNode;if(i.preventDefault(),i.dataTransfer.dropEffect="move",n&&r){var a={data:n.node.data};"none"!==s&&n.node.remove(),"before"===s?r.node.parent.insertBefore(a,r.node):"after"===s?r.node.parent.insertAfter(a,r.node):"inner"===s&&r.node.insertChild(a),"none"!==s&&e.store.registerNode(a),Object(Ae["removeClass"])(r.$el,"is-drop-inner"),e.$emit("node-drag-end",n.node,r.node,s,i),"none"!==s&&e.$emit("node-drop",n.node,r.node,s,i)}n&&!r&&e.$emit("node-drag-end",n.node,null,s,i),t.showDropIndicator=!1,t.draggingNode=null,t.dropNode=null,t.allowDrop=!0}))},mounted:function(){this.initTabIndex(),this.$el.addEventListener("keydown",this.handleKeydown)},updated:function(){this.treeItems=this.$el.querySelectorAll("[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]")}},$c=Dc,Oc=o($c,ic,nc,!1,null,null,null);Oc.options.__file="packages/tree/src/tree.vue";var Ec=Oc.exports;Ec.install=function(e){e.component(Ec.name,Ec)};var Tc=Ec,Pc=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-alert-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-alert",class:[e.typeClass,e.center?"is-center":"","is-"+e.effect],attrs:{role:"alert"}},[e.showIcon?i("i",{staticClass:"el-alert__icon",class:[e.iconClass,e.isBigIcon]}):e._e(),i("div",{staticClass:"el-alert__content"},[e.title||e.$slots.title?i("span",{staticClass:"el-alert__title",class:[e.isBoldTitle]},[e._t("title",[e._v(e._s(e.title))])],2):e._e(),e.$slots.default&&!e.description?i("p",{staticClass:"el-alert__description"},[e._t("default")],2):e._e(),e.description&&!e.$slots.default?i("p",{staticClass:"el-alert__description"},[e._v(e._s(e.description))]):e._e(),i("i",{directives:[{name:"show",rawName:"v-show",value:e.closable,expression:"closable"}],staticClass:"el-alert__closebtn",class:{"is-customed":""!==e.closeText,"el-icon-close":""===e.closeText},on:{click:function(t){e.close()}}},[e._v(e._s(e.closeText))])])])])},Mc=[];Pc._withStripped=!0;var Nc={success:"el-icon-success",warning:"el-icon-warning",error:"el-icon-error"},Ic={name:"ElAlert",props:{title:{type:String,default:""},description:{type:String,default:""},type:{type:String,default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,default:"light",validator:function(e){return-1!==["light","dark"].indexOf(e)}}},data:function(){return{visible:!0}},methods:{close:function(){this.visible=!1,this.$emit("close")}},computed:{typeClass:function(){return"el-alert--"+this.type},iconClass:function(){return Nc[this.type]||"el-icon-info"},isBigIcon:function(){return this.description||this.$slots.default?"is-big":""},isBoldTitle:function(){return this.description||this.$slots.default?"is-bold":""}}},jc=Ic,Fc=o(jc,Pc,Mc,!1,null,null,null);Fc.options.__file="packages/alert/src/main.vue";var Lc=Fc.exports;Lc.install=function(e){e.component(Lc.name,Lc)};var Ac=Lc,Vc=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-notification-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-notification",e.customClass,e.horizontalClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:function(t){e.clearTimer()},mouseleave:function(t){e.startTimer()},click:e.click}},[e.type||e.iconClass?i("i",{staticClass:"el-notification__icon",class:[e.typeClass,e.iconClass]}):e._e(),i("div",{staticClass:"el-notification__group",class:{"is-with-icon":e.typeClass||e.iconClass}},[i("h2",{staticClass:"el-notification__title",domProps:{textContent:e._s(e.title)}}),i("div",{directives:[{name:"show",rawName:"v-show",value:e.message,expression:"message"}],staticClass:"el-notification__content"},[e._t("default",[e.dangerouslyUseHTMLString?i("p",{domProps:{innerHTML:e._s(e.message)}}):i("p",[e._v(e._s(e.message))])])],2),e.showClose?i("div",{staticClass:"el-notification__closeBtn el-icon-close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}}):e._e()])])])},Bc=[];Vc._withStripped=!0;var zc={success:"success",info:"info",warning:"warning",error:"error"},Rc={data:function(){return{visible:!1,title:"",message:"",duration:4500,type:"",showClose:!0,customClass:"",iconClass:"",onClose:null,onClick:null,closed:!1,verticalOffset:0,timer:null,dangerouslyUseHTMLString:!1,position:"top-right"}},computed:{typeClass:function(){return this.type&&zc[this.type]?"el-icon-"+zc[this.type]:""},horizontalClass:function(){return this.position.indexOf("right")>-1?"right":"left"},verticalProperty:function(){return/^top-/.test(this.position)?"top":"bottom"},positionStyle:function(){var e;return e={},e[this.verticalProperty]=this.verticalOffset+"px",e}},watch:{closed:function(e){e&&(this.visible=!1,this.$el.addEventListener("transitionend",this.destroyElement))}},methods:{destroyElement:function(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},click:function(){"function"===typeof this.onClick&&this.onClick()},close:function(){this.closed=!0,"function"===typeof this.onClose&&this.onClose()},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout((function(){e.closed||e.close()}),this.duration))},keydown:function(e){46===e.keyCode||8===e.keyCode?this.clearTimer():27===e.keyCode?this.closed||this.close():this.startTimer()}},mounted:function(){var e=this;this.duration>0&&(this.timer=setTimeout((function(){e.closed||e.close()}),this.duration)),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},Hc=Rc,Wc=o(Hc,Vc,Bc,!1,null,null,null);Wc.options.__file="packages/notification/src/main.vue";var qc=Wc.exports,Yc=Rn.a.extend(qc),Kc=void 0,Uc=[],Gc=1,Xc=function e(t){if(!Rn.a.prototype.$isServer){t=St()({},t);var i=t.onClose,n="notification_"+Gc++,s=t.position||"top-right";t.onClose=function(){e.close(n,i)},Kc=new Yc({data:t}),Object(Do["isVNode"])(t.message)&&(Kc.$slots.default=[t.message],t.message="REPLACED_BY_VNODE"),Kc.id=n,Kc.$mount(),document.body.appendChild(Kc.$el),Kc.visible=!0,Kc.dom=Kc.$el,Kc.dom.style.zIndex=w["PopupManager"].nextZIndex();var r=t.offset||0;return Uc.filter((function(e){return e.position===s})).forEach((function(e){r+=e.$el.offsetHeight+16})),r+=16,Kc.verticalOffset=r,Uc.push(Kc),Kc}};["success","warning","info","error"].forEach((function(e){Xc[e]=function(t){return("string"===typeof t||Object(Do["isVNode"])(t))&&(t={message:t}),t.type=e,Xc(t)}})),Xc.close=function(e,t){var i=-1,n=Uc.length,s=Uc.filter((function(t,n){return t.id===e&&(i=n,!0)}))[0];if(s&&("function"===typeof t&&t(s),Uc.splice(i,1),!(n<=1)))for(var r=s.position,a=s.dom.offsetHeight,o=i;o=0;e--)Uc[e].close()};var Zc=Xc,Qc=Zc,Jc=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-slider",class:{"is-vertical":e.vertical,"el-slider--with-input":e.showInput},attrs:{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-orientation":e.vertical?"vertical":"horizontal","aria-disabled":e.sliderDisabled}},[e.showInput&&!e.range?i("el-input-number",{ref:"input",staticClass:"el-slider__input",attrs:{step:e.step,disabled:e.sliderDisabled,controls:e.showInputControls,min:e.min,max:e.max,debounce:e.debounce,size:e.inputSize},on:{change:e.emitChange},model:{value:e.firstValue,callback:function(t){e.firstValue=t},expression:"firstValue"}}):e._e(),i("div",{ref:"slider",staticClass:"el-slider__runway",class:{"show-input":e.showInput,disabled:e.sliderDisabled},style:e.runwayStyle,on:{click:e.onSliderClick}},[i("div",{staticClass:"el-slider__bar",style:e.barStyle}),i("slider-button",{ref:"button1",attrs:{vertical:e.vertical,"tooltip-class":e.tooltipClass},model:{value:e.firstValue,callback:function(t){e.firstValue=t},expression:"firstValue"}}),e.range?i("slider-button",{ref:"button2",attrs:{vertical:e.vertical,"tooltip-class":e.tooltipClass},model:{value:e.secondValue,callback:function(t){e.secondValue=t},expression:"secondValue"}}):e._e(),e._l(e.stops,(function(t,n){return e.showStops?i("div",{key:n,staticClass:"el-slider__stop",style:e.getStopStyle(t)}):e._e()})),e.markList.length>0?[i("div",e._l(e.markList,(function(t,n){return i("div",{key:n,staticClass:"el-slider__stop el-slider__marks-stop",style:e.getStopStyle(t.position)})})),0),i("div",{staticClass:"el-slider__marks"},e._l(e.markList,(function(t,n){return i("slider-marker",{key:n,style:e.getStopStyle(t.position),attrs:{mark:t.mark}})})),1)]:e._e()],2)],1)},eu=[];Jc._withStripped=!0;var tu=i(41),iu=i.n(tu),nu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"button",staticClass:"el-slider__button-wrapper",class:{hover:e.hovering,dragging:e.dragging},style:e.wrapperStyle,attrs:{tabindex:"0"},on:{mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave,mousedown:e.onButtonDown,touchstart:e.onButtonDown,focus:e.handleMouseEnter,blur:e.handleMouseLeave,keydown:[function(t){return!("button"in t)&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.onLeftKeyDown(t)},function(t){return!("button"in t)&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:e.onRightKeyDown(t)},function(t){return!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.onLeftKeyDown(t))},function(t){return!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.onRightKeyDown(t))}]}},[i("el-tooltip",{ref:"tooltip",attrs:{placement:"top","popper-class":e.tooltipClass,disabled:!e.showTooltip}},[i("span",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e.formatValue))]),i("div",{staticClass:"el-slider__button",class:{hover:e.hovering,dragging:e.dragging}})])],1)},su=[];nu._withStripped=!0;var ru={name:"ElSliderButton",components:{ElTooltip:st.a},props:{value:{type:Number,default:0},vertical:{type:Boolean,default:!1},tooltipClass:String},data:function(){return{hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:null,oldValue:this.value}},computed:{disabled:function(){return this.$parent.sliderDisabled},max:function(){return this.$parent.max},min:function(){return this.$parent.min},step:function(){return this.$parent.step},showTooltip:function(){return this.$parent.showTooltip},precision:function(){return this.$parent.precision},currentPosition:function(){return(this.value-this.min)/(this.max-this.min)*100+"%"},enableFormat:function(){return this.$parent.formatTooltip instanceof Function},formatValue:function(){return this.enableFormat&&this.$parent.formatTooltip(this.value)||this.value},wrapperStyle:function(){return this.vertical?{bottom:this.currentPosition}:{left:this.currentPosition}}},watch:{dragging:function(e){this.$parent.dragging=e}},methods:{displayTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!0)},hideTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!1)},handleMouseEnter:function(){this.hovering=!0,this.displayTooltip()},handleMouseLeave:function(){this.hovering=!1,this.hideTooltip()},onButtonDown:function(e){this.disabled||(e.preventDefault(),this.onDragStart(e),window.addEventListener("mousemove",this.onDragging),window.addEventListener("touchmove",this.onDragging),window.addEventListener("mouseup",this.onDragEnd),window.addEventListener("touchend",this.onDragEnd),window.addEventListener("contextmenu",this.onDragEnd))},onLeftKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)-this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onRightKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)+this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onDragStart:function(e){this.dragging=!0,this.isClick=!0,"touchstart"===e.type&&(e.clientY=e.touches[0].clientY,e.clientX=e.touches[0].clientX),this.vertical?this.startY=e.clientY:this.startX=e.clientX,this.startPosition=parseFloat(this.currentPosition),this.newPosition=this.startPosition},onDragging:function(e){if(this.dragging){this.isClick=!1,this.displayTooltip(),this.$parent.resetSize();var t=0;"touchmove"===e.type&&(e.clientY=e.touches[0].clientY,e.clientX=e.touches[0].clientX),this.vertical?(this.currentY=e.clientY,t=(this.startY-this.currentY)/this.$parent.sliderSize*100):(this.currentX=e.clientX,t=(this.currentX-this.startX)/this.$parent.sliderSize*100),this.newPosition=this.startPosition+t,this.setPosition(this.newPosition)}},onDragEnd:function(){var e=this;this.dragging&&(setTimeout((function(){e.dragging=!1,e.hideTooltip(),e.isClick||(e.setPosition(e.newPosition),e.$parent.emitChange())}),0),window.removeEventListener("mousemove",this.onDragging),window.removeEventListener("touchmove",this.onDragging),window.removeEventListener("mouseup",this.onDragEnd),window.removeEventListener("touchend",this.onDragEnd),window.removeEventListener("contextmenu",this.onDragEnd))},setPosition:function(e){var t=this;if(null!==e&&!isNaN(e)){e<0?e=0:e>100&&(e=100);var i=100/((this.max-this.min)/this.step),n=Math.round(e/i),s=n*i*(this.max-this.min)*.01+this.min;s=parseFloat(s.toFixed(this.precision)),this.$emit("input",s),this.$nextTick((function(){t.displayTooltip(),t.$refs.tooltip&&t.$refs.tooltip.updatePopper()})),this.dragging||this.value===this.oldValue||(this.oldValue=this.value)}}}},au=ru,ou=o(au,nu,su,!1,null,null,null);ou.options.__file="packages/slider/src/button.vue";var lu=ou.exports,cu={name:"ElMarker",props:{mark:{type:[String,Object]}},render:function(){var e=arguments[0],t="string"===typeof this.mark?this.mark:this.mark.label;return e("div",{class:"el-slider__marks-text",style:this.mark.style||{}},[t])}},uu={name:"ElSlider",mixins:[O.a],inject:{elForm:{default:""}},props:{min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},value:{type:[Number,Array],default:0},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},inputSize:{type:String,default:"small"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:Function,disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{type:String},debounce:{type:Number,default:300},label:{type:String},tooltipClass:String,marks:Object},components:{ElInputNumber:iu.a,SliderButton:lu,SliderMarker:cu},data:function(){return{firstValue:null,secondValue:null,oldValue:null,dragging:!1,sliderSize:1}},watch:{value:function(e,t){this.dragging||Array.isArray(e)&&Array.isArray(t)&&e.every((function(e,i){return e===t[i]}))||this.setValues()},dragging:function(e){e||this.setValues()},firstValue:function(e){this.range?this.$emit("input",[this.minValue,this.maxValue]):this.$emit("input",e)},secondValue:function(){this.range&&this.$emit("input",[this.minValue,this.maxValue])},min:function(){this.setValues()},max:function(){this.setValues()}},methods:{valueChanged:function(){var e=this;return this.range?![this.minValue,this.maxValue].every((function(t,i){return t===e.oldValue[i]})):this.value!==this.oldValue},setValues:function(){if(this.min>this.max)console.error("[Element Error][Slider]min should not be greater than max.");else{var e=this.value;this.range&&Array.isArray(e)?e[1]this.max?this.$emit("input",[this.max,this.max]):e[0]this.max?this.$emit("input",[e[0],this.max]):(this.firstValue=e[0],this.secondValue=e[1],this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",[this.minValue,this.maxValue]),this.oldValue=e.slice())):this.range||"number"!==typeof e||isNaN(e)||(ethis.max?this.$emit("input",this.max):(this.firstValue=e,this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",e),this.oldValue=e)))}},setPosition:function(e){var t=this.min+e*(this.max-this.min)/100;if(this.range){var i=void 0;i=Math.abs(this.minValue-t)this.secondValue?"button1":"button2",this.$refs[i].setPosition(e)}else this.$refs.button1.setPosition(e)},onSliderClick:function(e){if(!this.sliderDisabled&&!this.dragging){if(this.resetSize(),this.vertical){var t=this.$refs.slider.getBoundingClientRect().bottom;this.setPosition((t-e.clientY)/this.sliderSize*100)}else{var i=this.$refs.slider.getBoundingClientRect().left;this.setPosition((e.clientX-i)/this.sliderSize*100)}this.emitChange()}},resetSize:function(){this.$refs.slider&&(this.sliderSize=this.$refs.slider["client"+(this.vertical?"Height":"Width")])},emitChange:function(){var e=this;this.$nextTick((function(){e.$emit("change",e.range?[e.minValue,e.maxValue]:e.value)}))},getStopStyle:function(e){return this.vertical?{bottom:e+"%"}:{left:e+"%"}}},computed:{stops:function(){var e=this;if(!this.showStops||this.min>this.max)return[];if(0===this.step)return[];for(var t=(this.max-this.min)/this.step,i=100*this.step/(this.max-this.min),n=[],s=1;s100*(e.maxValue-e.min)/(e.max-e.min)})):n.filter((function(t){return t>100*(e.firstValue-e.min)/(e.max-e.min)}))},markList:function(){var e=this;if(!this.marks)return[];var t=Object.keys(this.marks);return t.map(parseFloat).sort((function(e,t){return e-t})).filter((function(t){return t<=e.max&&t>=e.min})).map((function(t){return{point:t,position:100*(t-e.min)/(e.max-e.min),mark:e.marks[t]}}))},minValue:function(){return Math.min(this.firstValue,this.secondValue)},maxValue:function(){return Math.max(this.firstValue,this.secondValue)},barSize:function(){return this.range?100*(this.maxValue-this.minValue)/(this.max-this.min)+"%":100*(this.firstValue-this.min)/(this.max-this.min)+"%"},barStart:function(){return this.range?100*(this.minValue-this.min)/(this.max-this.min)+"%":"0%"},precision:function(){var e=[this.min,this.max,this.step].map((function(e){var t=(""+e).split(".")[1];return t?t.length:0}));return Math.max.apply(null,e)},runwayStyle:function(){return this.vertical?{height:this.height}:{}},barStyle:function(){return this.vertical?{height:this.barSize,bottom:this.barStart}:{width:this.barSize,left:this.barStart}},sliderDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},mounted:function(){var e=void 0;this.range?(Array.isArray(this.value)?(this.firstValue=Math.max(this.min,this.value[0]),this.secondValue=Math.min(this.max,this.value[1])):(this.firstValue=this.min,this.secondValue=this.max),this.oldValue=[this.firstValue,this.secondValue],e=this.firstValue+"-"+this.secondValue):("number"!==typeof this.value||isNaN(this.value)?this.firstValue=this.min:this.firstValue=Math.min(this.max,Math.max(this.min,this.value)),this.oldValue=this.firstValue,e=this.firstValue),this.$el.setAttribute("aria-valuetext",e),this.$el.setAttribute("aria-label",this.label?this.label:"slider between "+this.min+" and "+this.max),this.resetSize(),window.addEventListener("resize",this.resetSize)},beforeDestroy:function(){window.removeEventListener("resize",this.resetSize)}},hu=uu,du=o(hu,Jc,eu,!1,null,null,null);du.options.__file="packages/slider/src/main.vue";var pu=du.exports;pu.install=function(e){e.component(pu.name,pu)};var fu=pu,mu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-loading-fade"},on:{"after-leave":e.handleAfterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-loading-mask",class:[e.customClass,{"is-fullscreen":e.fullscreen}],style:{backgroundColor:e.background||""}},[i("div",{staticClass:"el-loading-spinner"},[e.spinner?i("i",{class:e.spinner}):i("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[i("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]),e.text?i("p",{staticClass:"el-loading-text"},[e._v(e._s(e.text))]):e._e()])])])},vu=[];mu._withStripped=!0;var gu={data:function(){return{text:null,spinner:null,background:null,fullscreen:!0,visible:!1,customClass:""}},methods:{handleAfterLeave:function(){this.$emit("after-leave")},setText:function(e){this.text=e}}},bu=gu,yu=o(bu,mu,vu,!1,null,null,null);yu.options.__file="packages/loading/src/loading.vue";var _u=yu.exports,xu=i(32),Cu=i.n(xu),wu=Rn.a.extend(_u),ku={install:function(e){if(!e.prototype.$isServer){var t=function(t,n){n.value?e.nextTick((function(){n.modifiers.fullscreen?(t.originalPosition=Object(Ae["getStyle"])(document.body,"position"),t.originalOverflow=Object(Ae["getStyle"])(document.body,"overflow"),t.maskStyle.zIndex=w["PopupManager"].nextZIndex(),Object(Ae["addClass"])(t.mask,"is-fullscreen"),i(document.body,t,n)):(Object(Ae["removeClass"])(t.mask,"is-fullscreen"),n.modifiers.body?(t.originalPosition=Object(Ae["getStyle"])(document.body,"position"),["top","left"].forEach((function(e){var i="top"===e?"scrollTop":"scrollLeft";t.maskStyle[e]=t.getBoundingClientRect()[e]+document.body[i]+document.documentElement[i]-parseInt(Object(Ae["getStyle"])(document.body,"margin-"+e),10)+"px"})),["height","width"].forEach((function(e){t.maskStyle[e]=t.getBoundingClientRect()[e]+"px"})),i(document.body,t,n)):(t.originalPosition=Object(Ae["getStyle"])(t,"position"),i(t,t,n)))})):(Cu()(t.instance,(function(e){if(t.instance.hiding){t.domVisible=!1;var i=n.modifiers.fullscreen||n.modifiers.body?document.body:t;Object(Ae["removeClass"])(i,"el-loading-parent--relative"),Object(Ae["removeClass"])(i,"el-loading-parent--hidden"),t.instance.hiding=!1}}),300,!0),t.instance.visible=!1,t.instance.hiding=!0)},i=function(t,i,n){i.domVisible||"none"===Object(Ae["getStyle"])(i,"display")||"hidden"===Object(Ae["getStyle"])(i,"visibility")?i.domVisible&&!0===i.instance.hiding&&(i.instance.visible=!0,i.instance.hiding=!1):(Object.keys(i.maskStyle).forEach((function(e){i.mask.style[e]=i.maskStyle[e]})),"absolute"!==i.originalPosition&&"fixed"!==i.originalPosition&&Object(Ae["addClass"])(t,"el-loading-parent--relative"),n.modifiers.fullscreen&&n.modifiers.lock&&Object(Ae["addClass"])(t,"el-loading-parent--hidden"),i.domVisible=!0,t.appendChild(i.mask),e.nextTick((function(){i.instance.hiding?i.instance.$emit("after-leave"):i.instance.visible=!0})),i.domInserted=!0)};e.directive("loading",{bind:function(e,i,n){var s=e.getAttribute("element-loading-text"),r=e.getAttribute("element-loading-spinner"),a=e.getAttribute("element-loading-background"),o=e.getAttribute("element-loading-custom-class"),l=n.context,c=new wu({el:document.createElement("div"),data:{text:l&&l[s]||s,spinner:l&&l[r]||r,background:l&&l[a]||a,customClass:l&&l[o]||o,fullscreen:!!i.modifiers.fullscreen}});e.instance=c,e.mask=c.$el,e.maskStyle={},i.value&&t(e,i)},update:function(e,i){e.instance.setText(e.getAttribute("element-loading-text")),i.oldValue!==i.value&&t(e,i)},unbind:function(e,i){e.domInserted&&(e.mask&&e.mask.parentNode&&e.mask.parentNode.removeChild(e.mask),t(e,{value:!1,modifiers:i.modifiers})),e.instance&&e.instance.$destroy()}})}}},Su=ku,Du=Rn.a.extend(_u),$u={text:null,fullscreen:!0,body:!1,lock:!1,customClass:""},Ou=void 0;Du.prototype.originalPosition="",Du.prototype.originalOverflow="",Du.prototype.close=function(){var e=this;this.fullscreen&&(Ou=void 0),Cu()(this,(function(t){var i=e.fullscreen||e.body?document.body:e.target;Object(Ae["removeClass"])(i,"el-loading-parent--relative"),Object(Ae["removeClass"])(i,"el-loading-parent--hidden"),e.$el&&e.$el.parentNode&&e.$el.parentNode.removeChild(e.$el),e.$destroy()}),300),this.visible=!1};var Eu=function(e,t,i){var n={};e.fullscreen?(i.originalPosition=Object(Ae["getStyle"])(document.body,"position"),i.originalOverflow=Object(Ae["getStyle"])(document.body,"overflow"),n.zIndex=w["PopupManager"].nextZIndex()):e.body?(i.originalPosition=Object(Ae["getStyle"])(document.body,"position"),["top","left"].forEach((function(t){var i="top"===t?"scrollTop":"scrollLeft";n[t]=e.target.getBoundingClientRect()[t]+document.body[i]+document.documentElement[i]+"px"})),["height","width"].forEach((function(t){n[t]=e.target.getBoundingClientRect()[t]+"px"}))):i.originalPosition=Object(Ae["getStyle"])(t,"position"),Object.keys(n).forEach((function(e){i.$el.style[e]=n[e]}))},Tu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Rn.a.prototype.$isServer){if(e=St()({},$u,e),"string"===typeof e.target&&(e.target=document.querySelector(e.target)),e.target=e.target||document.body,e.target!==document.body?e.fullscreen=!1:e.body=!0,e.fullscreen&&Ou)return Ou;var t=e.body?document.body:e.target,i=new Du({el:document.createElement("div"),data:e});return Eu(e,t,i),"absolute"!==i.originalPosition&&"fixed"!==i.originalPosition&&Object(Ae["addClass"])(t,"el-loading-parent--relative"),e.fullscreen&&e.lock&&Object(Ae["addClass"])(t,"el-loading-parent--hidden"),t.appendChild(i.$el),Rn.a.nextTick((function(){i.visible=!0})),e.fullscreen&&(Ou=i),i}},Pu=Tu,Mu={install:function(e){e.use(Su),e.prototype.$loading=Pu},directive:Su,service:Pu},Nu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("i",{class:"el-icon-"+e.name})},Iu=[];Nu._withStripped=!0;var ju={name:"ElIcon",props:{name:String}},Fu=ju,Lu=o(Fu,Nu,Iu,!1,null,null,null);Lu.options.__file="packages/icon/src/icon.vue";var Au=Lu.exports;Au.install=function(e){e.component(Au.name,Au)};var Vu=Au,Bu={name:"ElRow",componentName:"ElRow",props:{tag:{type:String,default:"div"},gutter:Number,type:String,justify:{type:String,default:"start"},align:String},computed:{style:function(){var e={};return this.gutter&&(e.marginLeft="-"+this.gutter/2+"px",e.marginRight=e.marginLeft),e}},render:function(e){return e(this.tag,{class:["el-row","start"!==this.justify?"is-justify-"+this.justify:"",this.align?"is-align-"+this.align:"",{"el-row--flex":"flex"===this.type}],style:this.style},this.$slots.default)},install:function(e){e.component(Bu.name,Bu)}},zu=Bu,Ru="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hu={name:"ElCol",props:{span:{type:Number,default:24},tag:{type:String,default:"div"},offset:Number,pull:Number,push:Number,xs:[Number,Object],sm:[Number,Object],md:[Number,Object],lg:[Number,Object],xl:[Number,Object]},computed:{gutter:function(){var e=this.$parent;while(e&&"ElRow"!==e.$options.componentName)e=e.$parent;return e?e.gutter:0}},render:function(e){var t=this,i=[],n={};return this.gutter&&(n.paddingLeft=this.gutter/2+"px",n.paddingRight=n.paddingLeft),["span","offset","pull","push"].forEach((function(e){(t[e]||0===t[e])&&i.push("span"!==e?"el-col-"+e+"-"+t[e]:"el-col-"+t[e])})),["xs","sm","md","lg","xl"].forEach((function(e){if("number"===typeof t[e])i.push("el-col-"+e+"-"+t[e]);else if("object"===Ru(t[e])){var n=t[e];Object.keys(n).forEach((function(t){i.push("span"!==t?"el-col-"+e+"-"+t+"-"+n[t]:"el-col-"+e+"-"+n[t])}))}})),e(this.tag,{class:["el-col",i],style:n},this.$slots.default)},install:function(e){e.component(Hu.name,Hu)}},Wu=Hu,qu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition-group",{class:["el-upload-list","el-upload-list--"+e.listType,{"is-disabled":e.disabled}],attrs:{tag:"ul",name:"el-list"}},e._l(e.files,(function(t){return i("li",{key:t.uid,class:["el-upload-list__item","is-"+t.status,e.focusing?"focusing":""],attrs:{tabindex:"0"},on:{keydown:function(i){if(!("button"in i)&&e._k(i.keyCode,"delete",[8,46],i.key,["Backspace","Delete","Del"]))return null;!e.disabled&&e.$emit("remove",t)},focus:function(t){e.focusing=!0},blur:function(t){e.focusing=!1},click:function(t){e.focusing=!1}}},[e._t("default",["uploading"!==t.status&&["picture-card","picture"].indexOf(e.listType)>-1?i("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:t.url,alt:""}}):e._e(),i("a",{staticClass:"el-upload-list__item-name",on:{click:function(i){e.handleClick(t)}}},[i("i",{staticClass:"el-icon-document"}),e._v(e._s(t.name)+"\n ")]),i("label",{staticClass:"el-upload-list__item-status-label"},[i("i",{class:{"el-icon-upload-success":!0,"el-icon-circle-check":"text"===e.listType,"el-icon-check":["picture-card","picture"].indexOf(e.listType)>-1}})]),e.disabled?e._e():i("i",{staticClass:"el-icon-close",on:{click:function(i){e.$emit("remove",t)}}}),e.disabled?e._e():i("i",{staticClass:"el-icon-close-tip"},[e._v(e._s(e.t("el.upload.deleteTip")))]),"uploading"===t.status?i("el-progress",{attrs:{type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:e.parsePercentage(t.percentage)}}):e._e(),"picture-card"===e.listType?i("span",{staticClass:"el-upload-list__item-actions"},[e.handlePreview&&"picture-card"===e.listType?i("span",{staticClass:"el-upload-list__item-preview",on:{click:function(i){e.handlePreview(t)}}},[i("i",{staticClass:"el-icon-zoom-in"})]):e._e(),e.disabled?e._e():i("span",{staticClass:"el-upload-list__item-delete",on:{click:function(i){e.$emit("remove",t)}}},[i("i",{staticClass:"el-icon-delete"})])]):e._e()],{file:t})],2)})),0)},Yu=[];qu._withStripped=!0;var Ku=i(33),Uu=i.n(Ku),Gu={name:"ElUploadList",mixins:[g.a],data:function(){return{focusing:!1}},components:{ElProgress:Uu.a},props:{files:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},handlePreview:Function,listType:String},methods:{parsePercentage:function(e){return parseInt(e,10)},handleClick:function(e){this.handlePreview&&this.handlePreview(e)}}},Xu=Gu,Zu=o(Xu,qu,Yu,!1,null,null,null);Zu.options.__file="packages/upload/src/upload-list.vue";var Qu=Zu.exports,Ju=i(24),eh=i.n(Ju);function th(e,t,i){var n=void 0;n=i.response?""+(i.response.error||i.response):i.responseText?""+i.responseText:"fail to post "+e+" "+i.status;var s=new Error(n);return s.status=i.status,s.method="post",s.url=e,s}function ih(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(i){return t}}function nh(e){if("undefined"!==typeof XMLHttpRequest){var t=new XMLHttpRequest,i=e.action;t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach((function(t){n.append(t,e.data[t])})),n.append(e.filename,e.file,e.file.name),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300)return e.onError(th(i,e,t));e.onSuccess(ih(t))},t.open("post",i,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var s=e.headers||{};for(var r in s)s.hasOwnProperty(r)&&null!==s[r]&&t.setRequestHeader(r,s[r]);return t.send(n),t}}var sh=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-upload-dragger",class:{"is-dragover":e.dragover},on:{drop:function(t){return t.preventDefault(),e.onDrop(t)},dragover:function(t){return t.preventDefault(),e.onDragover(t)},dragleave:function(t){t.preventDefault(),e.dragover=!1}}},[e._t("default")],2)},rh=[];sh._withStripped=!0;var ah={name:"ElUploadDrag",props:{disabled:Boolean},inject:{uploader:{default:""}},data:function(){return{dragover:!1}},methods:{onDragover:function(){this.disabled||(this.dragover=!0)},onDrop:function(e){if(!this.disabled&&this.uploader){var t=this.uploader.accept;this.dragover=!1,t?this.$emit("file",[].slice.call(e.dataTransfer.files).filter((function(e){var i=e.type,n=e.name,s=n.indexOf(".")>-1?"."+n.split(".").pop():"",r=i.replace(/\/.*$/,"");return t.split(",").map((function(e){return e.trim()})).filter((function(e){return e})).some((function(e){return/\..+$/.test(e)?s===e:/\/\*$/.test(e)?r===e.replace(/\/\*$/,""):!!/^[^\/]+\/[^\/]+$/.test(e)&&i===e}))}))):this.$emit("file",e.dataTransfer.files)}}}},oh=ah,lh=o(oh,sh,rh,!1,null,null,null);lh.options.__file="packages/upload/src/upload-dragger.vue";var ch,uh,hh=lh.exports,dh={inject:["uploader"],components:{UploadDragger:hh},props:{type:String,action:{type:String,required:!0},name:{type:String,default:"file"},data:Object,headers:Object,withCredentials:Boolean,multiple:Boolean,accept:String,onStart:Function,onProgress:Function,onSuccess:Function,onError:Function,beforeUpload:Function,drag:Boolean,onPreview:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},fileList:Array,autoUpload:Boolean,listType:String,httpRequest:{type:Function,default:nh},disabled:Boolean,limit:Number,onExceed:Function},data:function(){return{mouseover:!1,reqs:{}}},methods:{isImage:function(e){return-1!==e.indexOf("image")},handleChange:function(e){var t=e.target.files;t&&this.uploadFiles(t)},uploadFiles:function(e){var t=this;if(this.limit&&this.fileList.length+e.length>this.limit)this.onExceed&&this.onExceed(e,this.fileList);else{var i=Array.prototype.slice.call(e);this.multiple||(i=i.slice(0,1)),0!==i.length&&i.forEach((function(e){t.onStart(e),t.autoUpload&&t.upload(e)}))}},upload:function(e){var t=this;if(this.$refs.input.value=null,!this.beforeUpload)return this.post(e);var i=this.beforeUpload(e);i&&i.then?i.then((function(i){var n=Object.prototype.toString.call(i);if("[object File]"===n||"[object Blob]"===n){for(var s in"[object Blob]"===n&&(i=new File([i],e.name,{type:e.type})),e)e.hasOwnProperty(s)&&(i[s]=e[s]);t.post(i)}else t.post(e)}),(function(){t.onRemove(null,e)})):!1!==i?this.post(e):this.onRemove(null,e)},abort:function(e){var t=this.reqs;if(e){var i=e;e.uid&&(i=e.uid),t[i]&&t[i].abort()}else Object.keys(t).forEach((function(e){t[e]&&t[e].abort(),delete t[e]}))},post:function(e){var t=this,i=e.uid,n={headers:this.headers,withCredentials:this.withCredentials,file:e,data:this.data,filename:this.name,action:this.action,onProgress:function(i){t.onProgress(i,e)},onSuccess:function(n){t.onSuccess(n,e),delete t.reqs[i]},onError:function(n){t.onError(n,e),delete t.reqs[i]}},s=this.httpRequest(n);this.reqs[i]=s,s&&s.then&&s.then(n.onSuccess,n.onError)},handleClick:function(){this.disabled||(this.$refs.input.value=null,this.$refs.input.click())},handleKeydown:function(e){e.target===e.currentTarget&&(13!==e.keyCode&&32!==e.keyCode||this.handleClick())}},render:function(e){var t=this.handleClick,i=this.drag,n=this.name,s=this.handleChange,r=this.multiple,a=this.accept,o=this.listType,l=this.uploadFiles,c=this.disabled,u=this.handleKeydown,h={class:{"el-upload":!0},on:{click:t,keydown:u}};return h.class["el-upload--"+o]=!0,e("div",eh()([h,{attrs:{tabindex:"0"}}]),[i?e("upload-dragger",{attrs:{disabled:c},on:{file:l}},[this.$slots.default]):this.$slots.default,e("input",{class:"el-upload__input",attrs:{type:"file",name:n,multiple:r,accept:a},ref:"input",on:{change:s}})])}},ph=dh,fh=o(ph,ch,uh,!1,null,null,null);fh.options.__file="packages/upload/src/upload.vue";var mh=fh.exports;function vh(){}var gh,bh,yh={name:"ElUpload",mixins:[D.a],components:{ElProgress:Uu.a,UploadList:Qu,Upload:mh},provide:function(){return{uploader:this}},inject:{elForm:{default:""}},props:{action:{type:String,required:!0},headers:{type:Object,default:function(){return{}}},data:Object,multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,dragger:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:String,type:{type:String,default:"select"},beforeUpload:Function,beforeRemove:Function,onRemove:{type:Function,default:vh},onChange:{type:Function,default:vh},onPreview:{type:Function},onSuccess:{type:Function,default:vh},onProgress:{type:Function,default:vh},onError:{type:Function,default:vh},fileList:{type:Array,default:function(){return[]}},autoUpload:{type:Boolean,default:!0},listType:{type:String,default:"text"},httpRequest:Function,disabled:Boolean,limit:Number,onExceed:{type:Function,default:vh}},data:function(){return{uploadFiles:[],dragOver:!1,draging:!1,tempIndex:1}},computed:{uploadDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{listType:function(e){"picture-card"!==e&&"picture"!==e||(this.uploadFiles=this.uploadFiles.map((function(e){if(!e.url&&e.raw)try{e.url=URL.createObjectURL(e.raw)}catch(t){console.error("[Element Error][Upload]",t)}return e})))},fileList:{immediate:!0,handler:function(e){var t=this;this.uploadFiles=e.map((function(e){return e.uid=e.uid||Date.now()+t.tempIndex++,e.status=e.status||"success",e}))}}},methods:{handleStart:function(e){e.uid=Date.now()+this.tempIndex++;var t={status:"ready",name:e.name,size:e.size,percentage:0,uid:e.uid,raw:e};if("picture-card"===this.listType||"picture"===this.listType)try{t.url=URL.createObjectURL(e)}catch(i){return void console.error("[Element Error][Upload]",i)}this.uploadFiles.push(t),this.onChange(t,this.uploadFiles)},handleProgress:function(e,t){var i=this.getFile(t);this.onProgress(e,i,this.uploadFiles),i.status="uploading",i.percentage=e.percent||0},handleSuccess:function(e,t){var i=this.getFile(t);i&&(i.status="success",i.response=e,this.onSuccess(e,i,this.uploadFiles),this.onChange(i,this.uploadFiles))},handleError:function(e,t){var i=this.getFile(t),n=this.uploadFiles;i.status="fail",n.splice(n.indexOf(i),1),this.onError(e,i,this.uploadFiles),this.onChange(i,this.uploadFiles)},handleRemove:function(e,t){var i=this;t&&(e=this.getFile(t));var n=function(){i.abort(e);var t=i.uploadFiles;t.splice(t.indexOf(e),1),i.onRemove(e,t)};if(this.beforeRemove){if("function"===typeof this.beforeRemove){var s=this.beforeRemove(e,this.uploadFiles);s&&s.then?s.then((function(){n()}),vh):!1!==s&&n()}}else n()},getFile:function(e){var t=this.uploadFiles,i=void 0;return t.every((function(t){return i=e.uid===t.uid?t:null,!i})),i},abort:function(e){this.$refs["upload-inner"].abort(e)},clearFiles:function(){this.uploadFiles=[]},submit:function(){var e=this;this.uploadFiles.filter((function(e){return"ready"===e.status})).forEach((function(t){e.$refs["upload-inner"].upload(t.raw)}))},getMigratingConfig:function(){return{props:{"default-file-list":"default-file-list is renamed to file-list.","show-upload-list":"show-upload-list is renamed to show-file-list.","thumbnail-mode":"thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan"}}}},beforeDestroy:function(){this.uploadFiles.forEach((function(e){e.url&&0===e.url.indexOf("blob:")&&URL.revokeObjectURL(e.url)}))},render:function(e){var t=this,i=void 0;this.showFileList&&(i=e(Qu,{attrs:{disabled:this.uploadDisabled,listType:this.listType,files:this.uploadFiles,handlePreview:this.onPreview},on:{remove:this.handleRemove}},[function(e){if(t.$scopedSlots.file)return t.$scopedSlots.file({file:e.file})}]));var n={props:{type:this.type,drag:this.drag,action:this.action,multiple:this.multiple,"before-upload":this.beforeUpload,"with-credentials":this.withCredentials,headers:this.headers,name:this.name,data:this.data,accept:this.accept,fileList:this.uploadFiles,autoUpload:this.autoUpload,listType:this.listType,disabled:this.uploadDisabled,limit:this.limit,"on-exceed":this.onExceed,"on-start":this.handleStart,"on-progress":this.handleProgress,"on-success":this.handleSuccess,"on-error":this.handleError,"on-preview":this.onPreview,"on-remove":this.handleRemove,"http-request":this.httpRequest},ref:"upload-inner"},s=this.$slots.trigger||this.$slots.default,r=e("upload",n,[s]);return e("div",["picture-card"===this.listType?i:"",this.$slots.trigger?[r,this.$slots.default]:r,this.$slots.tip,"picture-card"!==this.listType?i:""])}},_h=yh,xh=o(_h,gh,bh,!1,null,null,null);xh.options.__file="packages/upload/src/index.vue";var Ch=xh.exports;Ch.install=function(e){e.component(Ch.name,Ch)};var wh=Ch,kh=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-progress",class:["el-progress--"+e.type,e.status?"is-"+e.status:"",{"el-progress--without-text":!e.showText,"el-progress--text-inside":e.textInside}],attrs:{role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===e.type?i("div",{staticClass:"el-progress-bar"},[i("div",{staticClass:"el-progress-bar__outer",style:{height:e.strokeWidth+"px"}},[i("div",{staticClass:"el-progress-bar__inner",style:e.barStyle},[e.showText&&e.textInside?i("div",{staticClass:"el-progress-bar__innerText"},[e._v(e._s(e.content))]):e._e()])])]):i("div",{staticClass:"el-progress-circle",style:{height:e.width+"px",width:e.width+"px"}},[i("svg",{attrs:{viewBox:"0 0 100 100"}},[i("path",{staticClass:"el-progress-circle__track",style:e.trailPathStyle,attrs:{d:e.trackPath,stroke:"#e5e9f2","stroke-width":e.relativeStrokeWidth,fill:"none"}}),i("path",{staticClass:"el-progress-circle__path",style:e.circlePathStyle,attrs:{d:e.trackPath,stroke:e.stroke,fill:"none","stroke-linecap":e.strokeLinecap,"stroke-width":e.percentage?e.relativeStrokeWidth:0}})])]),e.showText&&!e.textInside?i("div",{staticClass:"el-progress__text",style:{fontSize:e.progressTextSize+"px"}},[e.status?i("i",{class:e.iconClass}):[e._v(e._s(e.content))]],2):e._e()])},Sh=[];kh._withStripped=!0;var Dh={name:"ElProgress",props:{type:{type:String,default:"line",validator:function(e){return["line","circle","dashboard"].indexOf(e)>-1}},percentage:{type:Number,default:0,required:!0,validator:function(e){return e>=0&&e<=100}},status:{type:String,validator:function(e){return["success","exception","warning"].indexOf(e)>-1}},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var e=this.radius,t="dashboard"===this.type;return"\n M 50 50\n m 0 "+(t?"":"-")+e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"-":"")+2*e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"":"-")+2*e+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){var e=-1*this.perimeter*(1-this.rate)/2;return e+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var e=void 0;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"===typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(e){return"function"===typeof this.color?this.color(e):"string"===typeof this.color?this.color:this.getLevelColor(e)},getLevelColor:function(e){for(var t=this.getColorArray().sort((function(e,t){return e.percentage-t.percentage})),i=0;ie)return t[i].color;return t[t.length-1].color},getColorArray:function(){var e=this.color,t=100/e.length;return e.map((function(e,i){return"string"===typeof e?{color:e,percentage:(i+1)*t}:e}))}}},$h=Dh,Oh=o($h,kh,Sh,!1,null,null,null);Oh.options.__file="packages/progress/src/progress.vue";var Eh=Oh.exports;Eh.install=function(e){e.component(Eh.name,Eh)};var Th=Eh,Ph=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{staticClass:"el-spinner"},[i("svg",{staticClass:"el-spinner-inner",style:{width:e.radius/2+"px",height:e.radius/2+"px"},attrs:{viewBox:"0 0 50 50"}},[i("circle",{staticClass:"path",attrs:{cx:"25",cy:"25",r:"20",fill:"none",stroke:e.strokeColor,"stroke-width":e.strokeWidth}})])])},Mh=[];Ph._withStripped=!0;var Nh={name:"ElSpinner",props:{type:String,radius:{type:Number,default:100},strokeWidth:{type:Number,default:5},strokeColor:{type:String,default:"#efefef"}}},Ih=Nh,jh=o(Ih,Ph,Mh,!1,null,null,null);jh.options.__file="packages/spinner/src/spinner.vue";var Fh=jh.exports;Fh.install=function(e){e.component(Fh.name,Fh)};var Lh=Fh,Ah=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-message-fade"},on:{"after-leave":e.handleAfterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-message",e.type&&!e.iconClass?"el-message--"+e.type:"",e.center?"is-center":"",e.showClose?"is-closable":"",e.customClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:e.clearTimer,mouseleave:e.startTimer}},[e.iconClass?i("i",{class:e.iconClass}):i("i",{class:e.typeClass}),e._t("default",[e.dangerouslyUseHTMLString?i("p",{staticClass:"el-message__content",domProps:{innerHTML:e._s(e.message)}}):i("p",{staticClass:"el-message__content"},[e._v(e._s(e.message))])]),e.showClose?i("i",{staticClass:"el-message__closeBtn el-icon-close",on:{click:e.close}}):e._e()],2)])},Vh=[];Ah._withStripped=!0;var Bh={success:"success",info:"info",warning:"warning",error:"error"},zh={data:function(){return{visible:!1,message:"",duration:3e3,type:"info",iconClass:"",customClass:"",onClose:null,showClose:!1,closed:!1,verticalOffset:20,timer:null,dangerouslyUseHTMLString:!1,center:!1}},computed:{typeClass:function(){return this.type&&!this.iconClass?"el-message__icon el-icon-"+Bh[this.type]:""},positionStyle:function(){return{top:this.verticalOffset+"px"}}},watch:{closed:function(e){e&&(this.visible=!1)}},methods:{handleAfterLeave:function(){this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},close:function(){this.closed=!0,"function"===typeof this.onClose&&this.onClose(this)},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout((function(){e.closed||e.close()}),this.duration))},keydown:function(e){27===e.keyCode&&(this.closed||this.close())}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},Rh=zh,Hh=o(Rh,Ah,Vh,!1,null,null,null);Hh.options.__file="packages/message/src/main.vue";var Wh=Hh.exports,qh=i(15),Yh=Object.assign||function(e){for(var t=1;tGh.length-1))for(var a=n;a=0;e--)Gh[e].close()};var Qh=Zh,Jh=Qh,ed=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-badge"},[e._t("default"),i("transition",{attrs:{name:"el-zoom-in-center"}},[i("sup",{directives:[{name:"show",rawName:"v-show",value:!e.hidden&&(e.content||0===e.content||e.isDot),expression:"!hidden && (content || content === 0 || isDot)"}],staticClass:"el-badge__content",class:[e.type?"el-badge__content--"+e.type:null,{"is-fixed":e.$slots.default,"is-dot":e.isDot}],domProps:{textContent:e._s(e.content)}})])],2)},td=[];ed._withStripped=!0;var id={name:"ElBadge",props:{value:[String,Number],max:Number,isDot:Boolean,hidden:Boolean,type:{type:String,validator:function(e){return["primary","success","warning","info","danger"].indexOf(e)>-1}}},computed:{content:function(){if(!this.isDot){var e=this.value,t=this.max;return"number"===typeof e&&"number"===typeof t&&t0&&e-1this.value,i=this.allowHalf&&this.pointerAtLeftHalf&&e-.5<=this.currentValue&&e>this.currentValue;return t||i},getIconStyle:function(e){var t=this.rateDisabled?this.disabledVoidColor:this.voidColor;return{color:e<=this.currentValue?this.activeColor:t}},selectValue:function(e){this.rateDisabled||(this.allowHalf&&this.pointerAtLeftHalf?(this.$emit("input",this.currentValue),this.$emit("change",this.currentValue)):(this.$emit("input",e),this.$emit("change",e)))},handleKey:function(e){if(!this.rateDisabled){var t=this.currentValue,i=e.keyCode;38===i||39===i?(this.allowHalf?t+=.5:t+=1,e.stopPropagation(),e.preventDefault()):37!==i&&40!==i||(this.allowHalf?t-=.5:t-=1,e.stopPropagation(),e.preventDefault()),t=t<0?0:t,t=t>this.max?this.max:t,this.$emit("input",t),this.$emit("change",t)}},setCurrentValue:function(e,t){if(!this.rateDisabled){if(this.allowHalf){var i=t.target;Object(Ae["hasClass"])(i,"el-rate__item")&&(i=i.querySelector(".el-rate__icon")),Object(Ae["hasClass"])(i,"el-rate__decimal")&&(i=i.parentNode),this.pointerAtLeftHalf=2*t.offsetX<=i.clientWidth,this.currentValue=this.pointerAtLeftHalf?e-.5:e}else this.currentValue=e;this.hoverIndex=e}},resetCurrentValue:function(){this.rateDisabled||(this.allowHalf&&(this.pointerAtLeftHalf=this.value!==Math.floor(this.value)),this.currentValue=this.value,this.hoverIndex=-1)}},created:function(){this.value||this.$emit("input",0)}},gd=vd,bd=o(gd,fd,md,!1,null,null,null);bd.options.__file="packages/rate/src/main.vue";var yd=bd.exports;yd.install=function(e){e.component(yd.name,yd)};var _d=yd,xd=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-steps",class:[!e.simple&&"el-steps--"+e.direction,e.simple&&"el-steps--simple"]},[e._t("default")],2)},Cd=[];xd._withStripped=!0;var wd={name:"ElSteps",mixins:[D.a],props:{space:[Number,String],active:Number,direction:{type:String,default:"horizontal"},alignCenter:Boolean,simple:Boolean,finishStatus:{type:String,default:"finish"},processStatus:{type:String,default:"process"}},data:function(){return{steps:[],stepOffset:0}},methods:{getMigratingConfig:function(){return{props:{center:"center is removed."}}}},watch:{active:function(e,t){this.$emit("change",e,t)},steps:function(e){e.forEach((function(e,t){e.index=t}))}}},kd=wd,Sd=o(kd,xd,Cd,!1,null,null,null);Sd.options.__file="packages/steps/src/steps.vue";var Dd=Sd.exports;Dd.install=function(e){e.component(Dd.name,Dd)};var $d=Dd,Od=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-step",class:[!e.isSimple&&"is-"+e.$parent.direction,e.isSimple&&"is-simple",e.isLast&&!e.space&&!e.isCenter&&"is-flex",e.isCenter&&!e.isVertical&&!e.isSimple&&"is-center"],style:e.style},[i("div",{staticClass:"el-step__head",class:"is-"+e.currentStatus},[i("div",{staticClass:"el-step__line",style:e.isLast?"":{marginRight:e.$parent.stepOffset+"px"}},[i("i",{staticClass:"el-step__line-inner",style:e.lineStyle})]),i("div",{staticClass:"el-step__icon",class:"is-"+(e.icon?"icon":"text")},["success"!==e.currentStatus&&"error"!==e.currentStatus?e._t("icon",[e.icon?i("i",{staticClass:"el-step__icon-inner",class:[e.icon]}):e._e(),e.icon||e.isSimple?e._e():i("div",{staticClass:"el-step__icon-inner"},[e._v(e._s(e.index+1))])]):i("i",{staticClass:"el-step__icon-inner is-status",class:["el-icon-"+("success"===e.currentStatus?"check":"close")]})],2)]),i("div",{staticClass:"el-step__main"},[i("div",{ref:"title",staticClass:"el-step__title",class:["is-"+e.currentStatus]},[e._t("title",[e._v(e._s(e.title))])],2),e.isSimple?i("div",{staticClass:"el-step__arrow"}):i("div",{staticClass:"el-step__description",class:["is-"+e.currentStatus]},[e._t("description",[e._v(e._s(e.description))])],2)])])},Ed=[];Od._withStripped=!0;var Td={name:"ElStep",props:{title:String,icon:String,description:String,status:String},data:function(){return{index:-1,lineStyle:{},internalStatus:""}},beforeCreate:function(){this.$parent.steps.push(this)},beforeDestroy:function(){var e=this.$parent.steps,t=e.indexOf(this);t>=0&&e.splice(t,1)},computed:{currentStatus:function(){return this.status||this.internalStatus},prevStatus:function(){var e=this.$parent.steps[this.index-1];return e?e.currentStatus:"wait"},isCenter:function(){return this.$parent.alignCenter},isVertical:function(){return"vertical"===this.$parent.direction},isSimple:function(){return this.$parent.simple},isLast:function(){var e=this.$parent;return e.steps[e.steps.length-1]===this},stepsCount:function(){return this.$parent.steps.length},space:function(){var e=this.isSimple,t=this.$parent.space;return e?"":t},style:function(){var e={},t=this.$parent,i=t.steps.length,n="number"===typeof this.space?this.space+"px":this.space?this.space:100/(i-(this.isCenter?0:1))+"%";return e.flexBasis=n,this.isVertical||(this.isLast?e.maxWidth=100/this.stepsCount+"%":e.marginRight=-this.$parent.stepOffset+"px"),e}},methods:{updateStatus:function(e){var t=this.$parent.$children[this.index-1];e>this.index?this.internalStatus=this.$parent.finishStatus:e===this.index&&"error"!==this.prevStatus?this.internalStatus=this.$parent.processStatus:this.internalStatus="wait",t&&t.calcProgress(this.internalStatus)},calcProgress:function(e){var t=100,i={};i.transitionDelay=150*this.index+"ms",e===this.$parent.processStatus?(this.currentStatus,t=0):"wait"===e&&(t=0,i.transitionDelay=-150*this.index+"ms"),i.borderWidth=t&&!this.isSimple?"1px":0,"vertical"===this.$parent.direction?i.height=t+"%":i.width=t+"%",this.lineStyle=i}},mounted:function(){var e=this,t=this.$watch("index",(function(i){e.$watch("$parent.active",e.updateStatus,{immediate:!0}),e.$watch("$parent.processStatus",(function(){var t=e.$parent.active;e.updateStatus(t)}),{immediate:!0}),t()}))}},Pd=Td,Md=o(Pd,Od,Ed,!1,null,null,null);Md.options.__file="packages/steps/src/step.vue";var Nd=Md.exports;Nd.install=function(e){e.component(Nd.name,Nd)};var Id=Nd,jd=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.carouselClasses,on:{mouseenter:function(t){return t.stopPropagation(),e.handleMouseEnter(t)},mouseleave:function(t){return t.stopPropagation(),e.handleMouseLeave(t)}}},[i("div",{staticClass:"el-carousel__container",style:{height:e.height}},[e.arrowDisplay?i("transition",{attrs:{name:"carousel-arrow-left"}},[i("button",{directives:[{name:"show",rawName:"v-show",value:("always"===e.arrow||e.hover)&&(e.loop||e.activeIndex>0),expression:"(arrow === 'always' || hover) && (loop || activeIndex > 0)"}],staticClass:"el-carousel__arrow el-carousel__arrow--left",attrs:{type:"button"},on:{mouseenter:function(t){e.handleButtonEnter("left")},mouseleave:e.handleButtonLeave,click:function(t){t.stopPropagation(),e.throttledArrowClick(e.activeIndex-1)}}},[i("i",{staticClass:"el-icon-arrow-left"})])]):e._e(),e.arrowDisplay?i("transition",{attrs:{name:"carousel-arrow-right"}},[i("button",{directives:[{name:"show",rawName:"v-show",value:("always"===e.arrow||e.hover)&&(e.loop||e.activeIndex0}))},carouselClasses:function(){var e=["el-carousel","el-carousel--"+this.direction];return"card"===this.type&&e.push("el-carousel--card"),e},indicatorsClasses:function(){var e=["el-carousel__indicators","el-carousel__indicators--"+this.direction];return this.hasLabel&&e.push("el-carousel__indicators--labels"),"outside"!==this.indicatorPosition&&"card"!==this.type||e.push("el-carousel__indicators--outside"),e}},watch:{items:function(e){e.length>0&&this.setActiveItem(this.initialIndex)},activeIndex:function(e,t){this.resetItemPosition(t),t>-1&&this.$emit("change",e,t)},autoplay:function(e){e?this.startTimer():this.pauseTimer()},loop:function(){this.setActiveItem(this.activeIndex)},interval:function(){this.pauseTimer(),this.startTimer()}},methods:{handleMouseEnter:function(){this.hover=!0,this.pauseTimer()},handleMouseLeave:function(){this.hover=!1,this.startTimer()},itemInStage:function(e,t){var i=this.items.length;return t===i-1&&e.inStage&&this.items[0].active||e.inStage&&this.items[t+1]&&this.items[t+1].active?"left":!!(0===t&&e.inStage&&this.items[i-1].active||e.inStage&&this.items[t-1]&&this.items[t-1].active)&&"right"},handleButtonEnter:function(e){var t=this;"vertical"!==this.direction&&this.items.forEach((function(i,n){e===t.itemInStage(i,n)&&(i.hover=!0)}))},handleButtonLeave:function(){"vertical"!==this.direction&&this.items.forEach((function(e){e.hover=!1}))},updateItems:function(){this.items=this.$children.filter((function(e){return"ElCarouselItem"===e.$options.name}))},resetItemPosition:function(e){var t=this;this.items.forEach((function(i,n){i.translateItem(n,t.activeIndex,e)}))},playSlides:function(){this.activeIndex0&&(e=this.items.indexOf(t[0]))}if(e=Number(e),isNaN(e)||e!==Math.floor(e))console.warn("[Element Warn][Carousel]index must be an integer.");else{var i=this.items.length,n=this.activeIndex;this.activeIndex=e<0?this.loop?i-1:0:e>=i?this.loop?0:i-1:e,n===this.activeIndex&&this.resetItemPosition(n),this.resetTimer()}},prev:function(){this.setActiveItem(this.activeIndex-1)},next:function(){this.setActiveItem(this.activeIndex+1)},handleIndicatorClick:function(e){this.activeIndex=e},handleIndicatorHover:function(e){"hover"===this.trigger&&e!==this.activeIndex&&(this.activeIndex=e)}},created:function(){var e=this;this.throttledArrowClick=Ad()(300,!0,(function(t){e.setActiveItem(t)})),this.throttledIndicatorHover=Ad()(300,(function(t){e.handleIndicatorHover(t)}))},mounted:function(){var e=this;this.updateItems(),this.$nextTick((function(){Object(Ji["addResizeListener"])(e.$el,e.resetItemPosition),e.initialIndex=0&&(e.activeIndex=e.initialIndex),e.startTimer()}))},beforeDestroy:function(){this.$el&&Object(Ji["removeResizeListener"])(this.$el,this.resetItemPosition),this.pauseTimer()}},Bd=Vd,zd=o(Bd,jd,Fd,!1,null,null,null);zd.options.__file="packages/carousel/src/main.vue";var Rd=zd.exports;Rd.install=function(e){e.component(Rd.name,Rd)};var Hd=Rd,Wd={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}};function qd(e){var t=e.move,i=e.size,n=e.bar,s={},r="translate"+n.axis+"("+t+"%)";return s[n.size]=i,s.transform=r,s.msTransform=r,s.webkitTransform=r,s}var Yd={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return Wd[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(e){var t=this.size,i=this.move,n=this.bar;return e("div",{class:["el-scrollbar__bar","is-"+n.key],on:{mousedown:this.clickTrackHandler}},[e("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:qd({size:t,move:i,bar:n})})])},methods:{clickThumbHandler:function(e){e.ctrlKey||2===e.button||(this.startDrag(e),this[this.bar.axis]=e.currentTarget[this.bar.offset]-(e[this.bar.client]-e.currentTarget.getBoundingClientRect()[this.bar.direction]))},clickTrackHandler:function(e){var t=Math.abs(e.target.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),i=this.$refs.thumb[this.bar.offset]/2,n=100*(t-i)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=n*this.wrap[this.bar.scrollSize]/100},startDrag:function(e){e.stopImmediatePropagation(),this.cursorDown=!0,Object(Ae["on"])(document,"mousemove",this.mouseMoveDocumentHandler),Object(Ae["on"])(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(e){if(!1!==this.cursorDown){var t=this[this.bar.axis];if(t){var i=-1*(this.$el.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),n=this.$refs.thumb[this.bar.offset]-t,s=100*(i-n)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=s*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(e){this.cursorDown=!1,this[this.bar.axis]=0,Object(Ae["off"])(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){Object(Ae["off"])(document,"mouseup",this.mouseUpDocumentHandler)}},Kd={name:"ElScrollbar",components:{Bar:Yd},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(e){var t=gs()(),i=this.wrapStyle;if(t){var n="-"+t+"px",s="margin-bottom: "+n+"; margin-right: "+n+";";Array.isArray(this.wrapStyle)?(i=Object(b["toObject"])(this.wrapStyle),i.marginRight=i.marginBottom=n):"string"===typeof this.wrapStyle?i+=s:i=s}var r=e(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),a=e("div",{ref:"wrap",style:i,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",t?"":"el-scrollbar__wrap--hidden-default"]},[[r]]),o=void 0;return o=this.native?[e("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:i},[[r]])]:[a,e(Yd,{attrs:{move:this.moveX,size:this.sizeWidth}}),e(Yd,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}})],e("div",{class:"el-scrollbar"},o)},methods:{handleScroll:function(){var e=this.wrap;this.moveY=100*e.scrollTop/e.clientHeight,this.moveX=100*e.scrollLeft/e.clientWidth},update:function(){var e=void 0,t=void 0,i=this.wrap;i&&(e=100*i.clientHeight/i.scrollHeight,t=100*i.clientWidth/i.scrollWidth,this.sizeHeight=e<100?e+"%":"",this.sizeWidth=t<100?t+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&Object(Ji["addResizeListener"])(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&Object(Ji["removeResizeListener"])(this.$refs.resize,this.update)},install:function(e){e.component(Kd.name,Kd)}},Ud=Kd,Gd=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"show",rawName:"v-show",value:e.ready,expression:"ready"}],staticClass:"el-carousel__item",class:{"is-active":e.active,"el-carousel__item--card":"card"===e.$parent.type,"is-in-stage":e.inStage,"is-hover":e.hover,"is-animating":e.animating},style:e.itemStyle,on:{click:e.handleItemClick}},["card"===e.$parent.type?i("div",{directives:[{name:"show",rawName:"v-show",value:!e.active,expression:"!active"}],staticClass:"el-carousel__mask"}):e._e(),e._t("default")],2)},Xd=[];Gd._withStripped=!0;var Zd=.83,Qd={name:"ElCarouselItem",props:{name:String,label:{type:[String,Number],default:""}},data:function(){return{hover:!1,translate:0,scale:1,active:!1,ready:!1,inStage:!1,animating:!1}},methods:{processIndex:function(e,t,i){return 0===t&&e===i-1?-1:t===i-1&&0===e?i:e=i/2?i+1:e>t+1&&e-t>=i/2?-2:e},calcCardTranslate:function(e,t){var i=this.$parent.$el.offsetWidth;return this.inStage?i*((2-Zd)*(e-t)+1)/4:e2&&this.$parent.loop&&(e=this.processIndex(e,t,r)),"card"===n)"vertical"===s&&console.warn("[Element Warn][Carousel]vertical direction is not supported in card mode"),this.inStage=Math.round(Math.abs(e-t))<=1,this.active=e===t,this.translate=this.calcCardTranslate(e,t),this.scale=this.active?1:Zd;else{this.active=e===t;var a="vertical"===s;this.translate=this.calcTranslate(e,t,a),this.scale=1}this.ready=!0},handleItemClick:function(){var e=this.$parent;if(e&&"card"===e.type){var t=e.items.indexOf(this);e.setActiveItem(t)}}},computed:{parentDirection:function(){return this.$parent.direction},itemStyle:function(){var e="vertical"===this.parentDirection?"translateY":"translateX",t=e+"("+this.translate+"px) scale("+this.scale+")",i={transform:t};return Object(b["autoprefixer"])(i)}},created:function(){this.$parent&&this.$parent.updateItems()},destroyed:function(){this.$parent&&this.$parent.updateItems()}},Jd=Qd,ep=o(Jd,Gd,Xd,!1,null,null,null);ep.options.__file="packages/carousel/src/item.vue";var tp=ep.exports;tp.install=function(e){e.component(tp.name,tp)};var ip=tp,np=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-collapse",attrs:{role:"tablist","aria-multiselectable":"true"}},[e._t("default")],2)},sp=[];np._withStripped=!0;var rp={name:"ElCollapse",componentName:"ElCollapse",props:{accordion:Boolean,value:{type:[Array,String,Number],default:function(){return[]}}},data:function(){return{activeNames:[].concat(this.value)}},provide:function(){return{collapse:this}},watch:{value:function(e){this.activeNames=[].concat(e)}},methods:{setActiveNames:function(e){e=[].concat(e);var t=this.accordion?e[0]:e;this.activeNames=e,this.$emit("input",t),this.$emit("change",t)},handleItemClick:function(e){if(this.accordion)this.setActiveNames(!this.activeNames[0]&&0!==this.activeNames[0]||this.activeNames[0]!==e.name?e.name:"");else{var t=this.activeNames.slice(0),i=t.indexOf(e.name);i>-1?t.splice(i,1):t.push(e.name),this.setActiveNames(t)}}},created:function(){this.$on("item-click",this.handleItemClick)}},ap=rp,op=o(ap,np,sp,!1,null,null,null);op.options.__file="packages/collapse/src/collapse.vue";var lp=op.exports;lp.install=function(e){e.component(lp.name,lp)};var cp=lp,up=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-collapse-item",class:{"is-active":e.isActive,"is-disabled":e.disabled}},[i("div",{attrs:{role:"tab","aria-expanded":e.isActive,"aria-controls":"el-collapse-content-"+e.id,"aria-describedby":"el-collapse-content-"+e.id}},[i("div",{staticClass:"el-collapse-item__header",class:{focusing:e.focusing,"is-active":e.isActive},attrs:{role:"button",id:"el-collapse-head-"+e.id,tabindex:e.disabled?void 0:0},on:{click:e.handleHeaderClick,keyup:function(t){return!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),e.handleEnterClick(t))},focus:e.handleFocus,blur:function(t){e.focusing=!1}}},[e._t("title",[e._v(e._s(e.title))]),i("i",{staticClass:"el-collapse-item__arrow el-icon-arrow-right",class:{"is-active":e.isActive}})],2)]),i("el-collapse-transition",[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"el-collapse-item__wrap",attrs:{role:"tabpanel","aria-hidden":!e.isActive,"aria-labelledby":"el-collapse-head-"+e.id,id:"el-collapse-content-"+e.id}},[i("div",{staticClass:"el-collapse-item__content"},[e._t("default")],2)])])],1)},hp=[];up._withStripped=!0;var dp={name:"ElCollapseItem",componentName:"ElCollapseItem",mixins:[O.a],components:{ElCollapseTransition:Ke.a},data:function(){return{contentWrapStyle:{height:"auto",display:"block"},contentHeight:0,focusing:!1,isClick:!1,id:Object(b["generateId"])()}},inject:["collapse"],props:{title:String,name:{type:[String,Number],default:function(){return this._uid}},disabled:Boolean},computed:{isActive:function(){return this.collapse.activeNames.indexOf(this.name)>-1}},methods:{handleFocus:function(){var e=this;setTimeout((function(){e.isClick?e.isClick=!1:e.focusing=!0}),50)},handleHeaderClick:function(){this.disabled||(this.dispatch("ElCollapse","item-click",this),this.focusing=!1,this.isClick=!0)},handleEnterClick:function(){this.dispatch("ElCollapse","item-click",this)}}},pp=dp,fp=o(pp,up,hp,!1,null,null,null);fp.options.__file="packages/collapse/src/collapse-item.vue";var mp=fp.exports;mp.install=function(e){e.component(mp.name,mp)};var vp=mp,gp=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:function(){return e.toggleDropDownVisible(!1)},expression:"() => toggleDropDownVisible(false)"}],ref:"reference",class:["el-cascader",e.realSize&&"el-cascader--"+e.realSize,{"is-disabled":e.isDisabled}],on:{mouseenter:function(t){e.inputHover=!0},mouseleave:function(t){e.inputHover=!1},click:function(){return e.toggleDropDownVisible(!e.readonly||void 0)},keydown:e.handleKeyDown}},[i("el-input",{ref:"input",class:{"is-focus":e.dropDownVisible},attrs:{size:e.realSize,placeholder:e.placeholder,readonly:e.readonly,disabled:e.isDisabled,"validate-event":!1},on:{focus:e.handleFocus,blur:e.handleBlur,input:e.handleInput},model:{value:e.multiple?e.presentText:e.inputValue,callback:function(t){e.multiple?e.presentText:e.inputValue=t},expression:"multiple ? presentText : inputValue"}},[i("template",{slot:"suffix"},[e.clearBtnVisible?i("i",{key:"clear",staticClass:"el-input__icon el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.handleClear(t)}}}):i("i",{key:"arrow-down",class:["el-input__icon","el-icon-arrow-down",e.dropDownVisible&&"is-reverse"],on:{click:function(t){t.stopPropagation(),e.toggleDropDownVisible()}}})])],2),e.multiple?i("div",{staticClass:"el-cascader__tags"},[e._l(e.presentTags,(function(t){return i("el-tag",{key:t.key,attrs:{type:"info",size:e.tagSize,hit:t.hitState,closable:t.closable,"disable-transitions":""},on:{close:function(i){e.deleteTag(t)}}},[i("span",[e._v(e._s(t.text))])])})),e.filterable&&!e.isDisabled?i("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.inputValue,expression:"inputValue",modifiers:{trim:!0}}],staticClass:"el-cascader__search-input",attrs:{type:"text",placeholder:e.presentTags.length?"":e.placeholder},domProps:{value:e.inputValue},on:{input:[function(t){t.target.composing||(e.inputValue=t.target.value.trim())},function(t){return e.handleInput(e.inputValue,t)}],click:function(t){t.stopPropagation(),e.toggleDropDownVisible(!0)},keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.handleDelete(t)},blur:function(t){e.$forceUpdate()}}}):e._e()],2):e._e(),i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.handleDropdownLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.dropDownVisible,expression:"dropDownVisible"}],ref:"popper",class:["el-popper","el-cascader__dropdown",e.popperClass]},[i("el-cascader-panel",{directives:[{name:"show",rawName:"v-show",value:!e.filtering,expression:"!filtering"}],ref:"panel",attrs:{options:e.options,props:e.config,border:!1,"render-label":e.$scopedSlots.default},on:{"expand-change":e.handleExpandChange,close:function(t){e.toggleDropDownVisible(!1)}},model:{value:e.checkedValue,callback:function(t){e.checkedValue=t},expression:"checkedValue"}}),e.filterable?i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.filtering,expression:"filtering"}],ref:"suggestionPanel",staticClass:"el-cascader__suggestion-panel",attrs:{tag:"ul","view-class":"el-cascader__suggestion-list"},nativeOn:{keydown:function(t){return e.handleSuggestionKeyDown(t)}}},[e.suggestions.length?e._l(e.suggestions,(function(t,n){return i("li",{key:t.uid,class:["el-cascader__suggestion-item",t.checked&&"is-checked"],attrs:{tabindex:-1},on:{click:function(t){e.handleSuggestionClick(n)}}},[i("span",[e._v(e._s(t.text))]),t.checked?i("i",{staticClass:"el-icon-check"}):e._e()])})):e._t("empty",[i("li",{staticClass:"el-cascader__empty-text"},[e._v(e._s(e.t("el.cascader.noMatch")))])])],2):e._e()],1)])],1)},bp=[];gp._withStripped=!0;var yp=i(42),_p=i.n(yp),xp=i(34),Cp=i.n(xp),wp=Cp.a.keys,kp={expandTrigger:{newProp:"expandTrigger",type:String},changeOnSelect:{newProp:"checkStrictly",type:Boolean},hoverThreshold:{newProp:"hoverThreshold",type:Number}},Sp={props:{placement:{type:String,default:"bottom-start"},appendToBody:H.a.props.appendToBody,visibleArrow:{type:Boolean,default:!0},arrowOffset:H.a.props.arrowOffset,offset:H.a.props.offset,boundariesPadding:H.a.props.boundariesPadding,popperOptions:H.a.props.popperOptions},methods:H.a.methods,data:H.a.data,beforeDestroy:H.a.beforeDestroy},Dp={medium:36,small:32,mini:28},$p={name:"ElCascader",directives:{Clickoutside:V.a},mixins:[Sp,O.a,g.a,D.a],inject:{elForm:{default:""},elFormItem:{default:""}},components:{ElInput:m.a,ElTag:Qi.a,ElScrollbar:q.a,ElCascaderPanel:_p.a},props:{value:{},options:Array,props:Object,size:String,placeholder:{type:String,default:function(){return Object(vo["t"])("el.cascader.placeholder")}},disabled:Boolean,clearable:Boolean,filterable:Boolean,filterMethod:Function,separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,debounce:{type:Number,default:300},beforeFilter:{type:Function,default:function(){return function(){}}},popperClass:String},data:function(){return{dropDownVisible:!1,checkedValue:this.value,inputHover:!1,inputValue:null,presentText:null,presentTags:[],checkedNodes:[],filtering:!1,suggestions:[],inputInitialHeight:0,pressDeleteCount:0}},computed:{realSize:function(){var e=(this.elFormItem||{}).elFormItemSize;return this.size||e||(this.$ELEMENT||{}).size},tagSize:function(){return["small","mini"].indexOf(this.realSize)>-1?"mini":"small"},isDisabled:function(){return this.disabled||(this.elForm||{}).disabled},config:function(){var e=this.props||{},t=this.$attrs;return Object.keys(kp).forEach((function(i){var n=kp[i],s=n.newProp,r=n.type,a=t[i]||t[Object(b["kebabCase"])(i)];Object(Dt["isDef"])(i)&&!Object(Dt["isDef"])(e[s])&&(r===Boolean&&""===a&&(a=!0),e[s]=a)})),e},multiple:function(){return this.config.multiple},leafOnly:function(){return!this.config.checkStrictly},readonly:function(){return!this.filterable||this.multiple},clearBtnVisible:function(){return!(!this.clearable||this.isDisabled||this.filtering||!this.inputHover)&&(this.multiple?!!this.checkedNodes.filter((function(e){return!e.isDisabled})).length:!!this.presentText)},panel:function(){return this.$refs.panel}},watch:{disabled:function(){this.computePresentContent()},value:function(e){Object(b["isEqual"])(e,this.checkedValue)||(this.checkedValue=e,this.computePresentContent())},checkedValue:function(e){var t=this.value,i=this.dropDownVisible,n=this.config,s=n.checkStrictly,r=n.multiple;Object(b["isEqual"])(e,t)&&!Object(qh["isUndefined"])(t)||(this.computePresentContent(),r||s||!i||this.toggleDropDownVisible(!1),this.$emit("input",e),this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",[e]))},options:{handler:function(){this.$nextTick(this.computePresentContent)},deep:!0},presentText:function(e){this.inputValue=e},presentTags:function(e,t){this.multiple&&(e.length||t.length)&&this.$nextTick(this.updateStyle)},filtering:function(e){this.$nextTick(this.updatePopper)}},mounted:function(){var e=this,t=this.$refs.input;t&&t.$el&&(this.inputInitialHeight=t.$el.offsetHeight||Dp[this.realSize]||40),this.isEmptyValue(this.value)||this.computePresentContent(),this.filterHandler=L()(this.debounce,(function(){var t=e.inputValue;if(t){var i=e.beforeFilter(t);i&&i.then?i.then(e.getSuggestions):!1!==i?e.getSuggestions():e.filtering=!1}else e.filtering=!1})),Object(Ji["addResizeListener"])(this.$el,this.updateStyle)},beforeDestroy:function(){Object(Ji["removeResizeListener"])(this.$el,this.updateStyle)},methods:{getMigratingConfig:function(){return{props:{"expand-trigger":"expand-trigger is removed, use `props.expandTrigger` instead.","change-on-select":"change-on-select is removed, use `props.checkStrictly` instead.","hover-threshold":"hover-threshold is removed, use `props.hoverThreshold` instead"},events:{"active-item-change":"active-item-change is renamed to expand-change"}}},toggleDropDownVisible:function(e){var t=this;if(!this.isDisabled){var i=this.dropDownVisible,n=this.$refs.input;e=Object(Dt["isDef"])(e)?e:!i,e!==i&&(this.dropDownVisible=e,e&&this.$nextTick((function(){t.updatePopper(),t.panel.scrollIntoView()})),n.$refs.input.setAttribute("aria-expanded",e),this.$emit("visible-change",e))}},handleDropdownLeave:function(){this.filtering=!1,this.inputValue=this.presentText,this.doDestroy()},handleKeyDown:function(e){switch(e.keyCode){case wp.enter:this.toggleDropDownVisible();break;case wp.down:this.toggleDropDownVisible(!0),this.focusFirstNode(),e.preventDefault();break;case wp.esc:case wp.tab:this.toggleDropDownVisible(!1);break}},handleFocus:function(e){this.$emit("focus",e)},handleBlur:function(e){this.$emit("blur",e)},handleInput:function(e,t){!this.dropDownVisible&&this.toggleDropDownVisible(!0),t&&t.isComposing||(e?this.filterHandler():this.filtering=!1)},handleClear:function(){this.presentText="",this.panel.clearCheckedNodes()},handleExpandChange:function(e){this.$nextTick(this.updatePopper.bind(this)),this.$emit("expand-change",e),this.$emit("active-item-change",e)},focusFirstNode:function(){var e=this;this.$nextTick((function(){var t=e.filtering,i=e.$refs,n=i.popper,s=i.suggestionPanel,r=null;if(t&&s)r=s.$el.querySelector(".el-cascader__suggestion-item");else{var a=n.querySelector(".el-cascader-menu");r=a.querySelector('.el-cascader-node[tabindex="-1"]')}r&&(r.focus(),!t&&r.click())}))},computePresentContent:function(){var e=this;this.$nextTick((function(){e.config.multiple?(e.computePresentTags(),e.presentText=e.presentTags.length?" ":null):e.computePresentText()}))},isEmptyValue:function(e){var t=this.multiple,i=this.panel.config.emitPath;return!(!t&&!i)&&Object(b["isEmpty"])(e)},computePresentText:function(){var e=this.checkedValue,t=this.config;if(!this.isEmptyValue(e)){var i=this.panel.getNodeByValue(e);if(i&&(t.checkStrictly||i.isLeaf))return void(this.presentText=i.getText(this.showAllLevels,this.separator))}this.presentText=null},computePresentTags:function(){var e=this.isDisabled,t=this.leafOnly,i=this.showAllLevels,n=this.separator,s=this.collapseTags,r=this.getCheckedNodes(t),a=[],o=function(t){return{node:t,key:t.uid,text:t.getText(i,n),hitState:!1,closable:!e&&!t.isDisabled}};if(r.length){var l=r[0],c=r.slice(1),u=c.length;a.push(o(l)),u&&(s?a.push({key:-1,text:"+ "+u,closable:!1}):c.forEach((function(e){return a.push(o(e))})))}this.checkedNodes=r,this.presentTags=a},getSuggestions:function(){var e=this,t=this.filterMethod;Object(qh["isFunction"])(t)||(t=function(e,t){return e.text.includes(t)});var i=this.panel.getFlattedNodes(this.leafOnly).filter((function(i){return!i.isDisabled&&(i.text=i.getText(e.showAllLevels,e.separator)||"",t(i,e.inputValue))}));this.multiple?this.presentTags.forEach((function(e){e.hitState=!1})):i.forEach((function(t){t.checked=Object(b["isEqual"])(e.checkedValue,t.getValueByOption())})),this.filtering=!0,this.suggestions=i,this.$nextTick(this.updatePopper)},handleSuggestionKeyDown:function(e){var t=e.keyCode,i=e.target;switch(t){case wp.enter:i.click();break;case wp.up:var n=i.previousElementSibling;n&&n.focus();break;case wp.down:var s=i.nextElementSibling;s&&s.focus();break;case wp.esc:case wp.tab:this.toggleDropDownVisible(!1);break}},handleDelete:function(){var e=this.inputValue,t=this.pressDeleteCount,i=this.presentTags,n=i.length-1,s=i[n];this.pressDeleteCount=e?0:t+1,s&&this.pressDeleteCount&&(s.hitState?this.deleteTag(s):s.hitState=!0)},handleSuggestionClick:function(e){var t=this.multiple,i=this.suggestions[e];if(t){var n=i.checked;i.doCheck(!n),this.panel.calculateMultiCheckedValue()}else this.checkedValue=i.getValueByOption(),this.toggleDropDownVisible(!1)},deleteTag:function(e){var t=this.checkedValue,i=e.node.getValueByOption(),n=t.find((function(e){return Object(b["isEqual"])(e,i)}));this.checkedValue=t.filter((function(e){return!Object(b["isEqual"])(e,i)})),this.$emit("remove-tag",n)},updateStyle:function(){var e=this.$el,t=this.inputInitialHeight;if(!this.$isServer&&e){var i=this.$refs.suggestionPanel,n=e.querySelector(".el-input__inner");if(n){var s=e.querySelector(".el-cascader__tags"),r=null;if(i&&(r=i.$el)){var a=r.querySelector(".el-cascader__suggestion-list");a.style.minWidth=n.offsetWidth+"px"}if(s){var o=Math.round(s.getBoundingClientRect().height),l=Math.max(o+6,t)+"px";n.style.height=l,this.dropDownVisible&&this.updatePopper()}}}},getCheckedNodes:function(e){return this.panel.getCheckedNodes(e)}}},Op=$p,Ep=o(Op,gp,bp,!1,null,null,null);Ep.options.__file="packages/cascader/src/cascader.vue";var Tp=Ep.exports;Tp.install=function(e){e.component(Tp.name,Tp)};var Pp=Tp,Mp=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.hide,expression:"hide"}],class:["el-color-picker",e.colorDisabled?"is-disabled":"",e.colorSize?"el-color-picker--"+e.colorSize:""]},[e.colorDisabled?i("div",{staticClass:"el-color-picker__mask"}):e._e(),i("div",{staticClass:"el-color-picker__trigger",on:{click:e.handleTrigger}},[i("span",{staticClass:"el-color-picker__color",class:{"is-alpha":e.showAlpha}},[i("span",{staticClass:"el-color-picker__color-inner",style:{backgroundColor:e.displayedColor}}),e.value||e.showPanelColor?e._e():i("span",{staticClass:"el-color-picker__empty el-icon-close"})]),i("span",{directives:[{name:"show",rawName:"v-show",value:e.value||e.showPanelColor,expression:"value || showPanelColor"}],staticClass:"el-color-picker__icon el-icon-arrow-down"})]),i("picker-dropdown",{ref:"dropdown",class:["el-color-picker__panel",e.popperClass||""],attrs:{color:e.color,"show-alpha":e.showAlpha,predefine:e.predefine},on:{pick:e.confirmValue,clear:e.clearValue},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}})],1)},Np=[];Mp._withStripped=!0;var Ip="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function jp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Fp=function(e,t,i){return[e,t*i/((e=(2-t)*i)<1?e:2-e)||0,e/2]},Lp=function(e){return"string"===typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)},Ap=function(e){return"string"===typeof e&&-1!==e.indexOf("%")},Vp=function(e,t){Lp(e)&&(e="100%");var i=Ap(e);return e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)},Bp={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},zp=function(e){var t=e.r,i=e.g,n=e.b,s=function(e){e=Math.min(Math.round(e),255);var t=Math.floor(e/16),i=e%16;return""+(Bp[t]||t)+(Bp[i]||i)};return isNaN(t)||isNaN(i)||isNaN(n)?"":"#"+s(t)+s(i)+s(n)},Rp={A:10,B:11,C:12,D:13,E:14,F:15},Hp=function(e){return 2===e.length?16*(Rp[e[0].toUpperCase()]||+e[0])+(Rp[e[1].toUpperCase()]||+e[1]):Rp[e[1].toUpperCase()]||+e[1]},Wp=function(e,t,i){t/=100,i/=100;var n=t,s=Math.max(i,.01),r=void 0,a=void 0;return i*=2,t*=i<=1?i:2-i,n*=s<=1?s:2-s,a=(i+t)/2,r=0===i?2*n/(s+n):2*t/(i+t),{h:e,s:100*r,v:100*a}},qp=function(e,t,i){e=Vp(e,255),t=Vp(t,255),i=Vp(i,255);var n=Math.max(e,t,i),s=Math.min(e,t,i),r=void 0,a=void 0,o=n,l=n-s;if(a=0===n?0:l/n,n===s)r=0;else{switch(n){case e:r=(t-i)/l+(t2?parseFloat(e):parseInt(e,10)}));if(4===n.length?this._alpha=Math.floor(100*parseFloat(n[3])):3===n.length&&(this._alpha=100),n.length>=3){var s=Wp(n[0],n[1],n[2]),r=s.h,a=s.s,o=s.v;i(r,a,o)}}else if(-1!==e.indexOf("hsv")){var l=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter((function(e){return""!==e})).map((function(e,t){return t>2?parseFloat(e):parseInt(e,10)}));4===l.length?this._alpha=Math.floor(100*parseFloat(l[3])):3===l.length&&(this._alpha=100),l.length>=3&&i(l[0],l[1],l[2])}else if(-1!==e.indexOf("rgb")){var c=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter((function(e){return""!==e})).map((function(e,t){return t>2?parseFloat(e):parseInt(e,10)}));if(4===c.length?this._alpha=Math.floor(100*parseFloat(c[3])):3===c.length&&(this._alpha=100),c.length>=3){var u=qp(c[0],c[1],c[2]),h=u.h,d=u.s,p=u.v;i(h,d,p)}}else if(-1!==e.indexOf("#")){var f=e.replace("#","").trim();if(!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(f))return;var m=void 0,v=void 0,g=void 0;3===f.length?(m=Hp(f[0]+f[0]),v=Hp(f[1]+f[1]),g=Hp(f[2]+f[2])):6!==f.length&&8!==f.length||(m=Hp(f.substring(0,2)),v=Hp(f.substring(2,4)),g=Hp(f.substring(4,6))),8===f.length?this._alpha=Math.floor(Hp(f.substring(6))/255*100):3!==f.length&&6!==f.length||(this._alpha=100);var b=qp(m,v,g),y=b.h,_=b.s,x=b.v;i(y,_,x)}},e.prototype.compare=function(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1},e.prototype.doOnChange=function(){var e=this._hue,t=this._saturation,i=this._value,n=this._alpha,s=this.format;if(this.enableAlpha)switch(s){case"hsl":var r=Fp(e,t/100,i/100);this.value="hsla("+e+", "+Math.round(100*r[1])+"%, "+Math.round(100*r[2])+"%, "+n/100+")";break;case"hsv":this.value="hsva("+e+", "+Math.round(t)+"%, "+Math.round(i)+"%, "+n/100+")";break;default:var a=Yp(e,t,i),o=a.r,l=a.g,c=a.b;this.value="rgba("+o+", "+l+", "+c+", "+n/100+")"}else switch(s){case"hsl":var u=Fp(e,t/100,i/100);this.value="hsl("+e+", "+Math.round(100*u[1])+"%, "+Math.round(100*u[2])+"%)";break;case"hsv":this.value="hsv("+e+", "+Math.round(t)+"%, "+Math.round(i)+"%)";break;case"rgb":var h=Yp(e,t,i),d=h.r,p=h.g,f=h.b;this.value="rgb("+d+", "+p+", "+f+")";break;default:this.value=zp(Yp(e,t,i))}},e}(),Up=Kp,Gp=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-color-dropdown"},[i("div",{staticClass:"el-color-dropdown__main-wrapper"},[i("hue-slider",{ref:"hue",staticStyle:{float:"right"},attrs:{color:e.color,vertical:""}}),i("sv-panel",{ref:"sl",attrs:{color:e.color}})],1),e.showAlpha?i("alpha-slider",{ref:"alpha",attrs:{color:e.color}}):e._e(),e.predefine?i("predefine",{attrs:{color:e.color,colors:e.predefine}}):e._e(),i("div",{staticClass:"el-color-dropdown__btns"},[i("span",{staticClass:"el-color-dropdown__value"},[i("el-input",{attrs:{"validate-event":!1,size:"mini"},on:{blur:e.handleConfirm},nativeOn:{keyup:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleConfirm(t)}},model:{value:e.customInput,callback:function(t){e.customInput=t},expression:"customInput"}})],1),i("el-button",{staticClass:"el-color-dropdown__link-btn",attrs:{size:"mini",type:"text"},on:{click:function(t){e.$emit("clear")}}},[e._v("\n "+e._s(e.t("el.colorpicker.clear"))+"\n ")]),i("el-button",{staticClass:"el-color-dropdown__btn",attrs:{plain:"",size:"mini"},on:{click:e.confirmValue}},[e._v("\n "+e._s(e.t("el.colorpicker.confirm"))+"\n ")])],1)],1)])},Xp=[];Gp._withStripped=!0;var Zp=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-svpanel",style:{backgroundColor:e.background}},[i("div",{staticClass:"el-color-svpanel__white"}),i("div",{staticClass:"el-color-svpanel__black"}),i("div",{staticClass:"el-color-svpanel__cursor",style:{top:e.cursorTop+"px",left:e.cursorLeft+"px"}},[i("div")])])},Qp=[];Zp._withStripped=!0;var Jp=!1,ef=function(e,t){if(!Rn.a.prototype.$isServer){var i=function(e){t.drag&&t.drag(e)},n=function e(n){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,Jp=!1,t.end&&t.end(n)};e.addEventListener("mousedown",(function(e){Jp||(document.onselectstart=function(){return!1},document.ondragstart=function(){return!1},document.addEventListener("mousemove",i),document.addEventListener("mouseup",n),Jp=!0,t.start&&t.start(e))}))}},tf={name:"el-sl-panel",props:{color:{required:!0}},computed:{colorValue:function(){var e=this.color.get("hue"),t=this.color.get("value");return{hue:e,value:t}}},watch:{colorValue:function(){this.update()}},methods:{update:function(){var e=this.color.get("saturation"),t=this.color.get("value"),i=this.$el,n=i.clientWidth,s=i.clientHeight;this.cursorLeft=e*n/100,this.cursorTop=(100-t)*s/100,this.background="hsl("+this.color.get("hue")+", 100%, 50%)"},handleDrag:function(e){var t=this.$el,i=t.getBoundingClientRect(),n=e.clientX-i.left,s=e.clientY-i.top;n=Math.max(0,n),n=Math.min(n,i.width),s=Math.max(0,s),s=Math.min(s,i.height),this.cursorLeft=n,this.cursorTop=s,this.color.set({saturation:n/i.width*100,value:100-s/i.height*100})}},mounted:function(){var e=this;ef(this.$el,{drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}}),this.update()},data:function(){return{cursorTop:0,cursorLeft:0,background:"hsl(0, 100%, 50%)"}}},nf=tf,sf=o(nf,Zp,Qp,!1,null,null,null);sf.options.__file="packages/color-picker/src/components/sv-panel.vue";var rf=sf.exports,af=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-hue-slider",class:{"is-vertical":e.vertical}},[i("div",{ref:"bar",staticClass:"el-color-hue-slider__bar",on:{click:e.handleClick}}),i("div",{ref:"thumb",staticClass:"el-color-hue-slider__thumb",style:{left:e.thumbLeft+"px",top:e.thumbTop+"px"}})])},of=[];af._withStripped=!0;var lf={name:"el-color-hue-slider",props:{color:{required:!0},vertical:Boolean},data:function(){return{thumbLeft:0,thumbTop:0}},computed:{hueValue:function(){var e=this.color.get("hue");return e}},watch:{hueValue:function(){this.update()}},methods:{handleClick:function(e){var t=this.$refs.thumb,i=e.target;i!==t&&this.handleDrag(e)},handleDrag:function(e){var t=this.$el.getBoundingClientRect(),i=this.$refs.thumb,n=void 0;if(this.vertical){var s=e.clientY-t.top;s=Math.min(s,t.height-i.offsetHeight/2),s=Math.max(i.offsetHeight/2,s),n=Math.round((s-i.offsetHeight/2)/(t.height-i.offsetHeight)*360)}else{var r=e.clientX-t.left;r=Math.min(r,t.width-i.offsetWidth/2),r=Math.max(i.offsetWidth/2,r),n=Math.round((r-i.offsetWidth/2)/(t.width-i.offsetWidth)*360)}this.color.set("hue",n)},getThumbLeft:function(){if(this.vertical)return 0;var e=this.$el,t=this.color.get("hue");if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetWidth-i.offsetWidth/2)/360)},getThumbTop:function(){if(!this.vertical)return 0;var e=this.$el,t=this.color.get("hue");if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetHeight-i.offsetHeight/2)/360)},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop()}},mounted:function(){var e=this,t=this.$refs,i=t.bar,n=t.thumb,s={drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}};ef(i,s),ef(n,s),this.update()}},cf=lf,uf=o(cf,af,of,!1,null,null,null);uf.options.__file="packages/color-picker/src/components/hue-slider.vue";var hf=uf.exports,df=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-alpha-slider",class:{"is-vertical":e.vertical}},[i("div",{ref:"bar",staticClass:"el-color-alpha-slider__bar",style:{background:e.background},on:{click:e.handleClick}}),i("div",{ref:"thumb",staticClass:"el-color-alpha-slider__thumb",style:{left:e.thumbLeft+"px",top:e.thumbTop+"px"}})])},pf=[];df._withStripped=!0;var ff={name:"el-color-alpha-slider",props:{color:{required:!0},vertical:Boolean},watch:{"color._alpha":function(){this.update()},"color.value":function(){this.update()}},methods:{handleClick:function(e){var t=this.$refs.thumb,i=e.target;i!==t&&this.handleDrag(e)},handleDrag:function(e){var t=this.$el.getBoundingClientRect(),i=this.$refs.thumb;if(this.vertical){var n=e.clientY-t.top;n=Math.max(i.offsetHeight/2,n),n=Math.min(n,t.height-i.offsetHeight/2),this.color.set("alpha",Math.round((n-i.offsetHeight/2)/(t.height-i.offsetHeight)*100))}else{var s=e.clientX-t.left;s=Math.max(i.offsetWidth/2,s),s=Math.min(s,t.width-i.offsetWidth/2),this.color.set("alpha",Math.round((s-i.offsetWidth/2)/(t.width-i.offsetWidth)*100))}},getThumbLeft:function(){if(this.vertical)return 0;var e=this.$el,t=this.color._alpha;if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetWidth-i.offsetWidth/2)/100)},getThumbTop:function(){if(!this.vertical)return 0;var e=this.$el,t=this.color._alpha;if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetHeight-i.offsetHeight/2)/100)},getBackground:function(){if(this.color&&this.color.value){var e=this.color.toRgb(),t=e.r,i=e.g,n=e.b;return"linear-gradient(to right, rgba("+t+", "+i+", "+n+", 0) 0%, rgba("+t+", "+i+", "+n+", 1) 100%)"}return null},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop(),this.background=this.getBackground()}},data:function(){return{thumbLeft:0,thumbTop:0,background:null}},mounted:function(){var e=this,t=this.$refs,i=t.bar,n=t.thumb,s={drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}};ef(i,s),ef(n,s),this.update()}},mf=ff,vf=o(mf,df,pf,!1,null,null,null);vf.options.__file="packages/color-picker/src/components/alpha-slider.vue";var gf=vf.exports,bf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-predefine"},[i("div",{staticClass:"el-color-predefine__colors"},e._l(e.rgbaColors,(function(t,n){return i("div",{key:e.colors[n],staticClass:"el-color-predefine__color-selector",class:{selected:t.selected,"is-alpha":t._alpha<100},on:{click:function(t){e.handleSelect(n)}}},[i("div",{style:{"background-color":t.value}})])})),0)])},yf=[];bf._withStripped=!0;var _f={props:{colors:{type:Array,required:!0},color:{required:!0}},data:function(){return{rgbaColors:this.parseColors(this.colors,this.color)}},methods:{handleSelect:function(e){this.color.fromString(this.colors[e])},parseColors:function(e,t){return e.map((function(e){var i=new Up;return i.enableAlpha=!0,i.format="rgba",i.fromString(e),i.selected=i.value===t.value,i}))}},watch:{"$parent.currentColor":function(e){var t=new Up;t.fromString(e),this.rgbaColors.forEach((function(e){e.selected=t.compare(e)}))},colors:function(e){this.rgbaColors=this.parseColors(e,this.color)},color:function(e){this.rgbaColors=this.parseColors(this.colors,e)}}},xf=_f,Cf=o(xf,bf,yf,!1,null,null,null);Cf.options.__file="packages/color-picker/src/components/predefine.vue";var wf=Cf.exports,kf={name:"el-color-picker-dropdown",mixins:[H.a,g.a],components:{SvPanel:rf,HueSlider:hf,AlphaSlider:gf,ElInput:m.a,ElButton:ae.a,Predefine:wf},props:{color:{required:!0},showAlpha:Boolean,predefine:Array},data:function(){return{customInput:""}},computed:{currentColor:function(){var e=this.$parent;return e.value||e.showPanelColor?e.color.value:""}},methods:{confirmValue:function(){this.$emit("pick")},handleConfirm:function(){this.color.fromString(this.customInput)}},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$el},watch:{showPopper:function(e){var t=this;!0===e&&this.$nextTick((function(){var e=t.$refs,i=e.sl,n=e.hue,s=e.alpha;i&&i.update(),n&&n.update(),s&&s.update()}))},currentColor:{immediate:!0,handler:function(e){this.customInput=e}}}},Sf=kf,Df=o(Sf,Gp,Xp,!1,null,null,null);Df.options.__file="packages/color-picker/src/components/picker-dropdown.vue";var $f=Df.exports,Of={name:"ElColorPicker",mixins:[O.a],props:{value:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:String,popperClass:String,predefine:Array},inject:{elForm:{default:""},elFormItem:{default:""}},directives:{Clickoutside:V.a},computed:{displayedColor:function(){return this.value||this.showPanelColor?this.displayedRgb(this.color,this.showAlpha):"transparent"},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},colorSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},colorDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{value:function(e){e?e&&e!==this.color.value&&this.color.fromString(e):this.showPanelColor=!1},color:{deep:!0,handler:function(){this.showPanelColor=!0}},displayedColor:function(e){if(this.showPicker){var t=new Up({enableAlpha:this.showAlpha,format:this.colorFormat});t.fromString(this.value);var i=this.displayedRgb(t,this.showAlpha);e!==i&&this.$emit("active-change",e)}}},methods:{handleTrigger:function(){this.colorDisabled||(this.showPicker=!this.showPicker)},confirmValue:function(){var e=this.color.value;this.$emit("input",e),this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",e),this.showPicker=!1},clearValue:function(){this.$emit("input",null),this.$emit("change",null),null!==this.value&&this.dispatch("ElFormItem","el.form.change",null),this.showPanelColor=!1,this.showPicker=!1,this.resetColor()},hide:function(){this.showPicker=!1,this.resetColor()},resetColor:function(){var e=this;this.$nextTick((function(t){e.value?e.color.fromString(e.value):e.showPanelColor=!1}))},displayedRgb:function(e,t){if(!(e instanceof Up))throw Error("color should be instance of Color Class");var i=e.toRgb(),n=i.r,s=i.g,r=i.b;return t?"rgba("+n+", "+s+", "+r+", "+e.get("alpha")/100+")":"rgb("+n+", "+s+", "+r+")"}},mounted:function(){var e=this.value;e&&this.color.fromString(e),this.popperElm=this.$refs.dropdown.$el},data:function(){var e=new Up({enableAlpha:this.showAlpha,format:this.colorFormat});return{color:e,showPicker:!1,showPanelColor:!1}},components:{PickerDropdown:$f}},Ef=Of,Tf=o(Ef,Mp,Np,!1,null,null,null);Tf.options.__file="packages/color-picker/src/main.vue";var Pf=Tf.exports;Pf.install=function(e){e.component(Pf.name,Pf)};var Mf=Pf,Nf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-transfer"},[i("transfer-panel",e._b({ref:"leftPanel",attrs:{data:e.sourceData,title:e.titles[0]||e.t("el.transfer.titles.0"),"default-checked":e.leftDefaultChecked,placeholder:e.filterPlaceholder||e.t("el.transfer.filterPlaceholder")},on:{"checked-change":e.onSourceCheckedChange}},"transfer-panel",e.$props,!1),[e._t("left-footer")],2),i("div",{staticClass:"el-transfer__buttons"},[i("el-button",{class:["el-transfer__button",e.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===e.rightChecked.length},nativeOn:{click:function(t){return e.addToLeft(t)}}},[i("i",{staticClass:"el-icon-arrow-left"}),void 0!==e.buttonTexts[0]?i("span",[e._v(e._s(e.buttonTexts[0]))]):e._e()]),i("el-button",{class:["el-transfer__button",e.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===e.leftChecked.length},nativeOn:{click:function(t){return e.addToRight(t)}}},[void 0!==e.buttonTexts[1]?i("span",[e._v(e._s(e.buttonTexts[1]))]):e._e(),i("i",{staticClass:"el-icon-arrow-right"})])],1),i("transfer-panel",e._b({ref:"rightPanel",attrs:{data:e.targetData,title:e.titles[1]||e.t("el.transfer.titles.1"),"default-checked":e.rightDefaultChecked,placeholder:e.filterPlaceholder||e.t("el.transfer.filterPlaceholder")},on:{"checked-change":e.onTargetCheckedChange}},"transfer-panel",e.$props,!1),[e._t("right-footer")],2)],1)},If=[];Nf._withStripped=!0;var jf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-transfer-panel"},[i("p",{staticClass:"el-transfer-panel__header"},[i("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleAllCheckedChange},model:{value:e.allChecked,callback:function(t){e.allChecked=t},expression:"allChecked"}},[e._v("\n "+e._s(e.title)+"\n "),i("span",[e._v(e._s(e.checkedSummary))])])],1),i("div",{class:["el-transfer-panel__body",e.hasFooter?"is-with-footer":""]},[e.filterable?i("el-input",{staticClass:"el-transfer-panel__filter",attrs:{size:"small",placeholder:e.placeholder},nativeOn:{mouseenter:function(t){e.inputHover=!0},mouseleave:function(t){e.inputHover=!1}},model:{value:e.query,callback:function(t){e.query=t},expression:"query"}},[i("i",{class:["el-input__icon","el-icon-"+e.inputIcon],attrs:{slot:"prefix"},on:{click:e.clearQuery},slot:"prefix"})]):e._e(),i("el-checkbox-group",{directives:[{name:"show",rawName:"v-show",value:!e.hasNoMatch&&e.data.length>0,expression:"!hasNoMatch && data.length > 0"}],staticClass:"el-transfer-panel__list",class:{"is-filterable":e.filterable},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},e._l(e.filteredData,(function(t){return i("el-checkbox",{key:t[e.keyProp],staticClass:"el-transfer-panel__item",attrs:{label:t[e.keyProp],disabled:t[e.disabledProp]}},[i("option-content",{attrs:{option:t}})],1)})),1),i("p",{directives:[{name:"show",rawName:"v-show",value:e.hasNoMatch,expression:"hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[e._v(e._s(e.t("el.transfer.noMatch")))]),i("p",{directives:[{name:"show",rawName:"v-show",value:0===e.data.length&&!e.hasNoMatch,expression:"data.length === 0 && !hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[e._v(e._s(e.t("el.transfer.noData")))])],1),e.hasFooter?i("p",{staticClass:"el-transfer-panel__footer"},[e._t("default")],2):e._e()])},Ff=[];jf._withStripped=!0;var Lf={mixins:[g.a],name:"ElTransferPanel",componentName:"ElTransferPanel",components:{ElCheckboxGroup:Ms.a,ElCheckbox:In.a,ElInput:m.a,OptionContent:{props:{option:Object},render:function(e){var t=function e(t){return"ElTransferPanel"===t.$options.componentName?t:t.$parent?e(t.$parent):t},i=t(this),n=i.$parent||i;return i.renderContent?i.renderContent(e,this.option):n.$scopedSlots.default?n.$scopedSlots.default({option:this.option}):e("span",[this.option[i.labelProp]||this.option[i.keyProp]])}}},props:{data:{type:Array,default:function(){return[]}},renderContent:Function,placeholder:String,title:String,filterable:Boolean,format:Object,filterMethod:Function,defaultChecked:Array,props:Object},data:function(){return{checked:[],allChecked:!1,query:"",inputHover:!1,checkChangeByUser:!0}},watch:{checked:function(e,t){if(this.updateAllChecked(),this.checkChangeByUser){var i=e.concat(t).filter((function(i){return-1===e.indexOf(i)||-1===t.indexOf(i)}));this.$emit("checked-change",e,i)}else this.$emit("checked-change",e),this.checkChangeByUser=!0},data:function(){var e=this,t=[],i=this.filteredData.map((function(t){return t[e.keyProp]}));this.checked.forEach((function(e){i.indexOf(e)>-1&&t.push(e)})),this.checkChangeByUser=!1,this.checked=t},checkableData:function(){this.updateAllChecked()},defaultChecked:{immediate:!0,handler:function(e,t){var i=this;if(!t||e.length!==t.length||!e.every((function(e){return t.indexOf(e)>-1}))){var n=[],s=this.checkableData.map((function(e){return e[i.keyProp]}));e.forEach((function(e){s.indexOf(e)>-1&&n.push(e)})),this.checkChangeByUser=!1,this.checked=n}}}},computed:{filteredData:function(){var e=this;return this.data.filter((function(t){if("function"===typeof e.filterMethod)return e.filterMethod(e.query,t);var i=t[e.labelProp]||t[e.keyProp].toString();return i.toLowerCase().indexOf(e.query.toLowerCase())>-1}))},checkableData:function(){var e=this;return this.filteredData.filter((function(t){return!t[e.disabledProp]}))},checkedSummary:function(){var e=this.checked.length,t=this.data.length,i=this.format,n=i.noChecked,s=i.hasChecked;return n&&s?e>0?s.replace(/\${checked}/g,e).replace(/\${total}/g,t):n.replace(/\${total}/g,t):e+"/"+t},isIndeterminate:function(){var e=this.checked.length;return e>0&&e0&&0===this.filteredData.length},inputIcon:function(){return this.query.length>0&&this.inputHover?"circle-close":"search"},labelProp:function(){return this.props.label||"label"},keyProp:function(){return this.props.key||"key"},disabledProp:function(){return this.props.disabled||"disabled"},hasFooter:function(){return!!this.$slots.default}},methods:{updateAllChecked:function(){var e=this,t=this.checkableData.map((function(t){return t[e.keyProp]}));this.allChecked=t.length>0&&t.every((function(t){return e.checked.indexOf(t)>-1}))},handleAllCheckedChange:function(e){var t=this;this.checked=e?this.checkableData.map((function(e){return e[t.keyProp]})):[]},clearQuery:function(){"circle-close"===this.inputIcon&&(this.query="")}}},Af=Lf,Vf=o(Af,jf,Ff,!1,null,null,null);Vf.options.__file="packages/transfer/src/transfer-panel.vue";var Bf=Vf.exports,zf={name:"ElTransfer",mixins:[O.a,g.a,D.a],components:{TransferPanel:Bf,ElButton:ae.a},props:{data:{type:Array,default:function(){return[]}},titles:{type:Array,default:function(){return[]}},buttonTexts:{type:Array,default:function(){return[]}},filterPlaceholder:{type:String,default:""},filterMethod:Function,leftDefaultChecked:{type:Array,default:function(){return[]}},rightDefaultChecked:{type:Array,default:function(){return[]}},renderContent:Function,value:{type:Array,default:function(){return[]}},format:{type:Object,default:function(){return{}}},filterable:Boolean,props:{type:Object,default:function(){return{label:"label",key:"key",disabled:"disabled"}}},targetOrder:{type:String,default:"original"}},data:function(){return{leftChecked:[],rightChecked:[]}},computed:{dataObj:function(){var e=this.props.key;return this.data.reduce((function(t,i){return(t[i[e]]=i)&&t}),{})},sourceData:function(){var e=this;return this.data.filter((function(t){return-1===e.value.indexOf(t[e.props.key])}))},targetData:function(){var e=this;return"original"===this.targetOrder?this.data.filter((function(t){return e.value.indexOf(t[e.props.key])>-1})):this.value.reduce((function(t,i){var n=e.dataObj[i];return n&&t.push(n),t}),[])},hasButtonTexts:function(){return 2===this.buttonTexts.length}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}},methods:{getMigratingConfig:function(){return{props:{"footer-format":"footer-format is renamed to format."}}},onSourceCheckedChange:function(e,t){this.leftChecked=e,void 0!==t&&this.$emit("left-check-change",e,t)},onTargetCheckedChange:function(e,t){this.rightChecked=e,void 0!==t&&this.$emit("right-check-change",e,t)},addToLeft:function(){var e=this.value.slice();this.rightChecked.forEach((function(t){var i=e.indexOf(t);i>-1&&e.splice(i,1)})),this.$emit("input",e),this.$emit("change",e,"left",this.rightChecked)},addToRight:function(){var e=this,t=this.value.slice(),i=[],n=this.props.key;this.data.forEach((function(t){var s=t[n];e.leftChecked.indexOf(s)>-1&&-1===e.value.indexOf(s)&&i.push(s)})),t="unshift"===this.targetOrder?i.concat(t):t.concat(i),this.$emit("input",t),this.$emit("change",t,"right",this.leftChecked)},clearQuery:function(e){"left"===e?this.$refs.leftPanel.query="":"right"===e&&(this.$refs.rightPanel.query="")}}},Rf=zf,Hf=o(Rf,Nf,If,!1,null,null,null);Hf.options.__file="packages/transfer/src/main.vue";var Wf=Hf.exports;Wf.install=function(e){e.component(Wf.name,Wf)};var qf=Wf,Yf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("section",{staticClass:"el-container",class:{"is-vertical":e.isVertical}},[e._t("default")],2)},Kf=[];Yf._withStripped=!0;var Uf={name:"ElContainer",componentName:"ElContainer",props:{direction:String},computed:{isVertical:function(){return"vertical"===this.direction||"horizontal"!==this.direction&&(!(!this.$slots||!this.$slots.default)&&this.$slots.default.some((function(e){var t=e.componentOptions&&e.componentOptions.tag;return"el-header"===t||"el-footer"===t})))}}},Gf=Uf,Xf=o(Gf,Yf,Kf,!1,null,null,null);Xf.options.__file="packages/container/src/main.vue";var Zf=Xf.exports;Zf.install=function(e){e.component(Zf.name,Zf)};var Qf=Zf,Jf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("header",{staticClass:"el-header",style:{height:e.height}},[e._t("default")],2)},em=[];Jf._withStripped=!0;var tm={name:"ElHeader",componentName:"ElHeader",props:{height:{type:String,default:"60px"}}},im=tm,nm=o(im,Jf,em,!1,null,null,null);nm.options.__file="packages/header/src/main.vue";var sm=nm.exports;sm.install=function(e){e.component(sm.name,sm)};var rm=sm,am=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("aside",{staticClass:"el-aside",style:{width:e.width}},[e._t("default")],2)},om=[];am._withStripped=!0;var lm={name:"ElAside",componentName:"ElAside",props:{width:{type:String,default:"300px"}}},cm=lm,um=o(cm,am,om,!1,null,null,null);um.options.__file="packages/aside/src/main.vue";var hm=um.exports;hm.install=function(e){e.component(hm.name,hm)};var dm=hm,pm=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("main",{staticClass:"el-main"},[e._t("default")],2)},fm=[];pm._withStripped=!0;var mm={name:"ElMain",componentName:"ElMain"},vm=mm,gm=o(vm,pm,fm,!1,null,null,null);gm.options.__file="packages/main/src/main.vue";var bm=gm.exports;bm.install=function(e){e.component(bm.name,bm)};var ym=bm,_m=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("footer",{staticClass:"el-footer",style:{height:e.height}},[e._t("default")],2)},xm=[];_m._withStripped=!0;var Cm={name:"ElFooter",componentName:"ElFooter",props:{height:{type:String,default:"60px"}}},wm=Cm,km=o(wm,_m,xm,!1,null,null,null);km.options.__file="packages/footer/src/main.vue";var Sm=km.exports;Sm.install=function(e){e.component(Sm.name,Sm)};var Dm,$m,Om=Sm,Em={name:"ElTimeline",props:{reverse:{type:Boolean,default:!1}},provide:function(){return{timeline:this}},render:function(){var e=arguments[0],t=this.reverse,i={"el-timeline":!0,"is-reverse":t},n=this.$slots.default||[];return t&&(n=n.reverse()),e("ul",{class:i},[n])}},Tm=Em,Pm=o(Tm,Dm,$m,!1,null,null,null);Pm.options.__file="packages/timeline/src/main.vue";var Mm=Pm.exports;Mm.install=function(e){e.component(Mm.name,Mm)};var Nm=Mm,Im=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-timeline-item"},[i("div",{staticClass:"el-timeline-item__tail"}),e.$slots.dot?e._e():i("div",{staticClass:"el-timeline-item__node",class:["el-timeline-item__node--"+(e.size||""),"el-timeline-item__node--"+(e.type||"")],style:{backgroundColor:e.color}},[e.icon?i("i",{staticClass:"el-timeline-item__icon",class:e.icon}):e._e()]),e.$slots.dot?i("div",{staticClass:"el-timeline-item__dot"},[e._t("dot")],2):e._e(),i("div",{staticClass:"el-timeline-item__wrapper"},[e.hideTimestamp||"top"!==e.placement?e._e():i("div",{staticClass:"el-timeline-item__timestamp is-top"},[e._v("\n "+e._s(e.timestamp)+"\n ")]),i("div",{staticClass:"el-timeline-item__content"},[e._t("default")],2),e.hideTimestamp||"bottom"!==e.placement?e._e():i("div",{staticClass:"el-timeline-item__timestamp is-bottom"},[e._v("\n "+e._s(e.timestamp)+"\n ")])])])},jm=[];Im._withStripped=!0;var Fm={name:"ElTimelineItem",inject:["timeline"],props:{timestamp:String,hideTimestamp:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},type:String,color:String,size:{type:String,default:"normal"},icon:String}},Lm=Fm,Am=o(Lm,Im,jm,!1,null,null,null);Am.options.__file="packages/timeline/src/item.vue";var Vm=Am.exports;Vm.install=function(e){e.component(Vm.name,Vm)};var Bm=Vm,zm=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("a",e._b({class:["el-link",e.type?"el-link--"+e.type:"",e.disabled&&"is-disabled",e.underline&&!e.disabled&&"is-underline"],attrs:{href:e.disabled?null:e.href},on:{click:e.handleClick}},"a",e.$attrs,!1),[e.icon?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",{staticClass:"el-link--inner"},[e._t("default")],2):e._e(),e.$slots.icon?[e.$slots.icon?e._t("icon"):e._e()]:e._e()],2)},Rm=[];zm._withStripped=!0;var Hm={name:"ElLink",props:{type:{type:String,default:"default"},underline:{type:Boolean,default:!0},disabled:Boolean,href:String,icon:String},methods:{handleClick:function(e){this.disabled||this.href||this.$emit("click",e)}}},Wm=Hm,qm=o(Wm,zm,Rm,!1,null,null,null);qm.options.__file="packages/link/src/main.vue";var Ym=qm.exports;Ym.install=function(e){e.component(Ym.name,Ym)};var Km=Ym,Um=function(e,t){var i=t._c;return i("div",t._g(t._b({class:[t.data.staticClass,"el-divider","el-divider--"+t.props.direction]},"div",t.data.attrs,!1),t.listeners),[t.slots().default&&"vertical"!==t.props.direction?i("div",{class:["el-divider__text","is-"+t.props.contentPosition]},[t._t("default")],2):t._e()])},Gm=[];Um._withStripped=!0;var Xm={name:"ElDivider",props:{direction:{type:String,default:"horizontal",validator:function(e){return-1!==["horizontal","vertical"].indexOf(e)}},contentPosition:{type:String,default:"center",validator:function(e){return-1!==["left","center","right"].indexOf(e)}}}},Zm=Xm,Qm=o(Zm,Um,Gm,!0,null,null,null);Qm.options.__file="packages/divider/src/main.vue";var Jm=Qm.exports;Jm.install=function(e){e.component(Jm.name,Jm)};var ev=Jm,tv=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-image"},[e.loading?e._t("placeholder",[i("div",{staticClass:"el-image__placeholder"})]):e.error?e._t("error",[i("div",{staticClass:"el-image__error"},[e._v(e._s(e.t("el.image.error")))])]):i("img",e._g(e._b({staticClass:"el-image__inner",class:{"el-image__inner--center":e.alignCenter,"el-image__preview":e.preview},style:e.imageStyle,attrs:{src:e.src},on:{click:e.clickHandler}},"img",e.$attrs,!1),e.$listeners)),e.preview?[e.showViewer?i("image-viewer",{attrs:{"z-index":e.zIndex,"initial-index":e.imageIndex,"on-close":e.closeViewer,"url-list":e.previewSrcList}}):e._e()]:e._e()],2)},iv=[];tv._withStripped=!0;var nv=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"viewer-fade"}},[i("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":e.viewerZIndex},attrs:{tabindex:"-1"}},[i("div",{staticClass:"el-image-viewer__mask",on:{click:function(t){return t.target!==t.currentTarget?null:e.handleMaskClick(t)}}}),i("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:e.hide}},[i("i",{staticClass:"el-icon-close"})]),e.isSingle?e._e():[i("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!e.infinite&&e.isFirst},on:{click:e.prev}},[i("i",{staticClass:"el-icon-arrow-left"})]),i("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!e.infinite&&e.isLast},on:{click:e.next}},[i("i",{staticClass:"el-icon-arrow-right"})])],i("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[i("div",{staticClass:"el-image-viewer__actions__inner"},[i("i",{staticClass:"el-icon-zoom-out",on:{click:function(t){e.handleActions("zoomOut")}}}),i("i",{staticClass:"el-icon-zoom-in",on:{click:function(t){e.handleActions("zoomIn")}}}),i("i",{staticClass:"el-image-viewer__actions__divider"}),i("i",{class:e.mode.icon,on:{click:e.toggleMode}}),i("i",{staticClass:"el-image-viewer__actions__divider"}),i("i",{staticClass:"el-icon-refresh-left",on:{click:function(t){e.handleActions("anticlocelise")}}}),i("i",{staticClass:"el-icon-refresh-right",on:{click:function(t){e.handleActions("clocelise")}}})])]),i("div",{staticClass:"el-image-viewer__canvas"},e._l(e.urlList,(function(t,n){return n===e.index?i("img",{key:t,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:e.imgStyle,attrs:{src:e.currentImg},on:{load:e.handleImgLoad,error:e.handleImgError,mousedown:e.handleMouseDown}}):e._e()})),0)],2)])},sv=[];nv._withStripped=!0;var rv=Object.assign||function(e){for(var t=1;te?this.zIndex:e}},watch:{index:{handler:function(e){this.reset(),this.onSwitch(e)}},currentImg:function(e){var t=this;this.$nextTick((function(e){var i=t.$refs.img[0];i.complete||(t.loading=!0)}))}},methods:{hide:function(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall:function(){var e=this;this._keyDownHandler=function(t){t.stopPropagation();var i=t.keyCode;switch(i){case 27:e.hide();break;case 32:e.toggleMode();break;case 37:e.prev();break;case 38:e.handleActions("zoomIn");break;case 39:e.next();break;case 40:e.handleActions("zoomOut");break}},this._mouseWheelHandler=Object(b["rafThrottle"])((function(t){var i=t.wheelDelta?t.wheelDelta:-t.detail;i>0?e.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):e.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})})),Object(Ae["on"])(document,"keydown",this._keyDownHandler),Object(Ae["on"])(document,ov,this._mouseWheelHandler)},deviceSupportUninstall:function(){Object(Ae["off"])(document,"keydown",this._keyDownHandler),Object(Ae["off"])(document,ov,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad:function(e){this.loading=!1},handleImgError:function(e){this.loading=!1,e.target.alt="加载失败"},handleMouseDown:function(e){var t=this;if(!this.loading&&0===e.button){var i=this.transform,n=i.offsetX,s=i.offsetY,r=e.pageX,a=e.pageY;this._dragHandler=Object(b["rafThrottle"])((function(e){t.transform.offsetX=n+e.pageX-r,t.transform.offsetY=s+e.pageY-a})),Object(Ae["on"])(document,"mousemove",this._dragHandler),Object(Ae["on"])(document,"mouseup",(function(e){Object(Ae["off"])(document,"mousemove",t._dragHandler)})),e.preventDefault()}},handleMaskClick:function(){this.maskClosable&&this.hide()},reset:function(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode:function(){if(!this.loading){var e=Object.keys(av),t=Object.values(av),i=t.indexOf(this.mode),n=(i+1)%e.length;this.mode=av[e[n]],this.reset()}},prev:function(){if(!this.isFirst||this.infinite){var e=this.urlList.length;this.index=(this.index-1+e)%e}},next:function(){if(!this.isLast||this.infinite){var e=this.urlList.length;this.index=(this.index+1)%e}},handleActions:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.loading){var i=rv({zoomRate:.2,rotateDeg:90,enableTransition:!0},t),n=i.zoomRate,s=i.rotateDeg,r=i.enableTransition,a=this.transform;switch(e){case"zoomOut":a.scale>.2&&(a.scale=parseFloat((a.scale-n).toFixed(3)));break;case"zoomIn":a.scale=parseFloat((a.scale+n).toFixed(3));break;case"clocelise":a.deg+=s;break;case"anticlocelise":a.deg-=s;break}a.enableTransition=r}}},mounted:function(){this.deviceSupportInstall(),this.appendToBody&&document.body.appendChild(this.$el),this.$refs["el-image-viewer__wrapper"].focus()},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},cv=lv,uv=o(cv,nv,sv,!1,null,null,null);uv.options.__file="packages/image/src/image-viewer.vue";var hv=uv.exports,dv=function(){return void 0!==document.documentElement.style.objectFit},pv={NONE:"none",CONTAIN:"contain",COVER:"cover",FILL:"fill",SCALE_DOWN:"scale-down"},fv="",mv={name:"ElImage",mixins:[g.a],inheritAttrs:!1,components:{ImageViewer:hv},props:{src:String,fit:String,lazy:Boolean,scrollContainer:{},previewSrcList:{type:Array,default:function(){return[]}},zIndex:{type:Number,default:2e3}},data:function(){return{loading:!0,error:!1,show:!this.lazy,imageWidth:0,imageHeight:0,showViewer:!1}},computed:{imageStyle:function(){var e=this.fit;return!this.$isServer&&e?dv()?{"object-fit":e}:this.getImageStyle(e):{}},alignCenter:function(){return!this.$isServer&&!dv()&&this.fit!==pv.FILL},preview:function(){var e=this.previewSrcList;return Array.isArray(e)&&e.length>0},imageIndex:function(){var e=0,t=this.previewSrcList.indexOf(this.src);return t>=0&&(e=t),e}},watch:{src:function(e){this.show&&this.loadImage()},show:function(e){e&&this.loadImage()}},mounted:function(){this.lazy?this.addLazyLoadListener():this.loadImage()},beforeDestroy:function(){this.lazy&&this.removeLazyLoadListener()},methods:{loadImage:function(){var e=this;if(!this.$isServer){this.loading=!0,this.error=!1;var t=new Image;t.onload=function(i){return e.handleLoad(i,t)},t.onerror=this.handleError.bind(this),Object.keys(this.$attrs).forEach((function(i){var n=e.$attrs[i];t.setAttribute(i,n)})),t.src=this.src}},handleLoad:function(e,t){this.imageWidth=t.width,this.imageHeight=t.height,this.loading=!1,this.error=!1},handleError:function(e){this.loading=!1,this.error=!0,this.$emit("error",e)},handleLazyLoad:function(){Object(Ae["isInContainer"])(this.$el,this._scrollContainer)&&(this.show=!0,this.removeLazyLoadListener())},addLazyLoadListener:function(){if(!this.$isServer){var e=this.scrollContainer,t=null;t=Object(qh["isHtmlElement"])(e)?e:Object(qh["isString"])(e)?document.querySelector(e):Object(Ae["getScrollContainer"])(this.$el),t&&(this._scrollContainer=t,this._lazyLoadHandler=Ad()(200,this.handleLazyLoad),Object(Ae["on"])(t,"scroll",this._lazyLoadHandler),this.handleLazyLoad())}},removeLazyLoadListener:function(){var e=this._scrollContainer,t=this._lazyLoadHandler;!this.$isServer&&e&&t&&(Object(Ae["off"])(e,"scroll",t),this._scrollContainer=null,this._lazyLoadHandler=null)},getImageStyle:function(e){var t=this.imageWidth,i=this.imageHeight,n=this.$el,s=n.clientWidth,r=n.clientHeight;if(!t||!i||!s||!r)return{};var a=t/i,o=s/r;if(e===pv.SCALE_DOWN){var l=ts)return console.warn("[ElementCalendar]end time should be greater than start time"),[];if(Object(ar["validateRangeInOneMonth"])(n,s))return[[n,s]];var r=[],a=new Date(n.getFullYear(),n.getMonth()+1,1),o=this.toDate(a.getTime()-Mv);if(!Object(ar["validateRangeInOneMonth"])(a,s))return console.warn("[ElementCalendar]start time and end time interval must not exceed two months"),[];r.push([n,o]);var l=this.realFirstDayOfWeek,c=a.getDay(),u=0;return c!==l&&(0===l?u=7-c:(u=l-c,u=u>0?u:7+u)),a=this.toDate(a.getTime()+u*Mv),a.getDate()6?0:Math.floor(this.firstDayOfWeek)}},data:function(){return{selectedDay:"",now:new Date}}},Iv=Nv,jv=o(Iv,_v,xv,!1,null,null,null);jv.options.__file="packages/calendar/src/main.vue";var Fv=jv.exports;Fv.install=function(e){e.component(Fv.name,Fv)};var Lv=Fv,Av=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-fade-in"}},[e.visible?i("div",{staticClass:"el-backtop",style:{right:e.styleRight,bottom:e.styleBottom},on:{click:function(t){return t.stopPropagation(),e.handleClick(t)}}},[e._t("default",[i("el-icon",{attrs:{name:"caret-top"}})])],2):e._e()])},Vv=[];Av._withStripped=!0;var Bv=function(e){return Math.pow(e,3)},zv=function(e){return e<.5?Bv(2*e)/2:1-Bv(2*(1-e))/2},Rv={name:"ElBacktop",props:{visibilityHeight:{type:Number,default:200},target:[String],right:{type:Number,default:40},bottom:{type:Number,default:40}},data:function(){return{el:null,container:null,visible:!1}},computed:{styleBottom:function(){return this.bottom+"px"},styleRight:function(){return this.right+"px"}},mounted:function(){this.init(),this.throttledScrollHandler=Ad()(300,this.onScroll),this.container.addEventListener("scroll",this.throttledScrollHandler)},methods:{init:function(){if(this.container=document,this.el=document.documentElement,this.target){if(this.el=document.querySelector(this.target),!this.el)throw new Error("target is not existed: "+this.target);this.container=this.el}},onScroll:function(){var e=this.el.scrollTop;this.visible=e>=this.visibilityHeight},handleClick:function(e){this.scrollToTop(),this.$emit("click",e)},scrollToTop:function(){var e=this.el,t=Date.now(),i=e.scrollTop,n=window.requestAnimationFrame||function(e){return setTimeout(e,16)},s=function s(){var r=(Date.now()-t)/500;r<1?(e.scrollTop=i*(1-zv(r)),n(s)):e.scrollTop=0};n(s)}},beforeDestroy:function(){this.container.removeEventListener("scroll",this.throttledScrollHandler)}},Hv=Rv,Wv=o(Hv,Av,Vv,!1,null,null,null);Wv.options.__file="packages/backtop/src/main.vue";var qv=Wv.exports;qv.install=function(e){e.component(qv.name,qv)};var Yv=qv,Kv=function(e,t){if(e===window&&(e=document.documentElement),1!==e.nodeType)return[];var i=window.getComputedStyle(e,null);return t?i[t]:i},Uv=function(e){return Object.keys(e||{}).map((function(t){return[t,e[t]]}))},Gv=function(e,t){return e===window||e===document?document.documentElement[t]:e[t]},Xv=function(e){return Gv(e,"offsetHeight")},Zv=function(e){return Gv(e,"clientHeight")},Qv="ElInfiniteScroll",Jv={delay:{type:Number,default:200},distance:{type:Number,default:0},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},eg=function(e,t){return Object(qh["isHtmlElement"])(e)?Uv(Jv).reduce((function(i,n){var s=n[0],r=n[1],a=r.type,o=r.default,l=e.getAttribute("infinite-scroll-"+s);switch(l=Object(qh["isUndefined"])(t[l])?l:t[l],a){case Number:l=Number(l),l=Number.isNaN(l)?o:l;break;case Boolean:l=Object(qh["isDefined"])(l)?"false"!==l&&Boolean(l):o;break;default:l=a(l)}return i[s]=l,i}),{}):{}},tg=function(e){return e.getBoundingClientRect().top},ig=function(e){var t=this[Qv],i=t.el,n=t.vm,s=t.container,r=t.observer,a=eg(i,n),o=a.distance,l=a.disabled;if(!l){var c=s.getBoundingClientRect();if(c.width||c.height){var u=!1;if(s===i){var h=s.scrollTop+Zv(s);u=s.scrollHeight-h<=o}else{var d=Xv(i)+tg(i)-tg(s),p=Xv(s),f=Number.parseFloat(Kv(s,"borderBottomWidth"));u=d-p+f<=o}u&&Object(qh["isFunction"])(e)?e.call(n):r&&(r.disconnect(),this[Qv].observer=null)}}},ng={name:"InfiniteScroll",inserted:function(e,t,i){var n=t.value,s=i.context,r=Object(Ae["getScrollContainer"])(e,!0),a=eg(e,s),o=a.delay,l=a.immediate,c=L()(o,ig.bind(e,n));if(e[Qv]={el:e,vm:s,container:r,onScroll:c},r&&(r.addEventListener("scroll",c),l)){var u=e[Qv].observer=new MutationObserver(c);u.observe(r,{childList:!0,subtree:!0}),c()}},unbind:function(e){var t=e[Qv],i=t.container,n=t.onScroll;i&&i.removeEventListener("scroll",n)},install:function(e){e.directive(ng.name,ng)}},sg=ng,rg=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-page-header"},[i("div",{staticClass:"el-page-header__left",on:{click:function(t){e.$emit("back")}}},[i("i",{staticClass:"el-icon-back"}),i("div",{staticClass:"el-page-header__title"},[e._t("title",[e._v(e._s(e.title))])],2)]),i("div",{staticClass:"el-page-header__content"},[e._t("content",[e._v(e._s(e.content))])],2)])},ag=[];rg._withStripped=!0;var og={name:"ElPageHeader",props:{title:{type:String,default:function(){return Object(vo["t"])("el.pageHeader.title")}},content:String}},lg=og,cg=o(lg,rg,ag,!1,null,null,null);cg.options.__file="packages/page-header/src/main.vue";var ug=cg.exports;ug.install=function(e){e.component(ug.name,ug)};var hg=ug,dg=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["el-cascader-panel",e.border&&"is-bordered"],on:{keydown:e.handleKeyDown}},e._l(e.menus,(function(e,t){return i("cascader-menu",{key:t,ref:"menu",refInFor:!0,attrs:{index:t,nodes:e}})})),1)},pg=[];dg._withStripped=!0;var fg,mg,vg=i(43),gg=i.n(vg),bg=function(e){return e.stopPropagation()},yg={inject:["panel"],components:{ElCheckbox:In.a,ElRadio:gg.a},props:{node:{required:!0},nodeId:String},computed:{config:function(){return this.panel.config},isLeaf:function(){return this.node.isLeaf},isDisabled:function(){return this.node.isDisabled},checkedValue:function(){return this.panel.checkedValue},isChecked:function(){return this.node.isSameNode(this.checkedValue)},inActivePath:function(){return this.isInPath(this.panel.activePath)},inCheckedPath:function(){var e=this;return!!this.config.checkStrictly&&this.panel.checkedNodePaths.some((function(t){return e.isInPath(t)}))},value:function(){return this.node.getValueByOption()}},methods:{handleExpand:function(){var e=this,t=this.panel,i=this.node,n=this.isDisabled,s=this.config,r=s.multiple,a=s.checkStrictly;!a&&n||i.loading||(s.lazy&&!i.loaded?t.lazyLoad(i,(function(){var t=e.isLeaf;if(t||e.handleExpand(),r){var n=!!t&&i.checked;e.handleMultiCheckChange(n)}})):t.handleExpand(i))},handleCheckChange:function(){var e=this.panel,t=this.value,i=this.node;e.handleCheckChange(t),e.handleExpand(i)},handleMultiCheckChange:function(e){this.node.doCheck(e),this.panel.calculateMultiCheckedValue()},isInPath:function(e){var t=this.node,i=e[t.level-1]||{};return i.uid===t.uid},renderPrefix:function(e){var t=this.isLeaf,i=this.isChecked,n=this.config,s=n.checkStrictly,r=n.multiple;return r?this.renderCheckbox(e):s?this.renderRadio(e):t&&i?this.renderCheckIcon(e):null},renderPostfix:function(e){var t=this.node,i=this.isLeaf;return t.loading?this.renderLoadingIcon(e):i?null:this.renderExpandIcon(e)},renderCheckbox:function(e){var t=this.node,i=this.config,n=this.isDisabled,s={on:{change:this.handleMultiCheckChange},nativeOn:{}};return i.checkStrictly&&(s.nativeOn.click=bg),e("el-checkbox",eh()([{attrs:{value:t.checked,indeterminate:t.indeterminate,disabled:n}},s]))},renderRadio:function(e){var t=this.checkedValue,i=this.value,n=this.isDisabled;return Object(b["isEqual"])(i,t)&&(i=t),e("el-radio",{attrs:{value:t,label:i,disabled:n},on:{change:this.handleCheckChange},nativeOn:{click:bg}},[e("span")])},renderCheckIcon:function(e){return e("i",{class:"el-icon-check el-cascader-node__prefix"})},renderLoadingIcon:function(e){return e("i",{class:"el-icon-loading el-cascader-node__postfix"})},renderExpandIcon:function(e){return e("i",{class:"el-icon-arrow-right el-cascader-node__postfix"})},renderContent:function(e){var t=this.panel,i=this.node,n=t.renderLabelFn,s=n?n({node:i,data:i.data}):null;return e("span",{class:"el-cascader-node__label"},[s||i.label])}},render:function(e){var t=this,i=this.inActivePath,n=this.inCheckedPath,s=this.isChecked,r=this.isLeaf,a=this.isDisabled,o=this.config,l=this.nodeId,c=o.expandTrigger,u=o.checkStrictly,h=o.multiple,d=!u&&a,p={on:{}};return"click"===c?p.on.click=this.handleExpand:(p.on.mouseenter=function(e){t.handleExpand(),t.$emit("expand",e)},p.on.focus=function(e){t.handleExpand(),t.$emit("expand",e)}),!r||a||u||h||(p.on.click=this.handleCheckChange),e("li",eh()([{attrs:{role:"menuitem",id:l,"aria-expanded":i,tabindex:d?null:-1},class:{"el-cascader-node":!0,"is-selectable":u,"in-active-path":i,"in-checked-path":n,"is-active":s,"is-disabled":d}},p]),[this.renderPrefix(e),this.renderContent(e),this.renderPostfix(e)])}},_g=yg,xg=o(_g,fg,mg,!1,null,null,null);xg.options.__file="packages/cascader-panel/src/cascader-node.vue";var Cg,wg,kg=xg.exports,Sg={name:"ElCascaderMenu",mixins:[g.a],inject:["panel"],components:{ElScrollbar:q.a,CascaderNode:kg},props:{nodes:{type:Array,required:!0},index:Number},data:function(){return{activeNode:null,hoverTimer:null,id:Object(b["generateId"])()}},computed:{isEmpty:function(){return!this.nodes.length},menuId:function(){return"cascader-menu-"+this.id+"-"+this.index}},methods:{handleExpand:function(e){this.activeNode=e.target},handleMouseMove:function(e){var t=this.activeNode,i=this.hoverTimer,n=this.$refs.hoverZone;if(t&&n)if(t.contains(e.target)){clearTimeout(i);var s=this.$el.getBoundingClientRect(),r=s.left,a=e.clientX-r,o=this.$el,l=o.offsetWidth,c=o.offsetHeight,u=t.offsetTop,h=u+t.offsetHeight;n.innerHTML='\n \n \n '}else i||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var e=this.$refs.hoverZone;e&&(e.innerHTML="")},renderEmptyText:function(e){return e("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(e){var t=this.menuId,i=this.panel.isHoverMenu,n={on:{}};i&&(n.on.expand=this.handleExpand);var s=this.nodes.map((function(i,s){var r=i.hasChildren;return e("cascader-node",eh()([{key:i.uid,attrs:{node:i,"node-id":t+"-"+s,"aria-haspopup":r,"aria-owns":r?t:null}},n]))}));return[].concat(s,[i?e("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(e){var t=this.isEmpty,i=this.menuId,n={nativeOn:{}};return this.panel.isHoverMenu&&(n.nativeOn.mousemove=this.handleMouseMove),e("el-scrollbar",eh()([{attrs:{tag:"ul",role:"menu",id:i,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":t}},class:"el-cascader-menu"},n]),[t?this.renderEmptyText(e):this.renderNodeList(e)])}},Dg=Sg,$g=o(Dg,Cg,wg,!1,null,null,null);$g.options.__file="packages/cascader-panel/src/cascader-menu.vue";var Og=$g.exports,Eg=function(){function e(e,t){for(var i=0;i1?t-1:0),n=1;n1?n-1:0),r=1;r0},e.prototype.syncCheckState=function(e){var t=this.getValueByOption(),i=this.isSameNode(e,t);this.doCheck(i)},e.prototype.doCheck=function(e){this.checked!==e&&(this.config.checkStrictly?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check")))},Eg(e,[{key:"isDisabled",get:function(){var e=this.data,t=this.parent,i=this.config,n=i.disabled,s=i.checkStrictly;return e[n]||!s&&t&&t.isDisabled}},{key:"isLeaf",get:function(){var e=this.data,t=this.loaded,i=this.hasChildren,n=this.children,s=this.config,r=s.lazy,a=s.leaf;if(r){var o=Object(Dt["isDef"])(e[a])?e[a]:!!t&&!n.length;return this.hasChildren=!o,o}return!i}}]),e}(),Ng=Mg;function Ig(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var jg=function e(t,i){return t.reduce((function(t,n){return n.isLeaf?t.push(n):(!i&&t.push(n),t=t.concat(e(n.children,i))),t}),[])},Fg=function(){function e(t,i){Ig(this,e),this.config=i,this.initNodes(t)}return e.prototype.initNodes=function(e){var t=this;e=Object(b["coerceTruthyValueToArray"])(e),this.nodes=e.map((function(e){return new Ng(e,t.config)})),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},e.prototype.appendNode=function(e,t){var i=new Ng(e,this.config,t),n=t?t.children:this.nodes;n.push(i)},e.prototype.appendNodes=function(e,t){var i=this;e=Object(b["coerceTruthyValueToArray"])(e),e.forEach((function(e){return i.appendNode(e,t)}))},e.prototype.getNodes=function(){return this.nodes},e.prototype.getFlattedNodes=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e?this.leafNodes:this.flattedNodes;return t?i:jg(this.nodes,e)},e.prototype.getNodeByValue=function(e){var t=this.getFlattedNodes(!1,!this.config.lazy).filter((function(t){return Object(b["valueEquals"])(t.path,e)||t.value===e}));return t&&t.length?t[0]:null},e}(),Lg=Fg,Ag=Object.assign||function(e){for(var t=1;t0){var l=i.store.getNodeByValue(r);l.data[o]||i.lazyLoad(l,(function(){i.handleExpand(l)})),i.loadCount===i.checkedValue.length&&i.$parent.computePresentText()}}t&&t(n)};n.lazyLoad(e,s)},calculateMultiCheckedValue:function(){this.checkedValue=this.getCheckedNodes(this.leafOnly).map((function(e){return e.getValueByOption()}))},scrollIntoView:function(){if(!this.$isServer){var e=this.$refs.menu||[];e.forEach((function(e){var t=e.$el;if(t){var i=t.querySelector(".el-scrollbar__wrap"),n=t.querySelector(".el-cascader-node.is-active")||t.querySelector(".el-cascader-node.in-active-path");tn()(i,n)}}))}},getNodeByValue:function(e){return this.store.getNodeByValue(e)},getFlattedNodes:function(e){var t=!this.config.lazy;return this.store.getFlattedNodes(e,t)},getCheckedNodes:function(e){var t=this.checkedValue,i=this.multiple;if(i){var n=this.getFlattedNodes(e);return n.filter((function(e){return e.checked}))}return this.isEmptyValue(t)?[]:[this.getNodeByValue(t)]},clearCheckedNodes:function(){var e=this.config,t=this.leafOnly,i=e.multiple,n=e.emitPath;i?(this.getCheckedNodes(t).filter((function(e){return!e.isDisabled})).forEach((function(e){return e.doCheck(!1)})),this.calculateMultiCheckedValue()):this.checkedValue=n?[]:null}}},Kg=Yg,Ug=o(Kg,dg,pg,!1,null,null,null);Ug.options.__file="packages/cascader-panel/src/cascader-panel.vue";var Gg=Ug.exports;Gg.install=function(e){e.component(Gg.name,Gg)};var Xg,Zg,Qg=Gg,Jg={name:"ElAvatar",props:{size:{type:[Number,String],validator:function(e){return"string"===typeof e?["large","medium","small"].includes(e):"number"===typeof e}},shape:{type:String,default:"circle",validator:function(e){return["circle","square"].includes(e)}},icon:String,src:String,alt:String,srcSet:String,error:Function,fit:{type:String,default:"cover"}},data:function(){return{isImageExist:!0}},computed:{avatarClass:function(){var e=this.size,t=this.icon,i=this.shape,n=["el-avatar"];return e&&"string"===typeof e&&n.push("el-avatar--"+e),t&&n.push("el-avatar--icon"),i&&n.push("el-avatar--"+i),n.join(" ")}},methods:{handleError:function(){var e=this.error,t=e?e():void 0;!1!==t&&(this.isImageExist=!1)},renderAvatar:function(){var e=this.$createElement,t=this.icon,i=this.src,n=this.alt,s=this.isImageExist,r=this.srcSet,a=this.fit;return s&&i?e("img",{attrs:{src:i,alt:n,srcSet:r},on:{error:this.handleError},style:{"object-fit":a}}):t?e("i",{class:t}):this.$slots.default}},render:function(){var e=arguments[0],t=this.avatarClass,i=this.size,n="number"===typeof i?{height:i+"px",width:i+"px",lineHeight:i+"px"}:{};return e("span",{class:t,style:n},[this.renderAvatar()])}},eb=Jg,tb=o(eb,Xg,Zg,!1,null,null,null);tb.options.__file="packages/avatar/src/main.vue";var ib=tb.exports;ib.install=function(e){e.component(ib.name,ib)};var nb=ib,sb=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-drawer-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-drawer__wrapper",attrs:{tabindex:"-1"}},[i("div",{staticClass:"el-drawer__container",class:e.visible&&"el-drawer__open",attrs:{role:"document",tabindex:"-1"},on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[i("div",{ref:"drawer",staticClass:"el-drawer",class:[e.direction,e.customClass],style:e.isHorizontal?"width: "+e.drawerSize:"height: "+e.drawerSize,attrs:{"aria-modal":"true","aria-labelledby":"el-drawer__title","aria-label":e.title,role:"dialog",tabindex:"-1"}},[e.withHeader?i("header",{staticClass:"el-drawer__header",attrs:{id:"el-drawer__title"}},[e._t("title",[i("span",{attrs:{role:"heading",title:e.title}},[e._v(e._s(e.title))])]),e.showClose?i("button",{staticClass:"el-drawer__close-btn",attrs:{"aria-label":"close "+(e.title||"drawer"),type:"button"},on:{click:e.closeDrawer}},[i("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):e._e()],2):e._e(),e.rendered?i("section",{staticClass:"el-drawer__body"},[e._t("default")],2):e._e()])])])])},rb=[];sb._withStripped=!0;var ab={name:"ElDrawer",mixins:[k.a,O.a],props:{appendToBody:{type:Boolean,default:!1},beforeClose:{type:Function},customClass:{type:String,default:""},closeOnPressEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},modal:{type:Boolean,default:!0},direction:{type:String,default:"rtl",validator:function(e){return-1!==["ltr","rtl","ttb","btt"].indexOf(e)}},modalAppendToBody:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},size:{type:[Number,String],default:"30%"},title:{type:String,default:""},visible:{type:Boolean},wrapperClosable:{type:Boolean,default:!0},withHeader:{type:Boolean,default:!0}},computed:{isHorizontal:function(){return"rtl"===this.direction||"ltr"===this.direction},drawerSize:function(){return"number"===typeof this.size?this.size+"px":this.size}},data:function(){return{closed:!1,prevActiveElement:null}},watch:{visible:function(e){var t=this;e?(this.closed=!1,this.$emit("open"),this.appendToBody&&document.body.appendChild(this.$el),this.prevActiveElement=document.activeElement):(this.closed||(this.$emit("close"),!0===this.destroyOnClose&&(this.rendered=!1)),this.$nextTick((function(){t.prevActiveElement&&t.prevActiveElement.focus()})))}},methods:{afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")},hide:function(e){!1!==e&&(this.$emit("update:visible",!1),this.$emit("close"),!0===this.destroyOnClose&&(this.rendered=!1),this.closed=!0)},handleWrapperClick:function(){this.wrapperClosable&&this.closeDrawer()},closeDrawer:function(){"function"===typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},handleClose:function(){this.closeDrawer()}},mounted:function(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},ob=ab,lb=o(ob,sb,rb,!1,null,null,null);lb.options.__file="packages/drawer/src/main.vue";var cb=lb.exports;cb.install=function(e){e.component(cb.name,cb)};var ub=cb,hb=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-popover",e._b({attrs:{trigger:"click"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},"el-popover",e.$attrs,!1),[i("div",{staticClass:"el-popconfirm"},[i("p",{staticClass:"el-popconfirm__main"},[e.hideIcon?e._e():i("i",{staticClass:"el-popconfirm__icon",class:e.icon,style:{color:e.iconColor}}),e._v("\n "+e._s(e.title)+"\n ")]),i("div",{staticClass:"el-popconfirm__action"},[i("el-button",{attrs:{size:"mini",type:e.cancelButtonType},on:{click:e.cancel}},[e._v("\n "+e._s(e.displayCancelButtonText)+"\n ")]),i("el-button",{attrs:{size:"mini",type:e.confirmButtonType},on:{click:e.confirm}},[e._v("\n "+e._s(e.displayConfirmButtonText)+"\n ")])],1)]),e._t("reference",null,{slot:"reference"})],2)},db=[];hb._withStripped=!0;var pb=i(44),fb=i.n(pb),mb={name:"ElPopconfirm",props:{title:{type:String},confirmButtonText:{type:String},cancelButtonText:{type:String},confirmButtonType:{type:String,default:"primary"},cancelButtonType:{type:String,default:"text"},icon:{type:String,default:"el-icon-question"},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1}},components:{ElPopover:fb.a,ElButton:ae.a},data:function(){return{visible:!1}},computed:{displayConfirmButtonText:function(){return this.confirmButtonText||Object(vo["t"])("el.popconfirm.confirmButtonText")},displayCancelButtonText:function(){return this.cancelButtonText||Object(vo["t"])("el.popconfirm.cancelButtonText")}},methods:{confirm:function(){this.visible=!1,this.$emit("confirm")},cancel:function(){this.visible=!1,this.$emit("cancel")}}},vb=mb,gb=o(vb,hb,db,!1,null,null,null);gb.options.__file="packages/popconfirm/src/main.vue";var bb=gb.exports;bb.install=function(e){e.component(bb.name,bb)};var yb=bb,_b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.uiLoading?[i("div",e._b({class:["el-skeleton",e.animated?"is-animated":""]},"div",e.$attrs,!1),[e._l(e.count,(function(t){return[e.loading?e._t("template",e._l(e.rows,(function(n){return i("el-skeleton-item",{key:t+"-"+n,class:{"el-skeleton__paragraph":1!==n,"is-first":1===n,"is-last":n===e.rows&&e.rows>1},attrs:{variant:"p"}})}))):e._e()]}))],2)]:[e._t("default",null,null,e.$attrs)]],2)},xb=[];_b._withStripped=!0;var Cb={name:"ElSkeleton",props:{animated:{type:Boolean,default:!1},count:{type:Number,default:1},rows:{type:Number,default:4},loading:{type:Boolean,default:!0},throttle:{type:Number,default:0}},watch:{loading:{handler:function(e){var t=this;this.throttle<=0?this.uiLoading=e:e?(clearTimeout(this.timeoutHandle),this.timeoutHandle=setTimeout((function(){t.uiLoading=t.loading}),this.throttle)):this.uiLoading=e},immediate:!0}},data:function(){return{uiLoading:this.throttle<=0&&this.loading}}},wb=Cb,kb=o(wb,_b,xb,!1,null,null,null);kb.options.__file="packages/skeleton/src/index.vue";var Sb=kb.exports;Sb.install=function(e){e.component(Sb.name,Sb)};var Db=Sb,$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["el-skeleton__item","el-skeleton__"+e.variant]},["image"===e.variant?i("img-placeholder"):e._e()],1)},Ob=[];$b._withStripped=!0;var Eb=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("svg",{attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[i("path",{attrs:{d:"M64 896V128h896v768H64z m64-128l192-192 116.352 116.352L640 448l256 307.2V192H128v576z m224-480a96 96 0 1 1-0.064 192.064A96 96 0 0 1 352 288z"}})])},Tb=[];Eb._withStripped=!0;var Pb={name:"ImgPlaceholder"},Mb=Pb,Nb=o(Mb,Eb,Tb,!1,null,null,null);Nb.options.__file="packages/skeleton/src/img-placeholder.vue";var Ib,jb=Nb.exports,Fb={name:"ElSkeletonItem",props:{variant:{type:String,default:"text"}},components:(Ib={},Ib[jb.name]=jb,Ib)},Lb=Fb,Ab=o(Lb,$b,Ob,!1,null,null,null);Ab.options.__file="packages/skeleton/src/item.vue";var Vb=Ab.exports;Vb.install=function(e){e.component(Vb.name,Vb)};var Bb=Vb,zb=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-empty"},[i("div",{staticClass:"el-empty__image",style:e.imageStyle},[e.image?i("img",{attrs:{src:e.image,ondragstart:"return false"}}):e._t("image",[i("img-empty")])],2),i("div",{staticClass:"el-empty__description"},[e.$slots.description?e._t("description"):i("p",[e._v(e._s(e.emptyDescription))])],2),e.$slots.default?i("div",{staticClass:"el-empty__bottom"},[e._t("default")],2):e._e()])},Rb=[];zb._withStripped=!0;var Hb=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("svg",{attrs:{viewBox:"0 0 79 86",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[i("defs",[i("linearGradient",{attrs:{id:"linearGradient-1-"+e.id,x1:"38.8503086%",y1:"0%",x2:"61.1496914%",y2:"100%"}},[i("stop",{attrs:{"stop-color":"#FCFCFD",offset:"0%"}}),i("stop",{attrs:{"stop-color":"#EEEFF3",offset:"100%"}})],1),i("linearGradient",{attrs:{id:"linearGradient-2-"+e.id,x1:"0%",y1:"9.5%",x2:"100%",y2:"90.5%"}},[i("stop",{attrs:{"stop-color":"#FCFCFD",offset:"0%"}}),i("stop",{attrs:{"stop-color":"#E9EBEF",offset:"100%"}})],1),i("rect",{attrs:{id:"path-3-"+e.id,x:"0",y:"0",width:"17",height:"36"}})],1),i("g",{attrs:{id:"Illustrations",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"}},[i("g",{attrs:{id:"B-type",transform:"translate(-1268.000000, -535.000000)"}},[i("g",{attrs:{id:"Group-2",transform:"translate(1268.000000, 535.000000)"}},[i("path",{attrs:{id:"Oval-Copy-2",d:"M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",fill:"#F7F8FC"}}),i("polygon",{attrs:{id:"Rectangle-Copy-14",fill:"#E5E7E9",transform:"translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",points:"13 58 53 58 42 45 2 45"}}),i("g",{attrs:{id:"Group-Copy",transform:"translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"}},[i("polygon",{attrs:{id:"Rectangle-Copy-10",fill:"#E5E7E9",transform:"translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",points:"2.84078316e-14 3 18 3 23 7 5 7"}}),i("polygon",{attrs:{id:"Rectangle-Copy-11",fill:"#EDEEF2",points:"-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"}}),i("rect",{attrs:{id:"Rectangle-Copy-12",fill:"url(#linearGradient-1-"+e.id+")",transform:"translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",x:"38",y:"7",width:"17",height:"36"}}),i("polygon",{attrs:{id:"Rectangle-Copy-13",fill:"#F8F9FB",transform:"translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",points:"24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"}})]),i("rect",{attrs:{id:"Rectangle-Copy-15",fill:"url(#linearGradient-2-"+e.id+")",x:"13",y:"45",width:"40",height:"36"}}),i("g",{attrs:{id:"Rectangle-Copy-17",transform:"translate(53.000000, 45.000000)"}},[i("mask",{attrs:{id:"mask-4-"+e.id,fill:"white"}},[i("use",{attrs:{"xlink:href":"#path-3-"+e.id}})]),i("use",{attrs:{id:"Mask",fill:"#E0E3E9",transform:"translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ","xlink:href":"#path-3-"+e.id}}),i("polygon",{attrs:{id:"Rectangle-Copy",fill:"#D5D7DE",mask:"url(#mask-4-"+e.id+")",transform:"translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",points:"7 0 24 0 20 18 -1.70530257e-13 16"}})]),i("polygon",{attrs:{id:"Rectangle-Copy-18",fill:"#F8F9FB",transform:"translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",points:"62 45 79 45 70 58 53 58"}})])])])])},Wb=[];Hb._withStripped=!0;var qb=0,Yb={name:"ImgEmpty",data:function(){return{id:++qb}}},Kb=Yb,Ub=o(Kb,Hb,Wb,!1,null,null,null);Ub.options.__file="packages/empty/src/img-empty.vue";var Gb,Xb=Ub.exports,Zb={name:"ElEmpty",components:(Gb={},Gb[Xb.name]=Xb,Gb),props:{image:{type:String,default:""},imageSize:Number,description:{type:String,default:""}},computed:{emptyDescription:function(){return this.description||Object(vo["t"])("el.empty.description")},imageStyle:function(){return{width:this.imageSize?this.imageSize+"px":""}}}},Qb=Zb,Jb=o(Qb,zb,Rb,!1,null,null,null);Jb.options.__file="packages/empty/src/index.vue";var ey=Jb.exports;ey.install=function(e){e.component(ey.name,ey)};var ty,iy=ey,ny=Object.assign||function(e){for(var t=1;t3&&void 0!==arguments[3]&&arguments[3];return e.props||(e.props={}),t>i&&(e.props.span=i),n&&(e.props.span=i),e},getRows:function(){var e=this,t=(this.$slots.default||[]).filter((function(e){return e.tag&&e.componentOptions&&"ElDescriptionsItem"===e.componentOptions.Ctor.options.name})),i=t.map((function(t){return{props:e.getOptionProps(t),slots:e.getSlots(t),vnode:t}})),n=[],s=[],r=this.column;return i.forEach((function(i,a){var o=i.props.span||1;if(a===t.length-1)return s.push(e.filledNode(i,o,r,!0)),void n.push(s);o1&&void 0!==arguments[1]?arguments[1]:{};go.a.use(t.locale),go.a.i18n(t.i18n),Hy.forEach((function(t){e.component(t.name,t)})),e.use(sg),e.use(Mu.directive),e.prototype.$ELEMENT={size:t.size||"",zIndex:t.zIndex||2e3},e.prototype.$loading=Mu.service,e.prototype.$msgbox=Ao,e.prototype.$alert=Ao.alert,e.prototype.$confirm=Ao.confirm,e.prototype.$prompt=Ao.prompt,e.prototype.$notify=Qc,e.prototype.$message=Jh};"undefined"!==typeof window&&window.Vue&&Wy(window.Vue);t["default"]={version:"2.15.7",locale:go.a.use,i18n:go.a.i18n,install:Wy,CollapseTransition:Ke.a,Loading:Mu,Pagination:_,Dialog:N,Autocomplete:se,Dropdown:pe,DropdownMenu:_e,DropdownItem:$e,Menu:qe,Submenu:et,MenuItem:ct,MenuItemGroup:vt,Input:Pt,InputNumber:Vt,Radio:Yt,RadioGroup:ei,RadioButton:oi,Checkbox:fi,CheckboxButton:xi,CheckboxGroup:Oi,Switch:ji,Select:ln,Option:cn,OptionGroup:vn,Button:wn,ButtonGroup:Tn,Table:Gs,TableColumn:nr,DatePicker:Ta,TimeSelect:Ra,TimePicker:to,Popover:uo,Tooltip:po,MessageBox:Ao,Breadcrumb:qo,BreadcrumbItem:Qo,Form:rl,FormItem:_l,Tabs:zl,TabPane:Xl,Tag:tc,Tree:Tc,Alert:Ac,Notification:Qc,Slider:fu,Icon:Vu,Row:zu,Col:Wu,Upload:wh,Progress:Th,Spinner:Lh,Message:Jh,Badge:ad,Card:pd,Rate:_d,Steps:$d,Step:Id,Carousel:Hd,Scrollbar:Ud,CarouselItem:ip,Collapse:cp,CollapseItem:vp,Cascader:Pp,ColorPicker:Mf,Transfer:qf,Container:Qf,Header:rm,Aside:dm,Main:ym,Footer:Om,Timeline:Nm,TimelineItem:Bm,Link:Km,Divider:ev,Image:yv,Calendar:Lv,Backtop:Yv,InfiniteScroll:sg,PageHeader:hg,CascaderPanel:Qg,Avatar:nb,Drawer:ub,Popconfirm:yb,Skeleton:Db,SkeletonItem:Bb,Empty:iy,Descriptions:oy,DescriptionsItem:cy,Result:Ry}}])["default"]},6167:function(e,t,i){"use strict";var n,s;"function"===typeof Symbol&&Symbol.iterator;(function(r,a){n=a,s="function"===typeof n?n.call(t,i,t,e):n,void 0===s||(e.exports=s)})(0,(function(){var e=window,t={placement:"bottom",gpuAcceleration:!0,offset:0,boundariesElement:"viewport",boundariesPadding:5,preventOverflowOrder:["left","right","top","bottom"],flipBehavior:"flip",arrowElement:"[x-arrow]",arrowOffset:0,modifiers:["shift","offset","preventOverflow","keepTogether","arrow","flip","applyStyle"],modifiersIgnored:[],forceAbsolute:!1};function i(e,i,n){this._reference=e.jquery?e[0]:e,this.state={};var s="undefined"===typeof i||null===i,r=i&&"[object Object]"===Object.prototype.toString.call(i);return this._popper=s||r?this.parse(r?i:{}):i.jquery?i[0]:i,this._options=Object.assign({},t,n),this._options.modifiers=this._options.modifiers.map(function(e){if(-1===this._options.modifiersIgnored.indexOf(e))return"applyStyle"===e&&this._popper.setAttribute("x-placement",this._options.placement),this.modifiers[e]||e}.bind(this)),this.state.position=this._getPosition(this._popper,this._reference),h(this._popper,{position:this.state.position,top:0}),this.update(),this._setupEventListeners(),this}function n(t){var i=t.style.display,n=t.style.visibility;t.style.display="block",t.style.visibility="hidden";t.offsetWidth;var s=e.getComputedStyle(t),r=parseFloat(s.marginTop)+parseFloat(s.marginBottom),a=parseFloat(s.marginLeft)+parseFloat(s.marginRight),o={width:t.offsetWidth+a,height:t.offsetHeight+r};return t.style.display=i,t.style.visibility=n,o}function s(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function r(e){var t=Object.assign({},e);return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function a(e,t){var i,n=0;for(i in e){if(e[i]===t)return n;n++}return null}function o(t,i){var n=e.getComputedStyle(t,null);return n[i]}function l(t){var i=t.offsetParent;return i!==e.document.body&&i?i:e.document.documentElement}function c(t){var i=t.parentNode;return i?i===e.document?e.document.body.scrollTop||e.document.body.scrollLeft?e.document.body:e.document.documentElement:-1!==["scroll","auto"].indexOf(o(i,"overflow"))||-1!==["scroll","auto"].indexOf(o(i,"overflow-x"))||-1!==["scroll","auto"].indexOf(o(i,"overflow-y"))?i:c(t.parentNode):t}function u(t){return t!==e.document.body&&("fixed"===o(t,"position")||(t.parentNode?u(t.parentNode):t))}function h(e,t){function i(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}Object.keys(t).forEach((function(n){var s="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&i(t[n])&&(s="px"),e.style[n]=t[n]+s}))}function d(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function p(e){var t={width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function f(e){var t=e.getBoundingClientRect(),i=-1!=navigator.userAgent.indexOf("MSIE"),n=i&&"HTML"===e.tagName?-e.scrollTop:t.top;return{left:t.left,top:n,right:t.right,bottom:t.bottom,width:t.right-t.left,height:t.bottom-n}}function m(e,t,i){var n=f(e),s=f(t);if(i){var r=c(t);s.top+=r.scrollTop,s.bottom+=r.scrollTop,s.left+=r.scrollLeft,s.right+=r.scrollLeft}var a={top:n.top-s.top,left:n.left-s.left,bottom:n.top-s.top+n.height,right:n.left-s.left+n.width,width:n.width,height:n.height};return a}function v(t){for(var i=["","ms","webkit","moz","o"],n=0;n1&&console.warn("WARNING: the given `parent` query("+t.parent+") matched more than one element, the first one will be used"),0===a.length)throw"ERROR: the given `parent` doesn't exists!";a=a[0]}return a.length>1&&a instanceof Element===!1&&(console.warn("WARNING: you have passed as parent a list of elements, the first one will be used"),a=a[0]),a.appendChild(s),s;function o(e,t){t.forEach((function(t){e.classList.add(t)}))}function l(e,t){t.forEach((function(t){e.setAttribute(t.split(":")[0],t.split(":")[1]||"")}))}},i.prototype._getPosition=function(e,t){var i=l(t);if(this._options.forceAbsolute)return"absolute";var n=u(t,i);return n?"fixed":"absolute"},i.prototype._getOffsets=function(e,t,i){i=i.split("-")[0];var s={};s.position=this.state.position;var r="fixed"===s.position,a=m(t,l(e),r),o=n(e);return-1!==["right","left"].indexOf(i)?(s.top=a.top+a.height/2-o.height/2,s.left="left"===i?a.left-o.width:a.right):(s.left=a.left+a.width/2-o.width/2,s.top="top"===i?a.top-o.height:a.bottom),s.width=o.width,s.height=o.height,{popper:s,reference:a}},i.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),e.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var t=c(this._reference);t!==e.document.body&&t!==e.document.documentElement||(t=e),t.addEventListener("scroll",this.state.updateBound),this.state.scrollTarget=t}},i.prototype._removeEventListeners=function(){e.removeEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement&&this.state.scrollTarget&&(this.state.scrollTarget.removeEventListener("scroll",this.state.updateBound),this.state.scrollTarget=null),this.state.updateBound=null},i.prototype._getBoundaries=function(t,i,n){var s,r,a={};if("window"===n){var o=e.document.body,u=e.document.documentElement;r=Math.max(o.scrollHeight,o.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),s=Math.max(o.scrollWidth,o.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),a={top:0,right:s,bottom:r,left:0}}else if("viewport"===n){var h=l(this._popper),d=c(this._popper),f=p(h),m=function(e){return e==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop},v=function(e){return e==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):e.scrollLeft},g="fixed"===t.offsets.popper.position?0:m(d),b="fixed"===t.offsets.popper.position?0:v(d);a={top:0-(f.top-g),right:e.document.documentElement.clientWidth-(f.left-b),bottom:e.document.documentElement.clientHeight-(f.top-g),left:0-(f.left-b)}}else a=l(this._popper)===n?{top:0,left:0,right:n.clientWidth,bottom:n.clientHeight}:p(n);return a.left+=i,a.right-=i,a.top=a.top+i,a.bottom=a.bottom-i,a},i.prototype.runModifiers=function(e,t,i){var n=t.slice();return void 0!==i&&(n=this._options.modifiers.slice(0,a(this._options.modifiers,i))),n.forEach(function(t){d(t)&&(e=t.call(this,e))}.bind(this)),e},i.prototype.isModifierRequired=function(e,t){var i=a(this._options.modifiers,e);return!!this._options.modifiers.slice(0,i).filter((function(e){return e===t})).length},i.prototype.modifiers={},i.prototype.modifiers.applyStyle=function(e){var t,i={position:e.offsets.popper.position},n=Math.round(e.offsets.popper.left),s=Math.round(e.offsets.popper.top);return this._options.gpuAcceleration&&(t=v("transform"))?(i[t]="translate3d("+n+"px, "+s+"px, 0)",i.top=0,i.left=0):(i.left=n,i.top=s),Object.assign(i,e.styles),h(this._popper,i),this._popper.setAttribute("x-placement",e.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&e.offsets.arrow&&h(e.arrowElement,e.offsets.arrow),e},i.prototype.modifiers.shift=function(e){var t=e.placement,i=t.split("-")[0],n=t.split("-")[1];if(n){var s=e.offsets.reference,a=r(e.offsets.popper),o={y:{start:{top:s.top},end:{top:s.top+s.height-a.height}},x:{start:{left:s.left},end:{left:s.left+s.width-a.width}}},l=-1!==["bottom","top"].indexOf(i)?"x":"y";e.offsets.popper=Object.assign(a,o[l][n])}return e},i.prototype.modifiers.preventOverflow=function(e){var t=this._options.preventOverflowOrder,i=r(e.offsets.popper),n={left:function(){var t=i.left;return i.lefte.boundaries.right&&(t=Math.min(i.left,e.boundaries.right-i.width)),{left:t}},top:function(){var t=i.top;return i.tope.boundaries.bottom&&(t=Math.min(i.top,e.boundaries.bottom-i.height)),{top:t}}};return t.forEach((function(t){e.offsets.popper=Object.assign(i,n[t]())})),e},i.prototype.modifiers.keepTogether=function(e){var t=r(e.offsets.popper),i=e.offsets.reference,n=Math.floor;return t.rightn(i.right)&&(e.offsets.popper.left=n(i.right)),t.bottomn(i.bottom)&&(e.offsets.popper.top=n(i.bottom)),e},i.prototype.modifiers.flip=function(e){if(!this.isModifierRequired(this.modifiers.flip,this.modifiers.preventOverflow))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),e;if(e.flipped&&e.placement===e._originalPlacement)return e;var t=e.placement.split("-")[0],i=s(t),n=e.placement.split("-")[1]||"",a=[];return a="flip"===this._options.flipBehavior?[t,i]:this._options.flipBehavior,a.forEach(function(o,l){if(t===o&&a.length!==l+1){t=e.placement.split("-")[0],i=s(t);var c=r(e.offsets.popper),u=-1!==["right","bottom"].indexOf(t);(u&&Math.floor(e.offsets.reference[t])>Math.floor(c[i])||!u&&Math.floor(e.offsets.reference[t])o[p]&&(e.offsets.popper[h]+=l[h]+f-o[p]);var m=l[h]+(i||l[u]/2-f/2),v=m-o[h];return v=Math.max(Math.min(o[u]-f-8,v),8),s[h]=v,s[d]="",e.offsets.arrow=s,e.arrowElement=t,e},Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),i=1;i-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(l["generateId"])()}},watch:{showPopper:function(e){this.disabled||(e?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var e=this,t=this.referenceElm=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!t&&this.$refs.wrapper.children&&(t=this.referenceElm=this.$refs.wrapper.children[0]),t&&(Object(o["addClass"])(t,"el-popover__reference"),t.setAttribute("aria-describedby",this.tooltipId),t.setAttribute("tabindex",this.tabindex),i.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(o["on"])(t,"focusin",(function(){e.handleFocus();var i=t.__vue__;i&&"function"===typeof i.focus&&i.focus()})),Object(o["on"])(i,"focusin",this.handleFocus),Object(o["on"])(t,"focusout",this.handleBlur),Object(o["on"])(i,"focusout",this.handleBlur)),Object(o["on"])(t,"keydown",this.handleKeydown),Object(o["on"])(t,"click",this.handleClick)),"click"===this.trigger?(Object(o["on"])(t,"click",this.doToggle),Object(o["on"])(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(o["on"])(t,"mouseenter",this.handleMouseEnter),Object(o["on"])(i,"mouseenter",this.handleMouseEnter),Object(o["on"])(t,"mouseleave",this.handleMouseLeave),Object(o["on"])(i,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),t.querySelector("input, textarea")?(Object(o["on"])(t,"focusin",this.doShow),Object(o["on"])(t,"focusout",this.doClose)):(Object(o["on"])(t,"mousedown",this.doShow),Object(o["on"])(t,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(o["addClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(o["removeClass"])(this.referenceElm,"focusing")},handleBlur:function(){Object(o["removeClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var e=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout((function(){e.showPopper=!0}),this.openDelay):this.showPopper=!0},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var e=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout((function(){e.showPopper=!1}),this.closeDelay):this.showPopper=!1},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!t&&this.$refs.wrapper.children&&(t=this.referenceElm=this.$refs.wrapper.children[0]),this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&i&&!i.contains(e.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var e=this.reference;Object(o["off"])(e,"click",this.doToggle),Object(o["off"])(e,"mouseup",this.doClose),Object(o["off"])(e,"mousedown",this.doShow),Object(o["off"])(e,"focusin",this.doShow),Object(o["off"])(e,"focusout",this.doClose),Object(o["off"])(e,"mousedown",this.doShow),Object(o["off"])(e,"mouseup",this.doClose),Object(o["off"])(e,"mouseleave",this.handleMouseLeave),Object(o["off"])(e,"mouseenter",this.handleMouseEnter),Object(o["off"])(document,"click",this.handleDocumentClick)}},u=c,h=i(0),d=Object(h["a"])(u,n,s,!1,null,null,null);d.options.__file="packages/popover/src/main.vue";var p=d.exports,f=function(e,t,i){var n=t.expression?t.value:t.arg,s=i.context.$refs[n];s&&(Array.isArray(s)?s[0].$refs.reference=e:s.$refs.reference=e)},m={bind:function(e,t,i){f(e,t,i)},inserted:function(e,t,i){f(e,t,i)}},v=i(7),g=i.n(v);g.a.directive("popover",m),p.install=function(e){e.directive("popover",m),e.component(p.name,p)},p.directive=m;t["default"]=p}})},"6b7c":function(e,t,i){"use strict";t.__esModule=!0;var n=i("4897");t.default={methods:{t:function(){for(var e=arguments.length,t=Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:"";return String(e).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")};var f=t.arrayFindIndex=function(e,t){for(var i=0;i!==e.length;++i)if(t(e[i]))return i;return-1},m=(t.arrayFind=function(e,t){var i=f(e,t);return-1!==i?e[i]:void 0},t.coerceTruthyValueToArray=function(e){return Array.isArray(e)?e:e?[e]:[]},t.isIE=function(){return!r.default.prototype.$isServer&&!isNaN(Number(document.documentMode))},t.isEdge=function(){return!r.default.prototype.$isServer&&navigator.userAgent.indexOf("Edge")>-1},t.isFirefox=function(){return!r.default.prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)},t.autoprefixer=function(e){if("object"!==("undefined"===typeof e?"undefined":n(e)))return e;var t=["transform","transition","animation"],i=["ms-","webkit-"];return t.forEach((function(t){var n=e[t];t&&n&&i.forEach((function(i){e[i+t]=n}))})),e},t.kebabCase=function(e){var t=/([^-])([A-Z])/g;return e.replace(t,"$1-$2").replace(t,"$1-$2").toLowerCase()},t.capitalize=function(e){return(0,a.isString)(e)?e.charAt(0).toUpperCase()+e.slice(1):e},t.looseEqual=function(e,t){var i=(0,a.isObject)(e),n=(0,a.isObject)(t);return i&&n?JSON.stringify(e)===JSON.stringify(t):!i&&!n&&String(e)===String(t)}),v=t.arrayEquals=function(e,t){if(e=e||[],t=t||[],e.length!==t.length)return!1;for(var i=0;i1?t-1:0),a=1;a-1}},percentage:{type:Number,default:0,required:!0,validator:function(e){return e>=0&&e<=100}},status:{type:String,validator:function(e){return["success","exception","warning"].indexOf(e)>-1}},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var e=this.radius,t="dashboard"===this.type;return"\n M 50 50\n m 0 "+(t?"":"-")+e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"-":"")+2*e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"":"-")+2*e+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){var e=-1*this.perimeter*(1-this.rate)/2;return e+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var e=void 0;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"===typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(e){return"function"===typeof this.color?this.color(e):"string"===typeof this.color?this.color:this.getLevelColor(e)},getLevelColor:function(e){for(var t=this.getColorArray().sort((function(e,t){return e.percentage-t.percentage})),i=0;ie)return t[i].color;return t[t.length-1].color},getColorArray:function(){var e=this.color,t=100/e.length;return e.map((function(e,i){return"string"===typeof e?{color:e,percentage:(i+1)*t}:e}))}}},a=r,o=i(0),l=Object(o["a"])(a,n,s,!1,null,null,null);l.options.__file="packages/progress/src/progress.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)};t["default"]=c}})},c56a:function(e,t,i){"use strict";t.__esModule=!0,t.default=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t)throw new Error("instance & callback is required");var s=!1,r=function(){s||(s=!0,t&&t.apply(null,arguments))};n?e.$once("after-leave",r):e.$on("after-leave",r),setTimeout((function(){r()}),i+100)}},d010:function(e,t,i){"use strict";function n(e,t,i){this.$children.forEach((function(s){var r=s.$options.componentName;r===e?s.$emit.apply(s,[t].concat(i)):n.apply(s,[e,t].concat([i]))}))}t.__esModule=!0,t.default={methods:{dispatch:function(e,t,i){var n=this.$parent||this.$root,s=n.$options.componentName;while(n&&(!s||s!==e))n=n.$parent,n&&(s=n.$options.componentName);n&&n.$emit.apply(n,[t].concat(i))},broadcast:function(e,t,i){n.call(this,e,t,i)}}}},d397:function(e,t,i){"use strict";function n(e){return void 0!==e&&null!==e}function s(e){var t=/([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;return t.test(e)}t.__esModule=!0,t.isDef=n,t.isKorean=s},d7d1:function(e,t,i){"use strict";var n;(function(s){var r={},a=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o="\\d\\d?",l="\\d{3}",c="\\d{4}",u="[^\\s]+",h=/\[([^]*?)\]/gm,d=function(){};function p(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")}function f(e,t){for(var i=[],n=0,s=e.length;n3?0:(e-e%10!==10)*e%10]}};var x={D:function(e){return e.getDay()},DD:function(e){return v(e.getDay())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return e.getDate()},dd:function(e){return v(e.getDate())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return e.getMonth()+1},MM:function(e){return v(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},yy:function(e){return v(String(e.getFullYear()),4).substr(2)},yyyy:function(e){return v(e.getFullYear(),4)},h:function(e){return e.getHours()%12||12},hh:function(e){return v(e.getHours()%12||12)},H:function(e){return e.getHours()},HH:function(e){return v(e.getHours())},m:function(e){return e.getMinutes()},mm:function(e){return v(e.getMinutes())},s:function(e){return e.getSeconds()},ss:function(e){return v(e.getSeconds())},S:function(e){return Math.round(e.getMilliseconds()/100)},SS:function(e){return v(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return v(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+v(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)}},C={d:[o,function(e,t){e.day=t}],Do:[o+u,function(e,t){e.day=parseInt(t,10)}],M:[o,function(e,t){e.month=t-1}],yy:[o,function(e,t){var i=new Date,n=+(""+i.getFullYear()).substr(0,2);e.year=""+(t>68?n-1:n)+t}],h:[o,function(e,t){e.hour=t}],m:[o,function(e,t){e.minute=t}],s:[o,function(e,t){e.second=t}],yyyy:[c,function(e,t){e.year=t}],S:["\\d",function(e,t){e.millisecond=100*t}],SS:["\\d{2}",function(e,t){e.millisecond=10*t}],SSS:[l,function(e,t){e.millisecond=t}],D:[o,d],ddd:[u,d],MMM:[u,m("monthNamesShort")],MMMM:[u,m("monthNames")],a:[u,function(e,t,i){var n=t.toLowerCase();n===i.amPm[0]?e.isPm=!1:n===i.amPm[1]&&(e.isPm=!0)}],ZZ:["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z",function(e,t){var i,n=(t+"").match(/([+-]|\d\d)/gi);n&&(i=60*n[1]+parseInt(n[2],10),e.timezoneOffset="+"===n[0]?i:-i)}]};C.dd=C.d,C.dddd=C.ddd,C.DD=C.D,C.mm=C.m,C.hh=C.H=C.HH=C.h,C.MM=C.M,C.ss=C.s,C.A=C.a,r.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"},r.format=function(e,t,i){var n=i||r.i18n;if("number"===typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");t=r.masks[t]||t||r.masks["default"];var s=[];return t=t.replace(h,(function(e,t){return s.push(t),"@@@"})),t=t.replace(a,(function(t){return t in x?x[t](e,n):t.slice(1,t.length-1)})),t.replace(/@@@/g,(function(){return s.shift()}))},r.parse=function(e,t,i){var n=i||r.i18n;if("string"!==typeof t)throw new Error("Invalid format in fecha.parse");if(t=r.masks[t]||t,e.length>1e3)return null;var s={},o=[],l=[];t=t.replace(h,(function(e,t){return l.push(t),"@@@"}));var c=p(t).replace(a,(function(e){if(C[e]){var t=C[e];return o.push(t[1]),"("+t[0]+")"}return e}));c=c.replace(/@@@/g,(function(){return l.shift()}));var u=e.match(new RegExp(c,"i"));if(!u)return null;for(var d=1;d1&&void 0!==arguments[1]?arguments[1]:1;return new Date(e.getFullYear(),e.getMonth(),e.getDate()-t)});t.nextDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)},t.getStartDateOfMonth=function(e,t){var i=new Date(e,t,1),n=i.getDay();return m(i,0===n?7:n)},t.getWeekNumber=function(e){if(!d(e))return null;var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var i=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},t.getRangeHours=function(e){var t=[],i=[];if((e||[]).forEach((function(e){var t=e.map((function(e){return e.getHours()}));i=i.concat(c(t[0],t[1]))})),i.length)for(var n=0;n<24;n++)t[n]=-1===i.indexOf(n);else for(var s=0;s<24;s++)t[s]=!1;return t},t.getPrevMonthLastDays=function(e,t){if(t<=0)return[];var i=new Date(e.getTime());i.setDate(0);var n=i.getDate();return g(t).map((function(e,i){return n-(t-i-1)}))},t.getMonthDays=function(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),i=t.getDate();return g(i).map((function(e,t){return t+1}))};function v(e,t,i,n){for(var s=t;s0?e.forEach((function(e){var n=e[0],s=e[1],r=n.getHours(),a=n.getMinutes(),o=s.getHours(),l=s.getMinutes();r===t&&o!==t?v(i,a,60,!0):r===t&&o===t?v(i,a,l+1,!0):r!==t&&o===t?v(i,0,l+1,!0):rt&&v(i,0,60,!0)})):v(i,0,60,!0),i};var g=t.range=function(e){return Array.apply(null,{length:e}).map((function(e,t){return t}))},b=t.modifyDate=function(e,t,i,n){return new Date(t,i,n,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())},y=t.modifyTime=function(e,t,i,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,i,n,e.getMilliseconds())},_=(t.modifyWithTimeString=function(e,t){return null!=e&&t?(t=p(t,"HH:mm:ss"),y(e,t.getHours(),t.getMinutes(),t.getSeconds())):e},t.clearTime=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.clearMilliseconds=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),0)},t.limitTimeRange=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"HH:mm:ss";if(0===t.length)return e;var n=function(e){return s.default.parse(s.default.format(e,i),i)},r=n(e),a=t.map((function(e){return e.map(n)}));if(a.some((function(e){return r>=e[0]&&r<=e[1]})))return e;var o=a[0][0],l=a[0][0];a.forEach((function(e){o=new Date(Math.min(e[0],o)),l=new Date(Math.max(e[1],o))}));var c=r1&&void 0!==arguments[1]?arguments[1]:1,i=e.getFullYear(),n=e.getMonth();return x(e,i-t,n)},t.nextYear=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=e.getFullYear(),n=e.getMonth();return x(e,i+t,n)},t.extractDateFormat=function(e){return e.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim()},t.extractTimeFormat=function(e){return e.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g,"").trim()},t.validateRangeInOneMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}},dcdc:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=120)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},120:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-checkbox",class:[e.border&&e.checkboxSize?"el-checkbox--"+e.checkboxSize:"",{"is-disabled":e.isDisabled},{"is-bordered":e.border},{"is-checked":e.isChecked}],attrs:{id:e.id}},[i("span",{staticClass:"el-checkbox__input",class:{"is-disabled":e.isDisabled,"is-checked":e.isChecked,"is-indeterminate":e.indeterminate,"is-focus":e.focus},attrs:{tabindex:!!e.indeterminate&&0,role:!!e.indeterminate&&"checkbox","aria-checked":!!e.indeterminate&&"mixed"}},[i("span",{staticClass:"el-checkbox__inner"}),e.trueLabel||e.falseLabel?i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var i=e.model,n=t.target,s=n.checked?e.trueLabel:e.falseLabel;if(Array.isArray(i)){var r=null,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",disabled:e.isDisabled,name:e.name},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var i=e.model,n=t.target,s=!!n.checked;if(Array.isArray(i)){var r=e.label,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})]),e.$slots.default||e.label?i("span",{staticClass:"el-checkbox__label"},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2):e._e()])},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o={name:"ElCheckbox",mixins:[a.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):(this.$emit("input",e),this.selfModel=e)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return this._checkboxGroup=e,!0;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,i=e.min;return!(!t&&!i)&&this.model.length>=t&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||e}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var i=void 0;i=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,e),this.$nextTick((function(){t.isGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])}))}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}}},l=o,c=i(0),u=Object(c["a"])(l,n,s,!1,null,null,null);u.options.__file="packages/checkbox/src/checkbox.vue";var h=u.exports;h.install=function(e){e.component(h.name,h)};t["default"]=h},4:function(e,t){e.exports=i("d010")}})},e450:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=104)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},10:function(e,t){e.exports=i("f3ad")},104:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["el-input-number",e.inputNumberSize?"el-input-number--"+e.inputNumberSize:"",{"is-disabled":e.inputNumberDisabled},{"is-without-controls":!e.controls},{"is-controls-right":e.controlsAtRight}],on:{dragstart:function(e){e.preventDefault()}}},[e.controls?i("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-input-number__decrease",class:{"is-disabled":e.minDisabled},attrs:{role:"button"},on:{keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.decrease(t)}}},[i("i",{class:"el-icon-"+(e.controlsAtRight?"arrow-down":"minus")})]):e._e(),e.controls?i("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-input-number__increase",class:{"is-disabled":e.maxDisabled},attrs:{role:"button"},on:{keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.increase(t)}}},[i("i",{class:"el-icon-"+(e.controlsAtRight?"arrow-up":"plus")})]):e._e(),i("el-input",{ref:"input",attrs:{value:e.displayValue,placeholder:e.placeholder,disabled:e.inputNumberDisabled,size:e.inputNumberSize,max:e.max,min:e.min,name:e.name,label:e.label},on:{blur:e.handleBlur,focus:e.handleFocus,input:e.handleInput,change:e.handleInputChange},nativeOn:{keydown:[function(t){return!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.increase(t))},function(t){return!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.decrease(t))}]}})],1)},s=[];n._withStripped=!0;var r=i(10),a=i.n(r),o=i(22),l=i.n(o),c=i(30),u={name:"ElInputNumber",mixins:[l()("input")],inject:{elForm:{default:""},elFormItem:{default:""}},directives:{repeatClick:c["a"]},components:{ElInput:a.a},props:{step:{type:Number,default:1},stepStrictly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},value:{},disabled:Boolean,size:String,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:""},name:String,label:String,placeholder:String,precision:{type:Number,validator:function(e){return e>=0&&e===parseInt(e,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(e){var t=void 0===e?e:Number(e);if(void 0!==t){if(isNaN(t))return;if(this.stepStrictly){var i=this.getPrecision(this.step),n=Math.pow(10,i);t=Math.round(t/this.step)*n*this.step/n}void 0!==this.precision&&(t=this.toPrecision(t,this.precision))}t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),this.currentValue=t,this.userInput=null,this.$emit("input",t)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)this.max},numPrecision:function(){var e=this.value,t=this.step,i=this.getPrecision,n=this.precision,s=i(t);return void 0!==n?(s>n&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),n):Math.max(i(e),s)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||!!(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var e=this.currentValue;if("number"===typeof e){if(this.stepStrictly){var t=this.getPrecision(this.step),i=Math.pow(10,t);e=Math.round(e/this.step)*i*this.step/i}void 0!==this.precision&&(e=e.toFixed(this.precision))}return e}},methods:{toPrecision:function(e,t){return void 0===t&&(t=this.numPrecision),parseFloat(Math.round(e*Math.pow(10,t))/Math.pow(10,t))},getPrecision:function(e){if(void 0===e)return 0;var t=e.toString(),i=t.indexOf("."),n=0;return-1!==i&&(n=t.length-i-1),n},_increase:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e+i*t)/i)},_decrease:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e-i*t)/i)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var e=this.value||0,t=this._increase(e,this.step);this.setCurrentValue(t)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var e=this.value||0,t=this._decrease(e,this.step);this.setCurrentValue(t)}},handleBlur:function(e){this.$emit("blur",e)},handleFocus:function(e){this.$emit("focus",e)},setCurrentValue:function(e){var t=this.currentValue;"number"===typeof e&&void 0!==this.precision&&(e=this.toPrecision(e,this.precision)),e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),t!==e&&(this.userInput=null,this.$emit("input",e),this.$emit("change",e,t),this.currentValue=e)},handleInput:function(e){this.userInput=e},handleInputChange:function(e){var t=""===e?void 0:Number(e);isNaN(t)&&""!==e||this.setCurrentValue(t),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var e=this.$refs.input.$refs.input;e.setAttribute("role","spinbutton"),e.setAttribute("aria-valuemax",this.max),e.setAttribute("aria-valuemin",this.min),e.setAttribute("aria-valuenow",this.currentValue),e.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){if(this.$refs&&this.$refs.input){var e=this.$refs.input.$refs.input;e.setAttribute("aria-valuenow",this.currentValue)}}},h=u,d=i(0),p=Object(d["a"])(h,n,s,!1,null,null,null);p.options.__file="packages/input-number/src/input-number.vue";var f=p.exports;f.install=function(e){e.component(f.name,f)};t["default"]=f},2:function(e,t){e.exports=i("5924")},22:function(e,t){e.exports=i("12f2")},30:function(e,t,i){"use strict";var n=i(2);t["a"]={bind:function(e,t,i){var s=null,r=void 0,a=function(){return i.context[t.expression].apply()},o=function(){Date.now()-r<100&&a(),clearInterval(s),s=null};Object(n["on"])(e,"mousedown",(function(e){0===e.button&&(r=Date.now(),Object(n["once"])(document,"mouseup",o),clearInterval(s),s=setInterval(a,100))}))}}}})},e452:function(e,t,i){"use strict";t.__esModule=!0;var n=n||{};n.Utils=n.Utils||{},n.Utils.focusFirstDescendant=function(e){for(var t=0;t=0;t--){var i=e.childNodes[t];if(n.Utils.attemptFocus(i)||n.Utils.focusLastDescendant(i))return!0}return!1},n.Utils.attemptFocus=function(e){if(!n.Utils.isFocusable(e))return!1;n.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(t){}return n.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},n.Utils.isFocusable=function(e){if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type&&"file"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},n.Utils.triggerEvent=function(e,t){var i=void 0;i=/^mouse|click/.test(t)?"MouseEvents":/^key/.test(t)?"KeyboardEvent":"HTMLEvents";for(var n=document.createEvent(i),s=arguments.length,r=Array(s>2?s-2:0),a=2;a=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var i=this.select,n=i.remote,s=i.valueKey;if(!this.created&&!n){if(s&&"object"===("undefined"===typeof e?"undefined":l(e))&&"object"===("undefined"===typeof t?"undefined":l(t))&&e[s]===t[s])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var i=this.select.valueKey;return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var i=this.select.valueKey;return e&&e.some((function(e){return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)}))}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(o["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var e=this.select,t=e.selected,i=e.multiple,n=i?t:[t],s=this.select.cachedOptions.indexOf(this),r=n.indexOf(this);s>-1&&r<0&&this.select.cachedOptions.splice(s,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},u=c,h=i(0),d=Object(h["a"])(u,n,s,!1,null,null,null);d.options.__file="packages/select/src/option.vue";t["a"]=d.exports},4:function(e,t){e.exports=i("d010")},53:function(e,t,i){"use strict";i.r(t);var n=i(33);n["a"].install=function(e){e.component(n["a"].name,n["a"])},t["default"]=n["a"]}})},e974:function(e,t,i){"use strict";t.__esModule=!0;var n=i("2b0e"),s=a(n),r=i("5128");function a(e){return e&&e.__esModule?e:{default:e}}var o=s.default.prototype.$isServer?function(){}:i("6167"),l=function(e){return e.stopPropagation()};t.default={props:{transformOrigin:{type:[Boolean,String],default:!0},placement:{type:String,default:"bottom"},boundariesPadding:{type:Number,default:5},reference:{},popper:{},offset:{default:0},value:Boolean,visibleArrow:Boolean,arrowOffset:{type:Number,default:35},appendToBody:{type:Boolean,default:!0},popperOptions:{type:Object,default:function(){return{gpuAcceleration:!1}}}},data:function(){return{showPopper:!1,currentPlacement:""}},watch:{value:{immediate:!0,handler:function(e){this.showPopper=e,this.$emit("input",e)}},showPopper:function(e){this.disabled||(e?this.updatePopper():this.destroyPopper(),this.$emit("input",e))}},methods:{createPopper:function(){var e=this;if(!this.$isServer&&(this.currentPlacement=this.currentPlacement||this.placement,/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement))){var t=this.popperOptions,i=this.popperElm=this.popperElm||this.popper||this.$refs.popper,n=this.referenceElm=this.referenceElm||this.reference||this.$refs.reference;!n&&this.$slots.reference&&this.$slots.reference[0]&&(n=this.referenceElm=this.$slots.reference[0].elm),i&&n&&(this.visibleArrow&&this.appendArrow(i),this.appendToBody&&document.body.appendChild(this.popperElm),this.popperJS&&this.popperJS.destroy&&this.popperJS.destroy(),t.placement=this.currentPlacement,t.offset=this.offset,t.arrowOffset=this.arrowOffset,this.popperJS=new o(n,i,t),this.popperJS.onCreate((function(t){e.$emit("created",e),e.resetTransformOrigin(),e.$nextTick(e.updatePopper)})),"function"===typeof t.onUpdate&&this.popperJS.onUpdate(t.onUpdate),this.popperJS._popper.style.zIndex=r.PopupManager.nextZIndex(),this.popperElm.addEventListener("click",l))}},updatePopper:function(){var e=this.popperJS;e?(e.update(),e._popper&&(e._popper.style.zIndex=r.PopupManager.nextZIndex())):this.createPopper()},doDestroy:function(e){!this.popperJS||this.showPopper&&!e||(this.popperJS.destroy(),this.popperJS=null)},destroyPopper:function(){this.popperJS&&this.resetTransformOrigin()},resetTransformOrigin:function(){if(this.transformOrigin){var e={top:"bottom",bottom:"top",left:"right",right:"left"},t=this.popperJS._popper.getAttribute("x-placement").split("-")[0],i=e[t];this.popperJS._popper.style.transformOrigin="string"===typeof this.transformOrigin?this.transformOrigin:["top","bottom"].indexOf(t)>-1?"center "+i:i+" center"}},appendArrow:function(e){var t=void 0;if(!this.appended){for(var i in this.appended=!0,e.attributes)if(/^_v-/.test(e.attributes[i].name)){t=e.attributes[i].name;break}var n=document.createElement("div");t&&n.setAttribute(t,""),n.setAttribute("x-arrow",""),n.className="popper__arrow",e.appendChild(n)}}},beforeDestroy:function(){this.doDestroy(!0),this.popperElm&&this.popperElm.parentNode===document.body&&(this.popperElm.removeEventListener("click",l),document.body.removeChild(this.popperElm))},deactivated:function(){this.$options.beforeDestroy[0].call(this)}}},eedf:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=86)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},86:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("button",{staticClass:"el-button",class:[e.type?"el-button--"+e.type:"",e.buttonSize?"el-button--"+e.buttonSize:"",{"is-disabled":e.buttonDisabled,"is-loading":e.loading,"is-plain":e.plain,"is-round":e.round,"is-circle":e.circle}],attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?i("i",{staticClass:"el-icon-loading"}):e._e(),e.icon&&!e.loading?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",[e._t("default")],2):e._e()])},s=[];n._withStripped=!0;var r={name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.$options.propsData.hasOwnProperty("disabled")?this.disabled:(this.elForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},a=r,o=i(0),l=Object(o["a"])(a,n,s,!1,null,null,null);l.options.__file="packages/button/src/button.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)};t["default"]=c}})},f0d9:function(e,t,i){"use strict";t.__esModule=!0,t.default={el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},empty:{description:"暂无数据"}}}},f3ad:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=73)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},11:function(e,t){e.exports=i("2bb5")},21:function(e,t){e.exports=i("d397")},4:function(e,t){e.exports=i("d010")},73:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["textarea"===e.type?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",{"is-disabled":e.inputDisabled,"is-exceed":e.inputExceed,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable||e.showPassword}],on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},["textarea"!==e.type?[e.$slots.prepend?i("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),"textarea"!==e.type?i("input",e._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:e.tabindex,type:e.showPassword?e.passwordVisible?"text":"password":e.type,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionupdate:e.handleCompositionUpdate,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"input",e.$attrs,!1)):e._e(),e.$slots.prefix||e.prefixIcon?i("span",{staticClass:"el-input__prefix"},[e._t("prefix"),e.prefixIcon?i("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.getSuffixVisible()?i("span",{staticClass:"el-input__suffix"},[i("span",{staticClass:"el-input__suffix-inner"},[e.showClear&&e.showPwdVisible&&e.isWordLimitVisible?e._e():[e._t("suffix"),e.suffixIcon?i("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()],e.showClear?i("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{mousedown:function(e){e.preventDefault()},click:e.clear}}):e._e(),e.showPwdVisible?i("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:e.handlePasswordVisible}}):e._e(),e.isWordLimitVisible?i("span",{staticClass:"el-input__count"},[i("span",{staticClass:"el-input__count-inner"},[e._v("\n "+e._s(e.textLength)+"/"+e._s(e.upperLimit)+"\n ")])]):e._e()],2),e.validateState?i("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?i("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:i("textarea",e._b({ref:"textarea",staticClass:"el-textarea__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionupdate:e.handleCompositionUpdate,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"textarea",e.$attrs,!1)),e.isWordLimitVisible&&"textarea"===e.type?i("span",{staticClass:"el-input__count"},[e._v(e._s(e.textLength)+"/"+e._s(e.upperLimit))]):e._e()],2)},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o=i(11),l=i.n(o),c=void 0,u="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",h=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function d(e){var t=window.getComputedStyle(e),i=t.getPropertyValue("box-sizing"),n=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),s=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width")),r=h.map((function(e){return e+":"+t.getPropertyValue(e)})).join(";");return{contextStyle:r,paddingSize:n,borderSize:s,boxSizing:i}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;c||(c=document.createElement("textarea"),document.body.appendChild(c));var n=d(e),s=n.paddingSize,r=n.borderSize,a=n.boxSizing,o=n.contextStyle;c.setAttribute("style",o+";"+u),c.value=e.value||e.placeholder||"";var l=c.scrollHeight,h={};"border-box"===a?l+=r:"content-box"===a&&(l-=s),c.value="";var p=c.scrollHeight-s;if(null!==t){var f=p*t;"border-box"===a&&(f=f+s+r),l=Math.max(f,l),h.minHeight=f+"px"}if(null!==i){var m=p*i;"border-box"===a&&(m=m+s+r),l=Math.min(m,l)}return h.height=l+"px",c.parentNode&&c.parentNode.removeChild(c),c=null,h}var f=i(9),m=i.n(f),v=i(21),g={name:"ElInput",componentName:"ElInput",mixins:[a.a,l.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return m()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"===typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(e){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[e])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var e=this;this.$nextTick((function(){e.setNativeInputValue(),e.resizeTextarea(),e.updateIconOffset()}))}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(e){this.focused=!1,this.$emit("blur",e),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var e=this.autosize,t=this.type;if("textarea"===t)if(e){var i=e.minRows,n=e.maxRows;this.textareaCalcStyle=p(this.$refs.textarea,i,n)}else this.textareaCalcStyle={minHeight:p(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var e=this.getInput();e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)},handleFocus:function(e){this.focused=!0,this.$emit("focus",e)},handleCompositionStart:function(e){this.$emit("compositionstart",e),this.isComposing=!0},handleCompositionUpdate:function(e){this.$emit("compositionupdate",e);var t=e.target.value,i=t[t.length-1]||"";this.isComposing=!Object(v["isKorean"])(i)},handleCompositionEnd:function(e){this.$emit("compositionend",e),this.isComposing&&(this.isComposing=!1,this.handleInput(e))},handleInput:function(e){this.isComposing||e.target.value!==this.nativeInputValue&&(this.$emit("input",e.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(e){this.$emit("change",e.target.value)},calcIconOffset:function(e){var t=[].slice.call(this.$el.querySelectorAll(".el-input__"+e)||[]);if(t.length){for(var i=null,n=0;n>examples/element-ui/CNAME","deploy:extension":"cross-env NODE_ENV=production webpack --config build/webpack.extension.js",dev:"npm run bootstrap && npm run build:file && cross-env NODE_ENV=development webpack-dev-server --config build/webpack.demo.js & node build/bin/template.js","dev:extension":"rimraf examples/extension/dist && cross-env NODE_ENV=development webpack --watch --config build/webpack.extension.js","dev:play":"npm run build:file && cross-env NODE_ENV=development PLAY_ENV=true webpack-dev-server --config build/webpack.demo.js",dist:"npm run clean && npm run build:file && npm run lint && webpack --config build/webpack.conf.js && webpack --config build/webpack.common.js && webpack --config build/webpack.component.js && npm run build:utils && npm run build:umd && npm run build:theme",i18n:"node build/bin/i18n.js",lint:"eslint src/**/* test/**/* packages/**/* build/**/* --quiet",pub:"npm run bootstrap && sh build/git-release.sh && sh build/release.sh && node build/bin/gen-indices.js",test:"npm run lint && npm run build:theme && cross-env CI_ENV=/dev/ BABEL_ENV=test karma start test/unit/karma.conf.js --single-run","test:watch":"npm run build:theme && cross-env BABEL_ENV=test karma start test/unit/karma.conf.js"},style:"lib/theme-chalk/index.css",typings:"types/index.d.ts",unpkg:"lib/index.js",version:"2.15.7"}}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-libs.75ab222e.js b/hippo4j-console/src/main/resources/static/static/js/chunk-libs.75ab222e.js new file mode 100644 index 00000000..e43b8d73 --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-libs.75ab222e.js @@ -0,0 +1,80 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-libs"],{"00e7":function(t,e,n){(function(){Number.isInteger=Number.isInteger||function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t};var e=n("06b1"),r={install:function(t){t.prototype.$cookie=this,t.cookie=this},set:function(t,n,r){var i=r;return Number.isInteger(r)&&(i={expires:r}),e.set(t,n,i)},get:function(t){return e.get(t)},delete:function(t,e){var n={expires:-1};void 0!==e&&(n=Object.assign(e,n)),this.set(t,"",n)}};t.exports=r})()},"014b":function(t,e,n){"use strict";var r=n("e53d"),i=n("07e3"),o=n("8e60"),a=n("63b6"),s=n("9138"),l=n("ebfd").KEY,u=n("294c"),c=n("dbdb"),h=n("45f2"),p=n("62a0"),f=n("5168"),d=n("ccb9"),g=n("6718"),v=n("47ee"),y=n("9003"),m=n("e4ae"),x=n("f772"),_=n("241e"),b=n("36c3"),w=n("1bc3"),S=n("aebd"),M=n("a159"),C=n("0395"),I=n("bf0b"),T=n("9aa9"),A=n("d9f6"),D=n("c3a1"),k=I.f,L=A.f,O=C.f,P=r.Symbol,E=r.JSON,R=E&&E.stringify,N="prototype",z=f("_hidden"),B=f("toPrimitive"),V={}.propertyIsEnumerable,F=c("symbol-registry"),G=c("symbols"),H=c("op-symbols"),j=Object[N],W="function"==typeof P&&!!T.f,U=r.QObject,q=!U||!U[N]||!U[N].findChild,X=o&&u((function(){return 7!=M(L({},"a",{get:function(){return L(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=k(j,e);r&&delete j[e],L(t,e,n),r&&t!==j&&L(j,e,r)}:L,Y=function(t){var e=G[t]=M(P[N]);return e._k=t,e},$=W&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},Z=function(t,e,n){return t===j&&Z(H,e,n),m(t),e=w(e,!0),m(n),i(G,e)?(n.enumerable?(i(t,z)&&t[z][e]&&(t[z][e]=!1),n=M(n,{enumerable:S(0,!1)})):(i(t,z)||L(t,z,S(1,{})),t[z][e]=!0),X(t,e,n)):L(t,e,n)},K=function(t,e){m(t);var n,r=v(e=b(e)),i=0,o=r.length;while(o>i)Z(t,n=r[i++],e[n]);return t},J=function(t,e){return void 0===e?M(t):K(M(t),e)},Q=function(t){var e=V.call(this,t=w(t,!0));return!(this===j&&i(G,t)&&!i(H,t))&&(!(e||!i(this,t)||!i(G,t)||i(this,z)&&this[z][t])||e)},tt=function(t,e){if(t=b(t),e=w(e,!0),t!==j||!i(G,e)||i(H,e)){var n=k(t,e);return!n||!i(G,e)||i(t,z)&&t[z][e]||(n.enumerable=!0),n}},et=function(t){var e,n=O(b(t)),r=[],o=0;while(n.length>o)i(G,e=n[o++])||e==z||e==l||r.push(e);return r},nt=function(t){var e,n=t===j,r=O(n?H:b(t)),o=[],a=0;while(r.length>a)!i(G,e=r[a++])||n&&!i(j,e)||o.push(G[e]);return o};W||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===j&&e.call(H,n),i(this,z)&&i(this[z],t)&&(this[z][t]=!1),X(this,t,S(1,n))};return o&&q&&X(j,t,{configurable:!0,set:e}),Y(t)},s(P[N],"toString",(function(){return this._k})),I.f=tt,A.f=Z,n("6abf").f=C.f=et,n("355d").f=Q,T.f=nt,o&&!n("b8e3")&&s(j,"propertyIsEnumerable",Q,!0),d.f=function(t){return Y(f(t))}),a(a.G+a.W+a.F*!W,{Symbol:P});for(var rt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;rt.length>it;)f(rt[it++]);for(var ot=D(f.store),at=0;ot.length>at;)g(ot[at++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return i(F,t+="")?F[t]:F[t]=P(t)},keyFor:function(t){if(!$(t))throw TypeError(t+" is not a symbol!");for(var e in F)if(F[e]===t)return e},useSetter:function(){q=!0},useSimple:function(){q=!1}}),a(a.S+a.F*!W,"Object",{create:J,defineProperty:Z,defineProperties:K,getOwnPropertyDescriptor:tt,getOwnPropertyNames:et,getOwnPropertySymbols:nt});var st=u((function(){T.f(1)}));a(a.S+a.F*st,"Object",{getOwnPropertySymbols:function(t){return T.f(_(t))}}),E&&a(a.S+a.F*(!W||u((function(){var t=P();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))}))),"JSON",{stringify:function(t){var e,n,r=[t],i=1;while(arguments.length>i)r.push(arguments[i++]);if(n=e=r[1],(x(e)||void 0!==t)&&!$(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!$(e))return e}),r[1]=e,R.apply(E,r)}}),P[N][B]||n("35e8")(P[N],B,P[N].valueOf),h(P,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},"01f9":function(t,e,n){"use strict";var r=n("2d00"),i=n("5ca1"),o=n("2aba"),a=n("32e9"),s=n("84f2"),l=n("41a0"),u=n("7f20"),c=n("38fd"),h=n("2b4c")("iterator"),p=!([].keys&&"next"in[].keys()),f="@@iterator",d="keys",g="values",v=function(){return this};t.exports=function(t,e,n,y,m,x,_){l(n,e,y);var b,w,S,M=function(t){if(!p&&t in A)return A[t];switch(t){case d:return function(){return new n(this,t)};case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},C=e+" Iterator",I=m==g,T=!1,A=t.prototype,D=A[h]||A[f]||m&&A[m],k=D||M(m),L=m?I?M("entries"):k:void 0,O="Array"==e&&A.entries||D;if(O&&(S=c(O.call(new t)),S!==Object.prototype&&S.next&&(u(S,C,!0),r||"function"==typeof S[h]||a(S,h,v))),I&&D&&D.name!==g&&(T=!0,k=function(){return D.call(this)}),r&&!_||!p&&!T&&A[h]||a(A,h,k),s[e]=k,s[C]=v,m)if(b={values:I?k:M(g),keys:x?k:M(d),entries:L},_)for(w in b)w in A||o(A,w,b[w]);else i(i.P+i.F*(p||T),e,b);return b}},"02f4":function(t,e,n){var r=n("4588"),i=n("be13");t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),l=r(n),u=s.length;return l<0||l>=u?t?"":void 0:(o=s.charCodeAt(l),o<55296||o>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):o:t?s.slice(l,l+2):a-56320+(o-55296<<10)+65536)}}},"0390":function(t,e,n){"use strict";var r=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"0395":function(t,e,n){var r=n("36c3"),i=n("6abf").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(r(t))}},"06b1":function(t,e,n){var r,i; +/*! + * tiny-cookie - A tiny cookie manipulation plugin + * https://github.com/Alex1990/tiny-cookie + * Under the MIT license | (c) Alex Chao + */!function(o,a){r=a,i="function"===typeof r?r.call(e,n,e,t):r,void 0===i||(t.exports=i)}(0,(function(){"use strict";function t(e,n,r){if(void 0===n)return t.get(e);null===n?t.remove(e):t.set(e,n,r)}function e(t){return t.replace(/[.*+?^$|[\](){}\\-]/g,"\\$&")}function n(t){var e="";for(var n in t)if(t.hasOwnProperty(n)){if("expires"===n){var i=t[n];"object"!==typeof i&&(i+="number"===typeof i?"D":"",i=r(i)),t[n]=i.toUTCString()}if("secure"===n){t[n]&&(e+=";"+n);continue}e+=";"+n+"="+t[n]}return t.hasOwnProperty("path")||(e+=";path=/"),e}function r(t){var e=new Date,n=t.charAt(t.length-1),r=parseInt(t,10);switch(n){case"Y":e.setFullYear(e.getFullYear()+r);break;case"M":e.setMonth(e.getMonth()+r);break;case"D":e.setDate(e.getDate()+r);break;case"h":e.setHours(e.getHours()+r);break;case"m":e.setMinutes(e.getMinutes()+r);break;case"s":e.setSeconds(e.getSeconds()+r);break;default:e=new Date(t)}return e}return t.enabled=function(){var e,n="__test_key";return document.cookie=n+"=1",e=!!document.cookie,e&&t.remove(n),e},t.get=function(t,n){if("string"!==typeof t||!t)return null;t="(?:^|; )"+e(t)+"(?:=([^;]*?))?(?:;|$)";var r=new RegExp(t),i=r.exec(document.cookie);return null!==i?n?i[1]:decodeURIComponent(i[1]):null},t.getRaw=function(e){return t.get(e,!0)},t.set=function(t,e,r,i){!0!==r&&(i=r,r=!1),i=n(i||{});var o=t+"="+(r?e:encodeURIComponent(e))+i;document.cookie=o},t.setRaw=function(e,n,r){t.set(e,n,!0,r)},t.remove=function(e){t.set(e,"a",{expires:new Date})},t}))},"07e3":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"097d":function(t,e,n){"use strict";var r=n("5ca1"),i=n("8378"),o=n("7726"),a=n("ebd6"),s=n("bcaa");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then((function(){return n}))}:t,n?function(n){return s(e,t()).then((function(){throw n}))}:t)}})},"0a06":function(t,e,n){"use strict";var r=n("c532"),i=n("30b5"),o=n("f6b4"),a=n("5270"),s=n("4a7b"),l=n("848b"),u=l.validators;function c(t){this.defaults=t,this.interceptors={request:new o,response:new o}}c.prototype.request=function(t){"string"===typeof t?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=s(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&l.assertOptions(e,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(t){o.push(t.fulfilled,t.rejected)})),!r){var c=[a,void 0];Array.prototype.unshift.apply(c,n),c=c.concat(o),i=Promise.resolve(t);while(c.length)i=i.then(c.shift(),c.shift());return i}var h=t;while(n.length){var p=n.shift(),f=n.shift();try{h=p(h)}catch(d){f(d);break}}try{i=a(h)}catch(d){return Promise.reject(d)}while(o.length)i=i.then(o.shift(),o.shift());return i},c.prototype.getUri=function(t){return t=s(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){c.prototype[t]=function(e,n){return this.request(s(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){c.prototype[t]=function(e,n,r){return this.request(s(r||{},{method:t,url:e,data:n}))}})),t.exports=c},"0a49":function(t,e,n){var r=n("9b43"),i=n("626a"),o=n("4bf8"),a=n("9def"),s=n("cd1c");t.exports=function(t,e){var n=1==t,l=2==t,u=3==t,c=4==t,h=6==t,p=5==t||h,f=e||s;return function(e,s,d){for(var g,v,y=o(e),m=i(y),x=r(s,d,3),_=a(m.length),b=0,w=n?f(e,_):l?f(e,0):void 0;_>b;b++)if((p||b in m)&&(g=m[b],v=x(g,b,y),t))if(n)w[b]=v;else if(v)switch(t){case 3:return!0;case 5:return g;case 6:return b;case 2:w.push(g)}else if(c)return!1;return h?-1:u||c?c:w}}},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0d58":function(t,e,n){var r=n("ce10"),i=n("e11e");t.exports=Object.keys||function(t){return r(t,i)}},"0df6":function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},"0e15":function(t,e,n){var r=n("597f");t.exports=function(t,e,n){return void 0===n?r(t,e,!1):r(t,n,!1!==e)}},"0fc9":function(t,e,n){var r=n("3a38"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},1098:function(t,e,n){"use strict";e.__esModule=!0;var r=n("17ed"),i=l(r),o=n("f893"),a=l(o),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 l(t){return t&&t.__esModule?t:{default:t}}e.default="function"===typeof a.default&&"symbol"===s(i.default)?function(t){return"undefined"===typeof t?"undefined":s(t)}:function(t){return t&&"function"===typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"===typeof t?"undefined":s(t)}},1169:function(t,e,n){var r=n("2d95");t.exports=Array.isArray||function(t){return"Array"==r(t)}},1173:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"11e9":function(t,e,n){var r=n("52a7"),i=n("4630"),o=n("6821"),a=n("6a99"),s=n("69a8"),l=n("c69a"),u=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?u:function(t,e){if(t=o(t),e=a(e,!0),l)try{return u(t,e)}catch(n){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},1495:function(t,e,n){var r=n("86cc"),i=n("cb7c"),o=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){i(t);var n,a=o(e),s=a.length,l=0;while(s>l)r.f(t,n=a[l++],e[n]);return t}},1654:function(t,e,n){"use strict";var r=n("71c1")(!0);n("30f1")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},1691:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"17ed":function(t,e,n){t.exports={default:n("d8d6"),__esModule:!0}},1991:function(t,e,n){var r,i,o,a=n("9b43"),s=n("31f4"),l=n("fab2"),u=n("230e"),c=n("7726"),h=c.process,p=c.setImmediate,f=c.clearImmediate,d=c.MessageChannel,g=c.Dispatch,v=0,y={},m="onreadystatechange",x=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},_=function(t){x.call(t.data)};p&&f||(p=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return y[++v]=function(){s("function"==typeof t?t:Function(t),e)},r(v),v},f=function(t){delete y[t]},"process"==n("2d95")(h)?r=function(t){h.nextTick(a(x,t,1))}:g&&g.now?r=function(t){g.now(a(x,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(t){c.postMessage(t+"","*")},c.addEventListener("message",_,!1)):r=m in u("script")?function(t){l.appendChild(u("script"))[m]=function(){l.removeChild(this),x.call(t)}}:function(t){setTimeout(a(x,t,1),0)}),t.exports={set:p,clear:f}},"1af6":function(t,e,n){var r=n("63b6");r(r.S,"Array",{isArray:n("9003")})},"1bc3":function(t,e,n){var r=n("f772");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")}},"1c4c":function(t,e,n){"use strict";var r=n("9b43"),i=n("5ca1"),o=n("4bf8"),a=n("1fa8"),s=n("33a4"),l=n("9def"),u=n("f1ae"),c=n("27ee");i(i.S+i.F*!n("5cc5")((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,h,p=o(t),f="function"==typeof this?this:Array,d=arguments.length,g=d>1?arguments[1]:void 0,v=void 0!==g,y=0,m=c(p);if(v&&(g=r(g,d>2?arguments[2]:void 0,2)),void 0==m||f==Array&&s(m))for(e=l(p.length),n=new f(e);e>y;y++)u(n,y,v?g(p[y],y):p[y]);else for(h=m.call(p),n=new f;!(i=h.next()).done;y++)u(n,y,v?a(h,g,[i.value,y],!0):i.value);return n.length=y,n}})},"1d2b":function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r1?arguments[1]:void 0)}}),n("9c6c")(o)},"20fd":function(t,e,n){"use strict";var r=n("d9f6"),i=n("aebd");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},"214f":function(t,e,n){"use strict";n("b0c5");var r=n("2aba"),i=n("32e9"),o=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),u=s("species"),c=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),h=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var p=s(t),f=!o((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),d=f?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[u]=function(){return n}),n[p](""),!e})):void 0;if(!f||!d||"replace"===t&&!c||"split"===t&&!h){var g=/./[p],v=n(a,p,""[t],(function(t,e,n,r,i){return e.exec===l?f&&!i?{done:!0,value:g.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),y=v[0],m=v[1];r(String.prototype,t,y),i(RegExp.prototype,p,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},"21a1":function(t,e,n){(function(e){(function(e,n){t.exports=n()})(0,(function(){"use strict";"undefined"!==typeof window?window:"undefined"!==typeof e||"undefined"!==typeof self&&self;function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}var n=t((function(t,e){(function(e,n){t.exports=n()})(0,(function(){function t(t){var e=t&&"object"===typeof t;return e&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function e(t){return Array.isArray(t)?[]:{}}function n(n,r){var i=r&&!0===r.clone;return i&&t(n)?o(e(n),n,r):n}function r(e,r,i){var a=e.slice();return r.forEach((function(r,s){"undefined"===typeof a[s]?a[s]=n(r,i):t(r)?a[s]=o(e[s],r,i):-1===e.indexOf(r)&&a.push(n(r,i))})),a}function i(e,r,i){var a={};return t(e)&&Object.keys(e).forEach((function(t){a[t]=n(e[t],i)})),Object.keys(r).forEach((function(s){t(r[s])&&e[s]?a[s]=o(e[s],r[s],i):a[s]=n(r[s],i)})),a}function o(t,e,o){var a=Array.isArray(e),s=o||{arrayMerge:r},l=s.arrayMerge||r;return a?Array.isArray(t)?l(t,e,o):n(e,o):i(t,e,o)}return o.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce((function(t,n){return o(t,n,e)}))},o}))}));function r(t){return t=t||Object.create(null),{on:function(e,n){(t[e]||(t[e]=[])).push(n)},off:function(e,n){t[e]&&t[e].splice(t[e].indexOf(n)>>>0,1)},emit:function(e,n){(t[e]||[]).map((function(t){t(n)})),(t["*"]||[]).map((function(t){t(e,n)}))}}}var i=t((function(t,e){var n={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};e.default=n,t.exports=e.default})),o=function(t){return Object.keys(t).map((function(e){var n=t[e].toString().replace(/"/g,""");return e+'="'+n+'"'})).join(" ")},a=i.svg,s=i.xlink,l={};l[a.name]=a.uri,l[s.name]=s.uri;var u,c=function(t,e){void 0===t&&(t="");var r=n(l,e||{}),i=o(r);return""+t+""},h=i.svg,p=i.xlink,f={attrs:(u={style:["position: absolute","width: 0","height: 0"].join("; ")},u[h.name]=h.uri,u[p.name]=p.uri,u)},d=function(t){this.config=n(f,t||{}),this.symbols=[]};d.prototype.add=function(t){var e=this,n=e.symbols,r=this.find(t.id);return r?(n[n.indexOf(r)]=t,!1):(n.push(t),!0)},d.prototype.remove=function(t){var e=this,n=e.symbols,r=this.find(t);return!!r&&(n.splice(n.indexOf(r),1),r.destroy(),!0)},d.prototype.find=function(t){return this.symbols.filter((function(e){return e.id===t}))[0]||null},d.prototype.has=function(t){return null!==this.find(t)},d.prototype.stringify=function(){var t=this.config,e=t.attrs,n=this.symbols.map((function(t){return t.stringify()})).join("");return c(n,e)},d.prototype.toString=function(){return this.stringify()},d.prototype.destroy=function(){this.symbols.forEach((function(t){return t.destroy()}))};var g=function(t){var e=t.id,n=t.viewBox,r=t.content;this.id=e,this.viewBox=n,this.content=r};g.prototype.stringify=function(){return this.content},g.prototype.toString=function(){return this.stringify()},g.prototype.destroy=function(){var t=this;["id","viewBox","content"].forEach((function(e){return delete t[e]}))};var v=function(t){var e=!!document.importNode,n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return e?document.importNode(n,!0):n},y=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},e.createFromExistingNode=function(t){return new e({id:t.getAttribute("id"),viewBox:t.getAttribute("viewBox"),content:t.outerHTML})},e.prototype.destroy=function(){this.isMounted&&this.unmount(),t.prototype.destroy.call(this)},e.prototype.mount=function(t){if(this.isMounted)return this.node;var e="string"===typeof t?document.querySelector(t):t,n=this.render();return this.node=n,e.appendChild(n),n},e.prototype.render=function(){var t=this.stringify();return v(c(t)).childNodes[0]},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(e.prototype,n),e}(g),m={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},x=function(t){return Array.prototype.slice.call(t,0)},_=navigator.userAgent,b={isChrome:/chrome/i.test(_),isFirefox:/firefox/i.test(_),isIE:/msie/i.test(_)||/trident/i.test(_),isEdge:/edge/i.test(_)},w=function(t,e){var n=document.createEvent("CustomEvent");n.initCustomEvent(t,!1,!1,e),window.dispatchEvent(n)},S=function(t){var e=[];return x(t.querySelectorAll("style")).forEach((function(t){t.textContent+="",e.push(t)})),e},M=function(t){return(t||window.location.href).split("#")[0]},C=function(t){angular.module("ng").run(["$rootScope",function(e){e.$on("$locationChangeSuccess",(function(e,n,r){w(t,{oldUrl:r,newUrl:n})}))}])},I="linearGradient, radialGradient, pattern",T=function(t,e){return void 0===e&&(e=I),x(t.querySelectorAll("symbol")).forEach((function(t){x(t.querySelectorAll(e)).forEach((function(e){t.parentNode.insertBefore(e,t)}))})),t};function A(t,e){var n=x(t).reduce((function(t,n){if(!n.attributes)return t;var r=x(n.attributes),i=e?r.filter(e):r;return t.concat(i)}),[]);return n}var D=i.xlink.uri,k="xlink:href",L=/[{}|\\\^\[\]`"<>]/g;function O(t){return t.replace(L,(function(t){return"%"+t[0].charCodeAt(0).toString(16).toUpperCase()}))}function P(t,e,n){return x(t).forEach((function(t){var r=t.getAttribute(k);if(r&&0===r.indexOf(e)){var i=r.replace(e,n);t.setAttributeNS(D,k,i)}})),t}var E,R=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],N=R.map((function(t){return"["+t+"]"})).join(","),z=function(t,e,n,r){var i=O(n),o=O(r),a=t.querySelectorAll(N),s=A(a,(function(t){var e=t.localName,n=t.value;return-1!==R.indexOf(e)&&-1!==n.indexOf("url("+i)}));s.forEach((function(t){return t.value=t.value.replace(i,o)})),P(e,i,o)},B={MOUNT:"mount",SYMBOL_MOUNT:"symbol_mount"},V=function(t){function e(e){var i=this;void 0===e&&(e={}),t.call(this,n(m,e));var o=r();this._emitter=o,this.node=null;var a=this,s=a.config;if(s.autoConfigure&&this._autoConfigure(e),s.syncUrlsWithBaseTag){var l=document.getElementsByTagName("base")[0].getAttribute("href");o.on(B.MOUNT,(function(){return i.updateUrls("#",l)}))}var u=this._handleLocationChange.bind(this);this._handleLocationChange=u,s.listenLocationChangeEvent&&window.addEventListener(s.locationChangeEvent,u),s.locationChangeAngularEmitter&&C(s.locationChangeEvent),o.on(B.MOUNT,(function(t){s.moveGradientsOutsideSymbol&&T(t)})),o.on(B.SYMBOL_MOUNT,(function(t){s.moveGradientsOutsideSymbol&&T(t.parentNode),(b.isIE||b.isEdge)&&S(t)}))}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={isMounted:{}};return i.isMounted.get=function(){return!!this.node},e.prototype._autoConfigure=function(t){var e=this,n=e.config;"undefined"===typeof t.syncUrlsWithBaseTag&&(n.syncUrlsWithBaseTag="undefined"!==typeof document.getElementsByTagName("base")[0]),"undefined"===typeof t.locationChangeAngularEmitter&&(n.locationChangeAngularEmitter="angular"in window),"undefined"===typeof t.moveGradientsOutsideSymbol&&(n.moveGradientsOutsideSymbol=b.isFirefox)},e.prototype._handleLocationChange=function(t){var e=t.detail,n=e.oldUrl,r=e.newUrl;this.updateUrls(n,r)},e.prototype.add=function(e){var n=this,r=t.prototype.add.call(this,e);return this.isMounted&&r&&(e.mount(n.node),this._emitter.emit(B.SYMBOL_MOUNT,e.node)),r},e.prototype.attach=function(t){var e=this,n=this;if(n.isMounted)return n.node;var r="string"===typeof t?document.querySelector(t):t;return n.node=r,this.symbols.forEach((function(t){t.mount(n.node),e._emitter.emit(B.SYMBOL_MOUNT,t.node)})),x(r.querySelectorAll("symbol")).forEach((function(t){var e=y.createFromExistingNode(t);e.node=t,n.add(e)})),this._emitter.emit(B.MOUNT,r),r},e.prototype.destroy=function(){var t=this,e=t.config,n=t.symbols,r=t._emitter;n.forEach((function(t){return t.destroy()})),r.off("*"),window.removeEventListener(e.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},e.prototype.mount=function(t,e){void 0===t&&(t=this.config.mountTo),void 0===e&&(e=!1);var n=this;if(n.isMounted)return n.node;var r="string"===typeof t?document.querySelector(t):t,i=n.render();return this.node=i,e&&r.childNodes[0]?r.insertBefore(i,r.childNodes[0]):r.appendChild(i),this._emitter.emit(B.MOUNT,i),i},e.prototype.render=function(){return v(this.stringify())},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},e.prototype.updateUrls=function(t,e){if(!this.isMounted)return!1;var n=document.querySelectorAll(this.config.usagesToUpdate);return z(this.node,n,M(t)+"#",M(e)+"#"),!0},Object.defineProperties(e.prototype,i),e}(d),F=t((function(t){ +/*! + * domready (c) Dustin Diaz 2014 - License MIT + */ +!function(e,n){t.exports=n()}(0,(function(){var t,e=[],n=document,r=n.documentElement.doScroll,i="DOMContentLoaded",o=(r?/^loaded|^c/:/^loaded|^i|^c/).test(n.readyState);return o||n.addEventListener(i,t=function(){n.removeEventListener(i,t),o=1;while(t=e.shift())t()}),function(t){o?setTimeout(t,0):e.push(t)}}))})),G="__SVG_SPRITE_NODE__",H="__SVG_SPRITE__",j=!!window[H];j?E=window[H]:(E=new V({attrs:{id:G}}),window[H]=E);var W=function(){var t=document.getElementById(G);t?E.attach(t):E.mount(document.body,!0)};document.body?W():F(W);var U=E;return U}))}).call(this,n("c8ba"))},"230e":function(t,e,n){var r=n("d3f4"),i=n("7726").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},"23c6":function(t,e,n){var r=n("2d95"),i=n("2b4c")("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},"241e":function(t,e,n){var r=n("25eb");t.exports=function(t){return Object(r(t))}},2444:function(t,e,n){"use strict";(function(e){var r=n("c532"),i=n("c8af"),o=n("387f"),a={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function l(){var t;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof e&&"[object process]"===Object.prototype.toString.call(e))&&(t=n("b50d")),t}function u(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(t)}var c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:l(),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(s(e,"application/json"),u(t)):t}],transformResponse:[function(t){var e=this.transitional||c.transitional,n=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||i&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(s){if(a){if("SyntaxError"===s.name)throw o(s,this,"E_JSON_PARSE");throw s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(a)})),t.exports=c}).call(this,n("4362"))},"24c5":function(t,e,n){"use strict";var r,i,o,a,s=n("b8e3"),l=n("e53d"),u=n("d864"),c=n("40c3"),h=n("63b6"),p=n("f772"),f=n("79aa"),d=n("1173"),g=n("a22a"),v=n("f201"),y=n("4178").set,m=n("aba2")(),x=n("656e"),_=n("4439"),b=n("bc13"),w=n("cd78"),S="Promise",M=l.TypeError,C=l.process,I=C&&C.versions,T=I&&I.v8||"",A=l[S],D="process"==c(C),k=function(){},L=i=x.f,O=!!function(){try{var t=A.resolve(1),e=(t.constructor={})[n("5168")("species")]=function(t){t(k,k)};return(D||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e&&0!==T.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(r){}}(),P=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},E=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,s=i?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{s?(i||(2==t._h&&z(t),t._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&(c.exit(),a=!0)),n===e.promise?u(M("Promise-chain cycle")):(o=P(n))?o.call(n,l,u):l(n)):u(r)}catch(h){c&&!a&&c.exit(),u(h)}};while(n.length>o)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&R(t)}))}},R=function(t){y.call(l,(function(){var e,n,r,i=t._v,o=N(t);if(o&&(e=_((function(){D?C.emit("unhandledRejection",i,t):(n=l.onunhandledrejection)?n({promise:t,reason:i}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=D||N(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},N=function(t){return 1!==t._h&&0===(t._a||t._c).length},z=function(t){y.call(l,(function(){var e;D?C.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})}))},B=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),E(e,!0))},V=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw M("Promise can't be resolved itself");(e=P(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,u(V,r,1),u(B,r,1))}catch(i){B.call(r,i)}})):(n._v=t,n._s=1,E(n,!1))}catch(r){B.call({_w:n,_d:!1},r)}}};O||(A=function(t){d(this,A,S,"_h"),f(t),r.call(this);try{t(u(V,this,1),u(B,this,1))}catch(e){B.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("5c95")(A.prototype,{then:function(t,e){var n=L(v(this,A));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=D?C.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&E(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(V,t,1),this.reject=u(B,t,1)},x.f=L=function(t){return t===A||t===a?new o(t):i(t)}),h(h.G+h.W+h.F*!O,{Promise:A}),n("45f2")(A,S),n("4c95")(S),a=n("584a")[S],h(h.S+h.F*!O,S,{reject:function(t){var e=L(this),n=e.reject;return n(t),e.promise}}),h(h.S+h.F*(s||!O),S,{resolve:function(t){return w(s&&this===a?A:this,t)}}),h(h.S+h.F*!(O&&n("4ee1")((function(t){A.all(t)["catch"](k)}))),S,{all:function(t){var e=this,n=L(e),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;g(t,!1,(function(t){var s=o++,l=!1;n.push(void 0),a++,e.resolve(t).then((function(t){l||(l=!0,n[s]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=L(e),r=n.reject,i=_((function(){g(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},"25eb":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"268f":function(t,e,n){t.exports=n("fde4")},"27ee":function(t,e,n){var r=n("23c6"),i=n("2b4c")("iterator"),o=n("84f2");t.exports=n("8378").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},2877:function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var l,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=l):i&&(l=s?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},"28a5":function(t,e,n){"use strict";var r=n("aae3"),i=n("cb7c"),o=n("ebd6"),a=n("0390"),s=n("9def"),l=n("5f1b"),u=n("520a"),c=n("79e5"),h=Math.min,p=[].push,f="split",d="length",g="lastIndex",v=4294967295,y=!c((function(){RegExp(v,"y")}));n("214f")("split",2,(function(t,e,n,c){var m;return m="c"=="abbc"[f](/(b)*/)[1]||4!="test"[f](/(?:)/,-1)[d]||2!="ab"[f](/(?:ab)*/)[d]||4!="."[f](/(.?)(.?)/)[d]||"."[f](/()()/)[d]>1||""[f](/.?/)[d]?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);var o,a,s,l=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,f=void 0===e?v:e>>>0,y=new RegExp(t.source,c+"g");while(o=u.call(y,i)){if(a=y[g],a>h&&(l.push(i.slice(h,o.index)),o[d]>1&&o.index=f))break;y[g]===o.index&&y[g]++}return h===i[d]?!s&&y.test("")||l.push(""):l.push(i.slice(h)),l[d]>f?l.slice(0,f):l}:"0"[f](void 0,0)[d]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=void 0==n?void 0:n[e];return void 0!==o?o.call(n,i,r):m.call(String(i),n,r)},function(t,e){var r=c(m,t,this,e,m!==n);if(r.done)return r.value;var u=i(t),p=String(this),f=o(u,RegExp),d=u.unicode,g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(y?"y":"g"),x=new f(y?u:"^(?:"+u.source+")",g),_=void 0===e?v:e>>>0;if(0===_)return[];if(0===p.length)return null===l(x,p)?[p]:[];var b=0,w=0,S=[];while(w";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+a+"document.F=Object"+i+"/script"+a),t.close(),u=t.F;while(r--)delete u[l][o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[l]=r(t),n=new s,s[l]=null,n[a]=t):n=u(),void 0===e?n:i(n,e)}},"2b0e":function(t,e,n){"use strict";n.r(e),function(t){ +/*! + * Vue.js v2.6.10 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +var n=Object.freeze({});function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function l(t){return null!==t&&"object"===typeof t}var u=Object.prototype.toString;function c(t){return"[object Object]"===u.call(t)}function h(t){return"[object RegExp]"===u.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return i(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function d(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function g(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var x=Object.prototype.hasOwnProperty;function _(t,e){return x.call(t,e)}function b(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}var w=/-(\w)/g,S=b((function(t){return t.replace(w,(function(t,e){return e?e.toUpperCase():""}))})),M=b((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),C=/\B([A-Z])/g,I=b((function(t){return t.replace(C,"-$1").toLowerCase()}));function T(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function A(t,e){return t.bind(e)}var D=Function.prototype.bind?A:T;function k(t,e){e=e||0;var n=t.length-e,r=new Array(n);while(n--)r[n]=t[n+e];return r}function L(t,e){for(var n in e)t[n]=e[n];return t}function O(t){for(var e={},n=0;n0,nt=Q&&Q.indexOf("edge/")>0,rt=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===J),it=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),ot={}.watch,at=!1;if(Z)try{var st={};Object.defineProperty(st,"passive",{get:function(){at=!0}}),window.addEventListener("test-passive",null,st)}catch(Sa){}var lt=function(){return void 0===Y&&(Y=!Z&&!K&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),Y},ut=Z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"===typeof t&&/native code/.test(t.toString())}var ht,pt="undefined"!==typeof Symbol&&ct(Symbol)&&"undefined"!==typeof Reflect&&ct(Reflect.ownKeys);ht="undefined"!==typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ft=P,dt=0,gt=function(){this.id=dt++,this.subs=[]};gt.prototype.addSub=function(t){this.subs.push(t)},gt.prototype.removeSub=function(t){m(this.subs,t)},gt.prototype.depend=function(){gt.target&>.target.addDep(this)},gt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!_(i,"default"))a=!1;else if(""===a||a===I(t)){var l=te(String,i.type);(l<0||s0&&(a=Te(a,(e||"")+"_"+n),Ie(a[0])&&Ie(u)&&(c[l]=wt(u.text+a[0].text),a.shift()),c.push.apply(c,a)):s(a)?Ie(u)?c[l]=wt(u.text+a):""!==a&&c.push(wt(a)):Ie(a)&&Ie(u)?c[l]=wt(u.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),c.push(a)));return c}function Ae(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function De(t){var e=ke(t.$options.inject,t);e&&(Dt(!1),Object.keys(e).forEach((function(n){Et(t,n,e[n])})),Dt(!0))}function ke(t,e){if(t){for(var n=Object.create(null),r=pt?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==n&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=Ee(e,l,t[l]))}else i={};for(var u in e)u in i||(i[u]=Re(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),U(i,"$stable",a),U(i,"$key",s),U(i,"$hasNormal",o),i}function Ee(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Ce(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function Re(t,e){return function(){return t[e]}}function Ne(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),r=0,o=t.length;r1?k(n):n;for(var r=k(arguments,1),i='event handler for "'+t+'"',o=0,a=n.length;odocument.createEvent("Event").timeStamp&&(Yn=function(){return $n.now()})}function Zn(){var t,e;for(Xn=Yn(),Wn=!0,Fn.sort((function(t,e){return t.id-e.id})),Un=0;UnUn&&Fn[n].id>t.id)n--;Fn.splice(n+1,0,t)}else Fn.push(t);jn||(jn=!0,de(Zn))}}var er=0,nr=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++er,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ht,this.newDepIds=new ht,this.expression="","function"===typeof e?this.getter=e:(this.getter=X(e),this.getter||(this.getter=P)),this.value=this.lazy?void 0:this.get()};nr.prototype.get=function(){var t;yt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(Sa){if(!this.user)throw Sa;ee(Sa,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ve(t),mt(),this.cleanupDeps()}return t},nr.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},nr.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},nr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():tr(this)},nr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(Sa){ee(Sa,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},nr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},nr.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},nr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||m(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var rr={enumerable:!0,configurable:!0,get:P,set:P};function ir(t,e,n){rr.get=function(){return this[e][n]},rr.set=function(t){this[e][n]=t},Object.defineProperty(t,n,rr)}function or(t){t._watchers=[];var e=t.$options;e.props&&ar(t,e.props),e.methods&&dr(t,e.methods),e.data?sr(t):Pt(t._data={},!0),e.computed&&cr(t,e.computed),e.watch&&e.watch!==ot&&gr(t,e.watch)}function ar(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;o||Dt(!1);var a=function(o){i.push(o);var a=Zt(o,e,n,t);Et(r,o,a),o in t||ir(t,"_props",o)};for(var s in e)a(s);Dt(!0)}function sr(t){var e=t.$options.data;e=t._data="function"===typeof e?lr(e,t):e||{},c(e)||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);while(i--){var o=n[i];0,r&&_(r,o)||W(o)||ir(t,"_data",o)}Pt(e,!0)}function lr(t,e){yt();try{return t.call(e,e)}catch(Sa){return ee(Sa,e,"data()"),{}}finally{mt()}}var ur={lazy:!0};function cr(t,e){var n=t._computedWatchers=Object.create(null),r=lt();for(var i in e){var o=e[i],a="function"===typeof o?o:o.get;0,r||(n[i]=new nr(t,a||P,P,ur)),i in t||hr(t,i,o)}}function hr(t,e,n){var r=!lt();"function"===typeof n?(rr.get=r?pr(e):fr(n),rr.set=P):(rr.get=n.get?r&&!1!==n.cache?pr(e):fr(n.get):P,rr.set=n.set||P),Object.defineProperty(t,e,rr)}function pr(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),gt.target&&e.depend(),e.value}}function fr(t){return function(){return t.call(this,this)}}function dr(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?P:D(e[n],t)}function gr(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i-1)return this;var n=k(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Cr(t){t.mixin=function(t){return this.options=Yt(this.options,t),this}}function Ir(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name;var a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=Yt(n.options,t),a["super"]=n,a.options.props&&Tr(a),a.options.computed&&Ar(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,F.forEach((function(t){a[t]=n[t]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=L({},a.options),i[r]=a,a}}function Tr(t){var e=t.options.props;for(var n in e)ir(t.prototype,"_props",n)}function Ar(t){var e=t.options.computed;for(var n in e)hr(t.prototype,n,e[n])}function Dr(t){F.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function kr(t){return t&&(t.Ctor.options.name||t.tag)}function Lr(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!h(t)&&t.test(e)}function Or(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=kr(a.componentOptions);s&&!e(s)&&Pr(n,o,r,i)}}}function Pr(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,m(n,e)}xr(Sr),yr(Sr),Dn(Sr),Pn(Sr),mn(Sr);var Er=[String,RegExp,Array],Rr={name:"keep-alive",abstract:!0,props:{include:Er,exclude:Er,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Pr(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Or(t,(function(t){return Lr(e,t)}))})),this.$watch("exclude",(function(e){Or(t,(function(t){return!Lr(e,t)}))}))},render:function(){var t=this.$slots.default,e=Sn(t),n=e&&e.componentOptions;if(n){var r=kr(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Lr(o,r))||a&&r&&Lr(a,r))return e;var s=this,l=s.cache,u=s.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;l[c]?(e.componentInstance=l[c].componentInstance,m(u,c),u.push(c)):(l[c]=e,u.push(c),this.max&&u.length>parseInt(this.max)&&Pr(l,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Nr={KeepAlive:Rr};function zr(t){var e={get:function(){return H}};Object.defineProperty(t,"config",e),t.util={warn:ft,extend:L,mergeOptions:Yt,defineReactive:Et},t.set=Rt,t.delete=Nt,t.nextTick=de,t.observable=function(t){return Pt(t),t},t.options=Object.create(null),F.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,L(t.options.components,Nr),Mr(t),Cr(t),Ir(t),Dr(t)}zr(Sr),Object.defineProperty(Sr.prototype,"$isServer",{get:lt}),Object.defineProperty(Sr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Sr,"FunctionalRenderContext",{value:Ke}),Sr.version="2.6.10";var Br=v("style,class"),Vr=v("input,textarea,option,select,progress"),Fr=function(t,e,n){return"value"===n&&Vr(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Gr=v("contenteditable,draggable,spellcheck"),Hr=v("events,caret,typing,plaintext-only"),jr=function(t,e){return Yr(e)||"false"===e?"false":"contenteditable"===t&&Hr(e)?e:"true"},Wr=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ur="http://www.w3.org/1999/xlink",qr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Xr=function(t){return qr(t)?t.slice(6,t.length):""},Yr=function(t){return null==t||!1===t};function $r(t){var e=t.data,n=t,r=t;while(i(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(e=Zr(r.data,e));while(i(n=n.parent))n&&n.data&&(e=Zr(e,n.data));return Kr(e.staticClass,e.class)}function Zr(t,e){return{staticClass:Jr(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Kr(t,e){return i(t)||i(e)?Jr(t,Qr(e)):""}function Jr(t,e){return t?e?t+" "+e:t:e||""}function Qr(t){return Array.isArray(t)?ti(t):l(t)?ei(t):"string"===typeof t?t:""}function ti(t){for(var e,n="",r=0,o=t.length;r-1?si[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:si[t]=/HTMLUnknownElement/.test(e.toString())}var ui=v("text,number,password,search,email,tel,url");function ci(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function hi(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function pi(t,e){return document.createElementNS(ni[t],e)}function fi(t){return document.createTextNode(t)}function di(t){return document.createComment(t)}function gi(t,e,n){t.insertBefore(e,n)}function vi(t,e){t.removeChild(e)}function yi(t,e){t.appendChild(e)}function mi(t){return t.parentNode}function xi(t){return t.nextSibling}function _i(t){return t.tagName}function bi(t,e){t.textContent=e}function wi(t,e){t.setAttribute(e,"")}var Si=Object.freeze({createElement:hi,createElementNS:pi,createTextNode:fi,createComment:di,insertBefore:gi,removeChild:vi,appendChild:yi,parentNode:mi,nextSibling:xi,tagName:_i,setTextContent:bi,setStyleScope:wi}),Mi={create:function(t,e){Ci(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Ci(t,!0),Ci(e))},destroy:function(t){Ci(t,!0)}};function Ci(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?m(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var Ii=new xt("",{},[]),Ti=["create","activate","update","remove","destroy"];function Ai(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&Di(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function Di(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||ui(r)&&ui(o)}function ki(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function Li(t){var e,n,a={},l=t.modules,u=t.nodeOps;for(e=0;eg?(h=r(n[m+1])?null:n[m+1].elm,S(t,h,n,d,m,o)):d>m&&C(t,e,p,g)}function A(t,e,n,r){for(var o=n;o-1?Hi(t,e,n):Wr(e)?Yr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Gr(e)?t.setAttribute(e,jr(e,n)):qr(e)?Yr(n)?t.removeAttributeNS(Ur,Xr(e)):t.setAttributeNS(Ur,e,n):Hi(t,e,n)}function Hi(t,e,n){if(Yr(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var ji={create:Fi,update:Fi};function Wi(t,e){var n=e.elm,o=e.data,a=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=$r(e),l=n._transitionClasses;i(l)&&(s=Jr(s,Qr(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Ui,qi={create:Wi,update:Wi},Xi="__r",Yi="__c";function $i(t){if(i(t[Xi])){var e=tt?"change":"input";t[e]=[].concat(t[Xi],t[e]||[]),delete t[Xi]}i(t[Yi])&&(t.change=[].concat(t[Yi],t.change||[]),delete t[Yi])}function Zi(t,e,n){var r=Ui;return function i(){var o=e.apply(null,arguments);null!==o&&Qi(t,i,n,r)}}var Ki=ae&&!(it&&Number(it[1])<=53);function Ji(t,e,n,r){if(Ki){var i=Xn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Ui.addEventListener(t,e,at?{capture:n,passive:r}:n)}function Qi(t,e,n,r){(r||Ui).removeEventListener(t,e._wrapper||e,n)}function to(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Ui=e.elm,$i(n),_e(n,i,Ji,Qi,Zi,e.context),Ui=void 0}}var eo,no={create:to,update:to};function ro(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},l=e.data.domProps||{};for(n in i(l.__ob__)&&(l=e.data.domProps=L({},l)),s)n in l||(a[n]="");for(n in l){if(o=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=o;var u=r(o)?"":String(o);io(a,u)&&(a.value=u)}else if("innerHTML"===n&&ii(a.tagName)&&r(a.innerHTML)){eo=eo||document.createElement("div"),eo.innerHTML=""+o+"";var c=eo.firstChild;while(a.firstChild)a.removeChild(a.firstChild);while(c.firstChild)a.appendChild(c.firstChild)}else if(o!==s[n])try{a[n]=o}catch(Sa){}}}}function io(t,e){return!t.composing&&("OPTION"===t.tagName||oo(t,e)||ao(t,e))}function oo(t,e){var n=!0;try{n=document.activeElement!==t}catch(Sa){}return n&&t.value!==e}function ao(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return g(n)!==g(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}var so={create:ro,update:ro},lo=b((function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function uo(t){var e=co(t.style);return t.staticStyle?L(t.staticStyle,e):e}function co(t){return Array.isArray(t)?O(t):"string"===typeof t?lo(t):t}function ho(t,e){var n,r={};if(e){var i=t;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(n=uo(i.data))&&L(r,n)}(n=uo(t.data))&&L(r,n);var o=t;while(o=o.parent)o.data&&(n=uo(o.data))&&L(r,n);return r}var po,fo=/^--/,go=/\s*!important$/,vo=function(t,e,n){if(fo.test(e))t.style.setProperty(e,n);else if(go.test(n))t.style.setProperty(I(e),n.replace(go,""),"important");else{var r=mo(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(bo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function So(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(bo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function Mo(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&L(e,Co(t.name||"v")),L(e,t),e}return"string"===typeof t?Co(t):void 0}}var Co=b((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Io=Z&&!et,To="transition",Ao="animation",Do="transition",ko="transitionend",Lo="animation",Oo="animationend";Io&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Do="WebkitTransition",ko="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Lo="WebkitAnimation",Oo="webkitAnimationEnd"));var Po=Z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Eo(t){Po((function(){Po(t)}))}function Ro(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),wo(t,e))}function No(t,e){t._transitionClasses&&m(t._transitionClasses,e),So(t,e)}function zo(t,e,n){var r=Vo(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===To?ko:Oo,l=0,u=function(){t.removeEventListener(s,c),n()},c=function(e){e.target===t&&++l>=a&&u()};setTimeout((function(){l0&&(n=To,c=a,h=o.length):e===Ao?u>0&&(n=Ao,c=u,h=l.length):(c=Math.max(a,u),n=c>0?a>u?To:Ao:null,h=n?n===To?o.length:l.length:0);var p=n===To&&Bo.test(r[Do+"Property"]);return{type:n,timeout:c,propCount:h,hasTransform:p}}function Fo(t,e){while(t.length1}function qo(t,e){!0!==e.data.show&&Ho(e)}var Xo=Z?{create:qo,activate:qo,remove:function(t,e){!0!==t.data.show?jo(t,e):e()}}:{},Yo=[ji,qi,no,so,_o,Xo],$o=Yo.concat(Vi),Zo=Li({nodeOps:Si,modules:$o});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&ia(t,"input")}));var Ko={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?be(n,"postpatch",(function(){Ko.componentUpdated(t,e,n)})):Jo(t,e,n.context),t._vOptions=[].map.call(t.options,ea)):("textarea"===n.tag||ui(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",na),t.addEventListener("compositionend",ra),t.addEventListener("change",ra),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Jo(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,ea);if(i.some((function(t,e){return!N(t,r[e])}))){var o=t.multiple?e.value.some((function(t){return ta(t,i)})):e.value!==e.oldValue&&ta(e.value,i);o&&ia(t,"change")}}}};function Jo(t,e,n){Qo(t,e,n),(tt||nt)&&setTimeout((function(){Qo(t,e,n)}),0)}function Qo(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,l=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(N(ea(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function ta(t,e){return e.every((function(e){return!N(e,t)}))}function ea(t){return"_value"in t?t._value:t.value}function na(t){t.target.composing=!0}function ra(t){t.target.composing&&(t.target.composing=!1,ia(t.target,"input"))}function ia(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function oa(t){return!t.componentInstance||t.data&&t.data.transition?t:oa(t.componentInstance._vnode)}var aa={bind:function(t,e,n){var r=e.value;n=oa(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Ho(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value,i=e.oldValue;if(!r!==!i){n=oa(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?Ho(n,(function(){t.style.display=t.__vOriginalDisplay})):jo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},sa={model:Ko,show:aa},la={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ua(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ua(Sn(e.children)):t}function ca(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[S(o)]=i[o];return e}function ha(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function pa(t){while(t=t.parent)if(t.data.transition)return!0}function fa(t,e){return e.key===t.key&&e.tag===t.tag}var da=function(t){return t.tag||wn(t)},ga=function(t){return"show"===t.name},va={name:"transition",props:la,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(da),n.length)){0;var r=this.mode;0;var i=n[0];if(pa(this.$vnode))return i;var o=ua(i);if(!o)return i;if(this._leaving)return ha(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var l=(o.data||(o.data={})).transition=ca(this),u=this._vnode,c=ua(u);if(o.data.directives&&o.data.directives.some(ga)&&(o.data.show=!0),c&&c.data&&!fa(o,c)&&!wn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var h=c.data.transition=L({},l);if("out-in"===r)return this._leaving=!0,be(h,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),ha(t,i);if("in-out"===r){if(wn(o))return u;var p,f=function(){p()};be(l,"afterEnter",f),be(l,"enterCancelled",f),be(h,"delayLeave",(function(t){p=t}))}}return i}}},ya=L({tag:String,moveClass:String},la);delete ya.mode;var ma={props:ya,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Ln(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=ca(this),s=0;s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,c=!0,h=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){h=!0,s=t},f:function(){try{c||null==n["return"]||n["return"]()}finally{if(h)throw s}}}}},"2d83":function(t,e,n){"use strict";var r=n("387f");t.exports=function(t,e,n,i,o){var a=new Error(t);return r(a,e,n,i,o)}},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"2e67":function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},"2f62":function(t,e,n){"use strict"; +/** + * vuex v3.1.0 + * (c) 2019 Evan You + * @license MIT + */ +function r(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}n.d(e,"c",(function(){return D})),n.d(e,"b",(function(){return L}));var i="undefined"!==typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function o(t){i&&(t._devtoolHook=i,i.emit("vuex:init",t),i.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){i.emit("vuex:mutation",t,e)})))}function a(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function s(t){return null!==t&&"object"===typeof t}function l(t){return t&&"function"===typeof t.then}var u=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"===typeof n?n():n)||{}},c={namespaced:{configurable:!0}};c.namespaced.get=function(){return!!this._rawModule.namespaced},u.prototype.addChild=function(t,e){this._children[t]=e},u.prototype.removeChild=function(t){delete this._children[t]},u.prototype.getChild=function(t){return this._children[t]},u.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},u.prototype.forEachChild=function(t){a(this._children,t)},u.prototype.forEachGetter=function(t){this._rawModule.getters&&a(this._rawModule.getters,t)},u.prototype.forEachAction=function(t){this._rawModule.actions&&a(this._rawModule.actions,t)},u.prototype.forEachMutation=function(t){this._rawModule.mutations&&a(this._rawModule.mutations,t)},Object.defineProperties(u.prototype,c);var h=function(t){this.register([],t,!1)};function p(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return void 0;p(t.concat(r),e.getChild(r),n.modules[r])}}h.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},h.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return e=e.getChild(n),t+(e.namespaced?n+"/":"")}),"")},h.prototype.update=function(t){p([],this.root,t)},h.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var i=new u(e,n);if(0===t.length)this.root=i;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],i)}e.modules&&a(e.modules,(function(e,i){r.register(t.concat(i),e,n)}))},h.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];e.getChild(n).runtime&&e.removeChild(n)};var f;var d=function(t){var e=this;void 0===t&&(t={}),!f&&"undefined"!==typeof window&&window.Vue&&A(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new h(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new f;var i=this,a=this,s=a.dispatch,l=a.commit;this.dispatch=function(t,e){return s.call(i,t,e)},this.commit=function(t,e,n){return l.call(i,t,e,n)},this.strict=r;var u=this._modules.root.state;x(this,u,[],this._modules.root),m(this,u),n.forEach((function(t){return t(e)}));var c=void 0!==t.devtools?t.devtools:f.config.devtools;c&&o(this)},g={state:{configurable:!0}};function v(t,e){return e.indexOf(t)<0&&e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function y(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;x(t,n,[],t._modules.root,!0),m(t,n,e)}function m(t,e,n){var r=t._vm;t.getters={};var i=t._wrappedGetters,o={};a(i,(function(e,n){o[n]=function(){return e(t)},Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=f.config.silent;f.config.silent=!0,t._vm=new f({data:{$$state:e},computed:o}),f.config.silent=s,t.strict&&C(t),r&&(n&&t._withCommit((function(){r._data.$$state=null})),f.nextTick((function(){return r.$destroy()})))}function x(t,e,n,r,i){var o=!n.length,a=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[a]=r),!o&&!i){var s=I(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){f.set(s,l,r.state)}))}var u=r.context=_(t,a,n);r.forEachMutation((function(e,n){var r=a+n;w(t,r,e,u)})),r.forEachAction((function(e,n){var r=e.root?n:a+n,i=e.handler||e;S(t,r,i,u)})),r.forEachGetter((function(e,n){var r=a+n;M(t,r,e,u)})),r.forEachChild((function(r,o){x(t,e,n.concat(o),r,i)}))}function _(t,e,n){var r=""===e,i={dispatch:r?t.dispatch:function(n,r,i){var o=T(n,r,i),a=o.payload,s=o.options,l=o.type;return s&&s.root||(l=e+l),t.dispatch(l,a)},commit:r?t.commit:function(n,r,i){var o=T(n,r,i),a=o.payload,s=o.options,l=o.type;s&&s.root||(l=e+l),t.commit(l,a,s)}};return Object.defineProperties(i,{getters:{get:r?function(){return t.getters}:function(){return b(t,e)}},state:{get:function(){return I(t.state,n)}}}),i}function b(t,e){var n={},r=e.length;return Object.keys(t.getters).forEach((function(i){if(i.slice(0,r)===e){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return t.getters[i]},enumerable:!0})}})),n}function w(t,e,n,r){var i=t._mutations[e]||(t._mutations[e]=[]);i.push((function(e){n.call(t,r.state,e)}))}function S(t,e,n,r){var i=t._actions[e]||(t._actions[e]=[]);i.push((function(e,i){var o=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e,i);return l(o)||(o=Promise.resolve(o)),t._devtoolHook?o.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):o}))}function M(t,e,n,r){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)})}function C(t){t._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function I(t,e){return e.length?e.reduce((function(t,e){return t[e]}),t):t}function T(t,e,n){return s(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function A(t){f&&t===f||(f=t,r(f))}g.state.get=function(){return this._vm._data.$$state},g.state.set=function(t){0},d.prototype.commit=function(t,e,n){var r=this,i=T(t,e,n),o=i.type,a=i.payload,s=(i.options,{type:o,payload:a}),l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(t){t(a)}))})),this._subscribers.forEach((function(t){return t(s,r.state)})))},d.prototype.dispatch=function(t,e){var n=this,r=T(t,e),i=r.type,o=r.payload,a={type:i,payload:o},s=this._actions[i];if(s){try{this._actionSubscribers.filter((function(t){return t.before})).forEach((function(t){return t.before(a,n.state)}))}catch(u){0}var l=s.length>1?Promise.all(s.map((function(t){return t(o)}))):s[0](o);return l.then((function(t){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(a,n.state)}))}catch(u){0}return t}))}},d.prototype.subscribe=function(t){return v(t,this._subscribers)},d.prototype.subscribeAction=function(t){var e="function"===typeof t?{before:t}:t;return v(e,this._actionSubscribers)},d.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},d.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},d.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),x(this,this.state,t,this._modules.get(t),n.preserveState),m(this,this.state)},d.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=I(e.state,t.slice(0,-1));f.delete(n,t[t.length-1])})),y(this)},d.prototype.hotUpdate=function(t){this._modules.update(t),y(this,!0)},d.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(d.prototype,g);var D=R((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=N(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"===typeof i?i.call(this,e,n):e[i]},n[r].vuex=!0})),n})),k=R((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var r=this.$store.commit;if(t){var o=N(this.$store,"mapMutations",t);if(!o)return;r=o.context.commit}return"function"===typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n})),L=R((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,i=e.val;i=t+i,n[r]=function(){if(!t||N(this.$store,"mapGetters",t))return this.$store.getters[i]},n[r].vuex=!0})),n})),O=R((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var o=N(this.$store,"mapActions",t);if(!o)return;r=o.context.dispatch}return"function"===typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n})),P=function(t){return{mapState:D.bind(null,t),mapGetters:L.bind(null,t),mapMutations:k.bind(null,t),mapActions:O.bind(null,t)}};function E(t){return Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}}))}function R(t){return function(e,n){return"string"!==typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function N(t,e,n){var r=t._modulesNamespaceMap[n];return r}var z={Store:d,install:A,version:"3.1.0",mapState:D,mapMutations:k,mapGetters:L,mapActions:O,createNamespacedHelpers:P};e["a"]=z},"2fdb":function(t,e,n){"use strict";var r=n("5ca1"),i=n("d2c8"),o="includes";r(r.P+r.F*n("5147")(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},3024:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},"30b5":function(t,e,n){"use strict";var r=n("c532");function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var a=[];r.forEach(e,(function(t,e){null!==t&&"undefined"!==typeof t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(i(e)+"="+i(t))})))})),o=a.join("&")}if(o){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},"30f1":function(t,e,n){"use strict";var r=n("b8e3"),i=n("63b6"),o=n("9138"),a=n("35e8"),s=n("481b"),l=n("8f60"),u=n("45f2"),c=n("53e2"),h=n("5168")("iterator"),p=!([].keys&&"next"in[].keys()),f="@@iterator",d="keys",g="values",v=function(){return this};t.exports=function(t,e,n,y,m,x,_){l(n,e,y);var b,w,S,M=function(t){if(!p&&t in A)return A[t];switch(t){case d:return function(){return new n(this,t)};case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},C=e+" Iterator",I=m==g,T=!1,A=t.prototype,D=A[h]||A[f]||m&&A[m],k=D||M(m),L=m?I?M("entries"):k:void 0,O="Array"==e&&A.entries||D;if(O&&(S=c(O.call(new t)),S!==Object.prototype&&S.next&&(u(S,C,!0),r||"function"==typeof S[h]||a(S,h,v))),I&&D&&D.name!==g&&(T=!0,k=function(){return D.call(this)}),r&&!_||!p&&!T&&A[h]||a(A,h,k),s[e]=k,s[C]=v,m)if(b={values:I?k:M(g),keys:x?k:M(d),entries:L},_)for(w in b)w in A||o(A,w,b[w]);else i(i.P+i.F*(p||T),e,b);return b}},"313e":function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"$override",(function(){return N})),n.d(r,"guid",(function(){return B})),n.d(r,"logError",(function(){return V})),n.d(r,"clone",(function(){return F})),n.d(r,"merge",(function(){return G})),n.d(r,"mergeAll",(function(){return H})),n.d(r,"extend",(function(){return j})),n.d(r,"defaults",(function(){return W})),n.d(r,"createCanvas",(function(){return U})),n.d(r,"indexOf",(function(){return q})),n.d(r,"inherits",(function(){return X})),n.d(r,"mixin",(function(){return Y})),n.d(r,"isArrayLike",(function(){return $})),n.d(r,"each",(function(){return Z})),n.d(r,"map",(function(){return K})),n.d(r,"reduce",(function(){return J})),n.d(r,"filter",(function(){return Q})),n.d(r,"find",(function(){return tt})),n.d(r,"keys",(function(){return et})),n.d(r,"bind",(function(){return rt})),n.d(r,"curry",(function(){return it})),n.d(r,"isArray",(function(){return ot})),n.d(r,"isFunction",(function(){return at})),n.d(r,"isString",(function(){return st})),n.d(r,"isStringSafe",(function(){return lt})),n.d(r,"isNumber",(function(){return ut})),n.d(r,"isObject",(function(){return ct})),n.d(r,"isBuiltInObject",(function(){return ht})),n.d(r,"isTypedArray",(function(){return pt})),n.d(r,"isDom",(function(){return ft})),n.d(r,"isGradientObject",(function(){return dt})),n.d(r,"isImagePatternObject",(function(){return gt})),n.d(r,"isRegExp",(function(){return vt})),n.d(r,"eqNaN",(function(){return yt})),n.d(r,"retrieve",(function(){return mt})),n.d(r,"retrieve2",(function(){return xt})),n.d(r,"retrieve3",(function(){return _t})),n.d(r,"slice",(function(){return bt})),n.d(r,"normalizeCssArray",(function(){return wt})),n.d(r,"assert",(function(){return St})),n.d(r,"trim",(function(){return Mt})),n.d(r,"setAsPrimitive",(function(){return It})),n.d(r,"isPrimitive",(function(){return Tt})),n.d(r,"HashMap",(function(){return At})),n.d(r,"createHashMap",(function(){return Dt})),n.d(r,"concatArray",(function(){return kt})),n.d(r,"createObject",(function(){return Lt})),n.d(r,"hasOwn",(function(){return Ot})),n.d(r,"noop",(function(){return Pt}));var i={};n.r(i),n.d(i,"create",(function(){return Et})),n.d(i,"copy",(function(){return Rt})),n.d(i,"clone",(function(){return Nt})),n.d(i,"set",(function(){return zt})),n.d(i,"add",(function(){return Bt})),n.d(i,"scaleAndAdd",(function(){return Vt})),n.d(i,"sub",(function(){return Ft})),n.d(i,"len",(function(){return Gt})),n.d(i,"length",(function(){return Ht})),n.d(i,"lenSquare",(function(){return jt})),n.d(i,"lengthSquare",(function(){return Wt})),n.d(i,"mul",(function(){return Ut})),n.d(i,"div",(function(){return qt})),n.d(i,"dot",(function(){return Xt})),n.d(i,"scale",(function(){return Yt})),n.d(i,"normalize",(function(){return $t})),n.d(i,"distance",(function(){return Zt})),n.d(i,"dist",(function(){return Kt})),n.d(i,"distanceSquare",(function(){return Jt})),n.d(i,"distSquare",(function(){return Qt})),n.d(i,"negate",(function(){return te})),n.d(i,"lerp",(function(){return ee})),n.d(i,"applyTransform",(function(){return ne})),n.d(i,"min",(function(){return re})),n.d(i,"max",(function(){return ie}));var o={};n.r(o),n.d(o,"parse",(function(){return En})),n.d(o,"lift",(function(){return zn})),n.d(o,"toHex",(function(){return Bn})),n.d(o,"fastLerp",(function(){return Vn})),n.d(o,"fastMapToColor",(function(){return Fn})),n.d(o,"lerp",(function(){return Gn})),n.d(o,"mapToColor",(function(){return Hn})),n.d(o,"modifyHSL",(function(){return jn})),n.d(o,"modifyAlpha",(function(){return Wn})),n.d(o,"stringify",(function(){return Un})),n.d(o,"lum",(function(){return qn})),n.d(o,"random",(function(){return Xn}));var a={};n.r(a),n.d(a,"create",(function(){return Gr})),n.d(a,"identity",(function(){return Hr})),n.d(a,"copy",(function(){return jr})),n.d(a,"mul",(function(){return Wr})),n.d(a,"translate",(function(){return Ur})),n.d(a,"rotate",(function(){return qr})),n.d(a,"scale",(function(){return Xr})),n.d(a,"invert",(function(){return Yr})),n.d(a,"clone",(function(){return $r}));var s={};n.r(s),n.d(s,"init",(function(){return Ji})),n.d(s,"dispose",(function(){return Qi})),n.d(s,"disposeAll",(function(){return to})),n.d(s,"getInstance",(function(){return eo})),n.d(s,"registerPainter",(function(){return no})),n.d(s,"version",(function(){return ro}));var l={};n.r(l),n.d(l,"updateProps",(function(){return Ec})),n.d(l,"initProps",(function(){return Rc})),n.d(l,"removeElement",(function(){return zc})),n.d(l,"removeElementWithFadeOut",(function(){return Vc})),n.d(l,"isElementRemoved",(function(){return Nc})),n.d(l,"extendShape",(function(){return dx})),n.d(l,"extendPath",(function(){return vx})),n.d(l,"registerShape",(function(){return yx})),n.d(l,"getShapeClass",(function(){return mx})),n.d(l,"makePath",(function(){return xx})),n.d(l,"makeImage",(function(){return _x})),n.d(l,"mergePath",(function(){return Sx})),n.d(l,"resizePath",(function(){return Mx})),n.d(l,"subPixelOptimizeLine",(function(){return Cx})),n.d(l,"subPixelOptimizeRect",(function(){return Ix})),n.d(l,"subPixelOptimize",(function(){return Tx})),n.d(l,"getTransform",(function(){return Ax})),n.d(l,"applyTransform",(function(){return Dx})),n.d(l,"transformDirection",(function(){return kx})),n.d(l,"groupTransition",(function(){return Px})),n.d(l,"clipPointsByRect",(function(){return Ex})),n.d(l,"clipRectByRect",(function(){return Rx})),n.d(l,"createIcon",(function(){return Nx})),n.d(l,"linePolygonIntersect",(function(){return zx})),n.d(l,"lineLineIntersect",(function(){return Bx})),n.d(l,"setTooltipConfig",(function(){return Gx})),n.d(l,"Group",(function(){return Ui})),n.d(l,"Image",(function(){return Yl})),n.d(l,"Text",(function(){return yu})),n.d(l,"Circle",(function(){return Fy})),n.d(l,"Ellipse",(function(){return pm})),n.d(l,"Sector",(function(){return Dm})),n.d(l,"Ring",(function(){return Om})),n.d(l,"Polygon",(function(){return Vm})),n.d(l,"Polyline",(function(){return Hm})),n.d(l,"Rect",(function(){return ru})),n.d(l,"Line",(function(){return zy})),n.d(l,"BezierCurve",(function(){return Xm})),n.d(l,"Arc",(function(){return Xv})),n.d(l,"IncrementalDisplayable",(function(){return cx})),n.d(l,"CompoundPath",(function(){return $m})),n.d(l,"LinearGradient",(function(){return Qm})),n.d(l,"RadialGradient",(function(){return ex})),n.d(l,"BoundingRect",(function(){return xi})),n.d(l,"OrientedBoundingRect",(function(){return sx})),n.d(l,"Point",(function(){return ui})),n.d(l,"Path",(function(){return Fl}));var u={};n.r(u),n.d(u,"createList",(function(){return sI})),n.d(u,"getLayoutRect",(function(){return Rp})),n.d(u,"createDimensions",(function(){return xM})),n.d(u,"dataStack",(function(){return lI})),n.d(u,"createSymbol",(function(){return Kx})),n.d(u,"createScale",(function(){return uI})),n.d(u,"mixinAxisModelCommonMethods",(function(){return cI})),n.d(u,"getECData",(function(){return mu})),n.d(u,"enableHoverEmphasis",(function(){return xc})),n.d(u,"createTextStyle",(function(){return hI}));var c={};n.r(c),n.d(c,"linearMap",(function(){return so})),n.d(c,"round",(function(){return uo})),n.d(c,"asc",(function(){return co})),n.d(c,"getPrecision",(function(){return ho})),n.d(c,"getPrecisionSafe",(function(){return po})),n.d(c,"getPixelPrecision",(function(){return fo})),n.d(c,"getPercentWithPrecision",(function(){return go})),n.d(c,"MAX_SAFE_INTEGER",(function(){return yo})),n.d(c,"remRadian",(function(){return mo})),n.d(c,"isRadianAroundZero",(function(){return xo})),n.d(c,"parseDate",(function(){return bo})),n.d(c,"quantity",(function(){return wo})),n.d(c,"quantityExponent",(function(){return So})),n.d(c,"nice",(function(){return Mo})),n.d(c,"quantile",(function(){return Co})),n.d(c,"reformIntervals",(function(){return Io})),n.d(c,"isNumeric",(function(){return Ao})),n.d(c,"numericToNumber",(function(){return To}));var h={};n.r(h),n.d(h,"parse",(function(){return bo})),n.d(h,"format",(function(){return Yh}));var p={};n.r(p),n.d(p,"extendShape",(function(){return dx})),n.d(p,"extendPath",(function(){return vx})),n.d(p,"makePath",(function(){return xx})),n.d(p,"makeImage",(function(){return _x})),n.d(p,"mergePath",(function(){return Sx})),n.d(p,"resizePath",(function(){return Mx})),n.d(p,"createIcon",(function(){return Nx})),n.d(p,"updateProps",(function(){return Ec})),n.d(p,"initProps",(function(){return Rc})),n.d(p,"getTransform",(function(){return Ax})),n.d(p,"clipPointsByRect",(function(){return Ex})),n.d(p,"clipRectByRect",(function(){return Rx})),n.d(p,"registerShape",(function(){return yx})),n.d(p,"getShapeClass",(function(){return mx})),n.d(p,"Group",(function(){return Ui})),n.d(p,"Image",(function(){return Yl})),n.d(p,"Text",(function(){return yu})),n.d(p,"Circle",(function(){return Fy})),n.d(p,"Ellipse",(function(){return pm})),n.d(p,"Sector",(function(){return Dm})),n.d(p,"Ring",(function(){return Om})),n.d(p,"Polygon",(function(){return Vm})),n.d(p,"Polyline",(function(){return Hm})),n.d(p,"Rect",(function(){return ru})),n.d(p,"Line",(function(){return zy})),n.d(p,"BezierCurve",(function(){return Xm})),n.d(p,"Arc",(function(){return Xv})),n.d(p,"IncrementalDisplayable",(function(){return cx})),n.d(p,"CompoundPath",(function(){return $m})),n.d(p,"LinearGradient",(function(){return Qm})),n.d(p,"RadialGradient",(function(){return ex})),n.d(p,"BoundingRect",(function(){return xi}));var f={};n.r(f),n.d(f,"addCommas",(function(){return fp})),n.d(f,"toCamelCase",(function(){return dp})),n.d(f,"normalizeCssArray",(function(){return gp})),n.d(f,"encodeHTML",(function(){return mp})),n.d(f,"formatTpl",(function(){return wp})),n.d(f,"getTooltipMarker",(function(){return Mp})),n.d(f,"formatTime",(function(){return Cp})),n.d(f,"capitalFirst",(function(){return Ip})),n.d(f,"truncateText",(function(){return Ba})),n.d(f,"getTextRect",(function(){return pp}));var d={};n.r(d),n.d(d,"map",(function(){return K})),n.d(d,"each",(function(){return Z})),n.d(d,"indexOf",(function(){return q})),n.d(d,"inherits",(function(){return X})),n.d(d,"reduce",(function(){return J})),n.d(d,"filter",(function(){return Q})),n.d(d,"bind",(function(){return rt})),n.d(d,"curry",(function(){return it})),n.d(d,"isArray",(function(){return ot})),n.d(d,"isString",(function(){return st})),n.d(d,"isObject",(function(){return ct})),n.d(d,"isFunction",(function(){return at})),n.d(d,"extend",(function(){return j})),n.d(d,"defaults",(function(){return W})),n.d(d,"clone",(function(){return F})),n.d(d,"merge",(function(){return G})); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var g=function(t,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},g(t,e)};function v(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var y=function(){return y=Object.assign||function(t){for(var e,n=1,r=arguments.length;n18),a&&(n.weChat=!0),e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!==typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!==typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}"object"===typeof wx&&"function"===typeof wx.getSystemInfoSync?(b.wxa=!0,b.canvasSupported=!0,b.touchEventsSupported=!0):"undefined"===typeof document&&"undefined"!==typeof self?(b.worker=!0,b.canvasSupported=!0):"undefined"===typeof navigator?(b.node=!0,b.canvasSupported=!0,b.svgSupported=!0):w(navigator.userAgent,b);var S=b,M={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},C={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},I=Object.prototype.toString,T=Array.prototype,A=T.forEach,D=T.filter,k=T.slice,L=T.map,O=function(){}.constructor,P=O?O.prototype:null,E="__proto__",R={};function N(t,e){R[t]=e}var z=2311;function B(){return z++}function V(){for(var t=[],e=0;e>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[l]+":0",i[u]+":0",r[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}function me(t,e,n){for(var r=n?"invTrans":"trans",i=e[r],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=t[u].getBoundingClientRect(),h=2*u,p=c.left,f=c.top;a.push(p,f),l=l&&o&&p===o[h]&&f===o[h+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=a,e[r]=n?pe(s,a):pe(a,s))}function xe(t){return"CANVAS"===t.nodeName.toUpperCase()}var _e="undefined"!==typeof window&&!!window.addEventListener,be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,we=[];function Se(t,e,n,r){return n=n||{},r||!S.canvasSupported?Me(t,e,n):S.browser.firefox&&S.browser.version<"39"&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Me(t,e,n),n}function Me(t,e,n){if(S.domSupported&&t.getBoundingClientRect){var r=e.clientX,i=e.clientY;if(xe(t)){var o=t.getBoundingClientRect();return n.zrX=r-o.left,void(n.zrY=i-o.top)}if(ve(we,t,r,i))return n.zrX=we[0],void(n.zrY=we[1])}n.zrX=n.zrY=0}function Ce(t){return t||window.event}function Ie(t,e,n){if(e=Ce(e),null!=e.zrX)return e;var r=e.type,i=r&&r.indexOf("touch")>=0;if(i){var o="touchend"!==r?e.targetTouches[0]:e.changedTouches[0];o&&Se(t,o,e,n)}else{Se(t,e,e,n);var a=Te(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return null==e.which&&void 0!==s&&be.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function Te(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,r=t.deltaY;if(null==n||null==r)return e;var i=0!==r?Math.abs(r):Math.abs(n),o=r>0?-1:r<0?1:n>0?-1:1;return 3*i*o}function Ae(t,e,n,r){_e?t.addEventListener(e,n,r):t.attachEvent("on"+e,n)}function De(t,e,n,r){_e?t.removeEventListener(e,n,r):t.detachEvent("on"+e,n)}var ke=_e?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function Le(t){return 2===t.which||3===t.which}var Oe=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var r=t.touches;if(r){for(var i={points:[],touches:[],target:e,event:t},o=0,a=r.length;o1&&r&&r.length>1){var o=Pe(r)/Pe(i);!isFinite(o)&&(o=1),e.pinchScale=o;var a=Ee(r);return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:t[0].target,event:e}}}}},Ne="silent";function ze(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Be}}function Be(){ke(this.event)}var Ve=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return v(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(ue),Fe=function(){function t(t,e){this.x=t,this.y=e}return t}(),Ge=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],He=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o._hovered=new Fe(0,0),o.storage=e,o.painter=n,o.painterRoot=i,r=r||new Ve,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new se(o),o}return v(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(Z(Ge,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,r=We(this,e,n),i=this._hovered,o=i.target;o&&!o.__zr&&(i=this.findHover(i.x,i.y),o=i.target);var a=this._hovered=r?new Fe(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Fe(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){t=t||{};var r=t.target;if(!r||!r.silent){var i="on"+e,o=ze(e,t,n);while(r)if(r[i]&&(o.cancelBubble=!!r[i].call(r,o)),r.trigger(e,o),r=r.__hostTarget?r.__hostTarget:r.parent,o.cancelBubble)break;o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"===typeof t[i]&&t[i].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,n){for(var r=this.storage.getDisplayList(),i=new Fe(t,e),o=r.length-1;o>=0;o--){var a=void 0;if(r[o]!==n&&!r[o].ignore&&(a=je(r[o],t,e))&&(!i.topTarget&&(i.topTarget=r[o]),a!==Ne)){i.target=r[o];break}}return i},e.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new Oe);var n=this._gestureMgr;"start"===e&&n.clear();var r=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&n.clear(),r){var i=r.type;t.gestureEvent=i;var o=new Fe;o.target=r.target,this.dispatchToElement(o,i,r.event)}},e}(ue);function je(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){var r=t,i=void 0,o=!1;while(r){if(r.ignoreClip&&(o=!0),!o){var a=r.getClipPath();if(a&&!a.contain(e,n))return!1;r.silent&&(i=!0)}var s=r.__hostTarget;r=s||r.parent}return!i||Ne}return!1}function We(t,e,n){var r=t.painter;return e<0||e>r.getWidth()||n<0||n>r.getHeight()}Z(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){He.prototype[t]=function(e){var n,r,i=e.zrX,o=e.zrY,a=We(this,i,o);if("mouseup"===t&&a||(n=this.findHover(i,o),r=n.target),"mousedown"===t)this._downEl=r,this._downPoint=[e.zrX,e.zrY],this._upEl=r;else if("mouseup"===t)this._upEl=r;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Kt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));var Ue=He,qe=32,Xe=7;function Ye(t){var e=0;while(t>=qe)e|=1&t,t>>=1;return t+e}function $e(t,e,n,r){var i=e+1;if(i===n)return 1;if(r(t[i++],t[e])<0){while(i=0)i++;return i-e}function Ze(t,e,n){n--;while(e>>1,i(a,t[o])<0?l=o:s=o+1;var u=r-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:while(u>0)t[s+u]=t[s+u-1],u--}t[s]=a}}function Je(t,e,n,r,i,o){var a=0,s=0,l=1;if(o(t,e[n+i])>0){s=r-i;while(l0)a=l,l=1+(l<<1),l<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}else{s=i+1;while(ls&&(l=s);var u=a;a=i-l,l=i-u}a++;while(a>>1);o(t,e[n+c])>0?a=c+1:l=c}return l}function Qe(t,e,n,r,i,o){var a=0,s=0,l=1;if(o(t,e[n+i])<0){s=i+1;while(ls&&(l=s);var u=a;a=i-l,l=i-u}else{s=r-i;while(l=0)a=l,l=1+(l<<1),l<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}a++;while(a>>1);o(t,e[n+c])<0?l=c:a=c+1}return l}function tn(t,e){var n,r,i=Xe,o=0,a=0;o=t.length;var s=[];function l(t,e){n[a]=t,r[a]=e,a+=1}function u(){while(a>1){var t=a-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]r[t+1])break;h(t)}}function c(){while(a>1){var t=a-2;t>0&&r[t-1]=Xe||f>=Xe);if(d)break;g<0&&(g=0),g+=2}if(i=g,i<1&&(i=1),1===r){for(l=0;l=0;l--)t[f+l]=t[p+l];if(0===r){y=!0;break}}if(t[h--]=s[c--],1===--a){y=!0;break}if(v=a-Je(t[u],s,0,a,a-1,e),0!==v){for(h-=v,c-=v,a-=v,f=h+1,p=c+1,l=0;l=Xe||v>=Xe);if(y)break;d<0&&(d=0),d+=2}if(i=d,i<1&&(i=1),1===a){for(h-=r,u-=r,f=h+1,p=u+1,l=r-1;l>=0;l--)t[f+l]=t[p+l];t[h]=s[c]}else{if(0===a)throw new Error;for(p=h-(a-1),l=0;l=0;l--)t[f+l]=t[p+l];t[h]=s[c]}else for(p=h-(a-1),l=0;ls&&(l=s),Ke(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),i-=o,n+=o}while(0!==i);a.forceMergeRuns()}}var nn=1,rn=2,on=4,an=!1;function sn(){an||(an=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function ln(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var un,cn=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=ln}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(sn(),u.z=0),isNaN(u.z2)&&(sn(),u.z2=0),isNaN(u.zlevel)&&(sn(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var c=t.getDecalElement&&t.getDecalElement();c&&this._updateAndAddDisplayable(c,e,n);var h=t.getTextGuideLine();h&&this._updateAndAddDisplayable(h,e,n);var p=t.getTextContent();p&&this._updateAndAddDisplayable(p,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(r,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),hn=cn;un="undefined"!==typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var pn=un,fn={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1,r=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=r/4):e=r*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r))},elasticOut:function(t){var e,n=.1,r=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=r/4):e=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/r)+1)},elasticInOut:function(t){var e,n=.1,r=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=r/4):e=r*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-fn.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*fn.bounceIn(2*t):.5*fn.bounceOut(2*t-1)+.5}},dn=fn,gn=function(){function t(t){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart}return t.prototype.step=function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),!this._paused){var n=(t-this._startTime-this._pausedTime)/this._life;n<0&&(n=0),n=Math.min(n,1);var r=this.easing,i="string"===typeof r?dn[r]:r,o="function"===typeof i?i(n):n;if(this.onframe&&this.onframe(o),1===n){if(!this.loop)return!0;this._restart(t),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=e},t.prototype._restart=function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t}(),vn=gn,yn=function(){function t(t){this.value=t}return t}(),mn=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new yn(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),xn=function(){function t(t){this._list=new mn,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,r=this._map,i=null;if(null==r[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new yn(e),a.key=t,n.insertEntry(a),r[t]=a}return i},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),_n=xn,bn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function wn(t){return t=Math.round(t),t<0?0:t>255?255:t}function Sn(t){return t=Math.round(t),t<0?0:t>360?360:t}function Mn(t){return t<0?0:t>1?1:t}function Cn(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?wn(parseFloat(e)/100*255):wn(parseInt(e,10))}function In(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Mn(parseFloat(e)/100):Mn(parseFloat(e))}function Tn(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function An(t,e,n){return t+(e-t)*n}function Dn(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function kn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Ln=new _n(20),On=null;function Pn(t,e){On&&kn(On,e),On=Ln.put(t,On||e.slice())}function En(t,e){if(t){e=e||[];var n=Ln.get(t);if(n)return kn(e,n);t+="";var r=t.replace(/ /g,"").toLowerCase();if(r in bn)return kn(e,bn[r]),Pn(t,e),e;var i=r.length;if("#"!==r.charAt(0)){var o=r.indexOf("("),a=r.indexOf(")");if(-1!==o&&a+1===i){var s=r.substr(0,o),l=r.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return 3===l.length?Dn(e,+l[0],+l[1],+l[2],1):Dn(e,0,0,0,1);u=In(l.pop());case"rgb":return 3!==l.length?void Dn(e,0,0,0,1):(Dn(e,Cn(l[0]),Cn(l[1]),Cn(l[2]),u),Pn(t,e),e);case"hsla":return 4!==l.length?void Dn(e,0,0,0,1):(l[3]=In(l[3]),Rn(l,e),Pn(t,e),e);case"hsl":return 3!==l.length?void Dn(e,0,0,0,1):(Rn(l,e),Pn(t,e),e);default:return}}Dn(e,0,0,0,1)}else{if(4===i||5===i){var c=parseInt(r.slice(1,4),16);return c>=0&&c<=4095?(Dn(e,(3840&c)>>4|(3840&c)>>8,240&c|(240&c)>>4,15&c|(15&c)<<4,5===i?parseInt(r.slice(4),16)/15:1),Pn(t,e),e):void Dn(e,0,0,0,1)}if(7===i||9===i){c=parseInt(r.slice(1,7),16);return c>=0&&c<=16777215?(Dn(e,(16711680&c)>>16,(65280&c)>>8,255&c,9===i?parseInt(r.slice(7),16)/255:1),Pn(t,e),e):void Dn(e,0,0,0,1)}}}}function Rn(t,e){var n=(parseFloat(t[0])%360+360)%360/360,r=In(t[1]),i=In(t[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return e=e||[],Dn(e,wn(255*Tn(a,o,n+1/3)),wn(255*Tn(a,o,n)),wn(255*Tn(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Nn(t){if(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-r)/6+l/2)/l,h=((s-i)/6+l/2)/l,p=((s-o)/6+l/2)/l;r===s?e=p-h:i===s?e=1/3+c-p:o===s&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}function zn(t,e){var n=En(t);if(n){for(var r=0;r<3;r++)n[r]=e<0?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return Un(n,4===n.length?"rgba":"rgb")}}function Bn(t){var e=En(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Vn(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var r=t*(e.length-1),i=Math.floor(r),o=Math.ceil(r),a=e[i],s=e[o],l=r-i;return n[0]=wn(An(a[0],s[0],l)),n[1]=wn(An(a[1],s[1],l)),n[2]=wn(An(a[2],s[2],l)),n[3]=Mn(An(a[3],s[3],l)),n}}var Fn=Vn;function Gn(t,e,n){if(e&&e.length&&t>=0&&t<=1){var r=t*(e.length-1),i=Math.floor(r),o=Math.ceil(r),a=En(e[i]),s=En(e[o]),l=r-i,u=Un([wn(An(a[0],s[0],l)),wn(An(a[1],s[1],l)),wn(An(a[2],s[2],l)),Mn(An(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}}var Hn=Gn;function jn(t,e,n,r){var i=En(t);if(t)return i=Nn(i),null!=e&&(i[0]=Sn(e)),null!=n&&(i[1]=In(n)),null!=r&&(i[2]=In(r)),Un(Rn(i),"rgba")}function Wn(t,e){var n=En(t);if(n&&null!=e)return n[3]=Mn(e),Un(n,"rgba")}function Un(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function qn(t,e){var n=En(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function Xn(){var t=Math.round(255*Math.random()),e=Math.round(255*Math.random()),n=Math.round(255*Math.random());return"rgb("+t+","+e+","+n+")"}var Yn=Array.prototype.slice;function $n(t,e,n){return(e-t)*n+t}function Zn(t,e,n){return n>.5?e:t}function Kn(t,e,n,r){for(var i=e.length,o=0;oa;if(s)r.length=a;else for(var l=o;l=2&&this.interpolable&&this.maxTime>0},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e){t>=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,r=n.length;if(this.interpolable)if($(e)){var i=lr(e);if(r>0&&this.arrDim!==i)return void(this.interpolable=!1);if(1===i&&"number"!==typeof e[0]||2===i&&"number"!==typeof e[0][0])return void(this.interpolable=!1);if(r>0){var o=n[r-1];this._isAllValueEqual&&(1===i&&nr(e,o.value)||(this._isAllValueEqual=!1))}this.arrDim=i}else{if(this.arrDim>0)return void(this.interpolable=!1);if("string"===typeof e){var a=En(e);a?(e=a,this.isValueColor=!0):this.interpolable=!1}else if("number"!==typeof e||isNaN(e))return void(this.interpolable=!1);if(this._isAllValueEqual&&r>0){o=n[r-1];(this.isValueColor&&!nr(o.value,e)||o.value!==e)&&(this._isAllValueEqual=!1)}}var s={time:t,value:e,percent:0};return this.keyframes.push(s),s},t.prototype.prepare=function(t){var e=this.keyframes;this._needsSort&&e.sort((function(t,e){return t.time-e.time}));for(var n=this.arrDim,r=e.length,i=e[r-1],o=0;o0&&o!==r-1&&er(e[o].value,i.value,n);if(t&&this.needsAnimate()&&t.needsAnimate()&&n===t.arrDim&&this.isValueColor===t.isValueColor&&!t._finished){this._additiveTrack=t;var a=e[0].value;for(o=0;o=0;n--)if(o[n].percent<=e)break;n=Math.min(n,a-2)}else{for(n=this._lastFrame;ne)break;n=Math.min(n-1,a-2)}var h=o[n+1],p=o[n];if(p&&h){this._lastFrame=n,this._lastFramePercent=e;var f=h.percent-p.percent;if(0!==f){var d=(e-p.percent)/f,g=r?this._additiveValue:u?ur:t[s];if((l>0||u)&&!g&&(g=this._additiveValue=[]),this.useSpline){var v=o[n][i],y=o[0===n?n:n-1][i],m=o[n>a-2?a-1:n+1][i],x=o[n>a-3?a-1:n+2][i];if(l>0)1===l?ir(g,y,v,m,x,d,d*d,d*d*d):or(g,y,v,m,x,d,d*d,d*d*d);else if(u)ir(g,y,v,m,x,d,d*d,d*d*d),r||(t[s]=sr(g));else{var _=void 0;_=this.interpolable?rr(y,v,m,x,d,d*d,d*d*d):m,r?this._additiveValue=_:t[s]=_}}else if(l>0)1===l?Kn(g,p[i],h[i],d):Jn(g,p[i],h[i],d);else if(u)Kn(g,p[i],h[i],d),r||(t[s]=sr(g));else{_=void 0;_=this.interpolable?$n(p[i],h[i],d):Zn(p[i],h[i],d),r?this._additiveValue=_:t[s]=_}r&&this._addToTarget(t)}}}},t.prototype._addToTarget=function(t){var e=this.arrDim,n=this.propName,r=this._additiveValue;0===e?this.isValueColor?(En(t[n],ur),Qn(ur,ur,r,1),t[n]=sr(ur)):t[n]=t[n]+r:1===e?Qn(t[n],t[n],r,1):2===e&&tr(t[n],t[n],r,1)},t}(),hr=function(){function t(t,e,n){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n?V("Can' use additive animation on looped animation."):this._additiveAnimators=n}return t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e){return this.whenWithKeys(t,e,et(e))},t.prototype.whenWithKeys=function(t,e,n){for(var r=this._tracks,i=0;i0)){this._started=1;for(var n=this,r=[],i=0;i1){var a=o.pop();i.addKeyframe(a.time,t[r]),i.prepare(i.getAdditiveTrack())}}}},t}(),pr=hr,fr=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n.onframe=e.onframe||function(){},n}return v(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._clipsHead?(this._clipsTail.next=t,t.prev=this._clipsTail,t.next=null,this._clipsTail=t):this._clipsHead=this._clipsTail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._clipsHead=n,n?n.prev=e:this._clipsTail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){var e=(new Date).getTime()-this._pausedTime,n=e-this._time,r=this._clipsHead;while(r){var i=r.next,o=r.step(e,n);o?(r.ondestroy&&r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=e,t||(this.onframe(n),this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;function e(){t._running&&(pn(e),!t._paused&&t.update())}this._running=!0,pn(e)},e.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){var t=this._clipsHead;while(t){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._clipsHead=this._clipsTail=null},e.prototype.isFinished=function(){return null==this._clipsHead},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new pr(t,e.loop);return this.addAnimator(n),n},e}(ue),dr=fr,gr=300,vr=S.domSupported,yr=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},r=K(t,(function(t){var e=t.replace("mouse","pointer");return n.hasOwnProperty(e)?e:t}));return{mouse:t,touch:e,pointer:r}}(),mr={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},xr=!1;function _r(t){var e=t.pointerType;return"pen"===e||"touch"===e}function br(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}function wr(t){t&&(t.zrByTouch=!0)}function Sr(t,e){return Ie(t.dom,new Cr(t,e),!0)}function Mr(t,e){var n=e,r=!1;while(n&&9!==n.nodeType&&!(r=n.domBelongToZr||n!==e&&n===t.painterRoot))n=n.parentNode;return r}var Cr=function(){function t(t,e){this.stopPropagation=Pt,this.stopImmediatePropagation=Pt,this.preventDefault=Pt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return t}(),Ir={mousedown:function(t){t=Ie(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Ie(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Ie(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=Ie(this.dom,t);var e=t.toElement||t.relatedTarget;Mr(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){xr=!0,t=Ie(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){xr||(t=Ie(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=Ie(this.dom,t),wr(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Ir.mousemove.call(this,t),Ir.mousedown.call(this,t)},touchmove:function(t){t=Ie(this.dom,t),wr(t),this.handler.processGesture(t,"change"),Ir.mousemove.call(this,t)},touchend:function(t){t=Ie(this.dom,t),wr(t),this.handler.processGesture(t,"end"),Ir.mouseup.call(this,t),+new Date-+this.__lastTouchMomentKr||t<-Kr}var Qr,ti,ei=[],ni=[],ri=Gr(),ii=Math.abs,oi=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Jr(this.rotation)||Jr(this.x)||Jr(this.y)||Jr(this.scaleX-1)||Jr(this.scaleY-1)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||Gr(),e?this.getLocalTransform(n):Zr(n),t&&(e?Wr(n,t,n):jr(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&Zr(n)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(ei);var n=ei[0]<0?-1:1,r=ei[1]<0?-1:1,i=((ei[0]-n)*e+n)/ei[0]||0,o=((ei[1]-r)*e+r)/ei[1]||0;t[0]*=i,t[1]*=i,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Gr(),Yr(this.invTransform,t)},t.prototype.getComputedTransform=function(){var t=this,e=[];while(t)e.push(t),t=t.parent;while(t=e.pop())t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],r=Math.atan2(t[1],t[0]),i=Math.PI/2+r-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(i),e=Math.sqrt(e),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Wr(ni,t.invTransform,e),e=ni);var n=this.originX,r=this.originY;(n||r)&&(ri[4]=n,ri[5]=r,Wr(ni,e,ri),ni[4]-=n,ni[5]-=r,e=ni),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],r=this.invTransform;return r&&ne(n,n,r),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],r=this.transform;return r&&ne(n,n,r),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&ii(t[0]-1)>1e-10&&ii(t[3]-1)>1e-10?Math.sqrt(ii(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){for(var e=this,n=0;nd&&(d=x,gd&&(d=_,y=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,r){if(r){if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],o=r[3],a=r[4],s=r[5];return e.x=n.x*i+a,e.y=n.y*o+s,e.width=n.width*i,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}pi.x=di.x=n.x,pi.y=gi.y=n.y,fi.x=gi.x=n.x+n.width,fi.y=di.y=n.y+n.height,pi.transform(r),gi.transform(r),fi.transform(r),di.transform(r),e.x=ci(pi.x,fi.x,di.x,gi.x),e.y=ci(pi.y,fi.y,di.y,gi.y);var l=hi(pi.x,fi.x,di.x,gi.x),u=hi(pi.y,fi.y,di.y,gi.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}(),xi=mi,_i={},bi="12px sans-serif";function wi(t,e){return Qr||(Qr=U().getContext("2d")),ti!==e&&(ti=Qr.font=e||bi),Qr.measureText(t)}var Si={measureText:wi};function Mi(t,e){e=e||bi;var n=_i[e];n||(n=_i[e]=new _n(500));var r=n.get(t);return null==r&&(r=Si.measureText(t,e).width,n.put(t,r)),r}function Ci(t,e,n,r){var i=Mi(t,e),o=Di(e),a=Ti(0,i,n),s=Ai(0,o,r),l=new xi(a,s,i,o);return l}function Ii(t,e,n,r){var i=((t||"")+"").split("\n"),o=i.length;if(1===o)return Ci(i[0],e,n,r);for(var a=new xi(0,0,0,0),s=0;s=0?parseFloat(t)/100*e:parseFloat(t):t}function Li(t,e,n){var r=e.position||"inside",i=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,c="left",h="top";if(r instanceof Array)l+=ki(r[0],n.width),u+=ki(r[1],n.height),c=null,h=null;else switch(r){case"left":l-=i,u+=s,c="right",h="middle";break;case"right":l+=i+a,u+=s,h="middle";break;case"top":l+=a/2,u-=i,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+i,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=i,u+=s,h="middle";break;case"insideRight":l+=a-i,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=i,c="center";break;case"insideBottom":l+=a/2,u+=o-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=a-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=o-i,h="bottom";break;case"insideBottomRight":l+=a-i,u+=o-i,c="right",h="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=c,t.verticalAlign=h,t}var Oi="__zr_normal__",Pi=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],Ei={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},Ri={},Ni=new xi(0,0,0,0),zi=function(){function t(t){this.id=B(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=t,r[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,r=n.local,i=e.innerTransformable,o=void 0,a=void 0,s=!1;i.parent=r?this:null;var l=!1;if(i.copyTransform(e),null!=n.position){var u=Ni;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),r||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ri,n,u):Li(Ri,n,u),i.x=Ri.x,i.y=Ri.y,o=Ri.align,a=Ri.verticalAlign;var c=n.origin;if(c&&null!=n.rotation){var h=void 0,p=void 0;"center"===c?(h=.5*u.width,p=.5*u.height):(h=ki(c[0],u.width),p=ki(c[1],u.height)),l=!0,i.originX=-i.x+h+(r?0:u.x),i.originY=-i.y+p+(r?0:u.y)}}null!=n.rotation&&(i.rotation=n.rotation);var f=n.offset;f&&(i.x+=f[0],i.y+=f[1],l||(i.originX=-f[0],i.originY=-f[1]));var d=null==n.inside?"string"===typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,m=void 0;d&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,null!=v&&"auto"!==v||(v=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(v),m=!0)):(v=n.outsideFill,y=n.outsideStroke,null!=v&&"auto"!==v||(v=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(v),m=!0)),v=v||"#000",v===g.fill&&y===g.stroke&&m===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=v,g.stroke=y,g.autoStroke=m,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=nn,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Vr:Br},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"===typeof e&&En(e);n||(n=[255,255,255,1]);for(var r=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*r+(i?0:255)*(1-r);return n[3]=1,Un(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},j(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"===typeof t)this.attrKV(t,e);else if(ct(t))for(var n=t,r=et(n),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Oi,!1,t)},t.prototype.useState=function(t,e,n,r){var i=t===Oi,o=this.hasState();if(o||!i){var a=this.currentStates,s=this.stateTransition;if(!(q(a,t)>=0)||!e&&1!==a.length){var l;if(this.stateProxy&&!i&&(l=this.stateProxy(t)),l||(l=this.states&&this.states[t]),l||i){i||this.saveCurrentToNormalState(l);var u=!!(l&&l.hoverLayer||r);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,l,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,h=this._textGuide;return c&&c.useState(t,e,n,u),h&&h.useState(t,e,n,u),i?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~nn),l}V("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var r=[],i=this.currentStates,o=t.length,a=o===i.length;if(a)for(var s=0;s0,f);var d=this._textContent,g=this._textGuide;d&&d.useStates(t,e,h),g&&g.useStates(t,e,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~nn)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var r=this.currentStates.slice(),i=q(r,t),o=q(r,e)>=0;i>=0?o?r.splice(i,1):r[i]=e:n&&!o&&r.push(e),this.useStates(r)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},r=0;r=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,r=n.length,i=[],o=0;o8)&&(i("position","_legacyPos","x","y"),i("scale","_legacyScale","scaleX","scaleY"),i("origin","_legacyOrigin","originX","originY"))}(),t}();function Bi(t,e,n,r,i){n=n||{};var o=[];Hi(t,"",t,e,n,r,o,i);var a=o.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,a--,a<=0&&(s?l&&l():u&&u())},h=function(){a--,a<=0&&(s?l&&l():u&&u())};a||l&&l(),o.length>0&&n.during&&o[0].during((function(t,e){n.during(e)}));for(var p=0;p0||i.force&&!a.length){for(var x=t.animators,_=[],b=0;b=0&&(n.splice(r,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=q(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,r=n[e];if(t&&t!==this&&t.parent!==this&&t!==r){n[e]=t,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,r=q(n,t);return r<0||(n.splice(r,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.addHover=function(t){},t.prototype.removeHover=function(t){},t.prototype.clearHover=function(){},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(t<=i)return a;if(t>=o)return s}else{if(t>=i)return a;if(t<=o)return s}else{if(t===i)return a;if(t===o)return s}return(t-i)/l*u+a}function lo(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return"string"===typeof t?ao(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function uo(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),oo),t=(+t).toFixed(e),n?t:+t}function co(t){return t.sort((function(t,e){return t-e})),t}function ho(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return po(t)}function po(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),r=n>0?+e.slice(n+1):0,i=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:i-1-o;return Math.max(0,a-r)}function fo(t,e){var n=Math.log,r=Math.LN10,i=Math.floor(n(t[1]-t[0])/r),o=Math.round(n(Math.abs(e[1]-e[0]))/r),a=Math.min(Math.max(-i+o,0),20);return isFinite(a)?a:20}function go(t,e,n){if(!t[e])return 0;var r=J(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===r)return 0;var i=Math.pow(10,n),o=K(t,(function(t){return(isNaN(t)?0:t)/r*i*100})),a=100*i,s=K(o,(function(t){return Math.floor(t)})),l=J(s,(function(t,e){return t+e}),0),u=K(o,(function(t,e){return t-s[e]}));while(lc&&(c=u[p],h=p);++s[h],u[h]=0,++l}return s[e]/i}function vo(t,e){var n=Math.max(ho(t),ho(e)),r=t+e;return n>oo?r:uo(r,n)}var yo=9007199254740991;function mo(t){var e=2*Math.PI;return(t%e+e)%e}function xo(t){return t>-io&&t=10&&e++,e}function Mo(t,e){var n,r=So(t),i=Math.pow(10,r),o=t/i;return n=e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10,t=n*i,r>=-20?+t.toFixed(r<0?-r:0):t}function Co(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i}function Io(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,r=0;r=0||i&&q(i,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var Da=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],ka=Aa(Da),La=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ka(this,t,e)},t}(),Oa=new _n(50);function Pa(t){if("string"===typeof t){var e=Oa.get(t);return e&&e.image}return t}function Ea(t,e,n,r,i){if(t){if("string"===typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=Oa.get(t),a={hostEl:n,cb:r,cbPayload:i};return o?(e=o.image,!Na(e)&&o.pending.push(a)):(e=new Image,e.onload=e.onerror=Ra,Oa.put(t,e.__cachedImgObj={image:e,pending:[a]}),e.src=e.__zrImageSrc=t),e}return t}return e}function Ra(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=a;l++)s-=a;var u=Mi(n,e);return u>s&&(n="",u=0),s=t-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=t,i}function Fa(t,e){var n=e.containerWidth,r=e.font,i=e.contentWidth;if(!n)return"";var o=Mi(t,r);if(o<=n)return t;for(var a=0;;a++){if(o<=i||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?Ga(t,i,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,s),o=Mi(t,r)}return""===t&&(t=e.placeholder),t}function Ga(t,e,n,r){for(var i=0,o=0,a=t.length;op&&u){var f=Math.floor(p/l);n=n.slice(0,f)}var d=p,g=c;if(i&&(d+=i[0]+i[2],null!=g&&(g+=i[1]+i[3])),t&&a&&null!=g)for(var v=Va(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),y=0;yl&&Xa(n,t.substring(l,u),e,s),Xa(n,r[2],e,s,r[1]),l=za.lastIndex}lo){b>0?(m.tokens=m.tokens.slice(0,b),v(m,_,x),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break t}var A=S.width,D=null==A||"auto"===A;if("string"===typeof A&&"%"===A.charAt(A.length-1))w.percentWidth=A,c.push(w),w.contentWidth=Mi(w.text,I);else{if(D){var k=S.backgroundColor,L=k&&k.image;L&&(L=Pa(L),Na(L)&&(w.width=Math.max(w.width,L.width*T/L.height)))}var O=d&&null!=i?i-_:null;null!=O&&O0&&d+r.accumWidth>r.width&&(o=e.split("\n"),h=!0),r.accumWidth=d}else{var g=Ka(e,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+f,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var v=0;v=33&&e<=255}var $a=J(",&?/;] ".split(""),(function(t,e){return t[e]=!0,t}),{});function Za(t){return!Ya(t)||!!$a[t]}function Ka(t,e,n,r,i){for(var o=[],a=[],s="",l="",u=0,c=0,h=0;hn:i+c+f>n)?c?(s||l)&&(d?(s||(s=l,l="",u=0,c=u),o.push(s),a.push(c-u),l+=p,u+=f,s="",c=u):(l&&(s+=l,c+=u,l="",u=0),o.push(s),a.push(c),s=p,c=f)):d?(o.push(l),a.push(u),l=p,u=f):(o.push(p),a.push(f)):(c+=f,d?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0}return o.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(c)),1===o.length&&(c+=i),{accumWidth:c,lines:o,linesWidths:a}}var Ja="__zr_style_"+Math.round(10*Math.random()),Qa={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ts={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Qa[Ja]=!0;var es=["z","z2","invisible"],ns=["invisible"],rs=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype._init=function(e){for(var n=et(e),r=0;r-cs&&tcs||t<-cs}function xs(t,e,n,r,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*r+3*o*n)}function _s(t,e,n,r,i){var o=1-i;return 3*(((e-t)*o+2*(n-e)*i)*o+(r-n)*i*i)}function bs(t,e,n,r,i,o){var a=r+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-i,c=s*s-3*a*l,h=s*l-9*a*u,p=l*l-3*s*u,f=0;if(ys(c)&&ys(h))if(ys(s))o[0]=0;else{var d=-l/s;d>=0&&d<=1&&(o[f++]=d)}else{var g=h*h-4*c*p;if(ys(g)){var v=h/c,y=(d=-s/a+v,-v/2);d>=0&&d<=1&&(o[f++]=d),y>=0&&y<=1&&(o[f++]=y)}else if(g>0){var m=us(g),x=c*s+1.5*a*(-h+m),_=c*s+1.5*a*(-h-m);x=x<0?-ls(-x,fs):ls(x,fs),_=_<0?-ls(-_,fs):ls(_,fs);d=(-s-(x+_))/(3*a);d>=0&&d<=1&&(o[f++]=d)}else{var b=(2*c*s-3*a*h)/(2*us(c*c*c)),w=Math.acos(b)/3,S=us(c),M=Math.cos(w),C=(d=(-s-2*S*M)/(3*a),y=(-s+S*(M+ps*Math.sin(w)))/(3*a),(-s+S*(M-ps*Math.sin(w)))/(3*a));d>=0&&d<=1&&(o[f++]=d),y>=0&&y<=1&&(o[f++]=y),C>=0&&C<=1&&(o[f++]=C)}}return f}function ws(t,e,n,r,i){var o=6*n-12*e+6*t,a=9*e+3*r-3*t-9*n,s=3*e-3*t,l=0;if(ys(a)){if(ms(o)){var u=-s/o;u>=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(ys(c))i[0]=-o/(2*a);else if(c>0){var h=us(c),p=(u=(-o+h)/(2*a),(-o-h)/(2*a));u>=0&&u<=1&&(i[l++]=u),p>=0&&p<=1&&(i[l++]=p)}}return l}function Ss(t,e,n,r,i,o){var a=(e-t)*i+t,s=(n-e)*i+e,l=(r-n)*i+n,u=(s-a)*i+a,c=(l-s)*i+s,h=(c-u)*i+u;o[0]=t,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=r}function Ms(t,e,n,r,i,o,a,s,l,u,c){var h,p,f,d,g,v=.005,y=1/0;ds[0]=l,ds[1]=u;for(var m=0;m<1;m+=.05)gs[0]=xs(t,n,i,a,m),gs[1]=xs(e,r,o,s,m),d=Qt(ds,gs),d=0&&d=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(ys(c)){u=-a/(2*o);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=us(c),p=(u=(-a+h)/(2*o),(-a-h)/(2*o));u>=0&&u<=1&&(i[l++]=u),p>=0&&p<=1&&(i[l++]=p)}}return l}function Ds(t,e,n){var r=t+n-2*e;return 0===r?.5:(t-e)/r}function ks(t,e,n,r,i){var o=(e-t)*r+t,a=(n-e)*r+e,s=(a-o)*r+o;i[0]=t,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=n}function Ls(t,e,n,r,i,o,a,s,l){var u,c=.005,h=1/0;ds[0]=a,ds[1]=s;for(var p=0;p<1;p+=.05){gs[0]=Is(t,n,i,p),gs[1]=Is(e,r,o,p);var f=Qt(ds,gs);f=0&&f1e-4)return s[0]=t-n,s[1]=e-r,l[0]=t+n,void(l[1]=e+r);if(Bs[0]=Ns(i)*n+t,Bs[1]=Rs(i)*r+e,Vs[0]=Ns(o)*n+t,Vs[1]=Rs(o)*r+e,u(s,Bs,Vs),c(l,Bs,Vs),i%=zs,i<0&&(i+=zs),o%=zs,o<0&&(o+=zs),i>o&&!a?o+=zs:ii&&(Fs[0]=Ns(f)*n+t,Fs[1]=Rs(f)*r+e,u(s,Fs,s),c(l,Fs,l))}var Ys={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},$s=[],Zs=[],Ks=[],Js=[],Qs=[],tl=[],el=Math.min,nl=Math.max,rl=Math.cos,il=Math.sin,ol=Math.sqrt,al=Math.abs,sl=Math.PI,ll=2*sl,ul="undefined"!==typeof Float32Array,cl=[];function hl(t){var e=Math.round(t/sl*1e8)/1e8;return e%2*sl}function pl(t,e){var n=hl(t[0]);n<0&&(n+=ll);var r=n-t[0],i=t[1];i+=r,!e&&i-n>=ll?i=n+ll:e&&n-i>=ll?i=n-ll:!e&&n>i?i=n+(ll-hl(n-i)):e&&n0&&(this._ux=al(n/Nr/t)||0,this._uy=al(n/Nr/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Ys.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=al(t-this._xi),r=al(e-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Ys.L,t,e),this._ctx&&i&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+r*r;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,r,i,o){return this._drawPendingPt(),this.addData(Ys.C,t,e,n,r,i,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,r,i,o):this._ctx.bezierCurveTo(t,e,n,r,i,o)),this._xi=i,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,r){return this._drawPendingPt(),this.addData(Ys.Q,t,e,n,r),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,r):this._ctx.quadraticCurveTo(t,e,n,r)),this._xi=n,this._yi=r,this},t.prototype.arc=function(t,e,n,r,i,o){this._drawPendingPt(),cl[0]=r,cl[1]=i,pl(cl,o),r=cl[0],i=cl[1];var a=i-r;return this.addData(Ys.A,t,e,n,n,r,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,r,i,o),this._xi=rl(i)*n+t,this._yi=il(i)*n+e,this},t.prototype.arcTo=function(t,e,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,n,r,i),this},t.prototype.rect=function(t,e,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,n,r),this.addData(Ys.R,t,e,n,r),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ys.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e0&&f<=t||c<0&&f>=t||0===c&&(h>0&&d<=e||h<0&&d>=e))r=this._dashIdx,n=o[r],f+=c*n,d+=h*n,this._dashIdx=(r+1)%g,c>0&&fl||h>0&&du||a[r%2?"moveTo":"lineTo"](c>=0?el(f,t):nl(f,t),h>=0?el(d,e):nl(d,e));c=f-t,h=d-e,this._dashOffset=-ol(c*c+h*h)},t.prototype._dashedBezierTo=function(t,e,n,r,i,o){var a,s,l,u,c,h=this._ctx,p=this._dashSum,f=this._dashOffset,d=this._lineDash,g=this._xi,v=this._yi,y=0,m=this._dashIdx,x=d.length,_=0;for(f<0&&(f=p+f),f%=p,a=0;a<1;a+=.1)s=xs(g,t,n,i,a+.1)-xs(g,t,n,i,a),l=xs(v,e,r,o,a+.1)-xs(v,e,r,o,a),y+=ol(s*s+l*l);for(;mf)break;a=(_-f)/y;while(a<=1)u=xs(g,t,n,i,a),c=xs(v,e,r,o,a),m%2?h.moveTo(u,c):h.lineTo(u,c),a+=d[m]/y,m=(m+1)%x;m%2!==0&&h.lineTo(i,o),s=i-u,l=o-c,this._dashOffset=-ol(s*s+l*l)},t.prototype._dashedQuadraticTo=function(t,e,n,r){var i=n,o=r;n=(n+2*t)/3,r=(r+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,n,r,i,o)},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,ul&&this._len>11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Ks[0]=Ks[1]=Qs[0]=Qs[1]=Number.MAX_VALUE,Js[0]=Js[1]=tl[0]=tl[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,r=0,i=0,o=0;for(t=0;tn||al(m)>r||h===e-1)&&(d=Math.sqrt(y*y+m*m),i=g,o=v);break;case Ys.C:var x=t[h++],_=t[h++],b=(g=t[h++],v=t[h++],t[h++]),w=t[h++];d=Cs(i,o,x,_,g,v,b,w,10),i=b,o=w;break;case Ys.Q:x=t[h++],_=t[h++],g=t[h++],v=t[h++];d=Os(i,o,x,_,g,v,10),i=g,o=v;break;case Ys.A:var S=t[h++],M=t[h++],C=t[h++],I=t[h++],T=t[h++],A=t[h++],D=A+T;h+=1;t[h++];f&&(a=rl(T)*C+S,s=il(T)*I+M),d=nl(C,I)*el(ll,Math.abs(A)),i=rl(D)*C+S,o=il(D)*I+M;break;case Ys.R:a=i=t[h++],s=o=t[h++];var k=t[h++],L=t[h++];d=2*k+2*L;break;case Ys.Z:y=a-i,m=s-o;d=Math.sqrt(y*y+m*m),i=a,o=s;break}d>=0&&(l[c++]=d,u+=d)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,r,i,o,a,s,l,u,c,h,p,f=this.data,d=this._ux,g=this._uy,v=this._len,y=e<1,m=0,x=0,_=0;if(!y||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=this._pathLen,c=e*u,c))t:for(var b=0;b0&&(t.lineTo(h,p),_=0),w){case Ys.M:n=i=f[b++],r=o=f[b++],t.moveTo(i,o);break;case Ys.L:a=f[b++],s=f[b++];var M=al(a-i),C=al(s-o);if(M>d||C>g){if(y){var I=l[x++];if(m+I>c){var T=(c-m)/I;t.lineTo(i*(1-T)+a*T,o*(1-T)+s*T);break t}m+=I}t.lineTo(a,s),i=a,o=s,_=0}else{var A=M*M+C*C;A>_&&(h=a,p=s,_=A)}break;case Ys.C:var D=f[b++],k=f[b++],L=f[b++],O=f[b++],P=f[b++],E=f[b++];if(y){I=l[x++];if(m+I>c){T=(c-m)/I;Ss(i,D,L,P,T,$s),Ss(o,k,O,E,T,Zs),t.bezierCurveTo($s[1],Zs[1],$s[2],Zs[2],$s[3],Zs[3]);break t}m+=I}t.bezierCurveTo(D,k,L,O,P,E),i=P,o=E;break;case Ys.Q:D=f[b++],k=f[b++],L=f[b++],O=f[b++];if(y){I=l[x++];if(m+I>c){T=(c-m)/I;ks(i,D,L,T,$s),ks(o,k,O,T,Zs),t.quadraticCurveTo($s[1],Zs[1],$s[2],Zs[2]);break t}m+=I}t.quadraticCurveTo(D,k,L,O),i=L,o=O;break;case Ys.A:var R=f[b++],N=f[b++],z=f[b++],B=f[b++],V=f[b++],F=f[b++],G=f[b++],H=!f[b++],j=z>B?z:B,W=al(z-B)>.001,U=V+F,q=!1;if(y){I=l[x++];m+I>c&&(U=V+F*(c-m)/I,q=!0),m+=I}if(W&&t.ellipse?t.ellipse(R,N,z,B,G,V,U,H):t.arc(R,N,j,V,U,H),q)break t;S&&(n=rl(V)*z+R,r=il(V)*B+N),i=rl(U)*z+R,o=il(U)*B+N;break;case Ys.R:n=i=f[b],r=o=f[b+1],a=f[b++],s=f[b++];var X=f[b++],Y=f[b++];if(y){I=l[x++];if(m+I>c){var $=c-m;t.moveTo(a,s),t.lineTo(a+el($,X),s),$-=X,$>0&&t.lineTo(a+X,s+el($,Y)),$-=Y,$>0&&t.lineTo(a+nl(X-$,0),s+Y),$-=X,$>0&&t.lineTo(a,s+nl(Y-$,0));break t}m+=I}t.rect(a,s,X,Y);break;case Ys.Z:if(y){I=l[x++];if(m+I>c){T=(c-m)/I;t.lineTo(i*(1-T)+n*T,o*(1-T)+r*T);break t}m+=I}t.closePath(),i=n,o=r}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Ys,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._needsDash=!1,e._dashOffset=0,e._dashIdx=0,e._dashSum=0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}(),dl=fl;function gl(t,e,n,r,i,o,a){if(0===i)return!1;var s=i,l=0,u=t;if(a>e+s&&a>r+s||at+s&&o>n+s||oe+h&&c>r+h&&c>o+h&&c>s+h||ct+h&&u>n+h&&u>i+h&&u>a+h||ue+u&&l>r+u&&l>o+u||lt+u&&s>n+u&&s>i+u||sn||c+ui&&(i+=_l);var p=Math.atan2(l,s);return p<0&&(p+=_l),p>=r&&p<=i||p+_l>=r&&p+_l<=i}function wl(t,e,n,r,i,o){if(o>e&&o>r||oi?s:0}var Sl=dl.CMD,Ml=2*Math.PI,Cl=1e-4;function Il(t,e){return Math.abs(t-e)e&&u>r&&u>o&&u>s||u1&&Dl(),f=xs(e,r,o,s,Al[0]),p>1&&(d=xs(e,r,o,s,Al[1]))),2===p?ve&&s>r&&s>o||s=0&&u<=1){for(var c=0,h=Is(e,r,o,u),p=0;pn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Tl[0]=-l,Tl[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=Ml-1e-4){r=0,i=Ml;var c=o?1:-1;return a>=Tl[0]+t&&a<=Tl[1]+t?c:0}if(r>i){var h=r;r=i,i=h}r<0&&(r+=Ml,i+=Ml);for(var p=0,f=0;f<2;f++){var d=Tl[f];if(d+t>a){var g=Math.atan2(s,d);c=o?1:-1;g<0&&(g=Ml+g),(g>=r&&g<=i||g+Ml>=r&&g+Ml<=i)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),p+=c)}}return p}function Pl(t,e,n,r,i){for(var o,a,s=t.data,l=t.len(),u=0,c=0,h=0,p=0,f=0,d=0;d1&&(n||(u+=wl(c,h,p,f,r,i))),v&&(c=s[d],h=s[d+1],p=c,f=h),g){case Sl.M:p=s[d++],f=s[d++],c=p,h=f;break;case Sl.L:if(n){if(gl(c,h,s[d],s[d+1],e,r,i))return!0}else u+=wl(c,h,s[d],s[d+1],r,i)||0;c=s[d++],h=s[d++];break;case Sl.C:if(n){if(vl(c,h,s[d++],s[d++],s[d++],s[d++],s[d],s[d+1],e,r,i))return!0}else u+=kl(c,h,s[d++],s[d++],s[d++],s[d++],s[d],s[d+1],r,i)||0;c=s[d++],h=s[d++];break;case Sl.Q:if(n){if(yl(c,h,s[d++],s[d++],s[d],s[d+1],e,r,i))return!0}else u+=Ll(c,h,s[d++],s[d++],s[d],s[d+1],r,i)||0;c=s[d++],h=s[d++];break;case Sl.A:var y=s[d++],m=s[d++],x=s[d++],_=s[d++],b=s[d++],w=s[d++];d+=1;var S=!!(1-s[d++]);o=Math.cos(b)*x+y,a=Math.sin(b)*_+m,v?(p=o,f=a):u+=wl(c,h,o,a,r,i);var M=(r-y)*_/x+y;if(n){if(bl(y,m,_,b,b+w,S,e,M,i))return!0}else u+=Ol(y,m,_,b,b+w,S,M,i);c=Math.cos(b+w)*x+y,h=Math.sin(b+w)*_+m;break;case Sl.R:p=c=s[d++],f=h=s[d++];var C=s[d++],I=s[d++];if(o=p+C,a=f+I,n){if(gl(p,f,o,f,e,r,i)||gl(o,f,o,a,e,r,i)||gl(o,a,p,a,e,r,i)||gl(p,a,p,f,e,r,i))return!0}else u+=wl(o,f,o,a,r,i),u+=wl(p,a,p,f,r,i);break;case Sl.Z:if(n){if(gl(c,h,p,f,e,r,i))return!0}else u+=wl(c,h,p,f,r,i);c=p,h=f;break}}return n||Il(h,f)||(u+=wl(c,h,p,f,r,i)||0),0!==u}function El(t,e,n){return Pl(t,0,!1,e,n)}function Rl(t,e,n,r){return Pl(t,e,!0,n,r)}var Nl=W({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Qa),zl={style:W({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ts.style)},Bl=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],Vl=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(t){n.buildPath(t,n.shape)}),i.silent=!0;var o=i.style;for(var a in r)o[a]!==r[a]&&(o[a]=r[a]);o.fill=r.fill?r.decal:null,o.decal=null,o.shadowColor=null,r.strokeFirst&&(o.stroke=null);for(var s=0;s.5?Br:e>.2?Fr:Vr}if(t)return Vr}return Br},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(st(e)){var n=this.__zr,r=!(!n||!n.isDarkMode()),i=qn(t,0)0))},e.prototype.hasFill=function(){var t=this.style,e=t.fill;return null!=e&&"none"!==e},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&on)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),t=i.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),r=this.getBoundingRect(),i=this.style;if(t=n[0],e=n[1],r.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),Rl(o,a/s,t,e)))return!0}if(this.hasFill())return El(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=on,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"===typeof t?n[t]=e:j(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&on)},e.prototype.createStyle=function(t){return Lt(Nl,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=j({},this.shape))},e.prototype._applyStateObj=function(e,n,r,i,o,a){t.prototype._applyStateObj.call(this,e,n,r,i,o,a);var s,l=!(n&&i);if(n&&n.shape?o?i?s=n.shape:(s=j({},r.shape),j(s,n.shape)):(s=j({},i?this.shape:r.shape),j(s,n.shape)):l&&(s=r.shape),s)if(o){this.shape=j({},this.shape);for(var u={},c=et(s),h=0;h0},e.prototype.hasFill=function(){var t=this.style,e=t.fill;return null!=e&&"none"!==e},e.prototype.createStyle=function(t){return Lt(Gl,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=Ii(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var r=t.lineWidth;n.x-=r/2,n.y-=r/2,n.width+=r,n.height+=r}this._rect=n}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(ss);Hl.prototype.type="tspan";var jl=Hl,Wl=W({x:0,y:0},Qa),Ul={style:W({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},ts.style)};function ql(t){return!!(t&&"string"!==typeof t&&t.width&&t.height)}var Xl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.createStyle=function(t){return Lt(Wl,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var r=ql(e.image)?e.image:this.__image;if(!r)return 0;var i="width"===t?"height":"width",o=e[i];return null==o?r[t]:r[t]/r[i]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Ul},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new xi(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ss);Xl.prototype.type="image";var Yl=Xl;function $l(t,e){var n,r,i,o,a,s=e.x,l=e.y,u=e.width,c=e.height,h=e.r;u<0&&(s+=u,u=-u),c<0&&(l+=c,c=-c),"number"===typeof h?n=r=i=o=h:h instanceof Array?1===h.length?n=r=i=o=h[0]:2===h.length?(n=i=h[0],r=o=h[1]):3===h.length?(n=h[0],r=o=h[1],i=h[2]):(n=h[0],r=h[1],i=h[2],o=h[3]):n=r=i=o=0,n+r>u&&(a=n+r,n*=u/a,r*=u/a),i+o>u&&(a=i+o,i*=u/a,o*=u/a),r+i>c&&(a=r+i,r*=c/a,i*=c/a),n+o>c&&(a=n+o,n*=c/a,o*=c/a),t.moveTo(s+n,l),t.lineTo(s+u-r,l),0!==r&&t.arc(s+u-r,l+r,r,-Math.PI/2,0),t.lineTo(s+u,l+c-i),0!==i&&t.arc(s+u-i,l+c-i,i,0,Math.PI/2),t.lineTo(s+o,l+c),0!==o&&t.arc(s+o,l+c-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}var Zl=Math.round;function Kl(t,e,n){if(e){var r=e.x1,i=e.x2,o=e.y1,a=e.y2;t.x1=r,t.x2=i,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(Zl(2*r)===Zl(2*i)&&(t.x1=t.x2=Ql(r,s,!0)),Zl(2*o)===Zl(2*a)&&(t.y1=t.y2=Ql(o,s,!0)),t):t}}function Jl(t,e,n){if(e){var r=e.x,i=e.y,o=e.width,a=e.height;t.x=r,t.y=i,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=Ql(r,s,!0),t.y=Ql(i,s,!0),t.width=Math.max(Ql(r+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(Ql(i+a,s,!1)-t.y,0===a?0:1),t):t}}function Ql(t,e,n){if(!e)return t;var r=Zl(2*t);return(r+Zl(e))%2===0?r/2:(r+(n?1:-1))/2}var tu=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),eu={},nu=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.getDefaultShape=function(){return new tu},e.prototype.buildPath=function(t,e){var n,r,i,o;if(this.subPixelOptimize){var a=Jl(eu,e,this.style);n=a.x,r=a.y,i=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,r=e.y,i=e.width,o=e.height;e.r?$l(t,e):t.rect(n,r,i,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Fl);nu.prototype.type="rect";var ru=nu,iu={fill:"#000"},ou=2,au={style:W({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},ts.style)},su=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=iu,n.attr(e),n}return v(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,C=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),I=i.calculatedLineHeight,T=0;T=0&&(A=_[T],"right"===A.align))this._placeToken(A,t,w,g,I,"right",y),S-=A.width,I-=A.width,T--;C+=(r-(C-d)-(v-I)-S)/2;while(M<=T)A=_[M],this._placeToken(A,t,w,g,C+A.width/2,"center",y),C+=A.width,M++;g+=w}},e.prototype._placeToken=function(t,e,n,r,i,o,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=r+n/2;"top"===l?u=r+t.height/2:"bottom"===l&&(u=r+n-t.height/2);var c=!t.isLineHolder&&vu(s);c&&this._renderBackground(s,e,"right"===o?i-t.width:"center"===o?i-t.width/2:i,u-t.height/2,t.width,t.height);var h=!!s.backgroundColor,p=t.textPadding;p&&(i=du(i,o,p),u-=t.height/2-p[0]-t.innerHeight/2);var f=this._getOrCreateChild(jl),d=f.createStyle();f.useStyle(d);var g=this._defaultStyle,v=!1,y=0,m=fu("fill"in s?s.fill:"fill"in e?e.fill:(v=!0,g.fill)),x=pu("stroke"in s?s.stroke:"stroke"in e?e.stroke:h||a||g.autoStroke&&!v?null:(y=ou,g.stroke)),_=s.textShadowBlur>0||e.textShadowBlur>0;d.text=t.text,d.x=i,d.y=u,_&&(d.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,d.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",d.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,d.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),d.textAlign=o,d.textBaseline="middle",d.font=t.font||bi,d.opacity=_t(s.opacity,e.opacity,1),x&&(d.lineWidth=_t(s.lineWidth,e.lineWidth,y),d.lineDash=xt(s.lineDash,e.lineDash),d.lineDashOffset=e.lineDashOffset||0,d.stroke=x),m&&(d.fill=m);var b=t.contentWidth,w=t.contentHeight;f.setBoundingRect(new xi(Ti(d.x,b,d.textAlign),Ai(d.y,w,d.textBaseline),b,w))},e.prototype._renderBackground=function(t,e,n,r,i,o){var a,s,l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,h=l&&l.image,p=l&&!h,f=t.borderRadius,d=this;if(p||t.lineHeight||u&&c){a=this._getOrCreateChild(ru),a.useStyle(a.createStyle()),a.style.fill=null;var g=a.shape;g.x=n,g.y=r,g.width=i,g.height=o,g.r=f,a.dirtyShape()}if(p){var v=a.style;v.fill=l||null,v.fillOpacity=xt(t.fillOpacity,1)}else if(h){s=this._getOrCreateChild(Yl),s.onload=function(){d.dirtyStyle()};var y=s.style;y.image=l.image,y.x=n,y.y=r,y.width=i,y.height=o}if(u&&c){v=a.style;v.lineWidth=u,v.stroke=c,v.strokeOpacity=xt(t.strokeOpacity,1),v.lineDash=t.borderDash,v.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(v.strokeFirst=!0,v.lineWidth*=2)}var m=(a||s).style;m.shadowBlur=t.shadowBlur||0,m.shadowColor=t.shadowColor||"transparent",m.shadowOffsetX=t.shadowOffsetX||0,m.shadowOffsetY=t.shadowOffsetY||0,m.opacity=_t(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";if(t.fontSize||t.fontFamily||t.fontWeight){var n="";n="string"!==typeof t.fontSize||-1===t.fontSize.indexOf("px")&&-1===t.fontSize.indexOf("rem")&&-1===t.fontSize.indexOf("em")?isNaN(+t.fontSize)?"12px":t.fontSize+"px":t.fontSize,e=[t.fontStyle,t.fontWeight,n,t.fontFamily||"sans-serif"].join(" ")}return e&&Mt(e)||t.textFont||t.font},e}(ss),lu={left:!0,right:1,center:1},uu={top:1,bottom:1,middle:1};function cu(t){return hu(t),Z(t.rich,hu),t}function hu(t){if(t){t.font=su.makeFont(t);var e=t.align;"middle"===e&&(e="center"),t.align=null==e||lu[e]?e:"left";var n=t.verticalAlign;"center"===n&&(n="middle"),t.verticalAlign=null==n||uu[n]?n:"top";var r=t.padding;r&&(t.padding=wt(t.padding))}}function pu(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function fu(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function du(t,e,n){return"right"===e?t-n[1]:"center"===e?t+n[3]/2-n[1]/2:t+n[3]}function gu(t){var e=t.text;return null!=e&&(e+=""),e}function vu(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var yu=su,mu=na(),xu=function(t,e,n,r){if(r){var i=mu(r);i.dataIndex=n,i.dataType=e,i.seriesIndex=t,"group"===r.type&&r.traverse((function(r){var i=mu(r);i.seriesIndex=t,i.dataIndex=n,i.dataType=e}))}},_u=1,bu={},wu=na(),Su=0,Mu=1,Cu=2,Iu=["emphasis","blur","select"],Tu=["normal","emphasis","blur","select"],Au=10,Du=9,ku="highlight",Lu="downplay",Ou="select",Pu="unselect",Eu="toggleSelect";function Ru(t){return null!=t&&"none"!==t}var Nu=new _n(100);function zu(t){if("string"!==typeof t)return t;var e=Nu.get(t);return e||(e=zn(t,-.1),Nu.put(t,e)),e}function Bu(t,e,n){t.onHoverStateChange&&(t.hoverState||0)!==n&&t.onHoverStateChange(e),t.hoverState=n}function Vu(t){Bu(t,"emphasis",Cu)}function Fu(t){t.hoverState===Cu&&Bu(t,"normal",Su)}function Gu(t){Bu(t,"blur",Mu)}function Hu(t){t.hoverState===Mu&&Bu(t,"normal",Su)}function ju(t){t.selected=!0}function Wu(t){t.selected=!1}function Uu(t,e,n){e(t,n)}function qu(t,e,n){Uu(t,e,n),t.isGroup&&t.traverse((function(t){Uu(t,e,n)}))}function Xu(t,e){switch(e){case"emphasis":t.hoverState=Cu;break;case"normal":t.hoverState=Su;break;case"blur":t.hoverState=Mu;break;case"select":t.selected=!0}}function Yu(t,e,n,r){for(var i=t.style,o={},a=0;a=0,o=!1;if(t instanceof Fl){var a=wu(t),s=i&&a.selectFill||a.normalFill,l=i&&a.selectStroke||a.normalStroke;if(Ru(s)||Ru(l)){r=r||{};var u=r.style||{};"inherit"===u.fill?(o=!0,r=j({},r),u=j({},u),u.fill=s):!Ru(u.fill)&&Ru(s)?(o=!0,r=j({},r),u=j({},u),u.fill=zu(s)):!Ru(u.stroke)&&Ru(l)&&(o||(r=j({},r),u=j({},u)),u.stroke=zu(l)),r.style=u}}if(r&&null==r.z2){o||(r=j({},r));var c=t.z2EmphasisLift;r.z2=t.z2+(null!=c?c:Au)}return r}function Zu(t,e,n){if(n&&null==n.z2){n=j({},n);var r=t.z2SelectLift;n.z2=t.z2+(null!=r?r:Du)}return n}function Ku(t,e,n){var r=q(t.currentStates,e)>=0,i=t.style.opacity,o=r?null:Yu(t,["opacity"],e,{opacity:1});n=n||{};var a=n.style||{};return null==a.opacity&&(n=j({},n),a=j({opacity:r?i:.1*o.opacity},a),n.style=a),n}function Ju(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return $u(this,t,e,n);if("blur"===t)return Ku(this,t,n);if("select"===t)return Zu(this,t,n)}return n}function Qu(t){t.stateProxy=Ju;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=Ju),n&&(n.stateProxy=Ju)}function tc(t,e){!lc(t,e)&&!t.__highByOuter&&qu(t,Vu)}function ec(t,e){!lc(t,e)&&!t.__highByOuter&&qu(t,Fu)}function nc(t,e){t.__highByOuter|=1<<(e||0),qu(t,Vu)}function rc(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&qu(t,Fu)}function ic(t){qu(t,Gu)}function oc(t){qu(t,Hu)}function ac(t){qu(t,ju)}function sc(t){qu(t,Wu)}function lc(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function uc(t){var e=t.getModel();e.eachComponent((function(e,n){var r="series"===e?t.getViewOfSeriesModel(n):t.getViewOfComponentModel(n);r.group.traverse((function(t){Hu(t)}))}))}function cc(t,e,n,r){var i=r.getModel();function o(t,e){for(var n=0;n0){var o={dataIndex:i,seriesIndex:t.seriesIndex};null!=r&&(o.dataType=r),e.push(o)}}))})),e}function xc(t,e,n){Mc(t,!0),qu(t,Qu),_c(t,e,n)}function _c(t,e,n){var r=mu(t);null!=e?(r.focus=e,r.blurScope=n):r.focus&&(r.focus=null)}var bc=["emphasis","blur","select"],wc={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Sc(t,e,n,r){n=n||"itemStyle";for(var i=0;i0){var h=c.duration,p=c.delay,f=c.easing,d={duration:h,delay:p||0,easing:f,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,d):e.animateTo(n,d)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Ec(t,e,n,r,i,o){Pc("update",t,e,n,r,i,o)}function Rc(t,e,n,r,i,o){Pc("init",t,e,n,r,i,o)}function Nc(t){if(!t.__zr)return!0;for(var e=0;e=0&&n.push(t)})),n}t.topologicalTravel=function(t,e,r,i){if(t.length){var o=n(e),a=o.graph,s=o.noEntryList,l={};Z(t,(function(t){l[t]=!0}));while(s.length){var u=s.pop(),c=a[u],h=!!l[u];h&&(r.call(i,u,c.originalDeps.slice()),delete l[u]),Z(c.successor,h?f:p)}Z(l,(function(){var t="";throw new Error(t)}))}function p(t){a[t].entryCount--,0===a[t].entryCount&&s.push(t)}function f(t){l[t]=!0,p(t)}}}function bh(t,e){return G(G({},t,!0),e,!0)}var wh={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},Sh={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},Mh="ZH",Ch="EN",Ih=Ch,Th={},Ah={},Dh=S.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return t.indexOf(Mh)>-1?Mh:Ih}():Ih;function kh(t,e){t=t.toUpperCase(),Ah[t]=new vh(e),Th[t]=e}function Lh(t){if(st(t)){var e=Th[t.toUpperCase()]||{};return t===Mh||t===Ch?F(e):G(F(e),F(Th[Ih]),!1)}return G(F(t),F(Th[Ih]),!1)}function Oh(t){return Ah[t]}function Ph(){return Ah[Ih]}kh(Ch,wh),kh(Mh,Sh);var Eh=1e3,Rh=60*Eh,Nh=60*Rh,zh=24*Nh,Bh=365*zh,Vh={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Fh="{yyyy}-{MM}-{dd}",Gh={year:"{yyyy}",month:"{yyyy}-{MM}",day:Fh,hour:Fh+" "+Vh.hour,minute:Fh+" "+Vh.minute,second:Fh+" "+Vh.second,millisecond:Vh.none},Hh=["year","month","day","hour","minute","second","millisecond"],jh=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Wh(t,e){return t+="","0000".substr(0,e-t.length)+t}function Uh(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function qh(t){return t===Uh(t)}function Xh(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Yh(t,e,n,r){var i=bo(t),o=i[Jh(n)](),a=i[Qh(n)]()+1,s=Math.floor((a-1)/4)+1,l=i[tp(n)](),u=i["get"+(n?"UTC":"")+"Day"](),c=i[ep(n)](),h=(c-1)%12+1,p=i[np(n)](),f=i[rp(n)](),d=i[ip(n)](),g=r instanceof vh?r:Oh(r||Dh)||Ph(),v=g.getModel("time"),y=v.get("month"),m=v.get("monthAbbr"),x=v.get("dayOfWeek"),_=v.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,o%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,m[a-1]).replace(/{MM}/g,Wh(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,Wh(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[u]).replace(/{ee}/g,_[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Wh(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Wh(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Wh(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,Wh(f,2)).replace(/{s}/g,f+"").replace(/{SSS}/g,Wh(d,3)).replace(/{S}/g,d+"")}function $h(t,e,n,r,i){var o=null;if("string"===typeof n)o=n;else if("function"===typeof n)o=n(t.value,e,{level:t.level});else{var a=j({},Vh);if(t.level>0)for(var s=0;s=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(ot(o)){var h=null==t.level?0:t.level>=0?t.level:o.length+t.level;h=Math.min(h,o.length-1),o=o[h]}}return Yh(new Date(t.value),o,i,r)}function Zh(t,e){var n=bo(t),r=n[Qh(e)]()+1,i=n[tp(e)](),o=n[ep(e)](),a=n[np(e)](),s=n[rp(e)](),l=n[ip(e)](),u=0===l,c=u&&0===s,h=c&&0===a,p=h&&0===o,f=p&&1===i,d=f&&1===r;return d?"year":f?"month":p?"day":h?"hour":c?"minute":u?"second":"millisecond"}function Kh(t,e,n){var r="number"===typeof t?bo(t):t;switch(e=e||Zh(t,n),e){case"year":return r[Jh(n)]();case"half-year":return r[Qh(n)]()>=6?1:0;case"quarter":return Math.floor((r[Qh(n)]()+1)/4);case"month":return r[Qh(n)]();case"day":return r[tp(n)]();case"half-day":return r[ep(n)]()/24;case"hour":return r[ep(n)]();case"minute":return r[np(n)]();case"second":return r[rp(n)]();case"millisecond":return r[ip(n)]()}}function Jh(t){return t?"getUTCFullYear":"getFullYear"}function Qh(t){return t?"getUTCMonth":"getMonth"}function tp(t){return t?"getUTCDate":"getDate"}function ep(t){return t?"getUTCHours":"getHours"}function np(t){return t?"getUTCMinutes":"getMinutes"}function rp(t){return t?"getUTCSeconds":"getSeconds"}function ip(t){return t?"getUTCMilliseconds":"getMilliseconds"}function op(t){return t?"setUTCFullYear":"setFullYear"}function ap(t){return t?"setUTCMonth":"setMonth"}function sp(t){return t?"setUTCDate":"setDate"}function lp(t){return t?"setUTCHours":"setHours"}function up(t){return t?"setUTCMinutes":"setMinutes"}function cp(t){return t?"setUTCSeconds":"setSeconds"}function hp(t){return t?"setUTCMilliseconds":"setMilliseconds"}function pp(t,e,n,r,i,o,a,s){var l=new yu({style:{text:t,font:e,align:n,verticalAlign:r,padding:i,rich:o,overflow:a?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function fp(t){if(!Ao(t))return st(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function dp(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var gp=wt,vp=/([&<>"'])/g,yp={"&":"&","<":"<",">":">",'"':""","'":"'"};function mp(t){return null==t?"":(t+"").replace(vp,(function(t,e){return yp[e]}))}function xp(t,e,n){var r="{yyyy}-{MM}-{dd} {hh}:{mm}:{ss}";function i(t){return t&&Mt(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var a="time"===e,s=t instanceof Date;if(a||s){var l=a?bo(t):t;if(!isNaN(+l))return Yh(l,r,n);if(s)return"-"}if("ordinal"===e)return lt(t)?i(t):ut(t)&&o(t)?t+"":"-";var u=To(t);return o(u)?fp(u):lt(t)?i(t):"boolean"===typeof t?t+"":"-"}var _p=["a","b","c","d","e","f","g"],bp=function(t,e){return"{"+t+(null==e?"":e)+"}"};function wp(t,e,n){ot(e)||(e=[e]);var r=e.length;if(!r)return"";for(var i=e[0].$vars||[],o=0;o':'';var a=n.markerId||"markerX";return{renderMode:o,content:"{"+a+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}}function Cp(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var r=bo(e),i=n?"UTC":"",o=r["get"+i+"FullYear"](),a=r["get"+i+"Month"]()+1,s=r["get"+i+"Date"](),l=r["get"+i+"Hours"](),u=r["get"+i+"Minutes"](),c=r["get"+i+"Seconds"](),h=r["get"+i+"Milliseconds"]();return t=t.replace("MM",Wh(a,2)).replace("M",a).replace("yyyy",o).replace("yy",o%100+"").replace("dd",Wh(s,2)).replace("d",s).replace("hh",Wh(l,2)).replace("h",l).replace("mm",Wh(u,2)).replace("m",u).replace("ss",Wh(c,2)).replace("s",c).replace("SSS",Wh(h,3)),t}function Ip(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function Tp(t,e){return e=e||"transparent",st(t)?t:ct(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Ap(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var Dp=Z,kp=["left","right","top","bottom","width","height"],Lp=[["width","left","right"],["height","top","bottom"]];function Op(t,e,n,r,i){var o=0,a=0;null==r&&(r=1/0),null==i&&(i=1/0);var s=0;e.eachChild((function(l,u){var c,h,p=l.getBoundingRect(),f=e.childAt(u+1),d=f&&f.getBoundingRect();if("horizontal"===t){var g=p.width+(d?-d.x+p.x:0);c=o+g,c>r||l.newline?(o=0,c=g,a+=s+n,s=p.height):s=Math.max(s,p.height)}else{var v=p.height+(d?-d.y+p.y:0);h=a+v,h>i||l.newline?(o+=s+n,a=0,h=v,s=p.width):s=Math.max(s,p.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=c+n:a=h+n)}))}var Pp=Op;it(Op,"vertical"),it(Op,"horizontal");function Ep(t,e,n){var r=e.width,i=e.height,o=lo(t.left,r),a=lo(t.top,i),s=lo(t.right,r),l=lo(t.bottom,i);return(isNaN(o)||isNaN(parseFloat(t.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(t.right)))&&(s=r),(isNaN(a)||isNaN(parseFloat(t.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(t.bottom)))&&(l=i),n=gp(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}function Rp(t,e,n){n=gp(n||0);var r=e.width,i=e.height,o=lo(t.left,r),a=lo(t.top,i),s=lo(t.right,r),l=lo(t.bottom,i),u=lo(t.width,r),c=lo(t.height,i),h=n[2]+n[0],p=n[1]+n[3],f=t.aspect;switch(isNaN(u)&&(u=r-s-p-o),isNaN(c)&&(c=i-l-h-a),null!=f&&(isNaN(u)&&isNaN(c)&&(f>r/i?u=.8*r:c=.8*i),isNaN(u)&&(u=f*c),isNaN(c)&&(c=u/f)),isNaN(o)&&(o=r-s-u-p),isNaN(a)&&(a=i-l-c-h),t.left||t.right){case"center":o=r/2-u/2-n[3];break;case"right":o=r-u-p;break}switch(t.top||t.bottom){case"middle":case"center":a=i/2-c/2-n[0];break;case"bottom":a=i-c-h;break}o=o||0,a=a||0,isNaN(u)&&(u=r-p-o-(s||0)),isNaN(c)&&(c=i-h-a-(l||0));var d=new xi(o+n[3],a+n[0],u,c);return d.margin=n,d}function Np(t,e,n,r,i){var o=!i||!i.hv||i.hv[0],a=!i||!i.hv||i.hv[1],s=i&&i.boundingMode||"all";if(o||a){var l;if("raw"===s)l="group"===t.type?new xi(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(l=t.getBoundingRect(),t.needLocalTransform()){var u=t.getLocalTransform();l=l.clone(),l.applyTransform(u)}var c=Rp(W({width:l.width,height:l.height},e),n,r),h=o?c.x-l.x:0,p=a?c.y-l.y:0;"raw"===s?(t.x=h,t.y=p):(t.x+=h,t.y+=p),t.markRedraw()}}function zp(t,e){return null!=t[Lp[e][0]]||null!=t[Lp[e][1]]&&null!=t[Lp[e][2]]}function Bp(t){var e=t.layoutMode||t.constructor.layoutMode;return ct(e)?e:e?{type:e}:null}function Vp(t,e,n){var r=n&&n.ignoreSize;!ot(r)&&(r=[r,r]);var i=a(Lp[0],0),o=a(Lp[1],1);function a(n,i){var o={},a=0,u={},c=0,h=2;if(Dp(n,(function(e){u[e]=t[e]})),Dp(n,(function(t){s(e,t)&&(o[t]=u[t]=e[t]),l(o,t)&&a++,l(u,t)&&c++})),r[i])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(c!==h&&a){if(a>=h)return o;for(var p=0;p=0;a--)o=G(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",r=t+"Id";return la(this.ecModel,t,{index:this.get(n,!0),id:this.get(r,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(vh);function Wp(t){var e=[];return Z(jp.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=K(e,(function(t){return ya(t).main})),"dataset"!==t&&q(e,"dataset")<=0&&e.unshift("dataset"),e}wa(jp,vh),Ta(jp),xh(jp),_h(jp,Wp);var Up=jp,qp="";"undefined"!==typeof navigator&&(qp=navigator.platform||"");var Xp="rgba(0, 0, 0, 0.2)",Yp={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Xp,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Xp,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Xp,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Xp,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Xp,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Xp,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:qp.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},$p=Dt(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),Zp="original",Kp="arrayRows",Jp="objectRows",Qp="keyedColumns",tf="typedArray",ef="unknown",nf="column",rf="row",of={Must:1,Might:2,Not:3},af=na();function sf(t){af(t).datasetMap=Dt()}function lf(t,e,n){var r={},i=cf(e);if(!i||!t)return r;var o,a,s=[],l=[],u=e.ecModel,c=af(u).datasetMap,h=i.uid+"_"+n.seriesLayoutBy;t=t.slice(),Z(t,(function(e,n){var i=ct(e)?e:t[n]={name:e};"ordinal"===i.type&&null==o&&(o=n,a=d(i)),r[i.name]=[]}));var p=c.get(h)||c.set(h,{categoryWayDim:a,valueWayDim:0});function f(t,e,n){for(var r=0;re)return t[r];return t[n-1]}function wf(t,e,n,r,i,o,a){o=o||t;var s=e(o),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=null!=a&&r?bf(r,a):n;if(c=c||n,c&&c.length){var h=c[l];return i&&(u[i]=h),s.paletteIdx=(l+1)%c.length,h}}function Sf(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var Mf,Cf,If;"undefined"!==typeof console&&console.warn&&console.log;function Tf(t){0}function Af(t){throw new Error(t)}var Df="\0_ec_inner",kf=1;var Lf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.init=function(t,e,n,r,i,o){r=r||{},this.option=null,this._theme=new vh(r),this._locale=new vh(i),this._optionManager=o},e.prototype.setOption=function(t,e,n){var r=Nf(e);this._optionManager.setOption(t,n,r),this._resetOption(null,r)},e.prototype.resetOption=function(t,e){return this._resetOption(t,Nf(e))},e.prototype._resetOption=function(t,e){var n=!1,r=this._optionManager;if(!t||"recreate"===t){var i=r.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(i,e)):If(this,i),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=r.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=r.getMediaOption(this);a.length&&Z(a,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,r=this._componentsMap,i=this._componentsCount,o=[],a=Dt(),s=e&&e.replaceMergeMainTypeMap;function l(e){var o=vf(this,e,Eo(t[e])),a=r.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=Vo(a,o,l);Jo(u,e,Up),n[e]=null,r.set(e,null),i.set(e,0);var c=[],h=[],p=0;Z(u,(function(t,n){var r=t.existing,i=t.newOption;if(i){var o="series"===e,a=Up.getClass(e,t.keyInfo.subType,!o);if(!a)return;if(r&&r.constructor===a)r.name=t.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var s=j({componentIndex:n},t.keyInfo);r=new a(i,this,this,s),j(r,s),t.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}else r&&(r.mergeOption({},this),r.optionUpdated({},!1));r?(c.push(r.option),h.push(r),p++):(c.push(void 0),h.push(void 0))}),this),n[e]=c,r.set(e,h),i.set(e,p),"series"===e&&Mf(this)}sf(this),Z(t,(function(t,e){null!=t&&(Up.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?F(t):G(n[e],t,!0))})),s&&s.each((function(t,e){Up.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))})),Up.topologicalTravel(o,Up.getAllClassMainTypes(),l,this),this._seriesIndices||Mf(this)},e.prototype.getOption=function(){var t=F(this.option);return Z(t,(function(e,n){if(Up.hasClass(n)){for(var r=Eo(e),i=r.length,o=!1,a=i-1;a>=0;a--)r[a]&&!Zo(r[a])?o=!0:(r[a]=null,!o&&i--);r.length=i,t[n]=r}})),delete t[Df],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var r=n[e||0];if(r)return r;if(null==e)for(var i=0;i=e:"max"===n?t<=e:t===e}function $f(t,e){return t.join(",")===e.join(",")}var Zf=Uf,Kf=Z,Jf=ct,Qf=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function td(t){var e=t&&t.itemStyle;if(e)for(var n=0,r=Qf.length;n=0;d--){var g=t[d];if(s||(h=g.data.rawIndexOf(g.stackedByDimension,c)),h>=0){var v=g.data.getByRawIndex(g.stackResultDimension,h);if(p>=0&&v>0||p<=0&&v<0){p=vo(p,v),f=v;break}}}return r[0]=p,r[1]=f,r}))}))}var Sd,Md,Cd,Id,Td,Ad=function(){function t(t){this.data=t.data||(t.sourceFormat===Qp?{}:[]),this.sourceFormat=t.sourceFormat||ef,this.seriesLayoutBy=t.seriesLayoutBy||nf,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;nu&&(u=f)}s[0]=l,s[1]=u}},r=function(){return this._data?this._data.length/this._dimSize:0};function i(t){for(var e=0;e=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}))}},t.prototype.getRawValue=function(t,e){return Zd(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function Qd(t){var e,n;return ct(t)?t.type&&(n=t):e=t,{markupText:e,markupFragment:n}}function tg(t){return new eg(t)}var eg=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,r=t&&t.skip;if(this._dirty&&n){var i=this.context;i.data=i.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!r&&(e=this._plan(this.context));var o,a=c(this._modBy),s=this._modDataCount||0,l=c(t&&t.modBy),u=t&&t.modDataCount||0;function c(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(r)),this._modBy=l,this._modDataCount=u;var h=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,f=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!r&&(o||p1&&r>0?s:a}};return o;function a(){return e=t?null:oe},gte:function(t,e){return t>=e}},sg=function(){function t(t,e){if("number"!==typeof e){var n="";0,Af(n)}this._opFn=ag[t],this._rvalFloat=To(e)}return t.prototype.evaluate=function(t){return"number"===typeof t?this._opFn(t,this._rvalFloat):this._opFn(To(t),this._rvalFloat)},t}(),lg=function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=typeof t,r=typeof e,i="number"===n?t:To(t),o="number"===r?e:To(e),a=isNaN(i),s=isNaN(o);if(a&&(i=this._incomparable),s&&(o=this._incomparable),a&&s){var l="string"===n,u="string"===r;l&&(i=u?t:0),u&&(o=l?e:0)}return io?-this._resultLT:0},t}(),ug=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=To(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=To(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function cg(t,e){return"eq"===t||"ne"===t?new ug("eq"===t,e):Ot(ag,t)?new sg(t,e):null}var hg=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return rg(t,e)},t}();function pg(t,e){var n=new hg,r=t.data,i=n.sourceFormat=t.sourceFormat,o=t.startIndex,a="";t.seriesLayoutBy!==nf&&Af(a);var s=[],l={},u=t.dimensionsDefine;if(u)Z(u,(function(t,e){var n=t.name,r={index:e,name:n,displayName:t.displayName};if(s.push(r),null!=n){var i="";Ot(l,n)&&Af(i),l[n]=r}}));else for(var c=0;c65535?Mg:Cg}function kg(){return[1/0,-1/0]}function Lg(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Og(t,e,n,r,i){var o=Ag[n||"float"];if(i){var a=t[e],s=a&&a.length;if(s!==r){for(var l=new o(r),u=0;ug[1]&&(g[1]=d)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var r=this._provider,i=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=K(o,(function(t){return t.property})),u=0;uv[1]&&(v[1]=g)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;i=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var r=this._chunks,i=r[t],o=[];if(!i)return o;null==n&&(n=1/0);for(var a=1/0,s=-1,l=0,u=0,c=this.count();u=0&&s<0)&&(a=f,s=p,l=0),p===s&&(o[l++]=u))}return o.length=l,o},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,r=this._count;if(n===Array){t=new n(r);for(var i=0;i=c&&y<=h||isNaN(y))&&(s[l++]=d),d++}f=!0}else if(2===i){g=p[r[0]];var m=p[r[1]],x=t[r[1]][0],_=t[r[1]][1];for(v=0;v=c&&y<=h||isNaN(y))&&(b>=x&&b<=_||isNaN(b))&&(s[l++]=d),d++}f=!0}}if(!f)if(1===i)for(v=0;v=c&&y<=h||isNaN(y))&&(s[l++]=w)}else for(v=0;vt[C][1])&&(S=!1)}S&&(s[l++]=e.getRawIndex(v))}return lv[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,r,i,o=this.clone([t],!0),a=o._chunks,s=a[t],l=this.count(),u=0,c=Math.floor(1/e),h=this.getRawIndex(0),p=new(Dg(this._rawCount))(Math.ceil(l/c)+2);p[u++]=h;for(var f=1;fn&&(n=r,i=x))}p[u++]=i,h=i}return p[u++]=this.getRawIndex(l-1),o._count=u,o._indices=p,o.getRawIndex=this._getRawIdx,o},t.prototype.downSample=function(t,e,n,r){for(var i=this.clone([t],!0),o=i._chunks,a=[],s=Math.floor(1/e),l=o[t],u=this.count(),c=i._rawExtent[t]=kg(),h=new(Dg(this._rawCount))(Math.ceil(u/s)),p=0,f=0;fu-f&&(s=u-f,a.length=s);for(var d=0;dc[1]&&(c[1]=v),h[p++]=y}return i._count=p,i._indices=h,i._updateGetRawIdx(),i},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,r=this._chunks,i=0,o=this.count();is&&(s=c)}return r=[a,s],this._extent[t]=r,r},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],r=this._chunks,i=0;i=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,r){return rg(t[r],this._dimensions[r])}wg={arrayRows:t,objectRows:function(t,e,n,r){return rg(t[e],this._dimensions[r])},keyedColumns:t,original:function(t,e,n,r){var i=t&&(null==t.value?t:t.value);return rg(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(t,e,n,r){return t[r]}}}(),t}(),Eg=Pg,Rg=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length;if(zg(n)){var o=n,a=void 0,s=void 0,l=void 0;if(i){var u=r[0];u.prepareSource(),l=u.getSource(),a=l.data,s=l.sourceFormat,e=[u._getVersionSign()]}else a=o.get("data",!0),s=pt(a)?tf:Zp,e=[];var c=this._getSourceMetaRawOption()||{},h=l&&l.metaRawOption||{},p=xt(c.seriesLayoutBy,h.seriesLayoutBy)||null,f=xt(c.sourceHeader,h.sourceHeader)||null,d=xt(c.dimensions,h.dimensions),g=p!==h.seriesLayoutBy||!!f!==!!h.sourceHeader||d;t=g?[kd(a,{seriesLayoutBy:p,sourceHeader:f,dimensions:d},s)]:[]}else{var v=n;if(i){var y=this._applyTransform(r);t=y.sourceList,e=y.upstreamSignList}else{var m=v.get("source",!0);t=[kd(m,this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,r=n.get("transform",!0),i=n.get("fromTransformResult",!0);if(null!=i){var o="";1!==t.length&&Bg(o)}var a=[],s=[];return Z(t,(function(t){t.prepareSource();var e=t.getSource(i||0),n="";null==i||e||Bg(n),a.push(e),s.push(t._getVersionSign())})),r?e=xg(r,a,{datasetIndex:n.componentIndex}):null!=i&&(e=[Od(a[0])]),{sourceList:e,upstreamSignList:s}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e1||e>0&&!t.noHeader,r=0;Z(t.blocks,(function(t){Wg(t).planLayout(t);var e=t.__gapLevelBetweenSubBlocks;e>=r&&(r=e+(!n||e&&("section"!==t.type||t.noHeader)?0:1))})),t.__gapLevelBetweenSubBlocks=r},build:function(t,e,n,r){var i=e.noHeader,o=Yg(e),a=qg(t,e,i?n:o.html,r);if(i)return a;var s=xp(e.header,"ordinal",t.useUTC),l=Fg(r,t.renderMode).nameStyle;return"richText"===t.renderMode?Jg(t,s,l)+o.richText+a:$g('
'+mp(s)+"
"+a,n)}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,n,r){var i=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=e.value,c=t.useUTC;if(!o||!a){var h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),p=o?"":xp(l,"ordinal",c),f=e.valueType,d=a?[]:ot(u)?K(u,(function(t,e){return xp(t,ot(f)?f[e]:f,c)})):[xp(u,ot(f)?f[0]:f,c)],g=!s||!o,v=!s&&o,y=Fg(r,i),m=y.nameStyle,x=y.valueStyle;return"richText"===i?(s?"":h)+(o?"":Jg(t,p,m))+(a?"":Qg(t,d,g,v,x)):$g((s?"":h)+(o?"":Zg(p,!s,m))+(a?"":Kg(d,g,v,x)),n)}}}};function qg(t,e,n,r){var i=[],o=e.blocks||[];St(!o||ot(o)),o=o||[];var a=t.orderMode;if(e.sortBlocks&&a){o=o.slice();var s={valueAsc:"asc",valueDesc:"desc"};if(Ot(s,a)){var l=new lg(s[a],null);o.sort((function(t,e){return l.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===a&&o.reverse()}var u=Yg(e);if(Z(o,(function(e,n){var o=Wg(e).build(t,e,n>0?u.html:0,r);null!=o&&i.push(o)})),i.length)return"richText"===t.renderMode?i.join(u.richText):$g(i.join(""),n)}function Xg(t,e,n,r,i,o){if(t){var a=Wg(t);a.planLayout(t);var s={useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:e};return a.build(s,t,0,o)}}function Yg(t){var e=t.__gapLevelBetweenSubBlocks;return{html:Gg[e],richText:Hg[e]}}function $g(t,e){var n='
',r="margin: "+e+"px 0 0";return'
'+t+n+"
"}function Zg(t,e,n){var r=e?"margin-left:2px":"";return''+mp(t)+""}function Kg(t,e,n,r){var i=n?"10px":"20px",o=e?"float:right;margin-left:"+i:"";return''+K(t,(function(t){return mp(t)})).join("  ")+""}function Jg(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function Qg(t,e,n,r,i){var o=[i],a=r?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(e.join(" "),o)}function tv(t,e){var n=t.getData().getItemVisual(e,"style"),r=n[t.visualDrawType];return Tp(r)}function ev(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var nv=function(){function t(){this.richTextStyles={},this._nextStyleNameId=Do()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var r="richText"===n?this._generateStyleName():null,i=Mp({color:e,type:t,renderMode:n,markerId:r});return st(i)?i:(this.richTextStyles[r]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};ot(e)?Z(e,(function(t){return j(n,t)})):j(n,e);var r=this._generateStyleName();return this.richTextStyles[r]=n,"{"+r+"|"+t+"}"},t}();function rv(t){var e,n,r,i,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=o.getRawValue(a),p=ot(h),f=tv(o,a);if(c>1||p&&!c){var d=iv(h,o,a,u,f);e=d.inlineValues,n=d.inlineValueTypes,r=d.blocks,i=d.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);i=e=Zd(l,a,u[0]),n=g.type}else i=e=p?h[0]:h;var v=$o(o),y=v&&o.name||"",m=l.getName(a),x=s?y:m;return jg("section",{header:y,noHeader:s||!v,sortParam:i,blocks:[jg("nameValue",{markerType:"item",markerColor:f,name:x,noName:!Mt(x),value:e,valueType:n})].concat(r||[])})}function iv(t,e,n,r,i){var o=e.getData(),a=J(t,(function(t,e,n){var r=o.getDimensionInfo(n);return t||r&&!1!==r.tooltip&&null!=r.displayName}),!1),s=[],l=[],u=[];function c(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(jg("nameValue",{markerType:"subItem",markerColor:i,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return r.length?Z(r,(function(t){c(Zd(o,n,t),t)})):Z(t,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}var ov=na();function av(t,e){return t.getName(e)||t.getId(e)}var sv="__universalTransitionEnabled",lv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return v(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=tg({count:hv,reset:pv}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n);var r=ov(this).sourceManager=new Rg(this);r.prepareSource();var i=this.getInitialData(t,n);dv(i,this),this.dataTask.context.data=i,ov(this).dataBeforeProcessed=i,uv(this),this._initSelectedMapFromData(i)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Bp(this),r=n?Fp(t):{},i=this.subType;Up.hasClass(i)&&(i+="Series"),G(t,e.getTheme().get(this.subType)),G(t,this.getDefaultOption()),Ro(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Vp(t,r,n)},e.prototype.mergeOption=function(t,e){t=G(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Bp(this);n&&Vp(this.option,t,n);var r=ov(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(t,e);dv(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,ov(this).dataBeforeProcessed=i,uv(this),this._initSelectedMapFromData(i)},e.prototype.fillDataTextStyle=function(t){if(t&&!pt(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(t=!1),!!t},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var r=this.ecModel,i=xf.prototype.getColorFromPalette.call(this,t,e,n);return i||(i=r.getColorFromPalette(t,e,n)),i},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var r=this.getData(e),i=0;i=0&&n.push(i)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(e),i=av(r,t);return n[i]||!1},e.prototype.isUniversalTransitionEnabled=function(){if(this[sv])return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,r,i=this.option.selectedMode,o=e.length;if(i&&o)if("multiple"===i)for(var a=this.option.selectedMap||(this.option.selectedMap={}),s=0;s0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Up.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Up);function uv(t){var e=t.name;$o(t)||(t.name=cv(t)||e)}function cv(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),r=[];return Z(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&r.push(n.displayName)})),r.join(" ")}function hv(t){return t.model.getRawData().count()}function pv(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),fv}function fv(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function dv(t,e){Z(kt(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,it(gv,e))}))}function gv(t,e){var n=vv(t);return n&&n.setOutputEnd((e||this).count()),e}function vv(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(t.uid))}return r}}Y(lv,Jd),Y(lv,xf),wa(lv,Up);var yv=lv,mv=function(){function t(){this.group=new Ui,this.uid=mh("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,r){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,r){},t.prototype.updateLayout=function(t,e,n,r){},t.prototype.updateVisual=function(t,e,n,r){},t.prototype.blurSeries=function(t,e){},t}();_a(mv),Ta(mv);var xv=mv;function _v(){var t=na();return function(e){var n=t(e),r=e.pipelineContext,i=!!n.large,o=!!n.progressiveRender,a=n.large=!(!r||!r.large),s=n.progressiveRender=!(!r||!r.progressiveRender);return!(i===a&&o===s)&&"reset"}}var bv=na(),wv=_v(),Sv=function(){function t(){this.group=new Ui,this.uid=mh("viewChart"),this.renderTask=tg({plan:Iv,reset:Tv}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,r){},t.prototype.highlight=function(t,e,n,r){Cv(t.getData(),r,"emphasis")},t.prototype.downplay=function(t,e,n,r){Cv(t.getData(),r,"normal")},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,r){this.render(t,e,n,r)},t.prototype.updateLayout=function(t,e,n,r){this.render(t,e,n,r)},t.prototype.updateVisual=function(t,e,n,r){this.render(t,e,n,r)},t.markUpdateMethod=function(t,e){bv(t).updateMethod=e},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function Mv(t,e,n){t&&("emphasis"===e?nc:rc)(t,n)}function Cv(t,e,n){var r=ea(t,e),i=e&&null!=e.highlightKey?Tc(e.highlightKey):null;null!=r?Z(Eo(r),(function(e){Mv(t.getItemGraphicEl(e),n,i)})):t.eachItemGraphicEl((function(t){Mv(t,n,i)}))}function Iv(t){return wv(t.model)}function Tv(t){var e=t.model,n=t.ecModel,r=t.api,i=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,s=i&&bv(i).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,r,i),Av[l]}_a(Sv,["dispose"]),Ta(Sv);var Av={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Dv=Sv,kv="\0__throttleOriginMethod",Lv="\0__throttleRate",Ov="\0__throttleType";function Pv(t,e,n){var r,i,o,a,s,l=0,u=0,c=null;function h(){u=(new Date).getTime(),c=null,t.apply(o,a||[])}e=e||0;var p=function(){for(var t=[],p=0;p=0?h():c=setTimeout(h,-i),l=r};return p.clear=function(){c&&(clearTimeout(c),c=null)},p.debounceNextCall=function(t){s=t},p}function Ev(t,e,n,r){var i=t[e];if(i){var o=i[kv]||i,a=i[Ov],s=i[Lv];if(s!==n||a!==r){if(null==n||!r)return t[e]=o;i=t[e]=Pv(o,n,"debounce"===r),i[kv]=o,i[Ov]=r,i[Lv]=n}return i}}function Rv(t,e){var n=t[e];n&&n[kv]&&(t[e]=n[kv])}var Nv=na(),zv={itemStyle:Aa(ph,!0),lineStyle:Aa(uh,!0)},Bv={lineStyle:"stroke",itemStyle:"fill"};function Vv(t,e){var n=t.visualStyleMapper||zv[e];return n||(console.warn("Unkown style type '"+e+"'."),zv.itemStyle)}function Fv(t,e){var n=t.visualDrawType||Bv[e];return n||(console.warn("Unkown style type '"+e+"'."),"fill")}var Gv={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),r=t.visualStyleAccessPath||"itemStyle",i=t.getModel(r),o=Vv(t,r),a=o(i),s=i.getShallow("decal");s&&(n.setVisual("decal",s),s.dirty=!0);var l=Fv(t,r),u=a[l],c=at(u)?u:null,h="auto"===a.fill||"auto"===a.stroke;if(!a[l]||c||h){var p=t.getColorFromPalette(t.name,null,e.getSeriesCount());a[l]||(a[l]=p,n.setVisual("colorFromPalette",!0)),a.fill="auto"===a.fill||"function"===typeof a.fill?p:a.fill,a.stroke="auto"===a.stroke||"function"===typeof a.stroke?p:a.stroke}if(n.setVisual("style",a),n.setVisual("drawType",l),!e.isSeriesFiltered(t)&&c)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var r=t.getDataParams(n),i=j({},a);i[l]=c(r),e.setItemVisual(n,"style",i)}}}},Hv=new vh,jv={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),r=t.visualStyleAccessPath||"itemStyle",i=Vv(t,r),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[r]){Hv.option=n[r];var a=i(Hv),s=t.ensureUniqueItemVisual(e,"style");j(s,a),Hv.option.decal&&(t.setItemVisual(e,"decal",Hv.option.decal),Hv.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},Wv={performRawSeries:!0,overallReset:function(t){var e=Dt();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var r=t.type+"-"+n,i=e.get(r);i||(i={},e.set(r,i)),Nv(t).scope=i}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),r={},i=e.getData(),o=Nv(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=Fv(e,a);i.each((function(t){var e=i.getRawIndex(t);r[e]=t})),n.each((function(t){var a=r[t],l=i.getItemVisual(a,"colorFromPalette");if(l){var u=i.ensureUniqueItemVisual(a,"style"),c=n.getName(t)||t+"",h=n.count();u[s]=e.getColorFromPalette(c,o,h)}}))}}))}},Uv=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0}return t}(),qv=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Uv},e.prototype.buildPath=function(t,e){var n=e.cx,r=e.cy,i=Math.max(e.r,0),o=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(o),u=Math.sin(o);t.moveTo(l*i+n,u*i+r),t.arc(n,r,i,o,a,!s)},e}(Fl);qv.prototype.type="arc";var Xv=qv,Yv=Math.PI;function $v(t,e){e=e||{},W(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Ui,r=new ru({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(r);var i,o=new yu({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new ru({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&(i=new Xv({shape:{startAngle:-Yv/2,endAngle:-Yv/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),i.animateShape(!0).when(1e3,{endAngle:3*Yv/2}).start("circularInOut"),i.animateShape(!0).when(1e3,{startAngle:3*Yv/2}).delay(300).start("circularInOut"),n.add(i)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&i.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}var Zv=function(){function t(t,e,n,r){this._stageTaskMap=Dt(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),r=n.context,i=!e&&n.progressiveEnabled&&(!r||r.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=i?n.step:null,a=r&&r.modDataCount,s=null!=a?Math.ceil(a/o):null;return{step:o,modBy:s,modDataCount:a}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),r=t.getData(),i=r.count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,a=t.get("large")&&i>=t.get("largeThreshold"),s="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:s,large:a}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=Dt();t.eachSeries((function(t){var r=t.getProgressive(),i=t.uid;n.set(i,{id:i,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:r&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(r||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;Z(this._allHandlers,(function(r){var i=t.get(r.uid)||t.set(r.uid,{}),o="";St(!(r.reset&&r.overallReset),o),r.reset&&this._createSeriesStageTask(r,i,e,n),r.overallReset&&this._createOverallStageTask(r,i,e,n)}),this)},t.prototype.prepareView=function(t,e,n,r){var i=t.renderTask,o=i.context;o.model=e,o.ecModel=n,o.api=r,i.__block=!t.incrementalPrepareRender,this._pipe(e,i)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,r){r=r||{};var i=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}Z(t,(function(t,s){if(!r.visualType||r.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,p=c.agentStubMap;p.each((function(t){a(r,t)&&(t.dirty(),h=!0)})),h&&c.dirty(),o.updatePayload(c,n);var f=o.getPerformArgs(c,r.block);p.each((function(t){t.perform(f)})),c.perform(f)&&(i=!0)}else u&&u.each((function(s,l){a(r,s)&&s.dirty();var u=o.getPerformArgs(s,r.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(i=!0)}))}})),this.unfinished=i||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,r){var i=this,o=e.seriesTaskMap,a=e.seriesTaskMap=Dt(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||tg({plan:ey,reset:ny,count:oy}));l.context={model:e,ecModel:n,api:r,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:i},i._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,r).each(u)},t.prototype._createOverallStageTask=function(t,e,n,r){var i=this,o=e.overallTask=e.overallTask||tg({reset:Kv});o.context={ecModel:n,api:r,overallReset:t.overallReset,scheduler:i};var a=o.agentStubMap,s=o.agentStubMap=Dt(),l=t.seriesType,u=t.getTargetSeries,c=!0,h=!1,p="";function f(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(h=!0,tg({reset:Jv,onDirty:ty})));n.context={model:t,overallProgress:c},n.agent=o,n.__block=c,i._pipe(t,n)}St(!t.createOnAllSeries,p),l?n.eachRawSeriesByType(l,f):u?u(n,r).each(f):(c=!1,Z(n.getSeries(),f)),h&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=e),r.tail&&r.tail.pipe(e),r.tail=e,e.__idxInPipeline=r.count++,e.__pipeline=r},t.wrapStageHandler=function(t,e){return at(t)&&(t={overallReset:t,seriesType:ay(t)}),t.uid=mh("stageHandler"),e&&(t.visualType=e),t},t}();function Kv(t){t.overallReset(t.ecModel,t.api,t.payload)}function Jv(t){return t.overallProgress&&Qv}function Qv(){this.agent.dirty(),this.getDownstream().dirty()}function ty(){this.agent&&this.agent.dirty()}function ey(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function ny(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Eo(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?K(e,(function(t,e){return iy(e)})):ry}var ry=iy(0);function iy(t){return function(e,n){var r=n.data,i=n.resetDefines[t];if(i&&i.dataEach)for(var o=e.start;o0&&c===i.length-u.length){var h=i.slice(0,c);"data"!==h&&(e.mainType=h,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(i)&&(n[i]=t,s=!0),s||(r[i]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:r}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,i,"name")&&u(l,i,"dataIndex")&&u(l,i,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,r,i));function u(t,e,n,r){return null==t[n]||e[r||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),by={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){var r=t.get("symbol"),i=t.get("symbolSize"),o=t.get("symbolKeepAspect"),a=t.get("symbolRotate"),s=t.get("symbolOffset"),l=at(r),u=at(i),c=at(a),h=at(s),p=l||u||c||h,f=!l&&r?r:t.defaultSymbol,d=u?null:i,g=c?null:a,v=h?null:s;if(n.setVisual({legendIcon:t.legendIcon||f,symbol:f,symbolSize:d,symbolKeepAspect:o,symbolRotate:g,symbolOffset:v}),!e.isSeriesFiltered(t))return{dataEach:p?y:null}}function y(e,n){var o=t.getRawValue(n),p=t.getDataParams(n);l&&e.setItemVisual(n,"symbol",r(o,p)),u&&e.setItemVisual(n,"symbolSize",i(o,p)),c&&e.setItemVisual(n,"symbolRotate",a(o,p)),h&&e.setItemVisual(n,"symbolOffset",s(o,p))}}},wy={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t)){var n=t.getData();return{dataEach:n.hasItemOption?r:null}}function r(t,e){var n=t.getItemModel(e),r=n.getShallow("symbol",!0),i=n.getShallow("symbolSize",!0),o=n.getShallow("symbolRotate",!0),a=n.getShallow("symbolOffset",!0),s=n.getShallow("symbolKeepAspect",!0);null!=r&&t.setItemVisual(e,"symbol",r),null!=i&&t.setItemVisual(e,"symbolSize",i),null!=o&&t.setItemVisual(e,"symbolRotate",o),null!=a&&t.setItemVisual(e,"symbolOffset",a),null!=s&&t.setItemVisual(e,"symbolKeepAspect",s)}}};function Sy(t,e,n){switch(n){case"color":var r=t.getItemVisual(e,"style");return r[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n);default:0}}function My(t,e){switch(e){case"color":var n=t.getVisual("style");return n[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e);default:0}}function Cy(t,e,n,r){switch(n){case"color":var i=t.ensureUniqueItemVisual(e,"style");i[t.getVisual("drawType")]=r,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,n,r);break;default:0}}function Iy(t,e){function n(e,n){var r=[];return e.eachComponent({mainType:"series",subType:t,query:n},(function(t){r.push(t.seriesIndex)})),r}Z([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],(function(t){e(t[0],(function(e,r,i){e=j({},e),i.dispatchAction(j(e,{type:t[1],seriesIndex:n(r,e)}))}))}))}function Ty(t,e,n,r,i){var o=t+e;n.isSilent(o)||r.eachComponent({mainType:"series",subType:"pie"},(function(t){for(var e=t.seriesIndex,r=i.selected,a=0;a1&&(a*=qy(d),s*=qy(d));var g=(i===o?-1:1)*qy((a*a*(s*s)-a*a*(f*f)-s*s*(p*p))/(a*a*(f*f)+s*s*(p*p)))||0,v=g*a*f/s,y=g*-s*p/a,m=(t+n)/2+Yy(h)*v-Xy(h)*y,x=(e+r)/2+Xy(h)*v+Yy(h)*y,_=Jy([1,0],[(p-v)/a,(f-y)/s]),b=[(p-v)/a,(f-y)/s],w=[(-1*p-v)/a,(-1*f-y)/s],S=Jy(b,w);if(Ky(b,w)<=-1&&(S=$y),Ky(b,w)>=1&&(S=0),S<0){var M=Math.round(S/$y*1e6)/1e6;S=2*$y+M%2*$y}c.addData(u,m,x,a,s,_,S,h,o)}var tm=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,em=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function nm(t){var e=new dl;if(!t)return e;var n,r=0,i=0,o=r,a=i,s=dl.CMD,l=t.match(tm);if(!l)return e;for(var u=0;uk*k+L*L&&(M=I,C=T),{cx:M,cy:C,x01:-c,y01:-h,x11:M*(i/b-1),y11:C*(i/b-1)}}function Im(t,e){var n=bm(e.r,0),r=bm(e.r0||0,0),i=n>0,o=r>0;if(i||o){if(i||(n=r,r=0),r>n){var a=n;n=r,r=a}var s,l=!!e.clockwise,u=e.startAngle,c=e.endAngle;if(u===c)s=0;else{var h=[u,c];pl(h,!l),s=xm(h[0]-h[1])}var p=e.cx,f=e.cy,d=e.cornerRadius||0,g=e.innerCornerRadius||0;if(n>Sm)if(s>dm-Sm)t.moveTo(p+n*vm(u),f+n*gm(u)),t.arc(p,f,n,u,c,!l),r>Sm&&(t.moveTo(p+r*vm(c),f+r*gm(c)),t.arc(p,f,r,c,u,l));else{var v=xm(n-r)/2,y=wm(v,d),m=wm(v,g),x=m,_=y,b=n*vm(u),w=n*gm(u),S=r*vm(c),M=r*gm(c),C=void 0,I=void 0,T=void 0,A=void 0;if((y>Sm||m>Sm)&&(C=n*vm(c),I=n*gm(c),T=r*vm(u),A=r*gm(u),sSm)if(_>Sm){var N=Cm(T,A,b,w,n,_,l),z=Cm(C,I,S,M,n,_,l);t.moveTo(p+N.cx+N.x01,f+N.cy+N.y01),_Sm&&s>Sm)if(x>Sm){N=Cm(S,M,C,I,r,-x,l),z=Cm(b,w,T,A,r,-x,l);t.lineTo(p+N.cx+N.x01,f+N.cy+N.y01),xn-2?n-1:l+1],f=t[l>n-3?n-1:l+2]);var d=u*u,g=u*d;r.push([Pm(c[0],h[0],p[0],f[0],u,d,g),Pm(c[1],h[1],p[1],f[1],u,d,g)])}return r}function Rm(t,e,n,r){var i,o,a,s,l=[],u=[],c=[],h=[];if(r){a=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,f=t.length;p=2){if(r&&"spline"!==r){var o=Rm(i,r,n,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var a=i.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=i[(s+1)%a];t.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{"spline"===r&&(i=Em(i,n)),t.moveTo(i[0][0],i[0][1]);s=1;for(var h=i.length;srx[1]){if(a=!1,i)return a;var u=Math.abs(rx[0]-nx[1]),c=Math.abs(nx[0]-rx[1]);Math.min(u,c)>r.len()&&(uMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function Lx(t){return!t.isGroup}function Ox(t){return null!=t.shape}function Px(t,e,n){if(t&&e){var r=i(t);e.traverse((function(t){if(Lx(t)&&t.anid){var e=r[t.anid];if(e){var i=o(t);t.attr(o(e)),Ec(t,i,n,mu(t).dataIndex)}}}))}function i(t){var e={};return t.traverse((function(t){Lx(t)&&t.anid&&(e[t.anid]=t)})),e}function o(t){var e={x:t.x,y:t.y,rotation:t.rotation};return Ox(t)&&(e.shape=j({},t.shape)),e}}function Ex(t,e){return K(t,(function(t){var n=t[0];n=hx(n,e.x),n=px(n,e.x+e.width);var r=t[1];return r=hx(r,e.y),r=px(r,e.y+e.height),[n,r]}))}function Rx(t,e){var n=hx(t.x,e.x),r=px(t.x+t.width,e.x+e.width),i=hx(t.y,e.y),o=px(t.y+t.height,e.y+e.height);if(r>=n&&o>=i)return{x:n,y:i,width:r-n,height:o-i}}function Nx(t,e,n){var r=j({rectHover:!0},e),i=r.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(i.image=t.slice(8),W(i,n),new Yl(r)):xx(t.replace("path://",""),r,n,"center")}function zx(t,e,n,r,i){for(var o=0,a=i[i.length-1];o1)return!1;var v=Vx(f,d,c,h)/p;return!(v<0||v>1)}function Vx(t,e,n,r){return t*r-n*e}function Fx(t){return t<=1e-6&&t>=-1e-6}function Gx(t){var e=t.itemTooltipOption,n=t.componentModel,r=t.itemName,i=st(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:r,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&Z(et(l),(function(t){Ot(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=mu(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:r,option:W({content:r,formatterParams:s},i)}}yx("circle",Fy),yx("ellipse",pm),yx("sector",Dm),yx("ring",Om),yx("polygon",Vm),yx("polyline",Hm),yx("rect",ru),yx("line",zy),yx("bezierCurve",Xm),yx("arc",Xv);var Hx=Fl.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,r=e.cy,i=e.width/2,o=e.height/2;t.moveTo(n,r-o),t.lineTo(n+i,r+o),t.lineTo(n-i,r+o),t.closePath()}}),jx=Fl.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,r=e.cy,i=e.width/2,o=e.height/2;t.moveTo(n,r-o),t.lineTo(n+i,r),t.lineTo(n,r+o),t.lineTo(n-i,r),t.closePath()}}),Wx=Fl.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,r=e.y,i=e.width/5*3,o=Math.max(i,e.height),a=i/2,s=a*a/(o-a),l=r-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),p=Math.cos(u),f=.6*a,d=.7*a;t.moveTo(n-c,l+s),t.arc(n,l,a,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(n+c-h*f,l+s+p*f,n,r-d,n,r),t.bezierCurveTo(n,r-d,n-c+h*f,l+s+p*f,n-c,l+s),t.closePath()}}),Ux=Fl.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,r=e.width,i=e.x,o=e.y,a=r/3*2;t.moveTo(i,o),t.lineTo(i+a,o+n),t.lineTo(i,o+n/4*3),t.lineTo(i-a,o+n),t.lineTo(i,o),t.closePath()}}),qx={line:zy,rect:ru,roundRect:ru,square:ru,circle:Fy,diamond:jx,pin:Wx,arrow:Ux,triangle:Hx},Xx={line:function(t,e,n,r,i){i.x1=t,i.y1=e+r/2,i.x2=t+n,i.y2=e+r/2},rect:function(t,e,n,r,i){i.x=t,i.y=e,i.width=n,i.height=r},roundRect:function(t,e,n,r,i){i.x=t,i.y=e,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(t,e,n,r,i){var o=Math.min(n,r);i.x=t,i.y=e,i.width=o,i.height=o},circle:function(t,e,n,r,i){i.cx=t+n/2,i.cy=e+r/2,i.r=Math.min(n,r)/2},diamond:function(t,e,n,r,i){i.cx=t+n/2,i.cy=e+r/2,i.width=n,i.height=r},pin:function(t,e,n,r,i){i.x=t+n/2,i.y=e+r/2,i.width=n,i.height=r},arrow:function(t,e,n,r,i){i.x=t+n/2,i.y=e+r/2,i.width=n,i.height=r},triangle:function(t,e,n,r,i){i.cx=t+n/2,i.cy=e+r/2,i.width=n,i.height=r}},Yx={};Z(qx,(function(t,e){Yx[e]=new t}));var $x=Fl.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,n){var r=Li(t,e,n),i=this.shape;return i&&"pin"===i.symbolType&&"inside"===e.position&&(r.y=n.y+.4*n.height),r},buildPath:function(t,e,n){var r=e.symbolType;if("none"!==r){var i=Yx[r];i||(r="rect",i=Yx[r]),Xx[r](e.x,e.y,e.width,e.height,i.shape),i.buildPath(t,i.shape,n)}}});function Zx(t,e){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=t,n.fill=e||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=t:n.fill=t,this.markRedraw()}}function Kx(t,e,n,r,i,o,a){var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),s=0===t.indexOf("image://")?_x(t.slice(8),new xi(e,n,r,i),a?"center":"cover"):0===t.indexOf("path://")?xx(t.slice(7),{},new xi(e,n,r,i),a?"center":"cover"):new $x({shape:{symbolType:t,x:e,y:n,width:r,height:i}}),s.__isEmptyBrush=l,s.setColor=Zx,o&&s.setColor(o),s}function Jx(t){return ot(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Qx(t,e){if(null!=t)return ot(t)||(t=[t,t]),[lo(t[0],e[0])||0,lo(xt(t[1],t[0]),e[1])||0]}function t_(t,e,n){var r=null==e.x?0:e.x,i=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;e.global||(r=r*n.width+n.x,i=i*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),r=isNaN(r)?0:r,i=isNaN(i)?1:i,o=isNaN(o)?0:o,a=isNaN(a)?0:a;var s=t.createLinearGradient(r,o,i,a);return s}function e_(t,e,n){var r=n.width,i=n.height,o=Math.min(r,i),a=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;e.global||(a=a*r+n.x,s=s*i+n.y,l*=o);var u=t.createRadialGradient(a,s,0,a,s,l);return u}function n_(t,e,n){for(var r="radial"===e.type?e_(t,e,n):t_(t,e,n),i=e.colorStops,o=0;o0?(e=e||1,"dashed"===t?[4*e,2*e]:"dotted"===t?[e]:ut(t)?[t]:ot(t)?t:null):null}var o_=new dl(!0);function a_(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function s_(t){return"string"===typeof t&&"none"!==t}function l_(t){var e=t.fill;return null!=e&&"none"!==e}function u_(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function c_(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function h_(t,e,n){var r=Ea(e.image,e.__image,n);if(Na(r)){var i=t.createPattern(r,e.repeat||"repeat");if("function"===typeof DOMMatrix&&i.setTransform){var o=new DOMMatrix;o.rotateSelf(0,0,(e.rotation||0)/Math.PI*180),o.scaleSelf(e.scaleX||1,e.scaleY||1),o.translateSelf(e.x||0,e.y||0),i.setTransform(o)}return i}}function p_(t,e,n,r){var i=a_(n),o=l_(n),a=n.strokePercent,s=a<1,l=!e.path;e.silent&&!s||!l||e.createPathProxy();var u=e.path||o_;if(!r){var c=n.fill,h=n.stroke,p=o&&!!c.colorStops,f=i&&!!h.colorStops,d=o&&!!c.image,g=i&&!!h.image,v=void 0,y=void 0,m=void 0,x=void 0,_=void 0;(p||f)&&(_=e.getBoundingRect()),p&&(v=e.__dirty?n_(t,c,_):e.__canvasFillGradient,e.__canvasFillGradient=v),f&&(y=e.__dirty?n_(t,h,_):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),d&&(m=e.__dirty||!e.__canvasFillPattern?h_(t,c,e):e.__canvasFillPattern,e.__canvasFillPattern=m),g&&(x=e.__dirty||!e.__canvasStrokePattern?h_(t,h,e):e.__canvasStrokePattern,e.__canvasStrokePattern=m),p?t.fillStyle=v:d&&(m?t.fillStyle=m:o=!1),f?t.strokeStyle=y:g&&(x?t.strokeStyle=x:i=!1)}var b=n.lineDash&&n.lineWidth>0&&i_(n.lineDash,n.lineWidth),w=n.lineDashOffset,S=!!t.setLineDash,M=e.getGlobalScale();if(u.setScale(M[0],M[1],e.segmentIgnoreThreshold),b){var C=n.strokeNoScale&&e.getLineScale?e.getLineScale():1;C&&1!==C&&(b=K(b,(function(t){return t/C})),w/=C)}var I=!0;(l||e.__dirty&on||b&&!S&&i)&&(u.setDPR(t.dpr),s?u.setContext(null):(u.setContext(t),I=!1),u.reset(),b&&!S&&(u.setLineDash(b),u.setLineDashOffset(w)),e.buildPath(u,e.shape,r),u.toStatic(),e.pathUpdated()),I&&u.rebuildPath(t,s?a:1),b&&S&&(t.setLineDash(b),t.lineDashOffset=w),r||(n.strokeFirst?(i&&c_(t,n),o&&u_(t,n)):(o&&u_(t,n),i&&c_(t,n))),b&&S&&t.setLineDash([])}function f_(t,e,n){var r=e.__image=Ea(n.image,e.__image,e,e.onload);if(r&&Na(r)){var i=n.x||0,o=n.y||0,a=e.getWidth(),s=e.getHeight(),l=r.width/r.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=r.width,s=r.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;t.drawImage(r,u,c,n.sWidth,n.sHeight,i,o,a,s)}else if(n.sx&&n.sy){u=n.sx,c=n.sy;var h=a-u,p=s-c;t.drawImage(r,u,c,h,p,i,o,a,s)}else t.drawImage(r,i,o,a,s)}}function d_(t,e,n){var r=n.text;if(null!=r&&(r+=""),r){t.font=n.font||bi,t.textAlign=n.textAlign,t.textBaseline=n.textBaseline;var i=void 0;if(t.setLineDash){var o=n.lineDash&&n.lineWidth>0&&i_(n.lineDash,n.lineWidth),a=n.lineDashOffset;if(o){var s=n.strokeNoScale&&e.getLineScale?e.getLineScale():1;s&&1!==s&&(o=K(o,(function(t){return t/s})),a/=s),t.setLineDash(o),t.lineDashOffset=a,i=!0}}n.strokeFirst?(a_(n)&&t.strokeText(r,n.x,n.y),l_(n)&&t.fillText(r,n.x,n.y)):(l_(n)&&t.fillText(r,n.x,n.y),a_(n)&&t.strokeText(r,n.x,n.y)),i&&t.setLineDash([])}}var g_=["shadowBlur","shadowOffsetX","shadowOffsetY"],v_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function y_(t,e,n,r,i){var o=!1;if(!r&&(n=n||{},e===n))return!1;if(r||e.opacity!==n.opacity){o||(A_(t,i),o=!0);var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?Qa.opacity:a}(r||e.blend!==n.blend)&&(o||(A_(t,i),o=!0),t.globalCompositeOperation=e.blend||Qa.blend);for(var s=0;s=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=s&&(u=db(l,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var p=r;r=new Ui,r.add(p),p.scaleX=p.scaleY=u.scale,p.x=u.x,p.y=u.y}return e.ignoreRootClip||null==a||null==s||r.setClipPath(new ru({shape:{x:0,y:0,width:a,height:s}})),{root:r,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},t.prototype._parseNode=function(t,e,n,r,i,o){var a,s=t.nodeName.toLowerCase(),l=r;if("defs"===s&&(i=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!i){var u=P_[s];if(u&&Ot(P_,s)){a=u.call(this,t,e);var c=t.getAttribute("name");if(c){var h={name:c,namedFrom:null,svgNodeTagLower:s,el:a};n.push(h),"g"===s&&(l=h)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:s,el:a});e.add(a)}}var p=Z_[s];if(p&&Ot(Z_,s)){var f=p.call(this,t),d=t.getAttribute("id");d&&(this._defs[d]=f)}}if(a&&a.isGroup){var g=t.firstChild;while(g)1===g.nodeType?this._parseNode(g,a,n,l,i,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling}},t.prototype._parseText=function(t,e){var n=new jl({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),nb(n,e);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9);var o=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+"px",r.fontFamily||"sans-serif"].join(" ");r.font=o;var a=n.getBoundingRect();return this._textX+=a.width,e.add(n),n},t.internalField=function(){P_={g:function(t,e){var n=new Ui;return Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new ru;return Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new Fy;return Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new zy;return Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new pm;return Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,r=t.getAttribute("points");r&&(n=tb(r));var i=new Vm({shape:{points:n||[]},silent:!0});return Q_(e,i),eb(t,i,this._defsUsePending,!1,!1),i},polyline:function(t,e){var n,r=t.getAttribute("points");r&&(n=tb(r));var i=new Hm({shape:{points:n||[]},silent:!0});return Q_(e,i),eb(t,i,this._defsUsePending,!1,!1),i},image:function(t,e){var n=new Yl;return Q_(e,n),eb(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",r=t.getAttribute("y")||"0",i=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(o);var a=new Ui;return Q_(e,a),eb(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var n=t.getAttribute("x"),r=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var i=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new Ui;return Q_(e,a),eb(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(o),a},path:function(t,e){var n=t.getAttribute("d")||"",r=am(n);return Q_(e,r),eb(t,r,this._defsUsePending,!1,!1),r.silent=!0,r}}}(),t}(),Z_={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),r=parseInt(t.getAttribute("x2")||"10",10),i=parseInt(t.getAttribute("y2")||"0",10),o=new Qm(e,n,r,i);return K_(t,o),J_(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),r=parseInt(t.getAttribute("r")||"0",10),i=new ex(e,n,r);return K_(t,i),J_(t,i),i}};function K_(t,e){var n=t.getAttribute("gradientUnits");"userSpaceOnUse"===n&&(e.global=!0)}function J_(t,e){var n=t.firstChild;while(n){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var r=n.getAttribute("offset"),i=void 0;i=r&&r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var o={};pb(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:a})}n=n.nextSibling}}function Q_(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),W(e.__inheritedStyle,t.__inheritedStyle))}function tb(t){for(var e=sb(t),n=[],r=0;r0;o-=2){var a=r[o],s=r[o-1],l=sb(a);switch(i=i||Gr(),s){case"translate":Ur(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Xr(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":qr(i,i,-parseFloat(l[0])*ub);break;case"skewX":var u=Math.tan(parseFloat(l[0])*ub);Wr(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*ub);Wr(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var hb=/([^\s:;]+)\s*:\s*([^:;]+)/g;function pb(t,e,n){var r=t.getAttribute("style");if(r){var i;hb.lastIndex=0;while(null!=(i=hb.exec(r))){var o=i[1],a=Ot(U_,o)?U_[o]:null;a&&(e[a]=i[2]);var s=Ot(X_,o)?X_[o]:null;s&&(n[s]=i[2])}}}function fb(t,e,n){for(var r=0;r>1^-(1&s),l=l>>1^-(1&l),s+=i,l+=o,i=s,o=l,r.push([s/n,l/n])}return r}function Db(t,e){return t=Tb(t),K(Q(t.features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,r=t.geometry,i=[];if("Polygon"===r.type){var o=r.coordinates;i.push({type:"polygon",exterior:o[0],interiors:o.slice(1)})}if("MultiPolygon"===r.type){o=r.coordinates;Z(o,(function(t){t[0]&&i.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})}))}var a=new bb(n[e||"name"],i,n.cp);return a.properties=n,a}))}for(var kb=[126,25],Lb="南海诸岛",Ob=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],Pb=0;Pb0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.setOption=function(t,e,n){if(this._disposed)Kw(this.id);else{var r,i,o;if(ct(e)&&(n=e.lazyUpdate,r=e.silent,i=e.replaceMerge,o=e.transition,e=e.notMerge),this[vw]=!0,!this._model||e){var a=new Zf(this._api),s=this._theme,l=this._model=new zf;l.scheduler=this._scheduler,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:i},eS);var u={seriesTransition:o,optionChanged:!0};n?(this[yw]={silent:r,updateParams:u},this[vw]=!1,this.getZr().wakeUp()):(Tw(this),kw.update.call(this,null,u),this._zr.flush(),this[yw]=null,this[vw]=!1,Ew.call(this,r),Rw.call(this,r))}},e.prototype.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Zb&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){if(S.canvasSupported)return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.getSvgDataURL=function(){if(S.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return Z(e,(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){t=t||{};var e=t.excludeComponents,n=this._model,r=[],i=this;Z(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(r.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return Z(r,(function(t){t.group.ignore=!1})),o}Kw(this.id)},e.prototype.getConnectedDataURL=function(t){if(this._disposed)Kw(this.id);else if(S.canvasSupported){var e="svg"===t.type,n=this.group,r=Math.min,i=Math.max,o=1/0;if(aS[n]){var a=o,s=o,l=-o,u=-o,c=[],h=t&&t.pixelRatio||this.getDevicePixelRatio();Z(oS,(function(o,h){if(o.group===n){var p=e?o.getZr().painter.getSvgDom().innerHTML:o.getRenderedCanvas(F(t)),f=o.getDom().getBoundingClientRect();a=r(f.left,a),s=r(f.top,s),l=i(f.right,l),u=i(f.bottom,u),c.push({dom:p,left:f.left,top:f.top})}})),a*=h,s*=h,l*=h,u*=h;var p=l-a,f=u-s,d=U(),g=Ji(d,{renderer:e?"svg":"canvas"});if(g.resize({width:p,height:f}),e){var v="";return Z(c,(function(t){var e=t.left-a,n=t.top-s;v+=''+t.dom+""})),g.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return t.connectedBackgroundColor&&g.add(new ru({shape:{x:0,y:0,width:p,height:f},style:{fill:t.connectedBackgroundColor}})),Z(c,(function(t){var e=new Yl({style:{x:t.left*h-a,y:t.top*h-s,image:t.dom}});g.add(e)})),g.refreshImmediately(),d.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},e.prototype.convertToPixel=function(t,e){return Lw(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return Lw(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){if(!this._disposed){var n,r=this._model,i=ia(r,t);return Z(i,(function(t,r){r.indexOf("Models")>=0&&Z(t,(function(t){var i=t.coordinateSystem;if(i&&i.containPoint)n=n||!!i.containPoint(e);else if("seriesModels"===r){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}else 0}),this)}),this),!!n}Kw(this.id)},e.prototype.getVisual=function(t,e){var n=this._model,r=ia(n,t,{defaultMainType:"series"}),i=r.seriesModel;var o=i.getData(),a=r.hasOwnProperty("dataIndexInside")?r.dataIndexInside:r.hasOwnProperty("dataIndex")?o.indexOfRawIndex(r.dataIndex):null;return null!=a?Sy(o,a,e):My(o,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;Z(Zw,(function(e){var n=function(n){var r,i=t.getModel(),o=n.target,a="globalout"===e;if(a?r={}:o&&Dy(o,(function(t){var e=mu(t);if(e&&null!=e.dataIndex){var n=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return r=n&&n.getDataParams(e.dataIndex,e.dataType)||{},!0}if(e.eventData)return r=j({},e.eventData),!0}),!0),r){var s=r.componentType,l=r.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=r.seriesIndex);var u=s&&null!=l&&i.getComponent(s,l),c=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,r.event=n,r.type=e,t._$eventProcessor.eventInfo={targetEl:o,packedEvent:r,model:u,view:c},t.trigger(e,r)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)})),Z(Qw,(function(e,n){t._messageCenter.on(n,(function(t){this.trigger(n,t)}),t)})),Z(["selectchanged"],(function(e){t._messageCenter.on(e,(function(t){this.trigger(e,t)}),t)})),Ay(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?Kw(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)Kw(this.id);else{this._disposed=!0,ua(this.getDom(),uS,"");var t=this,e=t._api,n=t._model;Z(t._componentsViews,(function(t){t.dispose(n,e)})),Z(t._chartsViews,(function(t){t.dispose(n,e)})),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete oS[t.id]}},e.prototype.resize=function(t){if(this._disposed)Kw(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),r=t&&t.silent;this[yw]&&(null==r&&(r=this[yw].silent),n=!0,this[yw]=null),this[vw]=!0,n&&Tw(this),kw.update.call(this,{type:"resize",animation:j({duration:0},t&&t.animation)}),this[vw]=!1,Ew.call(this,r),Rw.call(this,r)}}},e.prototype.showLoading=function(t,e){if(this._disposed)Kw(this.id);else if(ct(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),iS[t]){var n=iS[t](this._api,e),r=this._zr;this._loadingFX=n,r.add(n)}},e.prototype.hideLoading=function(){this._disposed?Kw(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=j({},t);return e.type=Qw[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)Kw(this.id);else if(ct(e)||(e={silent:!!e}),Jw[t.type]&&this._model)if(this[vw])this._pendingActions.push(t);else{var n=e.silent;Pw.call(this,t,n);var r=e.flush;r?this._zr.flush():!1!==r&&S.browser.weChat&&this._throttledZrFlush(),Ew.call(this,n),Rw.call(this,n)}},e.prototype.updateLabelLayout=function(){$b.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)Kw(this.id);else{var e=t.seriesIndex,n=this.getModel(),r=n.getSeriesByIndex(e);0,r.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){for(var e=[],n=t.currentStates,r=0;re.get("hoverLayerThreshold")&&!S.node&&!S.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.group.traverse((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}function n(t,e){var n=t.get("blendMode")||null;e.group.traverse((function(t){t.isGroup||(t.style.blend=n),t.eachPendingDisplayable&&t.eachPendingDisplayable((function(t){t.style.blend=n}))}))}function r(t,e){t.preventAutoZ||i(e.group,t.get("z")||0,t.get("zlevel")||0,-1/0)}function i(t,e,n,r){var o=t.getTextContent(),a=t.getTextGuideLine(),s=t.isGroup;if(s)for(var l=t.childrenRef(),u=0;u0?{duration:o,delay:r.get("delay"),easing:r.get("easing")}:null;n.group.traverse((function(e){if(e.states&&e.states.emphasis){if(Nc(e))return;if(e instanceof Fl&&kc(e),e.__dirty){var n=e.prevStates;n&&e.useStates(n)}if(i){e.stateTransition=a;var r=e.getTextContent(),o=e.getTextGuideLine();r&&(r.stateTransition=a),o&&(o.stateTransition=a)}e.__dirty&&t(e)}}))}Tw=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Aw(t,!0),Aw(t,!1),e.plan()},Aw=function(t,e){for(var n=t._model,r=t._scheduler,i=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l=0)){AS.push(n);var o=hy.wrapStageHandler(n,i);o.__prio=e,o.__raw=n,t.push(o)}}function kS(t,e){iS[t]=e}function LS(t){N("createCanvas",t)}function OS(t,e,n){Xb.registerMap(t,e,n)}function PS(t){return Xb.getMapForUser(t)}var ES=mg;TS(sw,Gv),TS(cw,jv),TS(cw,Wv),TS(sw,by),TS(cw,wy),TS(dw,j_),mS(_d),xS(ew,bd),kS("default",$v),SS({type:ku,event:ku,update:ku},Pt),SS({type:Lu,event:Lu,update:Lu},Pt),SS({type:Ou,event:Ou,update:Ou},Pt),SS({type:Pu,event:Pu,update:Pu},Pt),SS({type:Eu,event:Eu,update:Eu},Pt),yS("light",fy),yS("dark",xy);var RS={},NS=[],zS={registerPreprocessor:mS,registerProcessor:xS,registerPostInit:_S,registerPostUpdate:bS,registerUpdateLifecycle:wS,registerAction:SS,registerCoordinateSystem:MS,registerLayout:IS,registerVisual:TS,registerTransform:ES,registerLoading:kS,registerMap:OS,PRIORITY:gw,ComponentModel:Up,ComponentView:xv,SeriesModel:yv,ChartView:Dv,registerComponentModel:function(t){Up.registerClass(t)},registerComponentView:function(t){xv.registerClass(t)},registerSeriesModel:function(t){yv.registerClass(t)},registerChartView:function(t){Dv.registerClass(t)},registerSubTypeDefaulter:function(t,e){Up.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){no(t,e)}};function BS(t){ot(t)?Z(t,(function(t){BS(t)})):q(NS,t)>=0||(NS.push(t),at(t)&&(t={install:t}),t.install(zS))}function VS(t){return null==t?0:t.length||1}function FS(t){return t}var GS=function(){function t(t,e,n,r,i,o){this._old=t,this._new=e,this._oldKeyGetter=n||FS,this._newKeyGetter=r||FS,this.context=i,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},r=new Array(t.length),i=new Array(e.length);this._initIndexMap(t,null,r,"_oldKeyGetter"),this._initIndexMap(e,n,i,"_newKeyGetter");for(var o=0;o1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},r={},i=[],o=[];this._initIndexMap(t,n,i,"_oldKeyGetter"),this._initIndexMap(e,r,o,"_newKeyGetter");for(var a=0;a1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),r[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),r[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),r[s]=null;else if(c>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,l),r[s]=null;else if(c>1)for(var p=0;p1)for(var a=0;a30}var rM,iM,oM,aM,sM,lM,uM,cM=ct,hM=K,pM="undefined"===typeof Int32Array?Array:Int32Array,fM="e\0\0",dM=-1,gM=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],vM=["_approximateExtent"],yM=function(){function t(t,e){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var r=!1;QS(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(r=!0,n=t),n=n||["x","y"];for(var i={},o=[],a={},s=!1,l={},u=0;u=e)){var n=this._store,r=n.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList,a=r.getSource().sourceFormat,s=a===Zp;if(s&&!r.pure)for(var l=[],u=t;u0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,r=n[t];r||(r=n[t]={});var i=r[e];return null==i&&(i=this.getVisual(e),ot(i)?i=i.slice():cM(i)&&(i=j({},i)),r[e]=i),i},t.prototype.setItemVisual=function(t,e,n){var r=this._itemVisuals[t]||{};this._itemVisuals[t]=r,cM(e)?j(r,e):r[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){if(cM(t))for(var n in t)t.hasOwnProperty(n)&&this.setLayout(n,t[n]);else this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?j(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;xu(n,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){Z(this._graphicEls,(function(n,r){n&&t&&t.call(e,n,r)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:hM(this.dimensions,this._getDimInfo,this),this.hostModel)),sM(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];"function"===typeof n&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(bt(arguments)))})},t.internalField=function(){rM=function(t){var e=t._invertedIndicesMap;Z(e,(function(n,r){var i=t._dimInfos[r],o=i.ordinalMeta,a=t._store;if(o){n=e[r]=new pM(o.categories.length);for(var s=0;s1&&(s+="__ec__"+u),r[e]=s}}}(),t}(),mM=yM;function xM(t,e){return _M(t,e).dimensions}function _M(t,e){Dd(t)||(t=Ld(t)),e=e||{};var n=e.coordDimensions||[],r=e.dimensionsDefine||t.dimensionsDefine||[],i=Dt(),o=[],a=wM(t,n,r,e.dimensionsCount),s=e.canOmitUnusedDimensions&&nM(a),l=r===t.dimensionsDefine,u=l?eM(t):tM(r),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(t,a));for(var h=Dt(c),p=new Ig(a),f=0;f0&&(r.name=i+(o-1)),o++,e.set(i,o)}}function wM(t,e,n,r){var i=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,r||0);return Z(e,(function(t){var e;ct(t)&&(e=t.dimsDef)&&(i=Math.max(i,e.length))})),i}function SM(t,e,n){var r=e.data;if(n||r.hasOwnProperty(t)){var i=0;while(r.hasOwnProperty(t+i))i++;t+=i}return e.set(t,!0),t}var MM=function(){function t(t){this.coordSysDims=[],this.axisMap=Dt(),this.categoryAxisMap=Dt(),this.coordSysName=t}return t}();function CM(t){var e=t.get("coordinateSystem"),n=new MM(e),r=IM[e];if(r)return r(t,n,n.axisMap,n.categoryAxisMap),n}var IM={cartesian2d:function(t,e,n,r){var i=t.getReferringComponents("xAxis",aa).models[0],o=t.getReferringComponents("yAxis",aa).models[0];e.coordSysDims=["x","y"],n.set("x",i),n.set("y",o),TM(i)&&(r.set("x",i),e.firstCategoryDimIndex=0),TM(o)&&(r.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,r){var i=t.getReferringComponents("singleAxis",aa).models[0];e.coordSysDims=["single"],n.set("single",i),TM(i)&&(r.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,n,r){var i=t.getReferringComponents("polar",aa).models[0],o=i.findAxisModel("radiusAxis"),a=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),TM(o)&&(r.set("radius",o),e.firstCategoryDimIndex=0),TM(a)&&(r.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,r){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,r){var i=t.ecModel,o=i.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();Z(o.parallelAxisIndex,(function(t,o){var s=i.getComponent("parallelAxis",t),l=a[o];n.set(l,s),TM(s)&&(r.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function TM(t){return"category"===t.get("type")}function AM(t,e,n){n=n||{};var r,i,o,a=n.byIndex,s=n.stackedCoordDimension;DM(e)?r=e:(i=e.schema,r=i.dimensions,o=e.store);var l,u,c,h,p=!(!t||!t.get("stack"));if(Z(r,(function(t,e){st(t)&&(r[e]=t={name:t}),p&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))})),!u||a||l||(a=!0),u){c="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var f=u.coordDim,d=u.type,g=0;Z(r,(function(t){t.coordDim===f&&g++}));var v={name:c,coordDim:f,coordDimIndex:g,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length},y={name:h,coordDim:h,coordDimIndex:g+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length+1};i?(o&&(v.storeDimIndex=o.ensureCalculationDimension(h,d),y.storeDimIndex=o.ensureCalculationDimension(c,d)),i.appendCalculationDimension(v),i.appendCalculationDimension(y)):(r.push(v),r.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:h,stackResultDimension:c}}function DM(t){return!QS(t.schema)}function kM(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function LM(t,e){return kM(t,e)?t.getCalculationInfo("stackResultDimension"):e}function OM(t,e){var n,r=t.get("coordinateSystem"),i=jf.get(r);return e&&e.coordSysDims&&(n=K(e.coordSysDims,(function(t){var n={name:t},r=e.axisMap.get(t);if(r){var i=r.get("type");n.type=qS(i)}return n}))),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function PM(t,e,n){var r,i;return n&&Z(t,(function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==r&&(r=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(i=!0)})),i||null==r||(t[r].otherDims.itemName=0),r}function EM(t,e,n){n=n||{};var r,i=e.getSourceManager(),o=!1;t?(o=!0,r=Ld(t)):(r=i.getSource(),o=r.sourceFormat===Zp);var a=CM(e),s=OM(e,a),l=n.useEncodeDefaulter,u=at(l)?l:l?it(lf,s,e):null,c={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o},h=_M(r,c),p=PM(h.dimensions,n.createInvertedIndices,a),f=o?null:i.getSharedDataStore(h),d=AM(e,{schema:h,store:f}),g=new mM(h,e);g.setCalculationInfo(d);var v=null!=p&&RM(r)?function(t,e,n,r){return r===p?n:this.defaultDimValueGetter(t,e,n,r)}:null;return g.hasItemOption=!1,g.initData(o?r:f,null,v),g}function RM(t){if(t.sourceFormat===Zp){var e=NM(t.data||[]);return null!=e&&!ot(zo(e))}}function NM(t){var e=0;while(ee[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();Ta(BM);var VM=BM,FM=0,GM=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++FM}return t.createByAxisModel=function(e){var n=e.option,r=n.data,i=r&&K(r,HM);return new t({categories:i,needCollect:!i,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!==typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var r=this._getOrCreateMap();return e=r.get(t),null==e&&(n?(e=this.categories.length,this.categories[e]=t,r.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=Dt(this.categories))},t}();function HM(t){return ct(t)&&null!=t.value?t.value:t+""}var jM=GM,WM=uo;function UM(t,e,n,r){var i={},o=t[1]-t[0],a=i.interval=Mo(o/e,!0);null!=n&&ar&&(a=i.interval=r);var s=i.intervalPrecision=qM(a),l=i.niceTickExtent=[WM(Math.ceil(t[0]/a)*a,s),WM(Math.floor(t[1]/a)*a,s)];return YM(l,t),i}function qM(t){return ho(t)+2}function XM(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function YM(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),XM(t,0,e),XM(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function $M(t,e){return t>=e[0]&&t<=e[1]}function ZM(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function KM(t,e){return t*(e[1]-e[0])+e[0]}var JM=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var r=n.getSetting("ordinalMeta");return r||(r=new jM({})),ot(r)&&(r=new jM({categories:K(r,(function(t){return ct(t)?t.value:t}))})),n._ordinalMeta=r,n._extent=n.getSetting("extent")||[0,r.categories.length-1],n}return v(e,t),e.prototype.parse=function(t){return"string"===typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),$M(t,this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),ZM(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(KM(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){var t=[],e=this._extent,n=e[0];while(n<=e[1])t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);i=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.niceTicks=function(){},e.prototype.niceExtent=function(){},e.type="ordinal",e}(VM);VM.registerClass(JM);var QM=JM,tC=uo,eC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return v(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return $M(t,this._extent)},e.prototype.normalize=function(t){return ZM(t,this._extent)},e.prototype.scale=function(t){return KM(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=qM(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,o=[];if(!e)return o;var a=1e4;n[0]a)return[]}var l=o.length?o[o.length-1].value:r[1];return n[1]>l&&(t?o.push({value:tC(l+e,i)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],r=this.getExtent(),i=1;ir[0]&&h0&&(o=null===o?s:Math.min(o,s))}n[r]=o}}return n}function hC(t){var e=cC(t),n=[];return Z(t,(function(t){var r,i=t.coordinateSystem,o=i.getBaseAxis(),a=o.getExtent();if("category"===o.type)r=o.getBandWidth();else if("value"===o.type||"time"===o.type){var s=o.dim+"_"+o.index,l=e[s],u=Math.abs(a[1]-a[0]),c=o.scale.getExtent(),h=Math.abs(c[1]-c[0]);r=l?u/h*l:u}else{var p=t.getData();r=Math.abs(a[1]-a[0])/p.count()}var f=lo(t.get("barWidth"),r),d=lo(t.get("barMaxWidth"),r),g=lo(t.get("barMinWidth")||1,r),v=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:r,barWidth:f,barMaxWidth:d,barMinWidth:g,barGap:v,barCategoryGap:y,axisKey:sC(o),stackId:aC(t)})})),pC(n)}function pC(t){var e={};Z(t,(function(t,n){var r=t.axisKey,i=t.bandWidth,o=e[r]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[r]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var c=t.barMinWidth;c&&(a[s].minWidth=c);var h=t.barGap;null!=h&&(o.gap=h);var p=t.barCategoryGap;null!=p&&(o.categoryGap=p)}));var n={};return Z(e,(function(t,e){n[e]={};var r=t.stacks,i=t.bandWidth,o=t.categoryGap;if(null==o){var a=et(r).length;o=Math.max(35-4*a,15)+"%"}var s=lo(o,i),l=lo(t.gap,1),u=t.remainedWidth,c=t.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),Z(r,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){r=t.width;e&&(r=Math.min(r,e)),n&&(r=Math.max(r,n)),t.width=r,u-=r+l*r,c--}else{var r=h;e&&er&&(r=n),r!==h&&(t.width=r,u-=r+l*r,c--)}})),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var p,f=0;Z(r,(function(t,e){t.width||(t.width=h),p=t,f+=t.width*(1+l)})),p&&(f-=p.width*l);var d=-f/2;Z(r,(function(t,r){n[e][r]=n[e][r]||{bandWidth:i,offset:d,width:t.width},d+=t.width*(1+l)}))})),n}function fC(t,e,n){if(t&&e){var r=t[sC(e)];return null!=r&&null!=n?r[aC(n)]:r}}function dC(t,e){var n=uC(t,e),r=hC(n),i={};Z(n,(function(t){var e=t.getData(),n=t.coordinateSystem,o=n.getBaseAxis(),a=aC(t),s=r[sC(o)][a],l=s.offset,u=s.width,c=n.getOtherAxis(o),h=t.get("barMinHeight")||0;i[a]=i[a]||[],e.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var p=e.mapDimension(c.dim),f=e.mapDimension(o.dim),d=kM(e,p),g=c.isHorizontal(),v=mC(o,c,d),y=e.getStore(),m=e.getDimensionIndex(p),x=e.getDimensionIndex(f),_=0,b=y.count();_=0?"p":"n",C=v;d&&(i[a][S]||(i[a][S]={p:v,n:v}),C=i[a][S][M]);var I=void 0,T=void 0,A=void 0,D=void 0;if(g){var k=n.dataToPoint([w,S]);I=C,T=k[1]+l,A=k[0]-v,D=u,Math.abs(A)iC||(c=iC),{progress:function(t,e){var h,p=t.count,f=new oC(2*p),d=new oC(2*p),g=new oC(p),v=[],y=[],m=0,x=0,_=e.getStore();while(null!=(h=t.next()))y[u]=_.get(a,h),y[1-u]=_.get(s,h),v=n.dataToPoint(y,null),d[m]=l?r.x+r.width:v[0],f[m++]=v[0],d[m]=l?v[1]:r.y+r.height,f[m++]=v[1],g[x++]=h;e.setLayout({largePoints:f,largeDataIndices:g,largeBackgroundPoints:d,barWidth:c,valueAxisStart:mC(i,o,!1),backgroundStart:l?r.x:r.y,valueAxisHorizontal:l})}}}}};function vC(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function yC(t){return t.pipelineContext&&t.pipelineContext.large}function mC(t,e,n){return e.toGlobalCoord(e.dataToCoord("log"===e.type?1:0))}var xC=function(t,e,n,r){while(n>>1;t[i][1]n&&(this._approxInterval=n);var o=bC.length,a=Math.min(xC(bC,this._approxInterval,0,o),o-1);this._interval=bC[a][1],this._minLevelUnit=bC[Math.max(a-1,0)][0]},e.prototype.parse=function(t){return"number"===typeof t?t:+bo(t)},e.prototype.contain=function(t){return $M(this.parse(t),this._extent)},e.prototype.normalize=function(t){return ZM(this.parse(t),this._extent)},e.prototype.scale=function(t){return KM(t,this._extent)},e.type="time",e}(nC),bC=[["second",Eh],["minute",Rh],["hour",Nh],["quarter-day",6*Nh],["half-day",12*Nh],["day",1.2*zh],["half-week",3.5*zh],["week",7*zh],["month",31*zh],["quarter",95*zh],["half-year",Bh/2],["year",Bh]];function wC(t,e,n,r){var i=bo(e),o=bo(n),a=function(t){return Kh(i,t,r)===Kh(o,t,r)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},h=function(){return c()&&a("minute")},p=function(){return h()&&a("second")},f=function(){return p()&&a("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return p();case"millisecond":return f()}}function SC(t,e){return t/=zh,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function MC(t){var e=30*zh;return t/=e,t>6?6:t>3?3:t>2?2:1}function CC(t){return t/=Nh,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function IC(t,e){return t/=e?Rh:Eh,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function TC(t){return Mo(t,!0)}function AC(t,e,n){var r=new Date(t);switch(Uh(e)){case"year":case"month":r[ap(n)](0);case"day":r[sp(n)](1);case"hour":r[lp(n)](0);case"minute":r[up(n)](0);case"second":r[cp(n)](0),r[hp(n)](0)}return r.getTime()}function DC(t,e,n,r){var i=1e4,o=jh,a=0;function s(t,e,n,i,o,a,s){var l=new Date(e),u=e,c=l[i]();while(u1&&0===u&&o.unshift({value:o[0].value-p})}}for(u=0;u=r[0]&&m<=r[1]&&h++)}var x=(r[1]-r[0])/e;if(h>1.5*x&&p>x/1.5)break;if(u.push(v),h>x||t===o[f])break}c=[]}}}var _=Q(K(u,(function(t){return Q(t,(function(t){return t.value>=r[0]&&t.value<=r[1]&&!t.notAdd}))})),(function(t){return t.length>0})),b=[],w=_.length-1;for(f=0;f<_.length;++f)for(var S=_[f],M=0;M0)r*=10;var o=[uo(RC(e[0]/r)*r),uo(EC(e[1]/r)*r)];this._interval=r,this._niceExtent=o}},e.prototype.niceExtent=function(t){OC.niceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=zC(t)/zC(this.base),$M(t,this._extent)},e.prototype.normalize=function(t){return t=zC(t)/zC(this.base),ZM(t,this._extent)},e.prototype.scale=function(t){return t=KM(t,this._extent),NC(this.base,t)},e.type="log",e}(VM),VC=BC.prototype;function FC(t,e){return PC(t,ho(e))}VC.getMinorTicks=OC.getMinorTicks,VC.getLabel=OC.getLabel,VM.registerClass(BC);var GC=BC,HC=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var h=this._determinedMin,p=this._determinedMax;return null!=h&&(a=h,l=!0),null!=p&&(s=p,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},t.prototype.modifyDataMinMax=function(t,e){this[WC[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=jC[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),jC={min:"_determinedMin",max:"_determinedMax"},WC={min:"_dataMin",max:"_dataMax"};function UC(t,e,n){var r=t.rawExtentInfo;return r||(r=new HC(t,e,n),t.rawExtentInfo=r,r)}function qC(t,e){return null==e?null:yt(e)?NaN:t.parse(e)}function XC(t,e){var n=t.type,r=UC(t,e,t.getExtent()).calculate();t.setBlank(r.isBlank);var i=r.min,o=r.max,a=e.ecModel;if(a&&"time"===n){var s=uC("bar",a),l=!1;if(Z(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=hC(s),c=YC(i,o,e,u);i=c.min,o=c.max}}return{extent:[i,o],fixMin:r.minFixed,fixMax:r.maxFixed}}function YC(t,e,n,r){var i=n.axis.getExtent(),o=i[1]-i[0],a=fC(r,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;Z(a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;Z(a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-t,h=1-(s+l)/o,p=c/h-c;return e+=p*(l/u),t-=p*(s/u),{min:t,max:e}}function $C(t,e){var n=e,r=XC(t,n),i=r.extent,o=n.get("splitNumber");t instanceof GC&&(t.base=n.get("logBase"));var a=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:o,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:"interval"===a||"time"===a?n.get("minInterval"):null,maxInterval:"interval"===a||"time"===a?n.get("maxInterval"):null});var s=n.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function ZC(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new QM({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new kC({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(VM.getClass(e)||nC)}}function KC(t){var e=t.scale.getExtent(),n=e[0],r=e[1];return!(n>0&&r>0||n<0&&r<0)}function JC(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?function(e){return function(n,r){return t.scale.getFormattedLabel(n,r,e)}}(e):"string"===typeof e?function(e){return function(n){var r=t.scale.getLabel(n),i=e.replace("{value}",null!=r?r:"");return i}}(e):"function"===typeof e?function(e){return function(r,i){return null!=n&&(i=r.value-n),e(QC(t,r),i,null!=r.level?{level:r.level}:null)}}(e):function(e){return t.scale.getLabel(e)}}function QC(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function tI(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var r,i,o=n.getExtent();n instanceof QM?i=n.count():(r=n.getTicks(),i=r.length);var a,s=t.getLabelModel(),l=JC(t),u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;ct[1]&&(t[1]=r[1])}))}var aI=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},t.prototype.getCoordSysModel=function(){},t}();function sI(t){return zM(null,t)}var lI={isDimensionStacked:kM,enableDataStack:AM,getStackedDimension:LM};function uI(t,e){var n=e;e instanceof vh||(n=new vh(e));var r=ZC(n);return r.setExtent(t[0],t[1]),$C(r,n),r}function cI(t){Y(t,aI)}function hI(t,e){return e=e||{},Xc(t,null,null,"normal"!==e.state)}var pI=na();function fI(t){return"category"===t.type?gI(t):mI(t)}function dI(t,e){return"category"===t.type?yI(t,e):{ticks:K(t.scale.getTicks(),(function(t){return t.value}))}}function gI(t){var e=t.getLabelModel(),n=vI(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function vI(t,e){var n,r,i=xI(t,"labels"),o=nI(e),a=_I(i,o);return a||(at(o)?n=II(t,o):(r="auto"===o?wI(t):o,n=CI(t,r)),bI(i,o,{labels:n,labelCategoryInterval:r}))}function yI(t,e){var n,r,i=xI(t,"ticks"),o=nI(e),a=_I(i,o);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),at(o))n=II(t,o,!0);else if("auto"===o){var s=vI(t,t.getLabelModel());r=s.labelCategoryInterval,n=K(s.labels,(function(t){return t.tickValue}))}else r=o,n=CI(t,r,!0);return bI(i,o,{ticks:n,tickCategoryInterval:r})}function mI(t){var e=t.scale.getTicks(),n=JC(t);return{labels:K(e,(function(e,r){return{level:e.level,formattedLabel:n(e,r),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}function xI(t,e){return pI(t)[e]||(pI(t)[e]=[])}function _I(t,e){for(var n=0;n40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),c=Math.abs(u*Math.cos(r)),h=Math.abs(u*Math.sin(r)),p=0,f=0;l<=o[1];l+=s){var d=0,g=0,v=Ii(n({value:l}),e.font,"center","top");d=1.3*v.width,g=1.3*v.height,p=Math.max(p,d,7),f=Math.max(f,g,7)}var y=p/c,m=f/h;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var x=Math.max(0,Math.floor(Math.min(y,m))),_=pI(t.model),b=t.getExtent(),w=_.lastAutoInterval,S=_.lastTickCount;return null!=w&&null!=S&&Math.abs(w-x)<=1&&Math.abs(S-a)<=1&&w>x&&_.axisExtent0===b[0]&&_.axisExtent1===b[1]?x=w:(_.lastTickCount=a,_.lastAutoInterval=x,_.axisExtent0=b[0],_.axisExtent1=b[1]),x}function MI(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function CI(t,e,n){var r=JC(t),i=t.scale,o=i.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=o[0],c=i.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=rI(t),p=a.get("showMinLabel")||h,f=a.get("showMaxLabel")||h;p&&u!==o[0]&&g(o[0]);for(var d=u;d<=o[1];d+=l)g(d);function g(t){var e={value:t};s.push(n?t:{formattedLabel:r(e),rawLabel:i.getLabel(e),tickValue:t})}return f&&d-l!==o[1]&&g(o[1]),s}function II(t,e,n){var r=t.scale,i=JC(t),o=[];return Z(r.getTicks(),(function(t){var a=r.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:i(t),rawLabel:a,tickValue:s})})),o}var TI=[0,1],AI=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),r=Math.max(e[0],e[1]);return t>=n&&t<=r},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return fo(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,r=this.scale;return t=r.normalize(t),this.onBand&&"ordinal"===r.type&&(n=n.slice(),DI(n,r.count())),so(t,TI,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&(n=n.slice(),DI(n,r.count()));var i=so(t,n,TI,e);return this.scale.scale(i)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=dI(this,e),r=n.ticks,i=K(r,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this),o=e.get("alignWithLabel");return kI(this,i,o,t.clamp),i},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),r=K(n,(function(t){return K(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return r},t.prototype.getViewLabels=function(){return fI(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var r=Math.abs(t[1]-t[0]);return Math.abs(r)/n},t.prototype.calculateCategoryInterval=function(){return SI(this)},t}();function DI(t,e){var n=t[1]-t[0],r=e,i=n/r/2;t[0]+=i,t[1]-=i}function kI(t,e,n,r){var i=e.length;if(t.onBand&&!n&&i){var o,a,s=t.getExtent();if(1===i)e[0].coord=s[0],o=e[1]={coord:s[0]};else{var l=e[i-1].tickValue-e[0].tickValue,u=(e[i-1].coord-e[0].coord)/l;Z(e,(function(t){t.coord-=u/2}));var c=t.scale.getExtent();a=1+c[1]-e[i-1].tickValue,o={coord:e[i-1].coord+u*a},e.push(o)}var h=s[0]>s[1];p(e[0].coord,s[0])&&(r?e[0].coord=s[0]:e.shift()),r&&p(s[0],e[0].coord)&&e.unshift({coord:s[0]}),p(s[1],o.coord)&&(r?o.coord=s[1]:e.pop()),r&&p(o.coord,s[1])&&e.push({coord:s[1]})}function p(t,e){return t=uo(t),e=uo(e),h?t>e:ti&&(i+=NI);var f=Math.atan2(s,a);if(f<0&&(f+=NI),f>=r&&f<=i||f+NI>=r&&f+NI<=i)return l[0]=c,l[1]=h,u-n;var d=n*Math.cos(r)+t,g=n*Math.sin(r)+e,v=n*Math.cos(i)+t,y=n*Math.sin(i)+e,m=(d-a)*(d-a)+(g-s)*(g-s),x=(v-a)*(v-a)+(y-s)*(y-s);return m0){e=e/180*Math.PI,qI.fromArray(t[0]),XI.fromArray(t[1]),YI.fromArray(t[2]),ui.sub($I,qI,XI),ui.sub(ZI,YI,XI);var n=$I.len(),r=ZI.len();if(!(n<.001||r<.001)){$I.scale(1/n),ZI.scale(1/r);var i=$I.dot(ZI),o=Math.cos(e);if(o1&&ui.copy(QI,YI),QI.toArray(t[1])}}}}function eT(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,qI.fromArray(t[0]),XI.fromArray(t[1]),YI.fromArray(t[2]),ui.sub($I,XI,qI),ui.sub(ZI,YI,XI);var r=$I.len(),i=ZI.len();if(!(r<.001||i<.001)){$I.scale(1/r),ZI.scale(1/i);var o=$I.dot(e),a=Math.cos(n);if(o=l)ui.copy(QI,YI);else{QI.scaleAndAdd(ZI,s/Math.tan(Math.PI/2-c));var h=YI.x!==XI.x?(QI.x-XI.x)/(YI.x-XI.x):(QI.y-XI.y)/(YI.y-XI.y);if(isNaN(h))return;h<0?ui.copy(QI,XI):h>1&&ui.copy(QI,YI)}QI.toArray(t[1])}}}}function nT(t,e,n,r){var i="normal"===n,o=i?t:t.ensureState(n);o.ignore=e;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?t.useStyle(s):o.style=s}function rT(t,e){var n=e.smooth,r=e.points;if(r)if(t.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Kt(r[0],r[1]),o=Kt(r[1],r[2]);if(!i||!o)return t.lineTo(r[1][0],r[1][1]),void t.lineTo(r[2][0],r[2][1]);var a=Math.min(i,o)*n,s=ee([],r[1],r[0],a/i),l=ee([],r[1],r[2],a/o),u=ee([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c0&&o&&w(-h/a,0,a);var v,y,m=t[0],x=t[a-1];return _(),v<0&&S(-v,.8),y<0&&S(y,.8),_(),b(v,y,1),b(y,v,-1),_(),v<0&&M(-v),y<0&&M(y),u}function _(){v=m.rect[e]-r,y=i-x.rect[e]-x.rect[n]}function b(t,e,n){if(t<0){var r=Math.min(e,-t);if(r>0){w(r*n,0,a);var i=r+t;i<0&&S(-i*n,1)}else S(-t*n,1)}}function w(n,r,i){0!==n&&(u=!0);for(var o=r;o0)for(l=0;l0;l--){p=o[l-1]*h;w(-p,l,a)}}}function M(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),r=0;r0?w(n,0,r+1):w(-n,a-r-1,a),t-=n,t<=0)return}}function lT(t,e,n,r){return sT(t,"x","width",e,n,r)}function uT(t,e,n,r){return sT(t,"y","height",e,n,r)}function cT(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var n=new xi(0,0,0,0);function r(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var i=0;i=0&&n.attr(i.oldLayoutSelect),q(c,"emphasis")>=0&&n.attr(i.oldLayoutEmphasis)),Ec(n,l,e,s)}else if(n.attr(l),!nh(n).valueAnimation){var h=xt(n.style.opacity,1);n.style.opacity=0,Rc(n,{style:{opacity:h}},e,s)}if(i.oldLayout=l,n.states.select){var p=i.oldLayoutSelect={};yT(p,l,mT),yT(p,n.states.select,mT)}if(n.states.emphasis){var f=i.oldLayoutEmphasis={};yT(f,l,mT),yT(f,n.states.emphasis,mT)}ih(n,s,u,e,e)}if(r&&!r.ignore&&!r.invisible){i=vT(r),o=i.oldLayout;var d={points:r.shape.points};o?(r.attr({shape:o}),Ec(r,{shape:d},e)):(r.setShape(d),r.style.strokePercent=0,Rc(r,{style:{strokePercent:1}},e)),i.oldLayout=d}},t}(),_T=xT,bT=na();function wT(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){var r=bT(e).labelManager;r||(r=bT(e).labelManager=new _T),r.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var r=bT(e).labelManager;n.updatedSeries.forEach((function(t){r.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),r.updateLayoutConfig(e),r.layout(e),r.processLabelsOverall()}))}function ST(){return!1}function MT(t,e,n){var r=U(),i=e.getWidth(),o=e.getHeight(),a=r.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=i+"px",a.height=o+"px",r.setAttribute("data-zr-dom-id",t)),r.width=i*n,r.height=o*n,r}BS(wT);var CT=function(t){function e(e,n,r){var i,o=t.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,r=r||Nr,"string"===typeof e?i=MT(e,n,r):ct(e)&&(i=e,e=i.id),o.id=e,o.dom=i;var a=i.style;return a&&(i.onselectstart=ST,a.webkitUserSelect="none",a.userSelect="none",a.webkitTapHighlightColor="rgba(0,0,0,0)",a["-webkit-touch-callout"]="none",a.padding="0",a.margin="0",a.borderWidth="0"),o.domBack=null,o.ctxBack=null,o.painter=n,o.config=null,o.dpr=r,o}return v(e,t),e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=MT("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,e,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i,o=[],a=this.maxRepaintRectCount,s=!1,l=new xi(0,0,0,0);function u(t){if(t.isFinite()&&!t.isZero())if(0===o.length){var e=new xi(0,0,0,0);e.copy(t),o.push(e)}else{for(var n=!1,r=1/0,i=0,u=0;u=a)}}for(var c=this.__startIndex;c15)break}}n.prevElClipPaths&&h.restore()};if(f)if(0===f.length)s=l.__endIndex;else for(var _=p.dpr,b=0;b0&&t>r[0]){for(s=0;st)break;a=n[r[s]]}if(r.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}else V("Layer of zlevel "+t+" is not valid")},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,r=0;r0?DT:0),this._needsManuallyCompositing),u.__builtin__||V("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==o&&(u.__dirty=!0),u.__startIndex=o,u.incremental?u.__drawIndex=-1:u.__drawIndex=o,e(o),a=u),r.__dirty&nn&&!r.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=o))}e(o),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,Z(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?G(n[t],e,!0):n[t]=e;for(var r=0;r-1){var n=En(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function VT(t,e,n){n||(n=function(t,e){return t===e}),t=t.slice(),e=e.slice();var r=e.length,i=t.length,o=1,a=r+i,s=[{newPos:-1,components:[]}],l=FT(s[0],e,t,0,n);if(s[0].newPos+1>=r&&l+1>=i){for(var u=[],c=0;c=r&&h+1>=i)return HT(l.components);s[a]=l}else s[a]=void 0}o++}while(o<=a){var p=h();if(p)return p}}function FT(t,e,n,r,i){var o=e.length,a=n.length,s=t.newPos,l=s-r,u=0;while(s+1-JT}function nA(t){var e=t.fill;return null!=e&&e!==UT}function rA(t){var e=t.stroke;return null!=e&&e!==UT}function iA(t,e){e&&oA(t,"transform","matrix("+QT(e[0])+","+QT(e[1])+","+QT(e[2])+","+QT(e[3])+","+tA(e[4])+","+tA(e[5])+")")}function oA(t,e,n){(!n||"linear"!==n.type&&"radial"!==n.type)&&t.setAttribute(e,n)}function aA(t,e,n){t.setAttributeNS("http://www.w3.org/1999/xlink",e,n)}function sA(t,e,n){t.setAttributeNS("http://www.w3.org/XML/1998/namespace",e,n)}function lA(t,e,n){var r=null==e.opacity?1:e.opacity;if(n instanceof Yl)oA(t,"opacity",r+"");else{if(nA(e)){var i=BT(e.fill);oA(t,"fill",i.color),oA(t,"fill-opacity",(null!=e.fillOpacity?e.fillOpacity*i.opacity*r:i.opacity*r)+"")}else oA(t,"fill",UT);if(rA(e)){var o=BT(e.stroke);oA(t,"stroke",o.color);var a=e.lineWidth,s=e.strokeNoScale?n.getLineScale():1;oA(t,"stroke-width",(s?a/s:0)+""),oA(t,"paint-order",e.strokeFirst?"stroke":"fill"),oA(t,"stroke-opacity",(null!=e.strokeOpacity?e.strokeOpacity*o.opacity*r:o.opacity*r)+"");var l=e.lineDash&&a>0&&i_(e.lineDash,a);if(l){var u=e.lineDashOffset;s&&1!==s&&(l=K(l,(function(t){return t/s})),u&&(u/=s,u=qT(u))),oA(t,"stroke-dasharray",l.join(",")),oA(t,"stroke-dashoffset",(u||0)+"")}else oA(t,"stroke-dasharray",UT);e.lineCap&&oA(t,"stroke-linecap",e.lineCap),e.lineJoin&&oA(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&oA(t,"stroke-miterlimit",e.miterLimit+"")}else oA(t,"stroke",UT)}}var uA=function(){function t(){}return t.prototype.reset=function(){this._d=[],this._str=""},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,r,i,o){this._add("C",t,e,n,r,i,o)},t.prototype.quadraticCurveTo=function(t,e,n,r){this._add("Q",t,e,n,r)},t.prototype.arc=function(t,e,n,r,i,o){this.ellipse(t,e,n,n,0,r,i,o)},t.prototype.ellipse=function(t,e,n,r,i,o,a,s){var l=0===this._d.length,u=a-o,c=!s,h=Math.abs(u),p=eA(h-ZT)||(c?u>=ZT:-u>=ZT),f=u>0?u%ZT:u%ZT+ZT,d=!1;d=!!p||!eA(h)&&f>=$T===!!c;var g=tA(t+n*YT(o)),v=tA(e+r*XT(o));p&&(u=c?ZT-1e-4:1e-4-ZT,d=!0,l&&this._d.push("M",g,v));var y=tA(t+n*YT(o+u)),m=tA(e+r*XT(o+u));if(isNaN(g)||isNaN(v)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(KT)||isNaN(y)||isNaN(m))return"";this._d.push("A",tA(n),tA(r),qT(i*KT),+d,+c,y,m)},t.prototype.rect=function(t,e,n,r){this._add("M",t,e),this._add("L",t+n,e),this._add("L",t+n,e+r),this._add("L",t,e+r),this._add("L",t,e),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,r,i,o,a,s,l){this._d.push(t);for(var u=1;u=0;--n)if(e[n]===t)return!0;return!1}),r}return null}return n[0]},t.prototype.doUpdate=function(t,e){if(t){var n=this.getDefs(!1);if(t[this._domName]&&n.contains(t[this._domName]))"function"===typeof e&&e(t);else{var r=this.add(t);r&&(t[this._domName]=r)}}},t.prototype.add=function(t){return null},t.prototype.addDom=function(t){var e=this.getDefs(!0);t.parentNode!==e&&e.appendChild(t)},t.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},t.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return Z(this._tagNames,(function(n){for(var r=t.getElementsByTagName(n),i=0;i-1){var s=En(a)[3],l=Bn(a);o.setAttribute("stop-color","#"+l),o.setAttribute("stop-opacity",s+"")}else o.setAttribute("stop-color",n[r].color);e.appendChild(o)}t.__dom=e},e.prototype.markUsed=function(e){if(e.style){var n=e.style.fill;n&&n.__dom&&t.prototype.markDomUsed.call(this,n.__dom),n=e.style.stroke,n&&n.__dom&&t.prototype.markDomUsed.call(this,n.__dom)}},e}(mA),SA=wA;function MA(t){return t&&(!!t.image||!!t.svgElement)}var CA=new Py,IA=function(t){function e(e,n){return t.call(this,e,n,["pattern"],"__pattern_in_use__")||this}return v(e,t),e.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var n=this;Z(["fill","stroke"],(function(r){var i=e.style[r];if(MA(i)){var o=n.getDefs(!0),a=CA.get(i);a?o.contains(a)||n.addDom(a):a=n.add(i),n.markUsed(e);var s=a.getAttribute("id");t.setAttribute(r,"url(#"+s+")")}}))}},e.prototype.add=function(t){if(MA(t)){var e=this.createElement("pattern");return t.id=null==t.id?this.nextId++:t.id,e.setAttribute("id","zr"+this._zrId+"-pattern-"+t.id),e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("patternUnits","userSpaceOnUse"),this.updateDom(t,e),this.addDom(e),e}},e.prototype.update=function(t){if(MA(t)){var e=this;this.doUpdate(t,(function(){var n=CA.get(t);e.updateDom(t,n)}))}},e.prototype.updateDom=function(t,e){var n=t.svgElement;if(n instanceof SVGElement)n.parentNode!==e&&(e.innerHTML="",e.appendChild(n),e.setAttribute("width",t.svgWidth+""),e.setAttribute("height",t.svgHeight+""));else{var r=void 0,i=e.getElementsByTagName("image");if(i.length){if(!t.image)return void e.removeChild(i[0]);r=i[0]}else t.image&&(r=this.createElement("image"));if(r){var o=void 0,a=t.image;if("string"===typeof a?o=a:a instanceof HTMLImageElement?o=a.src:a instanceof HTMLCanvasElement&&(o=a.toDataURL()),o){r.setAttribute("href",o),r.setAttribute("x","0"),r.setAttribute("y","0");var s={dirty:function(){}},l=Ea(o,r,s,(function(t){e.setAttribute("width",t.width+""),e.setAttribute("height",t.height+"")}));l&&l.width&&l.height&&(e.setAttribute("width",l.width+""),e.setAttribute("height",l.height+"")),e.appendChild(r)}}}var u=t.x||0,c=t.y||0,h=(t.rotation||0)/Math.PI*180,p=t.scaleX||1,f=t.scaleY||1,d="translate("+u+", "+c+") rotate("+h+") scale("+p+", "+f+")";e.setAttribute("patternTransform",d),CA.set(t,e)},e.prototype.markUsed=function(e){e.style&&(MA(e.style.fill)&&t.prototype.markDomUsed.call(this,CA.get(e.style.fill)),MA(e.style.stroke)&&t.prototype.markDomUsed.call(this,CA.get(e.style.stroke)))},e}(mA),TA=IA;function AA(t){var e=[];if(t)for(var n=0;n0}var kA=function(t){function e(e,n){var r=t.call(this,e,n,"clipPath","__clippath_in_use__")||this;return r._refGroups={},r._keyDuplicateCount={},r}return v(e,t),e.prototype.markAllUnused=function(){t.prototype.markAllUnused.call(this);var e=this._refGroups;for(var n in e)e.hasOwnProperty(n)&&this.markDomUnused(e[n]);this._keyDuplicateCount={}},e.prototype._getClipPathGroup=function(t,e){if(DA(t)){var n=t.__clipPaths,r=this._keyDuplicateCount,i=AA(n);return r_(n,e&&e.__clipPaths)&&(r[i]=r[i]||0,r[i]&&(i+="-"+r[i]),r[i]++),this._refGroups[i]||(this._refGroups[i]=this.createElement("g"))}},e.prototype.update=function(t,e){var n=this._getClipPathGroup(t,e);return n&&(this.markDomUsed(n),this.updateDom(n,t.__clipPaths)),n},e.prototype.updateDom=function(t,e){if(e&&e.length>0){var n=this.getDefs(!0),r=e[0],i=void 0,o=void 0;r._dom?(o=r._dom.getAttribute("id"),i=r._dom,n.contains(i)||n.appendChild(i)):(o="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,i=this.createElement("clipPath"),i.setAttribute("id",o),n.appendChild(i),r._dom=i);var a=this.getSvgProxy(r);a.brush(r);var s=this.getSvgElement(r);i.innerHTML="",i.appendChild(s),t.setAttribute("clip-path","url(#"+o+")"),e.length>1&&this.updateDom(i,e.slice(1))}else t&&t.setAttribute("clip-path","none")},e.prototype.markUsed=function(e){var n=this;e.__clipPaths&&Z(e.__clipPaths,(function(e){e._dom&&t.prototype.markDomUsed.call(n,e._dom)}))},e.prototype.removeUnused=function(){t.prototype.removeUnused.call(this);var e={},n=this._refGroups;for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];this.isDomUnused(i)?i.parentNode&&i.parentNode.removeChild(i):e[r]=i}this._refGroups=e},e}(mA),LA=kA,OA=function(t){function e(e,n){var r=t.call(this,e,n,["filter"],"__filter_in_use__","_shadowDom")||this;return r._shadowDomMap={},r._shadowDomPool=[],r}return v(e,t),e.prototype._getFromPool=function(){var t=this._shadowDomPool.pop();if(!t){t=this.createElement("filter"),t.setAttribute("id","zr"+this._zrId+"-shadow-"+this.nextId++);var e=this.createElement("feDropShadow");t.appendChild(e),this.addDom(t)}return t},e.prototype.update=function(t,e){var n=e.style;if(EA(n)){var r=RA(e),i=e._shadowDom=this._shadowDomMap[r];i||(i=this._getFromPool(),this._shadowDomMap[r]=i),this.updateDom(t,e,i)}else this.remove(t,e)},e.prototype.remove=function(t,e){null!=e._shadowDom&&(e._shadowDom=null,t.removeAttribute("filter"))},e.prototype.updateDom=function(t,e,n){var r=n.children[0],i=e.style,o=e.getGlobalScale(),a=o[0],s=o[1];if(a&&s){var l=i.shadowOffsetX||0,u=i.shadowOffsetY||0,c=i.shadowBlur,h=BT(i.shadowColor);r.setAttribute("dx",l/a+""),r.setAttribute("dy",u/s+""),r.setAttribute("flood-color",h.color),r.setAttribute("flood-opacity",h.opacity+"");var p=c/2/a,f=c/2/s,d=p+" "+f;r.setAttribute("stdDeviation",d),n.setAttribute("x","-100%"),n.setAttribute("y","-100%"),n.setAttribute("width","300%"),n.setAttribute("height","300%"),e._shadowDom=n;var g=n.getAttribute("id");t.setAttribute("filter","url(#"+g+")")}},e.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this._shadowDomPool,n=this._shadowDomMap;for(var r in n)n.hasOwnProperty(r)&&e.push(n[r]);this._shadowDomMap={}}},e}(mA),PA=OA;function EA(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function RA(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}function NA(t){return parseInt(t,10)}function zA(t){return t instanceof Fl?cA:t instanceof Yl?hA:t instanceof jl?dA:cA}function BA(t,e){return e&&t&&e.parentNode!==t}function VA(t,e,n){if(BA(t,e)&&n){var r=n.nextSibling;r?t.insertBefore(e,r):t.appendChild(e)}}function FA(t,e){if(BA(t,e)){var n=t.firstChild;n?t.insertBefore(e,n):t.appendChild(e)}}function GA(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)}function HA(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function jA(t){return t.__svgEl}var WA=function(){function t(t,e,n,r){this.type="svg",this.refreshHover=UA("refreshHover"),this.pathToImage=UA("pathToImage"),this.configLayer=UA("configLayer"),this.root=t,this.storage=e,this._opts=n=j({},n||{});var i=zT("svg");i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),i.setAttribute("version","1.1"),i.setAttribute("baseProfile","full"),i.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=zT("g");i.appendChild(o);var a=zT("g");i.appendChild(a),this._gradientManager=new SA(r,a),this._patternManager=new TA(r,a),this._clipPathManager=new LA(r,a),this._shadowManager=new PA(r,a);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=i,this._svgRoot=a,this._backgroundRoot=o,this._viewport=s,t.appendChild(s),s.appendChild(i),this.resize(n.width,n.height),this._visibleList=[]}return t.prototype.getType=function(){return"svg"},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.getSvgRoot=function(){return this._svgRoot},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.refresh=function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},t.prototype.setBackgroundColor=function(t){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var e=zT("rect");e.setAttribute("width",this.getWidth()),e.setAttribute("height",this.getHeight()),e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("id",0);var n=BT(t),r=n.color,i=n.opacity;e.setAttribute("fill",r),e.setAttribute("fill-opacity",i),this._backgroundRoot.appendChild(e),this._backgroundNode=e},t.prototype.createSVGElement=function(t){return zT(t)},t.prototype.paintOne=function(t){var e=zA(t);return e&&e.brush(t),jA(t)},t.prototype._paintList=function(t){var e=this._gradientManager,n=this._patternManager,r=this._clipPathManager,i=this._shadowManager;e.markAllUnused(),n.markAllUnused(),r.markAllUnused(),i.markAllUnused();for(var o=this._svgRoot,a=this._visibleList,s=t.length,l=[],u=0;u\n\r<"));return"data:image/svg+xml;charset=UTF-8,"+n},t}();function UA(t){return function(){V('In SVG mode painter not support method "'+t+'"')}}var qA=WA;function XA(t){t.registerPainter("svg",qA)}var YA=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return v(e,t),e.prototype.getInitialData=function(t){return zM(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var e=new Ui,n=Kx("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(n),n.setStyle(t.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*t.itemHeight,s=Kx(o,(t.itemWidth-a)/2,(t.itemHeight-a)/2,a,a,t.itemStyle.fill);e.add(s),s.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?i:t.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([t.itemWidth/2,t.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={zlevel:0,z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0,lineStyle:{width:"bolder"}},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(yv),$A=YA;function ZA(t,e){var n=t.mapDimensionsAll("defaultedLabel"),r=n.length;if(1===r){var i=Zd(t,e,n[0]);return null!=i?i+"":null}if(r){for(var o=[],a=0;a=0&&r.push(e[o])}return r.join(" ")}var JA=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.updateData(e,n,r,i),o}return v(e,t),e.prototype._createSymbol=function(t,e,n,r,i){this.removeAll();var o=Kx(t,-1,-1,2,2,null,i);o.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=QA,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){nc(this.childAt(0))},e.prototype.downplay=function(){rc(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":e.cursor},e.prototype.updateData=function(t,n,r,i){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,u=i&&i.disableAnimation;if(l){var c=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,c)}else{var h=this.childAt(0);h.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?h.attr(p):Ec(h,p,a,n),Fc(h)}if(this._updateCommon(t,n,s,r,i),l){h=this.childAt(0);if(!u){p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,Rc(h,p,a,n)}}u&&this.childAt(0).stopAnimation("remove"),this._seriesModel=a},e.prototype._updateCommon=function(t,e,n,r,i){var o,a,s,l,u,c,h,p,f=this.childAt(0),d=t.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,u=r.blurScope,c=r.labelStatesModels,h=r.hoverScale,p=r.cursorStyle),!r||t.hasItemOption){var g=r&&r.itemModel?r.itemModel:t.getItemModel(e),v=g.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=g.getModel(["select","itemStyle"]).getItemStyle(),a=g.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=qc(g),h=v.getShallow("scale"),p=g.getShallow("cursor")}var y=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var m=Qx(t.getItemVisual(e,"symbolOffset"),n);m&&(f.x=m[0],f.y=m[1]),p&&f.attr("cursor",p);var x=t.getItemVisual(e,"style"),_=x.fill;if(f instanceof Yl){var b=f.style;f.useStyle(j({image:b.image,x:b.x,y:b.y,width:b.width,height:b.height},x))}else f.__isEmptyBrush?f.useStyle(j({},x)):f.useStyle(x),f.style.decal=null,f.setColor(_,i&&i.symbolInnerColor),f.style.strokeNoScale=!0;var w=t.getItemVisual(e,"liftZ"),S=this._z2;null!=w?null==S&&(this._z2=f.z2,f.z2+=w):null!=S&&(f.z2=S,this._z2=null);var M=i&&i.useNameLabel;function C(e){return M?t.getName(e):ZA(t,e)}Uc(f,c,{labelFetcher:d,labelDataIndex:e,defaultText:C,inheritColor:_,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=f.ensureState("emphasis");if(I.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a,h){var T=Math.max(1.1,3/this._sizeY);I.scaleX=this._sizeX*T,I.scaleY=this._sizeY*T}this.setSymbolScale(1),xc(this,l,u)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e){var n=this.childAt(0),r=this._seriesModel,i=mu(this).dataIndex,o=e&&e.animation;if(this.silent=n.silent=!0,e&&e.fadeLabel){var a=n.getTextContent();a&&zc(a,{style:{opacity:0}},r,{dataIndex:i,removeOpt:o,cb:function(){n.removeTextContent()}})}else n.removeTextContent();zc(n,{style:{opacity:0},scaleX:0,scaleY:0},r,{dataIndex:i,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return Jx(t.getItemVisual(e,"symbolSize"))},e}(Ui);function QA(t,e){this.parent.drift(t,e)}var tD=JA;function eD(t,e,n,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function nD(t){return null==t||ct(t)||(t={isIgnore:t}),t||{}}function rD(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),hoverScale:n.get("scale"),labelStatesModels:qc(e),cursorStyle:e.get("cursor")}}var iD=function(){function t(t){this.group=new Ui,this._SymbolCtor=t||tD}return t.prototype.updateData=function(t,e){e=nD(e);var n=this.group,r=t.hostModel,i=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=rD(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};i||n.removeAll(),t.diff(i).add((function(r){var i=u(r);if(eD(t,i,r,e)){var a=new o(t,r,s,l);a.setPosition(i),t.setItemGraphicEl(r,a),n.add(a)}})).update((function(c,h){var p=i.getItemGraphicEl(h),f=u(c);if(eD(t,f,c,e)){var d=t.getItemVisual(c,"symbol")||"circle",g=p&&p.getSymbolType&&p.getSymbolType();if(!p||g&&g!==d)n.remove(p),p=new o(t,c,s,l),p.setPosition(f);else{p.updateData(t,c,s,l);var v={x:f[0],y:f[1]};a?p.attr(v):Ec(p,v,r)}n.add(p),t.setItemGraphicEl(c,p)}else n.remove(p)})).remove((function(t){var e=i.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}))})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.isPersistent=function(){return!0},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var r=t._getSymbolPoint(n);e.setPosition(r),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=rD(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function r(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}n=nD(n);for(var i=t.start;i0?n=r[0]:r[1]<0&&(n=r[1]),n}function lD(t,e,n,r){var i=NaN;t.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,r),a[1-o]=i,e.dataToPoint(a)}var uD="undefined"!==typeof Float32Array,cD=uD?Float32Array:Array;function hD(t){return ot(t)?uD?new Float32Array(t):t:new cD(t)}function pD(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}function fD(t,e,n,r,i,o,a,s){for(var l=pD(t,e),u=[],c=[],h=[],p=[],f=[],d=[],g=[],v=aD(i,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],x=0;x=i||g<0)break;if(vD(y,m)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](y,m),h=y,p=m;else{var x=y-u,_=m-c;if(x*x+_*_<.5){g+=o;continue}if(a>0){var b=g+o,w=e[2*b],S=e[2*b+1];while(w===y&&S===m&&v=r||vD(w,S))f=y,d=m;else{I=w-u,T=S-c;var k=y-u,L=w-y,O=m-c,P=S-m,E=void 0,R=void 0;"x"===s?(E=Math.abs(k),R=Math.abs(L),f=y-E*a,d=m,A=y+E*a,D=m):"y"===s?(E=Math.abs(O),R=Math.abs(P),f=y,d=m-E*a,A=y,D=m+E*a):(E=Math.sqrt(k*k+O*O),R=Math.sqrt(L*L+P*P),C=R/(R+E),f=y-I*a*(1-C),d=m-T*a*(1-C),A=y+I*a*C,D=m+T*a*C,A=dD(A,gD(w,y)),D=dD(D,gD(S,m)),A=gD(A,dD(w,y)),D=gD(D,dD(S,m)),I=A-y,T=D-m,f=y-I*E/R,d=m-T*E/R,f=dD(f,gD(u,y)),d=dD(d,gD(c,m)),f=gD(f,dD(u,y)),d=gD(d,dD(c,m)),I=y-f,T=m-d,A=y+I*R/E,D=m+T*R/E)}t.bezierCurveTo(h,p,f,d,y,m),h=A,p=D}else t.lineTo(y,m)}u=y,c=m,g+=o}return v}var mD=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),xD=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return v(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mD},e.prototype.buildPath=function(t,e){var n=e.points,r=0,i=n.length/2;if(e.connectNulls){for(;i>0;i--)if(!vD(n[2*i-2],n[2*i-1]))break;for(;r=0){var m=s?(p-r)*y+r:(h-n)*y+n;return s?[t,m]:[m,t]}n=h,r=p;break;case a.C:h=o[u++],p=o[u++],f=o[u++],d=o[u++],g=o[u++],v=o[u++];var x=s?bs(n,h,f,g,t,l):bs(r,p,d,v,t,l);if(x>0)for(var _=0;_=0){m=s?xs(r,p,d,v,b):xs(n,h,f,g,b);return s?[t,m]:[m,t]}}n=g,r=v;break}}},e}(Fl),_D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e}(mD),bD=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return v(e,t),e.prototype.getDefaultShape=function(){return new _D},e.prototype.buildPath=function(t,e){var n=e.points,r=e.stackedOnPoints,i=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0;o--)if(!vD(n[2*o-2],n[2*o-1]))break;for(;ie){r?i.push(a(r,l,e)):n&&i.push(a(n,l,0),a(n,l,e));break}n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}}return i}function PD(t,e,n){var r=t.getVisual("visualMeta");if(r&&r.length&&t.count()&&"cartesian2d"===e.type){for(var i,o,a=r.length-1;a>=0;a--){var s=t.getDimensionInfo(r[a].dimension);if(i=s&&s.coordDim,"x"===i||"y"===i){o=r[a];break}}if(o){var l=e.getAxis(i),u=K(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),c=u.length,h=o.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var p=OD(u,"x"===i?n.getWidth():n.getHeight()),f=p.length;if(!f&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var d=10,g=p[0].coord-d,v=p[f-1].coord+d,y=v-g;if(y<.001)return"transparent";Z(p,(function(t){t.offset=(t.coord-g)/y})),p.push({offset:f?p[f-1].offset:.5,color:h[1]||"transparent"}),p.unshift({offset:f?p[0].offset:.5,color:h[0]||"transparent"});var m=new Qm(0,0,0,0,p,!0);return m[i]=g,m[i+"2"]=v,m}}}function ED(t,e,n){var r=t.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&(!i||!RD(o,e))){var a=e.mapDimension(o.dim),s={};return Z(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function RD(t,e){var n=t.getExtent(),r=Math.abs(n[1]-n[0])/t.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),o=Math.max(1,Math.round(i/5)),a=0;ar)return!1;return!0}function ND(t,e){return isNaN(t)||isNaN(e)}function zD(t){for(var e=t.length/2;e>0;e--)if(!ND(t[2*e-2],t[2*e-1]))break;return e-1}function BD(t,e){return[t[2*e],t[2*e+1]]}function VD(t,e,n){for(var r,i,o=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u=e||r>=e&&i<=e){l=u;break}s=u,r=i}else r=i;return{range:[s,l],t:(e-r)/(i-r)}}function FD(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&"bolder"===t.get(["emphasis","lineStyle","width"])){var L=f.getState("emphasis").style;L.lineWidth=+f.style.lineWidth+1}mu(f).seriesIndex=t.seriesIndex,xc(f,D,k);var O=DD(t.get("smooth")),P=t.get("smoothMonotone"),E=t.get("connectNulls");if(f.setShape({smooth:O,smoothMonotone:P,connectNulls:E}),d){var R=a.getCalculationInfo("stackedOnSeries"),N=0;d.useStyle(W(l.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),R&&(N=DD(R.get("smooth"))),d.setShape({smooth:O,stackedOnSmooth:N,smoothMonotone:P,connectNulls:E}),Sc(d,t,"areaStyle"),mu(d).seriesIndex=t.seriesIndex,xc(d,D,k)}var z=function(t){r._changePolyState(t)};a.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=z)})),this._polyline.onHoverStateChange=z,this._data=a,this._coordSys=i,this._stackedOnPoints=_,this._points=u,this._step=C,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,f),d&&this.packEventData(t,d))},e.prototype.packEventData=function(t,e){mu(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,r){var i=t.getData(),o=ea(i,r);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=t.get("zlevel"),h=t.get("z");s=new tD(i,o),s.x=l,s.y=u,s.setZ(c,h);var p=s.getSymbolPath().getTextContent();p&&(p.zlevel=c,p.z=h,p.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else Dv.prototype.highlight.call(this,t,e,n,r)},e.prototype.downplay=function(t,e,n,r){var i=t.getData(),o=ea(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else Dv.prototype.downplay.call(this,t,e,n,r)},e.prototype._changePolyState=function(t){var e=this._polygon;Xu(this._polyline,t),e&&Xu(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new xD({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new bD({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var r,i,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(r=o.isHorizontal(),i=!1):"polar"===e.type&&(r="angle"===o.dim,i=!0);var s=t.hostModel,l=s.get("animationDuration");"function"===typeof l&&(l=l(null));var u=s.get("animationDelay")||0,c="function"===typeof u?u(null):u;t.eachItemGraphicEl((function(t,o){var s=t;if(s){var h=[t.x,t.y],p=void 0,f=void 0,d=void 0;if(n)if(i){var g=n,v=e.pointToCoord(h);r?(p=g.startAngle,f=g.endAngle,d=-v[1]/180*Math.PI):(p=g.r0,f=g.r,d=v[0])}else{var y=n;r?(p=y.x,f=y.x+y.width,d=t.x):(p=y.y+y.height,f=y.y,d=t.y)}var m=f===p?0:(d-p)/(f-p);a&&(m=1-m);var x="function"===typeof u?u(o):l*m+c,_=s.getSymbolPath(),b=_.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:x}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:x}),_.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var r=t.getModel("endLabel");if(FD(t)){var i=t.getData(),o=this._polyline,a=this._endLabel;a||(a=this._endLabel=new yu({z2:200}),a.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var s=zD(i.getLayout("points"));s>=0&&(Uc(o,qc(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:s,defaultText:function(t,e,n){return null!=n?KA(i,n):ZA(i,t)},enableTextSetter:!0},HD(r,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),p=o.get("precision"),f=o.get("distance")||0,d=a.getBaseAxis(),g=d.isHorizontal(),v=d.inverse,y=e.shape,m=v?g?y.x:y.y+y.height:g?y.x+y.width:y.y,x=(g?f:0)*(v?-1:1),_=(g?0:-f)*(v?-1:1),b=g?"x":"y",w=VD(u,m,b),S=w.range,M=S[1]-S[0],C=void 0;if(M>=1){if(M>1&&!h){var I=BD(u,S[0]);s.attr({x:I[0]+x,y:I[1]+_}),i&&(C=c.getRawValue(S[0]))}else{I=l.getPointOn(m,b);I&&s.attr({x:I[0]+x,y:I[1]+_});var T=c.getRawValue(S[0]),A=c.getRawValue(S[1]);i&&(C=fa(n,p,T,A,w.t))}r.lastFrameIndex=S[0]}else{var D=1===t||r.lastFrameIndex>0?S[0]:0;I=BD(u,D);i&&(C=c.getRawValue(D)),s.attr({x:I[0]+x,y:I[1]+_})}i&&nh(s).setLabelText(C)}},e.prototype._doUpdateAnimation=function(t,e,n,r,i,o){var a=this._polyline,s=this._polygon,l=t.hostModel,u=fD(this._data,t,this._stackedOnPoints,e,this._coordSys,n,this._valueOrigin,o),c=u.current,h=u.stackedOnCurrent,p=u.next,f=u.stackedOnNext;if(i&&(c=LD(u.current,n,i),h=LD(u.stackedOnCurrent,n,i),p=LD(u.next,n,i),f=LD(u.stackedOnNext,n,i)),AD(c,p)>3e3||s&&AD(h,f)>3e3)return a.stopAnimation(),a.setShape({points:p}),void(s&&(s.stopAnimation(),s.setShape({points:p,stackedOnPoints:f})));a.shape.__points=u.current,a.shape.points=c;var d={shape:{points:p}};u.current!==c&&(d.shape.__points=u.next),a.stopAnimation(),Ec(a,d,l),s&&(s.setShape({points:c,stackedOnPoints:h}),s.stopAnimation(),Ec(s,{shape:{stackedOnPoints:f}},l),a.shape.points!==s.shape.points&&(s.shape.points=a.shape.points));for(var g=[],v=u.status,y=0;ye&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(c||1),p=Math.round(a/h);if(p>1){"lttb"===i&&t.setData(r.lttbDownSample(r.mapDimension(l.dim),1/p));var f=void 0;"string"===typeof i?f=qD[i]:"function"===typeof i&&(f=i),f&&t.setData(r.downSample(r.mapDimension(l.dim),1/p,f,XD))}}}}}function $D(t){t.registerChartView(WD),t.registerSeriesModel($A),t.registerLayout(UD("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,YD("line"))}var ZD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.getInitialData=function(t,e){return zM(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t){var e=this.coordinateSystem;if(e&&e.clampData){var n=e.dataToPoint(e.clampData(t)),r=this.getData(),i=r.getLayout("offset"),o=r.getLayout("size"),a=e.getBaseAxis().isHorizontal()?0:1;return n[a]+=i+o/2,n}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(yv);yv.registerClass(ZD);var KD=ZD,JD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.getInitialData=function(){return zM(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=bh(KD.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(KD),QD=JD,tk=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0}return t}(),ek=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return v(e,t),e.prototype.getDefaultShape=function(){return new tk},e.prototype.buildPath=function(t,e){var n=e.cx,r=e.cy,i=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-i),s=i+a,l=e.startAngle,u=e.endAngle,c=e.clockwise,h=Math.cos(l),p=Math.sin(l),f=Math.cos(u),d=Math.sin(u),g=c?u-l<2*Math.PI:l-u<2*Math.PI;g&&(t.moveTo(h*i+n,p*i+r),t.arc(h*s+n,p*s+r,a,-Math.PI+l,l,!c)),t.arc(n,r,o,l,u,!c),t.moveTo(f*o+n,d*o+r),t.arc(f*s+n,d*s+r,a,u-2*Math.PI,u-Math.PI,!c),0!==i&&(t.arc(n,r,i,u,l,c),t.moveTo(h*i+n,d*i+r)),t.closePath()},e}(Fl),nk=ek;function rk(t,e){e=e||{};var n=e.isRoundCap;return function(e,r,i){var o=r.position;if(!o||o instanceof Array)return Li(e,r,i);var a=t(o),s=null!=r.distance?r.distance:5,l=this.shape,u=l.cx,c=l.cy,h=l.r,p=l.r0,f=(h+p)/2,d=l.startAngle,g=l.endAngle,v=(d+g)/2,y=n?Math.abs(h-p)/2:0,m=Math.cos,x=Math.sin,_=u+h*m(d),b=c+h*x(d),w="left",S="top";switch(a){case"startArc":_=u+(p-s)*m(v),b=c+(p-s)*x(v),w="center",S="top";break;case"insideStartArc":_=u+(p+s)*m(v),b=c+(p+s)*x(v),w="center",S="bottom";break;case"startAngle":_=u+f*m(d)+ok(d,s+y,!1),b=c+f*x(d)+ak(d,s+y,!1),w="right",S="middle";break;case"insideStartAngle":_=u+f*m(d)+ok(d,-s+y,!1),b=c+f*x(d)+ak(d,-s+y,!1),w="left",S="middle";break;case"middle":_=u+f*m(v),b=c+f*x(v),w="center",S="middle";break;case"endArc":_=u+(h+s)*m(v),b=c+(h+s)*x(v),w="center",S="bottom";break;case"insideEndArc":_=u+(h-s)*m(v),b=c+(h-s)*x(v),w="center",S="top";break;case"endAngle":_=u+f*m(g)+ok(g,s+y,!0),b=c+f*x(g)+ak(g,s+y,!0),w="left",S="middle";break;case"insideEndAngle":_=u+f*m(g)+ok(g,-s+y,!0),b=c+f*x(g)+ak(g,-s+y,!0),w="right",S="middle";break;default:return Li(e,r,i)}return e=e||{},e.x=_,e.y=b,e.align=w,e.verticalAlign=S,e}}function ik(t,e,n,r){if("number"!==typeof r)if(ot(e))t.setTextConfig({rotation:0});else{var i,o=t.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=l;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:return void t.setTextConfig({rotation:0})}var c=1.5*Math.PI-i;"middle"===u&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),t.setTextConfig({rotation:c})}else t.setTextConfig({rotation:r})}function ok(t,e,n){return e*Math.sin(t)*(n?-1:1)}function ak(t,e,n){return e*Math.cos(t)*(n?1:-1)}var sk=[0,0],lk=Math.max,uk=Math.min;function ck(t,e){var n=t.getArea&&t.getArea();if(CD(t,"cartesian2d")){var r=t.getBaseAxis();if("category"!==r.type||!r.onBand){var i=e.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}var hk=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return v(e,t),e.prototype.render=function(t,e,n,r){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var i=t.get("coordinateSystem");("cartesian2d"===i||"polar"===i)&&(this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,r))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._incrementalRenderLarge(t,e)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,r){var i,o=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=t.isAnimationEnabled()?t:null,h=dk(t,l);h&&this._enableRealtimeSort(h,a,n);var p=t.get("clip",!0)||h,f=ck(l,a);o.removeClipPath();var d=t.get("roundCap",!0),g=t.get("showBackground",!0),v=t.getModel("backgroundStyle"),y=v.get("borderRadius")||0,m=[],x=this._backgroundEls,_=r&&r.isInitSort,b=r&&"changeAxisOrder"===r.type;function w(t){var e=_k[l.type](a,t),n=Pk(l,i,e);return n.useStyle(v.getItemStyle()),"cartesian2d"===l.type&&n.setShape("r",y),m[t]=n,n}a.diff(s).add((function(e){var n=a.getItemModel(e),r=_k[l.type](a,e,n);if(g&&w(e),a.hasValue(e)&&xk[l.type](r)){var s=!1;p&&(s=pk[l.type](f,r));var v=fk[l.type](t,a,e,r,i,c,u.model,!1,d);h&&(v.forceLabelAnimation=!0),Sk(v,a,e,n,r,t,i,"polar"===l.type),_?v.attr({shape:r}):h?gk(h,c,v,r,e,i,!1,!1):Rc(v,{shape:r},t,e),a.setItemGraphicEl(e,v),o.add(v),v.ignore=s}})).update((function(e,n){var r=a.getItemModel(e),S=_k[l.type](a,e,r);if(g){var M=void 0;0===x.length?M=w(n):(M=x[n],M.useStyle(v.getItemStyle()),"cartesian2d"===l.type&&M.setShape("r",y),m[e]=M);var C=_k[l.type](a,e),I=Ok(i,C,l);Ec(M,{shape:I},c,e)}var T=s.getItemGraphicEl(n);if(a.hasValue(e)&&xk[l.type](S)){var A=!1;if(p&&(A=pk[l.type](f,S),A&&o.remove(T)),T?Fc(T):T=fk[l.type](t,a,e,S,i,c,u.model,!!T,d),h&&(T.forceLabelAnimation=!0),b){var D=T.getTextContent();if(D){var k=nh(D);null!=k.prevValue&&(k.prevValue=k.value)}}b||Sk(T,a,e,r,S,t,i,"polar"===l.type),_?T.attr({shape:S}):h?gk(h,c,T,S,e,i,!0,b):Ec(T,{shape:S},t,e,null),a.setItemGraphicEl(e,T),T.ignore=A,o.add(T)}else o.remove(T)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&Vc(n,t,e)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Ui);S.removeAll();for(var M=0;Mo)return!0;o=u}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(t.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,r){if(this._isOrderChangedWithinSameData(t,e,n)){var i=this._dataSort(t,n,e);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},e.prototype._dispatchInitSort=function(t,e,n){var r=e.baseAxis,i=this._dataSort(t,r,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){Vc(e,t,mu(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Dv),pk={cartesian2d:function(t,e){var n=e.width<0?-1:1,r=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=t.x+t.width,o=t.y+t.height,a=lk(e.x,t.x),s=uk(e.x+e.width,i),l=lk(e.y,t.y),u=uk(e.y+e.height,o),c=si?s:a,e.y=h&&l>o?u:l,e.width=c?0:s-a,e.height=h?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),c||h},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var r=e.r;e.r=e.r0,e.r0=r}var i=uk(e.r,t.r),o=lk(e.r0,t.r0);e.r=i,e.r0=o;var a=i-o<0;if(n<0){r=e.r;e.r=e.r0,e.r0=r}return a}},fk={cartesian2d:function(t,e,n,r,i,o,a,s,l){var u=new ru({shape:j({},r),z2:1});if(u.__dataIndex=n,u.name="item",o){var c=u.shape,h=i?"height":"width";c[h]=0}return u},polar:function(t,e,n,r,i,o,a,s,l){var u=!i&&l?nk:Dm,c=new u({shape:r,z2:1});c.name="item";var h=wk(i);if(c.calculateTextPosition=rk(h,{isRoundCap:u===nk}),o){var p=c.shape,f=i?"r":"endAngle",d={};p[f]=i?0:r.startAngle,d[f]=r[f],(s?Ec:Rc)(c,{shape:d},o)}return c}};function dk(t,e){var n=t.get("realtimeSort",!0),r=e.getBaseAxis();if(n&&"category"===r.type&&"cartesian2d"===e.type)return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}function gk(t,e,n,r,i,o,a,s){var l,u;o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?Ec:Rc)(n,{shape:l},e,i,null);var c=e?t.baseAxis.model:null;(a?Ec:Rc)(n,{shape:u},c,i)}function vk(t,e){for(var n=0;n0?1:-1,a=r.height>0?1:-1;return{x:r.x+o*i/2,y:r.y+a*i/2,width:r.width-o*i,height:r.height-a*i}},polar:function(t,e,n){var r=t.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function bk(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}function wk(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function Sk(t,e,n,r,i,o,a,s){var l=e.getItemVisual(n,"style");s||t.setShape("r",r.get(["itemStyle","borderRadius"])||0),t.useStyle(l);var u=r.getShallow("cursor");u&&t.attr("cursor",u);var c=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",h=qc(r);Uc(t,h,{labelFetcher:o,labelDataIndex:n,defaultText:ZA(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:c});var p=t.getTextContent();if(s&&p){var f=r.get(["label","position"]);t.textConfig.inside="middle"===f||null,ik(t,"outside"===f?c:f,wk(a),r.get(["label","rotate"]))}rh(p,h,o.getRawValue(n),(function(t){return KA(e,t)}));var d=r.getModel(["emphasis"]);xc(t,d.get("focus"),d.get("blurScope")),Sc(t,r),bk(i)&&(t.style.fill="none",t.style.stroke="none",Z(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}function Mk(t,e){var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var r=t.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(r,i,o)}var Ck=function(){function t(){}return t}(),Ik=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return v(e,t),e.prototype.getDefaultShape=function(){return new Ck},e.prototype.buildPath=function(t,e){for(var n=e.points,r=this.__startPoint,i=this.__baseDimIdx,o=0;o=0?n:null}),30,!1);function Dk(t,e,n){var r=t.__baseDimIdx,i=1-r,o=t.shape.points,a=t.__largeDataIndices,s=Math.abs(t.__barWidth/2),l=t.__startPoint[i];sk[0]=e,sk[1]=n;for(var u=sk[r],c=sk[1-r],h=u-s,p=u+s,f=0,d=o.length/2;f=h&&v<=p&&(l<=y?c>=l&&c<=y:c>=y&&c<=l))return a[f]}return-1}function kk(t,e,n){var r=n.getVisual("style");t.useStyle(j({},r)),t.style.fill=null,t.style.stroke=r.fill,t.style.lineWidth=n.getLayout("barWidth")}function Lk(t,e,n){var r=e.get("borderColor")||e.get("color"),i=e.getItemStyle();t.useStyle(i),t.style.fill=null,t.style.stroke=r,t.style.lineWidth=n.getLayout("barWidth")}function Ok(t,e,n){if(CD(n,"cartesian2d")){var r=e,i=n.getArea();return{x:t?r.x:i.x,y:t?i.y:r.y,width:t?r.width:i.width,height:t?i.height:r.height}}i=n.getArea();var o=e;return{cx:i.cx,cy:i.cy,r0:t?i.r0:o.r0,r:t?i.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}function Pk(t,e,n){var r="polar"===t.type?Dm:ru;return new r({shape:Ok(e,n,t),silent:!0,z2:0})}var Ek=hk;function Rk(t){t.registerChartView(Ek),t.registerSeriesModel(QD),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,it(dC,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,gC),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,YD("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))}var Nk=2*Math.PI,zk=Math.PI/180;function Bk(t,e){return Rp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Vk(t,e){var n=Bk(t,e),r=t.get("center"),i=t.get("radius");ot(i)||(i=[0,i]),ot(r)||(r=[r,r]);var o=lo(n.width,e.getWidth()),a=lo(n.height,e.getHeight()),s=Math.min(o,a),l=lo(r[0],o)+n.x,u=lo(r[1],a)+n.y,c=lo(i[0],s/2),h=lo(i[1],s/2);return{cx:l,cy:u,r0:c,r:h}}function Fk(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),r=e.mapDimension("value"),i=Bk(t,n),o=Vk(t,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-t.get("startAngle")*zk,h=t.get("minAngle")*zk,p=0;e.each(r,(function(t){!isNaN(t)&&p++}));var f=e.getSum(r),d=Math.PI/(f||p)*2,g=t.get("clockwise"),v=t.get("roseType"),y=t.get("stillShowZeroSum"),m=e.getDataExtent(r);m[0]=0;var x=Nk,_=0,b=c,w=g?1:-1;if(e.setLayout({viewRect:i,r:l}),e.each(r,(function(t,n){var r;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:g,cx:a,cy:s,r0:u,r:v?NaN:l});else{r="area"!==v?0===f&&y?d:t*d:Nk/p,rn?a:o,c=Math.abs(l.label.y-n);if(c>u.maxY){var h=l.label.x-e-l.len2*i,p=r+l.len,d=Math.abs(h)0?"right":"left":L>0?"left":"right"}var G=y.get("rotate");if("number"===typeof G)P=G*(Math.PI/180);else if("center"===m)P=0;else{var H=L<0?-k+Math.PI:-k;"radial"===G||!0===G?P=H:"tangential"===G&&"outside"!==m&&"outer"!==m?(P=H+Math.PI/2,P>Math.PI/2&&(P-=Math.PI)):P=0}if(o=!!P,p.x=I,p.y=T,p.rotation=P,p.setStyle({verticalAlign:"middle"}),E){p.setStyle({align:D});var j=p.states.select;j&&(j.x+=p.x,j.y+=p.y)}else{var W=p.getBoundingRect().clone();W.applyTransform(p.getComputedTransform());var U=(p.style.margin||0)+2.1;W.y-=U/2,W.height+=U,i.push({label:p,labelLine:g,position:m,len:M,len2:C,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new ui(L,O),linePoints:A,textAlign:D,labelDistance:x,labelAlignTo:_,edgeDistance:b,bleedMargin:w,rect:W})}s.setTextConfig({inside:E})}})),!o&&t.get("avoidLabelOverlap")&&Wk(i,e,n,l,u,p,c,h);for(var g=0;g0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=r.r0}},e.type="pie",e}(Dv),Zk=$k;function Kk(t,e,n){e=ot(e)&&{coordDimensions:e}||j({encodeDefine:t.getEncode()},e);var r=t.getSource(),i=_M(r,e).dimensions,o=new mM(i,t);return o.initData(r,n),o}var Jk=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},t.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},t.prototype.getItemVisual=function(t,e){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,e)},t}(),Qk=Jk,tL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Qk(rt(this.getData,this),rt(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Kk(this,{coordDimensions:["value"],encodeDefaulter:it(uf,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),r=t.prototype.getDataParams.call(this,e),i=[];return n.each(n.mapDimension("value"),(function(t){i.push(t)})),r.percent=go(i,e,n.hostModel.get("percentPrecision")),r.$vars.push("percent"),r},e.prototype._defaultLabelLine=function(t){Ro(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(yv),eL=tL;function nL(t){return{seriesType:t,reset:function(t,e){var n=t.getData();n.filterSelf((function(t){var e=n.mapDimension("value"),r=n.get(e,t);return!("number"===typeof r&&!isNaN(r)&&r<0)}))}}}function rL(t){t.registerChartView(Zk),t.registerSeriesModel(eL),Iy("pie",t.registerAction),t.registerLayout(it(Fk,"pie")),t.registerProcessor(Gk("pie")),t.registerProcessor(nL("pie"))}var iL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return v(e,t),e.prototype.getInitialData=function(t,e){return zM(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(yv),oL=iL,aL=4,sL=function(){function t(){}return t}(),lL=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.getDefaultShape=function(){return new sL},e.prototype.buildPath=function(t,e){var n=e.points,r=e.size,i=this.symbolProxy,o=i.shape,a=t.getContext?t.getContext():t,s=a&&r[0]=0;s--){var l=2*s,u=r[l]-o/2,c=r[l+1]-a/2;if(t>=u&&e>=c&&t<=u+o&&e<=c+a)return s}return-1},e}(Fl),uL=function(){function t(){this.group=new Ui}return t.prototype.isPersistent=function(){return!this._incremental},t.prototype.updateData=function(t,e){this.group.removeAll();var n=new lL({rectHover:!0,cursor:"default"});n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,!1,e),this.group.add(n),this._incremental=null},t.prototype.updateLayout=function(t){if(!this._incremental){var e=t.getLayout("points");this.group.eachChild((function(t){if(null!=t.startIndex){var n=2*(t.endIndex-t.startIndex),r=4*t.startIndex*2;e=new Float32Array(e.buffer,r,n)}t.setShape("points",e)}))}},t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>2e6?(this._incremental||(this._incremental=new cx({silent:!0})),this.group.add(this._incremental)):this._incremental=null},t.prototype.incrementalUpdate=function(t,e,n){var r;this._incremental?(r=new lL,this._incremental.addDisplayable(r,!0)):(r=new lL({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end}),r.incremental=!0,this.group.add(r)),r.setShape({points:e.getLayout("points")}),this._setCommon(r,e,!!this._incremental,n)},t.prototype._setCommon=function(t,e,n,r){var i=e.hostModel;r=r||{};var o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.softClipShape=r.clipShape||null,t.symbolProxy=Kx(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var a=t.shape.size[0]=0&&(u.dataIndex=n+(t.startIndex||0))}))}},t.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},t.prototype._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},t}(),cL=uL,hL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r=t.getData(),i=this._updateSymbolDraw(r,t);i.updateData(r,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var r=t.getData(),i=this._updateSymbolDraw(r,t);i.incrementalPrepareUpdate(r),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var r=t.getData();if(this.group.dirty(),!this._finished||r.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var i=UD("").reset(t,e,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,r=e.pipelineContext,i=r.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new cL:new oD,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Dv),pL=hL,fL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Up),dL=fL,gL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",aa).models[0]},e.type="cartesian2dAxis",e}(Up);Y(gL,aI);var vL={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},yL=G({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},vL),mL=G({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},vL),xL=G({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},mL),_L=W({scale:!0,logBase:10},mL),bL={category:yL,value:mL,time:xL,log:_L},wL={value:1,category:1,time:1,log:1};function SL(t,e,n,r){Z(wL,(function(i,o){var a=G(G({},bL[o],!0),r,!0),s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+o,n}return v(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=Bp(this),r=n?Fp(t):{},i=e.getTheme();G(t,i.get(o+"Axis")),G(t,this.getDefaultOption()),t.type=ML(t),n&&Vp(t,r,n)},n.prototype.optionUpdated=function(){var t=this.option;"category"===t.type&&(this.__ordinalMeta=jM.createByAxisModel(this))},n.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+o,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",ML)}function ML(t){return t.type||(t.data?"category":"value")}var CL=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return K(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Q(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),IL=CL,TL=["x","y"];function AL(t){return"interval"===t.type||"time"===t.type}var DL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=TL,e}return v(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(AL(t)&&AL(e)){var n=t.getExtent(),r=e.getExtent(),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,u=(o[1]-i[1])/s,c=i[0]-n[0]*l,h=i[1]-r[0]*u,p=this._transform=[l,0,0,u,c,h];this._invTransform=Yr([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.dataToPoint=function(t,e,n){n=n||[];var r=t[0],i=t[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return ne(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,e)),n[1]=a.toGlobalCoord(a.dataToCoord(i,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(t[0]),s=r.parse(t[1]);return e=e||[],e[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return ne(n,t,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(t[0]),e),n[1]=i.coordToData(i.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),n=Math.min(t[0],t[1]),r=Math.min(e[0],e[1]),i=Math.max(t[0],t[1])-n,o=Math.max(e[0],e[1])-r;return new xi(n,r,i,o)},e}(IL),kL=DL,LL=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return v(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(LI),OL=LL;function PL(t,e,n){n=n||{};var r=t.coordinateSystem,i=e.axis,o={},a=i.getAxesOnZeroOf()[0],s=i.position,l=a?"onZero":s,u=i.dim,c=r.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],p={left:0,right:1,top:0,bottom:1,onZero:2},f=e.get("offset")||0,d="x"===u?[h[2]-f,h[3]+f]:[h[0]-f,h[1]+f];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));d[p.onZero]=Math.max(Math.min(g,d[1]),d[0])}o.position=["y"===u?d[p[l]]:h[0],"x"===u?d[p[l]]:h[3]],o.rotation=Math.PI/2*("x"===u?0:1);var v={top:-1,bottom:1,left:-1,right:1};o.labelDirection=o.tickDirection=o.nameDirection=v[s],o.labelOffset=a?d[p[s]]-d[p.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),mt(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var y=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-y:y,o.z2=1,o}function EL(t){return"cartesian2d"===t.get("coordinateSystem")}function RL(t){var e={xAxisModel:null,yAxisModel:null};return Z(e,(function(n,r){var i=r.replace(/Model$/,""),o=t.getReferringComponents(i,aa).models[0];e[r]=o})),e}var NL=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=TL,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),Z(n.x,(function(t){$C(t.scale,t.model)})),Z(n.y,(function(t){$C(t.scale,t.model)}));var r={};Z(n.x,(function(t){BL(n,"y",t,r)})),Z(n.y,(function(t){BL(n,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var r=t.getBoxLayoutParams(),i=!n&&t.get("containLabel"),o=Rp(r,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){Z(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],r=t.inverse?1:0;t.setExtent(n[r],n[1-r]),FL(t,e?o.x:o.y)}))}s(),i&&(Z(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=tI(t);if(e){var n=t.isHorizontal()?"height":"width",r=t.model.get(["axisLabel","margin"]);o[n]-=e[n]+r,"top"===t.position?o.y+=e.height+r:"left"===t.position&&(o.x+=e.width+r)}}})),s()),Z(this._coordsList,(function(t){t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}ct(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var r=0,i=this._coordsList;r0?"top":"bottom",r="center"):xo(o-HL)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),WL={axisLine:function(t,e,n,r){var i=e.get(["axisLine","show"]);if("auto"===i&&t.handleAutoShown&&(i=t.handleAutoShown("axisLine")),i){var o=e.axis.getExtent(),a=r.transform,s=[o[0],0],l=[o[1],0];a&&(ne(s,s,a),ne(l,l,a));var u=j({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new zy({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});c.anid="line",n.add(c);var h=e.get(["axisLine","symbol"]);if(null!=h){var p=e.get(["axisLine","symbolSize"]);"string"===typeof h&&(h=[h,h]),"string"!==typeof p&&"number"!==typeof p||(p=[p,p]);var f=Qx(e.get(["axisLine","symbolOffset"])||0,p),d=p[0],g=p[1];Z([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,r){if("none"!==h[r]&&null!=h[r]){var i=Kx(h[r],-d/2,-g/2,d,g,u.stroke,!0),o=e.r+e.offset;i.attr({rotation:e.rotate,x:s[0]+o*Math.cos(t.rotation),y:s[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(i)}}))}}},axisTickLabel:function(t,e,n,r){var i=KL(n,r,e,t),o=QL(n,r,e,t);if(qL(e,o,i),JL(n,r,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var a=aT(K(o,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}})));cT(a)}},axisName:function(t,e,n,r){var i=mt(t.axisName,e.get("name"));if(i){var o,a,s=e.get("nameLocation"),l=t.nameDirection,u=e.getModel("nameTextStyle"),c=e.get("nameGap")||0,h=e.axis.getExtent(),p=h[0]>h[1]?-1:1,f=["start"===s?h[0]-p*c:"end"===s?h[1]+p*c:(h[0]+h[1])/2,$L(s)?t.labelOffset+l*c:0],d=e.get("nameRotate");null!=d&&(d=d*HL/180),$L(s)?o=jL.innerTextLayout(t.rotation,null!=d?d:t.rotation,l):(o=UL(t.rotation,s,d||0,h),a=t.axisNameAvailableWidth,null!=a&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),v=e.get("nameTruncate",!0)||{},y=v.ellipsis,m=mt(t.nameTruncateMaxWidth,v.maxWidth,a),x=new yu({x:f[0],y:f[1],rotation:o.rotation,silent:jL.isLabelSilent(e),style:Xc(u,{text:i,font:g,overflow:"truncate",width:m,ellipsis:y,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(Gx({el:x,componentModel:e,itemName:i}),x.__fullText=i,x.anid="name",e.get("triggerEvent")){var _=jL.makeAxisEventDataBase(e);_.targetType="axisName",_.name=i,mu(x).eventData=_}r.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};function UL(t,e,n,r){var i,o,a=mo(n-t),s=r[0]>r[1],l="start"===e&&!s||"start"!==e&&s;return xo(a-HL/2)?(o=l?"bottom":"top",i="center"):xo(a-1.5*HL)?(o=l?"top":"bottom",i="center"):(o="middle",i=a<1.5*HL&&a>HL/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:i,textVerticalAlign:o}}function qL(t,e,n){if(!rI(t.axis)){var r=t.get(["axisLabel","showMinLabel"]),i=t.get(["axisLabel","showMaxLabel"]);e=e||[],n=n||[];var o=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],c=n[1],h=n[n.length-1],p=n[n.length-2];!1===r?(XL(o),XL(u)):YL(o,a)&&(r?(XL(a),XL(c)):(XL(o),XL(u))),!1===i?(XL(s),XL(h)):YL(l,s)&&(i?(XL(l),XL(p)):(XL(s),XL(h)))}}function XL(t){t&&(t.ignore=!0)}function YL(t,e){var n=t&&t.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(n&&r){var i=Hr([]);return qr(i,i,-t.rotation),n.applyTransform(Wr([],i,t.getLocalTransform())),r.applyTransform(Wr([],i,e.getLocalTransform())),n.intersect(r)}}function $L(t){return"middle"===t||"center"===t}function ZL(t,e,n,r,i){for(var o=[],a=[],s=[],l=0;l=0||t===e}function sO(t){var e=lO(t);if(e){var n=e.axisPointerModel,r=e.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=cO(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var p=a;null!=h.color&&(p=W({color:h.color},a));var f=G(F(h),{boundaryGap:t,splitNumber:e,scale:n,axisLine:r,axisTick:i,axisLabel:o,name:h.text,nameLocation:"end",nameGap:u,nameTextStyle:p,triggerEvent:c},!1);if(s||(f.name=""),"string"===typeof l){var d=f.name;f.name=l.replace("{value}",null!=d?d:"")}else"function"===typeof l&&(f.name=l(f.name,f));var g=new vh(f,null,this.ecModel);return Y(g,aI.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=h},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:G({lineStyle:{color:"#bbb"}},NO.axisLine),axisLabel:zO(NO.axisLabel,!1),axisTick:zO(NO.axisTick,!1),splitLine:zO(NO.splitLine,!0),splitArea:zO(NO.splitArea,!0),indicator:[]},e}(Up),VO=BO,FO=["axisLine","axisTickLabel","axisName"],GO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r=this.group;r.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes(),r=K(n,(function(t){var n=new tO(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return n}));Z(r,(function(t){Z(FO,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var r=t.get("shape"),i=t.getModel("splitLine"),o=t.getModel("splitArea"),a=i.getModel("lineStyle"),s=o.getModel("areaStyle"),l=i.get("show"),u=o.get("show"),c=a.get("color"),h=s.get("color"),p=ot(c)?c:[c],f=ot(h)?h:[h],d=[],g=[];if("circle"===r)for(var v=n[0].getTicksCoords(),y=e.cx,m=e.cy,x=0;xn[0]&&isFinite(h)&&isFinite(n[0]))}else{var p=a.getTicks().length-1;p>i&&(u=o(u));c=Math.ceil(n[1]/u)*u,h=uo(c-u*i);a.setExtent(h,c),a.setInterval(u)}}))},t.prototype.convertToPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.convertFromPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.create=function(e,n){var r=[];return e.eachComponent("radar",(function(i){var o=new t(i,e,n);r.push(o),i.coordinateSystem=o})),e.eachSeriesByType("radar",(function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=r[t.get("radarIndex")||0])})),r},t.dimensions=[],t}(),qO=UO;function XO(t){t.registerCoordinateSystem("radar",qO),t.registerComponentModel(VO),t.registerComponentView(HO),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();e.each((function(t){e.setItemVisual(t,"legendIcon","roundRect")})),e.setVisual("legendIcon","roundRect")}})}function YO(t){BS(XO),t.registerChartView(PO),t.registerSeriesModel(RO),t.registerLayout(AO),t.registerProcessor(Gk("radar")),t.registerPreprocessor(LO)}var $O="\0_ec_interaction_mutex";function ZO(t,e,n){var r=QO(t);r[e]=n}function KO(t,e,n){var r=QO(t),i=r[e];i===n&&(r[e]=null)}function JO(t,e){return!!QO(t)[e]}function QO(t){return t[$O]||(t[$O]={})}SS({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){}));var tP=function(t){function e(e){var n=t.call(this)||this;n._zr=e;var r=rt(n._mousedownHandler,n),i=rt(n._mousemoveHandler,n),o=rt(n._mouseupHandler,n),a=rt(n._mousewheelHandler,n),s=rt(n._pinchHandler,n);return n.enable=function(t,n){this.disable(),this._opt=W(F(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",r),e.on("mousemove",i),e.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",s))},n.disable=function(){e.off("mousedown",r),e.off("mousemove",i),e.off("mouseup",o),e.off("mousewheel",a),e.off("pinch",s)},n}return v(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!(Le(t)||t.target&&t.target.draggable)){var e=t.offsetX,n=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,n)&&(this._x=e,this._y=n,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&rP("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!JO(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,r=this._x,i=this._y,o=e-r,a=n-i;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&ke(t.event),nP(this,"pan","moveOnMouseMove",t,{dx:o,dy:a,oldX:r,oldY:i,newX:e,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){Le(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=rP("zoomOnMouseWheel",t,this._opt),n=rP("moveOnMouseWheel",t,this._opt),r=t.wheelDelta,i=Math.abs(r),o=t.offsetX,a=t.offsetY;if(0!==r&&(e||n)){if(e){var s=i>3?1.4:i>1?1.2:1.1,l=r>0?s:1/s;eP(this,"zoom","zoomOnMouseWheel",t,{scale:l,originX:o,originY:a,isAvailableBehavior:null})}if(n){var u=Math.abs(r),c=(r>0?1:-1)*(u>3?.4:u>1?.15:.05);eP(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:c,originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!JO(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;eP(this,"zoom",null,t,{scale:e,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(ue);function eP(t,e,n,r,i){t.pointerChecker&&t.pointerChecker(r,i.originX,i.originY)&&(ke(r.event),nP(t,e,n,r,i))}function nP(t,e,n,r,i){i.isAvailableBehavior=rt(rP,null,n,r),t.trigger(e,i)}function rP(t,e,n){var r=n[t];return!t||r&&(!st(r)||e.event[r+"Key"])}var iP=tP;function oP(t,e,n){var r=t.target;r.x+=e,r.y+=n,r.dirty()}function aP(t,e,n,r){var i=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,i.x-=(n-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var sP={axisPointer:1,tooltip:1,brush:1};function lP(t,e,n){var r=e.getComponentByElement(t.topTarget),i=r&&r.coordinateSystem;return r&&r!==n&&!sP.hasOwnProperty(r.mainType)&&i&&i.model!==n}var uP=["rect","circle","line","ellipse","polygon","polyline","path"],cP=Dt(uP),hP=Dt(uP.concat(["g"])),pP=Dt(uP.concat(["g"])),fP=na();function dP(t){var e=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(e.fill=n),e}var gP=function(){function t(t){var e=new Ui;this.uid=mh("ec_map_draw"),this._controller=new iP(t.getZr()),this._controllerHost={target:e},this.group=e,e.add(this._regionsGroup=new Ui),e.add(this._svgGroup=new Ui)}return t.prototype.draw=function(t,e,n,r,i){var o="geo"===t.mainType,a=t.getData&&t.getData();o&&e.eachComponent({mainType:"series",subType:"map"},(function(e){a||e.getHostGeoModel()!==t||(a=e.getData())}));var s=t.coordinateSystem,l=this._regionsGroup,u=this.group,c=s.getTransformInfo(),h=c.raw,p=c.roam,f=!l.childAt(0)||i;f?(u.x=p.x,u.y=p.y,u.scaleX=p.scaleX,u.scaleY=p.scaleY,u.dirty()):Ec(u,p,t);var d=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,g={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:d,isGeo:o,transformInfoRaw:h};"geoJSON"===s.resourceType?this._buildGeoJSON(g):"geoSVG"===s.resourceType&&this._buildSVG(g),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,r)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=Dt(),n=Dt(),r=this._regionsGroup,i=t.transformInfoRaw,o=t.mapOrGeoModel,a=t.data,s=function(t){return[t[0]*i.scaleX+i.x,t[1]*i.scaleY+i.y]};r.removeAll(),Z(t.geo.regions,(function(i){var l=i.name,u=e.get(l),c=n.get(l)||{},h=c.dataIdx,p=c.regionModel;u||(u=e.set(l,new Ui),r.add(u),h=a?a.indexOfName(l):null,p=t.isGeo?o.getRegionModel(l):a?a.getItemModel(h):null,n.set(l,{dataIdx:h,regionModel:p}));var f=new $m({segmentIgnoreThreshold:1,shape:{paths:[]}});u.add(f),Z(i.geometries,(function(t){if("polygon"===t.type){for(var e=[],n=0;n=0)&&(p=i);var f=a?{normal:{align:"center",verticalAlign:"middle"}}:null;Uc(e,qc(r),{labelFetcher:p,labelDataIndex:h,defaultText:n},f);var d=e.getTextContent();if(d&&(fP(d).ignore=d.ignore,e.textConfig&&a)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function mP(t,e,n,r,i,o){t.data?t.data.setItemGraphicEl(o,e):mu(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:n,region:r&&r.option||{}}}function xP(t,e,n,r,i){t.data||Gx({el:e,componentModel:i,itemName:n,itemTooltipOption:r.get("tooltip")})}function _P(t,e,n,r,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var o=r.getModel("emphasis"),a=o.get("focus");return xc(e,a,o.get("blurScope")),t.isGeo&&Ic(e,i,n),a}var bP=gP,wP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n,r){if(!r||"mapToggleSelect"!==r.type||r.from!==this.uid){var i=this.group;if(i.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&r&&"geoRoam"===r.type&&this._mapDraw.resetForLabelLayout(),r&&"geoRoam"===r.type&&"series"===r.componentType&&r.seriesId===t.id){o=this._mapDraw;o&&i.add(o.group)}else if(t.needsDrawMap){var o=this._mapDraw||new bP(n);i.add(o.group),o.draw(t,e,n,this,r),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,n)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,e,n){var r=t.originalData,i=this.group;r.each(r.mapDimension("value"),(function(e,n){if(!isNaN(e)){var o=r.getItemLayout(n);if(o&&o.point){var a=o.point,s=o.offset,l=new Fy({style:{fill:t.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:Au+1)});if(!s){var u=t.mainSeries.getData(),c=r.getName(n),h=u.indexOfName(c),p=r.getItemModel(n),f=p.getModel("label"),d=u.getItemGraphicEl(h);Uc(l,qc(p),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(h,n)}}}),l.disableLabelAnimation=!0,f.get("position")||l.setTextConfig({position:"bottom"}),d.onHoverStateChange=function(t){Xu(l,t)}}i.add(l)}}}))},e.type="map",e}(Dv),SP=wP,MP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,r=n.getRegion(e);return r&&n.dataToPoint(r.getCenter())}},n}return v(e,t),e.prototype.getInitialData=function(t){for(var e=Kk(this,{coordDimensions:["value"],encodeDefaulter:it(uf,this)}),n=Dt(),r=[],i=0,o=e.count();i-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(yv),CP=MP;function IP(t,e){var n={};return Z(t,(function(t){t.each(t.mapDimension("value"),(function(e,r){var i="ec-"+t.getName(r);n[i]=n[i]||[],isNaN(e)||n[i].push(e)}))})),t[0].map(t[0].mapDimension("value"),(function(r,i){for(var o,a="ec-"+t[0].getName(i),s=0,l=1/0,u=-1/0,c=n[a].length,h=0;h1?(s.width=a,s.height=a/f):(s.height=a,s.width=a*f),s.y=o[1]-s.height/2,s.x=o[0]-s.width/2;else{var g=t.getBoxLayoutParams();g.aspect=f,s=Rp(g,{width:h,height:p})}this.setViewRect(s.x,s.y,s.width,s.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function VP(t,e){Z(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}var FP=function(){function t(){this.dimensions=EP}return t.prototype.create=function(t,e){var n=[];t.eachComponent("geo",(function(t,r){var i=t.get("map"),o=new zP(i+r,i,{nameMap:t.get("nameMap"),nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale")});o.zoomLimit=t.get("scaleLimit"),n.push(o),t.coordinateSystem=o,o.model=t,o.resize=BP,o.resize(t,e)})),t.eachSeries((function(t){var e=t.get("coordinateSystem");if("geo"===e){var r=t.get("geoIndex")||0;t.coordinateSystem=n[r]}}));var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),Z(r,(function(t,r){var i=K(t,(function(t){return t.get("nameMap")})),o=new zP(r,r,{nameMap:H(i),nameProperty:t[0].get("nameProperty"),aspectScale:t[0].get("aspectScale")});o.zoomLimit=mt.apply(null,K(t,(function(t){return t.get("scaleLimit")}))),n.push(o),o.resize=BP,o.resize(t[0],e),Z(t,(function(t){t.coordinateSystem=o,VP(o,t)}))})),n},t.prototype.getFilledRegions=function(t,e,n,r){for(var i=(t||[]).slice(),o=Dt(),a=0;a=0;a--){var s=r[a];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},i.push(s)}}function KP(t,e){var n=t.isExpand?t.children:[],r=t.parentNode.children,i=t.hierNode.i?r[t.hierNode.i-1]:null;if(n.length){nE(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(t.hierNode.prelim=i.hierNode.prelim+e(t,i),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else i&&(t.hierNode.prelim=i.hierNode.prelim+e(t,i));t.parentNode.hierNode.defaultAncestor=rE(t,i,t.parentNode.hierNode.defaultAncestor||r[0],e)}function JP(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function QP(t){return arguments.length?t:lE}function tE(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function eE(t,e){return Rp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function nE(t){var e=t.children,n=e.length,r=0,i=0;while(--n>=0){var o=e[n];o.hierNode.prelim+=r,o.hierNode.modifier+=r,i+=o.hierNode.change,r+=o.hierNode.shift+i}}function rE(t,e,n,r){if(e){var i=t,o=t,a=o.parentNode.children[0],s=e,l=i.hierNode.modifier,u=o.hierNode.modifier,c=a.hierNode.modifier,h=s.hierNode.modifier;while(s=iE(s),o=oE(o),s&&o){i=iE(i),a=oE(a),i.hierNode.ancestor=t;var p=s.hierNode.prelim+h-o.hierNode.prelim-u+r(s,o);p>0&&(sE(aE(s,t,n),t,p),u+=p,l+=p),h+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=i.hierNode.modifier,c+=a.hierNode.modifier}s&&!iE(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=h-l),o&&!oE(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-c,n=t)}return n}function iE(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function oE(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function aE(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function sE(t,e,n){var r=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=r,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=r}function lE(t,e){return t.parentNode===e.parentNode?1:2}var uE=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),cE=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new uE},e.prototype.buildPath=function(t,e){var n=e.childPoints,r=n.length,i=e.parentPoint,o=n[0],a=n[r-1];if(1===r)return t.moveTo(i[0],i[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=lo(e.forkPosition,1),h=[];h[l]=i[l],h[u]=i[u]+(a[u]-i[u])*c,t.moveTo(i[0],i[1]),t.lineTo(h[0],h[1]),t.moveTo(o[0],o[1]),h[l]=o[l],t.lineTo(h[0],h[1]),h[l]=a[l],t.lineTo(h[0],h[1]),t.lineTo(a[0],a[1]);for(var p=1;pm.x,b||(_-=Math.PI));var S=b?"left":"right",M=s.getModel("label"),C=M.get("rotate"),I=C*(Math.PI/180),T=v.getTextContent();T&&(v.setTextConfig({position:M.get("position")||S,rotation:null==C?-_:I,origin:"center"}),T.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),D="ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;D&&(mu(n).focus=D),dE(i,a,c,n,d,f,g,r),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){var r=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);r&&r.hoverState===Mu||Xu(n.__edge,e)}})}function dE(t,e,n,r,i,o,a,s){var l=e.getModel(),u=t.get("edgeShape"),c=t.get("layout"),h=t.getOrient(),p=t.get(["lineStyle","curveness"]),f=t.get("edgeForkPosition"),d=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=r.__edge=new Xm({shape:mE(c,h,p,i,i)})),Ec(g,{shape:mE(c,h,p,o,a)},t));else if("polyline"===u)if("orthogonal"===c){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var v=e.children,y=[],m=0;me&&(e=r.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,r=n.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,n=e.data.getItemModel(this.dataIndex);return n.getModel(t)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e=0){var r=n.getData().tree.root,i=t.targetNode;if("string"===typeof i&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var o=t.targetNodeId;if(null!=o&&(i=r.getNodeById(o)))return{node:i}}}function NE(t){var e=[];while(t)t=t.parentNode,t&&e.push(t);return e.reverse()}function zE(t,e){var n=NE(t);return q(n,e)>=0}function BE(t,e){var n=[];while(t){var r=t.dataIndex;n.push({name:t.name,dataIndex:r,value:e.getRawValue(r)}),t=t.parentNode}return n.reverse(),n}var VE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return v(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},r=new vh(n,this,this.ecModel),i=EE.createTree(e,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=i.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=r),t}))}var a=0;i.eachNode("preorder",(function(t){t.depth>a&&(a=t.depth)}));var s=t.expandAndCollapse,l=s&&t.initialTreeDepth>=0?t.initialTreeDepth:a;return i.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=l})),i.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){var r=this.getData().tree,i=r.root.children[0],o=r.getNodeByDataIndex(t),a=o.getValue(),s=o.name;while(o&&o!==i)s=o.parentNode.name+"."+s,o=o.parentNode;return jg("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=BE(r,this),n},e.type="series.tree",e.layoutMode="box",e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(yv),FE=VE;function GE(t,e,n){var r,i=[t],o=[];while(r=i.pop())if(o.push(r),r.isExpand){var a=r.children;if(a.length)for(var s=0;s=0;o--)r.push(i[o])}}function jE(t,e){t.eachSeriesByType("tree",(function(t){WE(t,e)}))}function WE(t,e){var n=eE(t,e);t.layoutInfo=n;var r=t.get("layout"),i=0,o=0,a=null;"radial"===r?(i=2*Math.PI,o=Math.min(n.height,n.width)/2,a=QP((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(i=n.width,o=n.height,a=QP());var s=t.getData().tree.root,l=s.children[0];if(l){ZP(s),GE(l,KP,a),s.hierNode.modifier=-l.hierNode.prelim,HE(l,JP);var u=l,c=l,h=l;HE(l,(function(t){var e=t.getLayout().x;ec.getLayout().x&&(c=t),t.depth>h.depth&&(h=t)}));var p=u===c?1:a(u,c)/2,f=p-u.getLayout().x,d=0,g=0,v=0,y=0;if("radial"===r)d=i/(c.getLayout().x+p+f),g=o/(h.depth-1||1),HE(l,(function(t){v=(t.getLayout().x+f)*d,y=(t.depth-1)*g;var e=tE(v,y);t.setLayout({x:e.x,y:e.y,rawX:v,rawY:y},!0)}));else{var m=t.getOrient();"RL"===m||"LR"===m?(g=o/(c.getLayout().x+p+f),d=i/(h.depth-1||1),HE(l,(function(t){y=(t.getLayout().x+f)*g,v="LR"===m?(t.depth-1)*d:i-(t.depth-1)*d,t.setLayout({x:v,y:y},!0)}))):"TB"!==m&&"BT"!==m||(d=i/(c.getLayout().x+p+f),g=o/(h.depth-1||1),HE(l,(function(t){v=(t.getLayout().x+f)*d,y="TB"===m?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:v,y:y},!0)})))}}}function UE(t){t.eachSeriesByType("tree",(function(t){var e=t.getData(),n=e.tree;n.eachNode((function(t){var n=t.getModel(),r=n.getModel("itemStyle").getItemStyle(),i=e.ensureUniqueItemVisual(t.dataIndex,"style");j(i,r)}))}))}function qE(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=t.dataIndex,r=e.getData().tree,i=r.getNodeByDataIndex(n);i.isExpand=!i.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=e.coordinateSystem,r=UP(n,t);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom)}))}))}function XE(t){t.registerChartView(xE),t.registerSeriesModel(FE),t.registerLayout(jE),t.registerVisual(UE),qE(t)}var YE=function(){},$E=["treemapZoomToNode","treemapRender","treemapMove"];function ZE(t){for(var e=0;e<$E.length;e++)t.registerAction({type:$E[e],update:"updateView"},YE);t.registerAction({type:"treemapRootToNode",update:"updateView"},(function(t,e){function n(e,n){var r=["treemapZoomToNode","treemapRootToNode"],i=RE(t,r,e);if(i){var o=e.getViewRoot();o&&(t.direction=zE(o,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}e.eachComponent({mainType:"series",subType:"treemap",query:t},n)}))}function KE(t){var e=t.getData(),n=e.tree,r={};n.eachNode((function(e){var n=e;while(n&&n.depth>1)n=n.parentNode;var i=_f(t.ecModel,n.name||n.dataIndex+"",r);e.setVisual("decal",i)}))}var JE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}return v(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};QE(n);var r=t.levels||[],i=this.designatedVisualItemStyle={},o=new vh({itemStyle:i},this,e);r=t.levels=tR(r,e);var a=K(r||[],(function(t){return new vh(t,o,e)}),this),s=EE.createTree(n,this,l);function l(t){t.wrapMethod("getItemModel",(function(t,e){var n=s.getNodeByDataIndex(e),r=n?a[n.depth]:null;return t.parentModel=r||o,t}))}return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,n){var r=this.getData(),i=this.getRawValue(t),o=r.getName(t);return jg("nameValue",{name:o,value:i})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=BE(r,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},j(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=Dt(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){KE(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(yv);function QE(t){var e=0;Z(t.children,(function(t){QE(t);var n=t.value;ot(n)&&(n=n[0]),e+=n}));var n=t.value;ot(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),ot(t.value)?t.value[0]=n:t.value=n}function tR(t,e){var n=Eo(e.get("color")),r=Eo(e.get(["aria","decal","decals"]));if(n){var i,o;t=t||[],Z(t,(function(t){var e=new vh(t),n=e.get("color"),r=e.get("decal");(e.get(["itemStyle","color"])||n&&"none"!==n)&&(i=!0),(e.get(["itemStyle","decal"])||r&&"none"!==r)&&(o=!0)}));var a=t[0]||(t[0]={});return i||(a.color=n.slice()),!o&&r&&(a.decal=r.slice()),t}}var eR=JE,nR=8,rR=8,iR=5,oR=function(){function t(t){this.group=new Ui,t.add(this.group)}return t.prototype.render=function(t,e,n,r){var i=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),i.get("show")&&n){var a=i.getModel("itemStyle"),s=a.getModel("textStyle"),l={pos:{left:i.get("left"),right:i.get("right"),top:i.get("top"),bottom:i.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:i.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,l,s),this._renderContent(t,l,a,s,r),Np(o,l.pos,l.box)}},t.prototype._prepare=function(t,e,n){for(var r=t;r;r=r.parentNode){var i=Yo(r.getModel().get("name"),""),o=n.getTextRect(i),a=Math.max(o.width+2*nR,e.emptyItemWidth);e.totalWidth+=a+rR,e.renderList.push({node:r,text:i,width:a})}},t.prototype._renderContent=function(t,e,n,r,i){for(var o=0,a=e.emptyItemWidth,s=t.get(["breadcrumb","height"]),l=Ep(e.pos,e.box),u=e.totalWidth,c=e.renderList,h=c.length-1;h>=0;h--){var p=c[h],f=p.node,d=p.width,g=p.text;u>l.width&&(u-=d-a,d=a,g=null);var v=new Vm({shape:{points:aR(o,0,d,s,h===c.length-1,0===h)},style:W(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new yu({style:{text:g,fill:r.getTextColor(),font:r.getFont()}}),textConfig:{position:"inside"},z2:1e4*Au,onclick:it(i,f)});v.disableLabelAnimation=!0,this.group.add(v),sR(v,t,f),o+=d+rR}},t.prototype.remove=function(){this.group.removeAll()},t}();function aR(t,e,n,r,i,o){var a=[[i?t:t-iR,e],[t+n,e],[t+n,e+r],[i?t:t-iR,e+r]];return!o&&a.splice(2,0,[t+n+iR,e+r/2]),!i&&a.push([t,e+r/2]),a}function sR(t,e,n){mu(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&BE(n,e)}}var lR=oR,uR=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,r,i){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:r,easing:i}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},r=0,i=this._storage.length;rfR||Math.abs(t.dy)>fR)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY;if("animating"!==this._state){var r=this.seriesModel.getData().tree.root;if(!r)return;var i=r.getLayout();if(!i)return;var o=new xi(i.x,i.y,i.width,i.height),a=this.seriesModel.layoutInfo;e-=a.x,n-=a.y;var s=Gr();Ur(s,s,[-e,-n]),Xr(s,s,[t.scale,t.scale]),Ur(s,s,[e,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var r=e.findTarget(t.offsetX,t.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)e._rootToNode(r);else if("zoomToNode"===n)e._zoomToNode(r);else if("link"===n){var o=i.hostTree.data.getItemModel(i.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Ap(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var r=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new lR(this.group))).render(t,e,n.node,(function(e){"animating"!==r._state&&(zE(t.getViewRoot(),e)?r._rootToNode({node:e}):r._zoomToNode({node:e}))}))},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=SR(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var n,r=this.seriesModel.getViewRoot();return r.eachNode({attr:"viewChildren",order:"preorder"},(function(r){var i=this._storage.background[r.getRawIndex()];if(i){var o=i.transformCoordToLocal(t,e),a=i.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:r,offsetX:o[0],offsetY:o[1]}}}),this),n},e.type="treemap",e}(Dv);function SR(){return{nodeGroup:[],background:[],content:[]}}function MR(t,e,n,r,i,o,a,s,l,u){if(a){var c=a.getLayout(),h=t.getData(),p=a.getModel();if(h.setItemGraphicEl(a.dataIndex,null),c&&c.isInView){var f=c.width,d=c.height,g=c.borderWidth,v=c.invisible,y=a.getRawIndex(),m=s&&s.getRawIndex(),x=a.viewChildren,_=c.upperHeight,b=x&&x.length,w=p.getModel("itemStyle"),S=p.getModel(["emphasis","itemStyle"]),M=p.getModel(["blur","itemStyle"]),C=p.getModel(["select","itemStyle"]),I=w.get("borderRadius")||0,T=B("nodeGroup",hR);if(T){if(l.add(T),T.x=c.x||0,T.y=c.y||0,T.markRedraw(),bR(T).nodeWidth=f,bR(T).nodeHeight=d,c.isAboveViewRoot)return T;var A=B("background",pR,u,yR);A&&P(T,A,b&&c.upperLabelHeight);var D=p.get(["emphasis","focus"]),k=p.get(["emphasis","blurScope"]),L="ancestor"===D?a.getAncestorsIndices():"descendant"===D?a.getDescendantIndices():D;if(b)Cc(T)&&Mc(T,!1),A&&(Mc(A,!0),h.setItemGraphicEl(a.dataIndex,A),_c(A,L,k));else{var O=B("content",pR,u,mR);O&&E(T,O),A.disableMorphing=!0,A&&Cc(A)&&Mc(A,!1),Mc(T,!0),h.setItemGraphicEl(a.dataIndex,T),_c(T,L,k)}return T}}}function P(e,n,r){var i=mu(n);if(i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:f,height:d,r:I}),v)R(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=_R(w);l.fill=s;var u=xR(S);u.fill=S.get("borderColor");var c=xR(M);c.fill=M.get("borderColor");var h=xR(C);if(h.fill=C.get("borderColor"),r){var p=f-2*g;N(n,s,o.opacity,{x:g,y:0,width:p,height:_})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=c,n.ensureState("select").style=h,Qu(n)}e.add(n)}function E(e,n){var r=mu(n);r.dataIndex=a.dataIndex,r.seriesIndex=t.seriesIndex;var i=Math.max(f-2*g,0),o=Math.max(d-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:i,height:o,r:I}),v)R(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=_R(w);u.fill=l,u.decal=s.decal;var c=xR(S),h=xR(M),p=xR(C);N(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=c,n.ensureState("blur").style=h,n.ensureState("select").style=p,Qu(n)}e.add(n)}function R(t){!t.invisible&&o.push(t)}function N(e,n,r,i){var o=p.getModel(i?gR:dR),s=Yo(p.get("name"),null),l=o.getShallow("show");Uc(e,qc(p,i?gR:dR),{defaultText:l?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent();if(u){var h=u.style,f=wt(h.padding||0);i&&(e.setTextConfig({layoutRect:i}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((i?i.width:e.shape.width)-f[1]-f[3],0),n=Math.max((i?i.height:e.shape.height)-f[0]-f[2],0);h.width===t&&h.height===n||u.setStyle({width:t,height:n})},h.truncateMinChar=2,h.lineOverflow="truncate",z(h,i,c);var d=u.getState("emphasis");z(d?d.style:null,i,c)}}function z(e,n,r){var i=e?e.text:null;if(!n&&r.isLeafRoot&&null!=i){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+i:i}}function B(t,r,o,a){var s=null!=m&&n[t][m],l=i[t];return s?(n[t][m]=null,V(l,s)):v||(s=new r,s instanceof ss&&(s.z2=CR(o,a)),F(l,s)),e[t][y]=s}function V(t,e){var n=t[y]={};e instanceof hR?(n.oldX=e.x,n.oldY=e.y):n.oldShape=j({},e.shape)}function F(t,e){var n=t[y]={},o=a.parentNode,s=e instanceof Ui;if(o&&(!r||"drillDown"===r.direction)){var l=0,u=0,c=i.background[o.getRawIndex()];!r&&c&&c.oldShape&&(l=c.oldShape.width,u=c.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}function CR(t,e){return t*vR+e}var IR=wR,TR=Z,AR=ct,DR=-1,kR=function(){function t(e){var n=e.mappingMethod,r=e.type,i=this.option=F(e);this.type=r,this.mappingMethod=n,this._normalizeData=HR[n];var o=t.visualHandlers[r];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(PR(i),LR(i)):"category"===n?i.categories?OR(i):PR(i,!0):(St("linear"!==n||i.dataExtent),PR(i))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return rt(this._normalizeData,this)},t.listVisualTypes=function(){return et(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){ct(t)?Z(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,r){var i,o=ot(e)?[]:ct(e)?{}:(i=!0,null);return t.eachVisual(e,(function(t,e){var a=n.call(r,t,e);i?o=a:o[e]=a})),o},t.retrieveVisuals=function(e){var n,r={};return e&&TR(t.visualHandlers,(function(t,i){e.hasOwnProperty(i)&&(r[i]=e[i],n=!0)})),n?r:null},t.prepareVisualTypes=function(t){if(ot(t))t=t.slice();else{if(!AR(t))return[];var e=[];TR(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var r,i=1/0,o=0,a=e.length;o=0;o--)null==r[o]&&(delete n[e[o]],e.pop())}function PR(t,e){var n=t.visual,r=[];ct(n)?TR(n,(function(t){r.push(t)})):null!=n&&r.push(n);var i={color:1,symbol:1};e||1!==r.length||i.hasOwnProperty(t.type)||(r[1]=r[0]),GR(t,r)}function ER(t){return{applyVisual:function(e,n,r){var i=this.mapValueToVisual(e);r("color",t(n("color"),i))},_normalizedToVisual:VR([0,1])}}function RR(t){var e=this.option.visual;return e[Math.round(so(t,[0,1],[0,e.length-1],!0))]||{}}function NR(t){return function(e,n,r){r(t,this.mapValueToVisual(e))}}function zR(t){var e=this.option.visual;return e[this.option.loop&&t!==DR?t%e.length:t]}function BR(){return this.option.visual[0]}function VR(t){return{linear:function(e){return so(e,t,this.option.visual,!0)},category:zR,piecewise:function(e,n){var r=FR.call(this,n);return null==r&&(r=so(e,t,this.option.visual,!0)),r},fixed:BR}}function FR(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var r=kR.findPieceIndex(t,n),i=n[r];if(i&&i.visual)return i.visual[this.type]}}function GR(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=K(e,(function(t){return En(t)}))),e}var HR={linear:function(t){return so(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=kR.findPieceIndex(t,e,!0);if(null!=n)return so(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?DR:e},fixed:Pt};function jR(t,e,n){return t?e<=n:e=n.length||t===n[t.depth]){var o=eN(i,u,t,e,d,r);YR(t,o,n,r)}}))}else s=ZR(u),c.fill=s}}function $R(t,e,n){var r=j({},e),i=n.designatedVisualItemStyle;return Z(["color","colorAlpha","colorSaturation"],(function(n){i[n]=e[n];var o=t.get(n);i[n]=null,null!=o&&(r[n]=o)})),r}function ZR(t){var e=JR(t,"color");if(e){var n=JR(t,"colorAlpha"),r=JR(t,"colorSaturation");return r&&(e=jn(e,null,null,r)),n&&(e=Wn(e,n)),e}}function KR(t,e){return null!=e?jn(e,null,null,t):null}function JR(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function QR(t,e,n,r,i,o){if(o&&o.length){var a=tN(e,"color")||null!=i.color&&"none"!==i.color&&(tN(e,"colorAlpha")||tN(e,"colorSaturation"));if(a){var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var c=e.get("colorMappingBy"),h={type:a.name,dataExtent:u,visual:a.range};"color"!==h.type||"index"!==c&&"id"!==c?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var p=new WR(h);return qR(p).drColorMappingBy=c,p}}}function tN(t,e){var n=t.get(e);return ot(n)&&n.length?{name:e,range:n}:null}function eN(t,e,n,r,i,o){var a=j({},e);if(i){var s=i.type,l="color"===s&&qR(i).drColorMappingBy,u="index"===l?r:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=i.mapValueToVisual(u)}return a}var nN=Math.max,rN=Math.min,iN=mt,oN=Z,aN=["itemStyle","borderWidth"],sN=["itemStyle","gapWidth"],lN=["upperLabel","show"],uN=["upperLabel","height"],cN={seriesType:"treemap",reset:function(t,e,n,r){var i=n.getWidth(),o=n.getHeight(),a=t.option,s=Rp(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=lo(iN(s.width,l[0]),i),c=lo(iN(s.height,l[1]),o),h=r&&r.type,p=["treemapZoomToNode","treemapRootToNode"],f=RE(r,p,t),d="treemapRender"===h||"treemapMove"===h?r.rootRect:null,g=t.getViewRoot(),v=NE(g);if("treemapMove"!==h){var y="treemapZoomToNode"===h?mN(t,f,g,u,c):d?[d.width,d.height]:[u,c],m=a.sort;m&&"asc"!==m&&"desc"!==m&&(m="desc");var x={squareRatio:a.squareRatio,sort:m,leafDepth:a.leafDepth};g.hostTree.clearLayouts();var _={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(_),hN(g,x,!1,0),_=g.getLayout(),oN(v,(function(t,e){var n=(v[e+1]||g).getValue();t.setLayout(j({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var b=t.getData().tree.root;b.setLayout(xN(s,d,f),!0),t.setLayoutInfo(s),_N(b,new xi(-s.x,-s.y,i,o),v,g,0)}};function hN(t,e,n,r){var i,o;if(!t.isRemoved()){var a=t.getLayout();i=a.width,o=a.height;var s=t.getModel(),l=s.get(aN),u=s.get(sN)/2,c=bN(s),h=Math.max(l,c),p=l-u,f=h-u;t.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=nN(i-2*p,0),o=nN(o-p-f,0);var d=i*o,g=pN(t,s,d,e,n,r);if(g.length){var v={x:p,y:f,width:i,height:o},y=rN(i,o),m=1/0,x=[];x.area=0;for(var _=0,b=g.length;_=0;l--){var u=i["asc"===r?a-l-1:l].getValue();u/n*ea[1]&&(a[1]=e)}))):a=[NaN,NaN],{sum:r,dataExtent:a}}function vN(t,e,n){for(var r=0,i=1/0,o=0,a=void 0,s=t.length;or&&(r=a));var l=t.area*t.area,u=e*e*n;return l?nN(u*r/l,l/(u*i)):1/0}function yN(t,e,n,r,i){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],c=e?t.area/e:0;(i||c>n[l[a]])&&(c=n[l[a]]);for(var h=0,p=t.length;hyo&&(u=yo),a=o}ur&&(r=e);var o=r%2?r+2:r+3;i=[];for(var a=0;a0&&(m[0]=-m[0],m[1]=-m[1]);var _=y[0]<0?-1:1;if("start"!==r.__position&&"end"!==r.__position){var b=-Math.atan2(y[1],y[0]);u[0].8?"left":c[0]<-.8?"right":"center",p=c[1]>.8?"top":c[1]<-.8?"bottom":"middle";break;case"start":r.x=-c[0]*d+l[0],r.y=-c[1]*g+l[1],h=c[0]>.8?"right":c[0]<-.8?"left":"center",p=c[1]>.8?"bottom":c[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":r.x=d*_+l[0],r.y=l[1]+w,h=y[0]<0?"right":"left",r.originX=-d*_,r.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":r.x=x[0],r.y=x[1]+w,h="center",r.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":r.x=-d*_+u[0],r.y=u[1]+w,h=y[0]>=0?"right":"left",r.originX=d*_,r.originY=-w;break}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||h})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var r=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else t.attr("rotation",n)}},e}(Ui),hz=cz,pz=function(){function t(t){this.group=new Ui,this._LineCtor=t||hz}return t.prototype.isPersistent=function(){return!0},t.prototype.updateData=function(t){var e=this,n=this,r=n.group,i=n._lineData;n._lineData=t,i||r.removeAll();var o=dz(t);t.diff(i).add((function(n){e._doAdd(t,n,o)})).update((function(n,r){e._doUpdate(i,t,r,n,o)})).remove((function(t){r.remove(i.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=dz(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||fz(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var r=t.start;r0}function dz(t){var e=t.hostModel;return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:e.getModel(["emphasis","lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),labelStatesModels:qc(e)}}function gz(t){return isNaN(t[0])||isNaN(t[1])}function vz(t){return!gz(t[0])&&!gz(t[1])}var yz=pz,mz=[],xz=[],_z=[],bz=Is,wz=Qt,Sz=Math.abs;function Mz(t,e,n){for(var r,i=t[0],o=t[1],a=t[2],s=1/0,l=n*n,u=.1,c=.1;c<=.9;c+=.1){mz[0]=bz(i[0],o[0],a[0],c),mz[1]=bz(i[1],o[1],a[1],c);var h=Sz(wz(mz,e)-l);h=0?r+=u:r-=u:d>=0?r-=u:r+=u}return r}function Cz(t,e){var n=[],r=ks,i=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),c=t.getVisual("toSymbol");l.__original||(l.__original=[Nt(l[0]),Nt(l[1])],l[2]&&l.__original.push(Nt(l[2])));var h=l.__original;if(null!=l[2]){if(Rt(i[0],h[0]),Rt(i[1],h[2]),Rt(i[2],h[1]),u&&"none"!==u){var p=HN(t.node1),f=Mz(i,h[0],p*e);r(i[0][0],i[1][0],i[2][0],f,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],f,n),i[0][1]=n[3],i[1][1]=n[4]}if(c&&"none"!==c){p=HN(t.node2),f=Mz(i,h[1],p*e);r(i[0][0],i[1][0],i[2][0],f,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],f,n),i[1][1]=n[1],i[2][1]=n[2]}Rt(l[0],i[0]),Rt(l[1],i[2]),Rt(l[2],i[1])}else{if(Rt(o[0],h[0]),Rt(o[1],h[1]),Ft(a,o[1],o[0]),$t(a,a),u&&"none"!==u){p=HN(t.node1);Vt(o[0],o[0],a,p*e)}if(c&&"none"!==c){p=HN(t.node2);Vt(o[1],o[1],a,-p*e)}Rt(l[0],o[0]),Rt(l[1],o[1])}}))}function Iz(t){return"view"===t.type}var Tz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(t,e){var n=new oD,r=new yz,i=this.group;this._controller=new iP(e.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(r.group),this._symbolDraw=n,this._lineDraw=r,this._firstRender=!0},e.prototype.render=function(t,e,n){var r=this,i=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(Iz(i)){var l={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(l):Ec(s,l,t)}Cz(t.getGraph(),GN(t));var u=t.getData();o.updateData(u);var c=t.getEdgeData();a.updateData(c),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var h=t.forceLayout,p=t.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,p),u.graph.eachNode((function(t){var e=t.dataIndex,n=t.getGraphicEl(),i=t.getModel();n.off("drag").off("dragend");var o=i.get("draggable");o&&n.on("drag",(function(){h&&(h.warmUp(),!r._layouting&&r._startForceLayoutIteration(h,p),h.setFixed(e),u.setItemLayout(e,[n.x,n.y]))})).on("dragend",(function(){h&&h.setUnfixed(e)})),n.setDraggable(o&&!!h);var a=i.get(["emphasis","focus"]);"adjacency"===a&&(mu(n).focus=t.getAdjacentDataIndices())})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);"adjacency"===n&&(mu(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),d=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(t,e){var n=u.getItemModel(e),r=n.get(["label","rotate"])||0,i=t.getSymbolPath();if(f){var o=u.getItemLayout(e),a=Math.atan2(o[1]-g,o[0]-d);a<0&&(a=2*Math.PI+a);var s=o[0]=0&&t.call(e,n[i],i)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,r=n.length,i=0;i=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&t.call(e,n[i],i)},t.prototype.breadthFirstTraverse=function(t,e,n,r){if(e instanceof Lz||(e=this._nodesMap[Dz(e)]),e){for(var i="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0}));for(i=0,o=r.length;i=0&&this[t][e].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}Y(Lz,Pz("hostGraph","data")),Y(Oz,Pz("hostGraph","edgeData"));var Ez=kz;function Rz(t,e,n,r,i){for(var o=new Ez(r),a=0;a "+p)),u++)}var f,d=n.get("coordinateSystem");if("cartesian2d"===d||"polar"===d)f=zM(t,n);else{var g=jf.get(d),v=g&&g.dimensions||[];q(v,"value")<0&&v.concat(["value"]);var y=_M(t,{coordDimensions:v,encodeDefine:n.getEncode()}).dimensions;f=new mM(y,n),f.initData(t)}var m=new mM(["value"],n);return m.initData(l,s),i&&i(f,m),kE({mainData:f,struct:o,structAttr:"graph",datas:{node:f,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var Nz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return v(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new Qk(r,r),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),Ro(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],r=t.data||t.nodes||[],i=this;if(r&&n){RN(this);var o=Rz(r,n,this,!0,a);return Z(o.edges,(function(t){NN(t.node1,t.node2,this,t.dataIndex)}),this),o.data}function a(t,e){t.wrapMethod("getItemModel",(function(t){var e=i._categoriesModels,n=t.getShallow("category"),r=e[n];return r&&(r.parentModel=t.parentModel,t.parentModel=r),t}));var n=vh.prototype.getModel;function r(t,e){var r=n.call(this,t,e);return r.resolveParentPath=o,r}function o(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=o,t.getModel=r,t}))}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(t,n),o=r.graph.getEdgeByIndex(t),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),jg("nameValue",{name:l.join(" > "),value:i.value,noValue:null==i.value})}var u=rv({series:this,dataIndex:t,multipleSeries:e});return u},e.prototype._updateCategoriesData=function(){var t=K(this.option.categories||[],(function(t){return null!=t.value?t:j({value:0},t)})),e=new mM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(yv),zz=Nz,Bz={type:"graphRoam",event:"graphRoam",update:"none"};function Vz(t){t.registerChartView(Az),t.registerSeriesModel(zz),t.registerProcessor(SN),t.registerVisual(MN),t.registerVisual(IN),t.registerLayout(FN),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,XN),t.registerLayout(ZN),t.registerCoordinateSystem("graphView",{dimensions:OP.dimensions,create:JN}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){})),t.registerAction(Bz,(function(t,e){e.eachComponent({mainType:"series",query:t},(function(e){var n=e.coordinateSystem,r=UP(n,t);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom)}))}))}var Fz=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),Gz=function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return v(e,t),e.prototype.getDefaultShape=function(){return new Fz},e.prototype.buildPath=function(t,e){var n=Math.cos,r=Math.sin,i=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=i/3?1:2),l=e.y-r(a)*o*(o>=i/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+r(a)*o),t.lineTo(e.x+n(e.angle)*i,e.y+r(e.angle)*i),t.lineTo(e.x-n(a)*o,e.y-r(a)*o),t.lineTo(s,l)},e}(Fl),Hz=Gz;function jz(t,e){var n=t.get("center"),r=e.getWidth(),i=e.getHeight(),o=Math.min(r,i),a=lo(n[0],e.getWidth()),s=lo(n[1],e.getHeight()),l=lo(t.get("radius"),o/2);return{cx:a,cy:s,r:l}}function Wz(t,e){var n=null==t?"":t+"";return e&&("string"===typeof e?n=e.replace("{value}",n):"function"===typeof e&&(n=e(t))),n}var Uz=2*Math.PI,qz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var r=t.get(["axisLine","lineStyle","color"]),i=jz(t,n);this._renderMain(t,e,n,r,i),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,r,i){for(var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,u=t.getModel("axisLine"),c=u.get("roundCap"),h=c?nk:Dm,p=u.get("show"),f=u.getModel("lineStyle"),d=f.get("width"),g=(l-s)%Uz||l===s?(l-s)%Uz:Uz,v=s,y=0;p&&y=t&&(0===e?0:r[e-1][0]).8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:E}),silent:!0}))}if(m.get("show")&&k!==_){L=m.get("distance");L=L?L+l:l;for(var R=0;R<=b;R++){u=Math.cos(M),c=Math.sin(M);var N=new zy({shape:{x1:u*(d-L)+p,y1:c*(d-L)+f,x2:u*(d-S-L)+p,y2:c*(d-S-L)+f},silent:!0,style:A});"auto"===A.stroke&&N.setStyle({stroke:r((k+R/b)/_)}),h.add(N),M+=I}M-=I}else M+=C}},e.prototype._renderPointer=function(t,e,n,r,i,o,a,s,l){var u=this.group,c=this._data,h=this._progressEls,p=[],f=t.get(["pointer","show"]),d=t.getModel("progress"),g=d.get("show"),v=t.getData(),y=v.mapDimension("value"),m=+t.get("min"),x=+t.get("max"),_=[m,x],b=[o,a];function w(e,n){var r,o=v.getItemModel(e),a=o.getModel("pointer"),s=lo(a.get("width"),i.r),l=lo(a.get("length"),i.r),u=t.get(["pointer","icon"]),c=a.get("offsetCenter"),h=lo(c[0],i.r),p=lo(c[1],i.r),f=a.get("keepAspect");return r=u?Kx(u,h-s/2,p-l,s,l,null,f):new Hz({shape:{angle:-Math.PI/2,width:s,r:l,x:h,y:p}}),r.rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function S(t,e){var n=d.get("roundCap"),r=n?nk:Dm,a=d.get("overlap"),u=a?d.get("width"):l/v.count(),c=a?i.r-u:i.r-(t+1)*u,h=a?i.r:i.r-t*u,p=new r({shape:{startAngle:o,endAngle:e,cx:i.cx,cy:i.cy,clockwise:s,r0:c,r:h}});return a&&(p.z2=x-v.get(y,t)%x),p}(g||f)&&(v.diff(c).add((function(e){if(f){var n=w(e,o);Rc(n,{rotation:-(so(v.get(y,e),_,b,!0)+Math.PI/2)},t),u.add(n),v.setItemGraphicEl(e,n)}if(g){var r=S(e,o),i=d.get("clip");Rc(r,{shape:{endAngle:so(v.get(y,e),_,b,i)}},t),u.add(r),xu(t.seriesIndex,v.dataType,e,r),p[e]=r}})).update((function(e,n){if(f){var r=c.getItemGraphicEl(n),i=r?r.rotation:o,a=w(e,i);a.rotation=i,Ec(a,{rotation:-(so(v.get(y,e),_,b,!0)+Math.PI/2)},t),u.add(a),v.setItemGraphicEl(e,a)}if(g){var s=h[n],l=s?s.shape.endAngle:o,m=S(e,l),x=d.get("clip");Ec(m,{shape:{endAngle:so(v.get(y,e),_,b,x)}},t),u.add(m),xu(t.seriesIndex,v.dataType,e,m),p[e]=m}})).execute(),v.each((function(t){var e=v.getItemModel(t),n=e.getModel("emphasis");if(f){var i=v.getItemGraphicEl(t),o=v.getItemVisual(t,"style"),a=o.fill;if(i instanceof Yl){var s=i.style;i.useStyle(j({image:s.image,x:s.x,y:s.y,width:s.width,height:s.height},o))}else i.useStyle(o),"pointer"!==i.type&&i.setColor(a);i.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===i.style.fill&&i.setStyle("fill",r(so(v.get(y,t),_,[0,1],!0))),i.z2EmphasisLift=0,Sc(i,e),xc(i,n.get("focus"),n.get("blurScope"))}if(g){var l=p[t];l.useStyle(v.getItemVisual(t,"style")),l.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),l.z2EmphasisLift=0,Sc(l,e),xc(l,n.get("focus"),n.get("blurScope"))}})),this._progressEls=p)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor"),r=n.get("show");if(r){var i=n.get("size"),o=n.get("icon"),a=n.get("offsetCenter"),s=n.get("keepAspect"),l=Kx(o,e.cx-i/2+lo(a[0],e.r),e.cy-i/2+lo(a[1],e.r),i,i,null,s);l.z2=n.get("showAbove")?1:0,l.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(l)}},e.prototype._renderTitleAndDetail=function(t,e,n,r,i){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),c=new Ui,h=[],p=[],f=t.isAnimationEnabled(),d=t.get(["pointer","showAbove"]);a.diff(this._data).add((function(t){h[t]=new yu({silent:!0}),p[t]=new yu({silent:!0})})).update((function(t,e){h[t]=o._titleEls[e],p[t]=o._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),o=a.get(s,e),g=new Ui,v=r(so(o,[l,u],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var m=y.get("offsetCenter"),x=i.cx+lo(m[0],i.r),_=i.cy+lo(m[1],i.r),b=h[e];b.attr({z2:d?0:2,style:Xc(y,{x:x,y:_,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:v})}),g.add(b)}var w=n.getModel("detail");if(w.get("show")){var S=w.get("offsetCenter"),M=i.cx+lo(S[0],i.r),C=i.cy+lo(S[1],i.r),I=lo(w.get("width"),i.r),T=lo(w.get("height"),i.r),A=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:v,D=(b=p[e],w.get("formatter"));b.attr({z2:d?0:2,style:Xc(w,{x:M,y:C,text:Wz(o,D),width:isNaN(I)?null:I,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:A})}),rh(b,{normal:w},o,(function(t){return Wz(t,D)})),f&&ih(b,e,a,t,{getFormattedLabel:function(t,e,n,r,i,a){return Wz(a?a.interpolatedValue:o,D)}}),g.add(b)}c.add(g)})),this.group.add(c),this._titleEls=h,this._detailEls=p},e.type="gauge",e}(Dv),Xz=qz,Yz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return v(e,t),e.prototype.getInitialData=function(t,e){return Kk(this,["value"])},e.type="series.gauge",e.defaultOption={zlevel:0,z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(yv),$z=Yz;function Zz(t){t.registerChartView(Xz),t.registerSeriesModel($z)}var Kz=["itemStyle","opacity"],Jz=function(t){function e(e,n){var r=t.call(this)||this,i=r,o=new Hm,a=new yu;return i.setTextContent(a),r.setTextGuideLine(o),r.updateData(e,n,!0),r}return v(e,t),e.prototype.updateData=function(t,e,n){var r=this,i=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(Kz);l=null==l?1:l,n||Fc(r),r.useStyle(t.getItemVisual(e,"style")),r.style.lineJoin="round",n?(r.setShape({points:a.points}),r.style.opacity=0,Rc(r,{style:{opacity:l}},i,e)):Ec(r,{style:{opacity:l},shape:{points:a.points}},i,e),Sc(r,o),this._updateLabel(t,e),xc(this,s.get("focus"),s.get("blurScope"))},e.prototype._updateLabel=function(t,e){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=s.label,u=t.getItemVisual(e,"style"),c=u.fill;Uc(i,qc(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:u.opacity,defaultText:t.getName(e)},{normal:{align:l.textAlign,verticalAlign:l.verticalAlign}}),n.setTextConfig({local:!0,inside:!!l.inside,insideStroke:c,outsideFill:c});var h=l.linePoints;r.setShape({points:h}),n.textGuideLineConfig={anchor:h?new ui(h[0][0],h[0][1]):null},Ec(i,{style:{x:l.x,y:l.y}},o,e),i.attr({rotation:l.rotation,originX:l.x,originY:l.y,z2:10}),iT(n,oT(a),{stroke:c})},e}(Vm),Qz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return v(e,t),e.prototype.render=function(t,e,n){var r=t.getData(),i=this._data,o=this.group;r.diff(i).add((function(t){var e=new Jz(r,t);r.setItemGraphicEl(t,e),o.add(e)})).update((function(t,e){var n=i.getItemGraphicEl(e);n.updateData(r,t),o.add(n),r.setItemGraphicEl(t,n)})).remove((function(e){var n=i.getItemGraphicEl(e);Vc(n,t,e)})).execute(),this._data=r},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Dv),tB=Qz,eB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Qk(rt(this.getData,this),rt(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return Kk(this,{coordDimensions:["value"],encodeDefaulter:it(uf,this)})},e.prototype._defaultLabelLine=function(t){Ro(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var n=this.getData(),r=t.prototype.getDataParams.call(this,e),i=n.mapDimension("value"),o=n.getSum(i);return r.percent=o?+(n.get(i,e)/o*100).toFixed(2):0,r.$vars.push("percent"),r},e.type="series.funnel",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(yv),nB=eB;function rB(t,e){return Rp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function iB(t,e){for(var n=t.mapDimension("value"),r=t.mapArray(n,(function(t){return t})),i=[],o="ascending"===e,a=0,s=t.count();aTB)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&kB(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),r=n.behavior;"jump"===r&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===r?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===r?null:{duration:0}})}}};function kB(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}var LB=AB,OB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&G(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){Z(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],n=Q(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){return(t.get("parallelIndex")||0)===this.componentIndex}),this);Z(n,(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Up),PB=OB,EB=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,r)||this;return a.type=i||"value",a.axisIndex=o,a}return v(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(LI),RB=EB;function NB(t,e,n,r,i,o){t=t||0;var a=n[1]-n[0];if(null!=i&&(i=BB(i,[0,a])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var s=Math.abs(e[1]-e[0]);s=BB(s,[0,a]),i=o=BB(s,[i,o]),r=0}e[0]=BB(e[0],n),e[1]=BB(e[1],n);var l=zB(e,r);e[r]+=t;var u,c=i||0,h=n.slice();return l.sign<0?h[0]+=c:h[1]-=c,e[r]=BB(e[r],h),u=zB(e,r),null!=i&&(u.sign!==l.sign||u.spano&&(e[1-r]=e[r]+u.sign*o),e}function zB(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function BB(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var VB=Z,FB=Math.min,GB=Math.max,HB=Math.floor,jB=Math.ceil,WB=uo,UB=Math.PI,qB=function(){function t(t,e,n){this.type="parallel",this._axesMap=Dt(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var r=t.dimensions,i=t.parallelAxisIndex;VB(r,(function(t,n){var r=i[n],o=e.getComponent("parallelAxis",r),a=this._axesMap.set(t,new RB(t,ZC(o),[0,0],o.get("type"),r)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,r=e.layoutBase,i=e.pixelDimIndex,o=t[1-i],a=t[i];return o>=n&&o<=n+e.axisLength&&a>=r&&a<=r+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var r=n.getData();VB(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(r,r.mapDimension(t)),$C(e.scale,e.model)}),this)}}),this)},t.prototype.resize=function(t,e){this._rect=Rp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,r=["x","y"],i=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[i[a]],l=[0,s],u=this.dimensions.length,c=XB(e.get("axisExpandWidth"),l),h=XB(e.get("axisExpandCount")||0,[0,u]),p=e.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,f=e.get("axisExpandWindow");if(f)t=XB(f[1]-f[0],l),f[1]=f[0]+t;else{t=XB(c*(h-1),l);var d=e.get("axisExpandCenter")||HB(u/2);f=[c*d-t/2],f[1]=f[0]+t}var g=(s-t)/(u-h);g<3&&(g=0);var v=[HB(WB(f[0]/c,1))+1,jB(WB(f[1]/c,1))-1],y=g/c*f[0];return{layout:o,pixelDimIndex:a,layoutBase:n[r[a]],layoutLength:s,axisBase:n[r[1-a]],axisLength:n[i[1-a]],axisExpandable:p,axisExpandWidth:c,axisCollapseWidth:g,axisExpandWindow:f,axisCount:u,winInnerIndices:v,axisExpandWindow0Pos:y}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;e.each((function(t){var e=[0,r.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),VB(n,(function(e,n){var o=(r.axisExpandable?$B:YB)(n,r),a={horizontal:{x:o.position,y:r.axisLength},vertical:{x:0,y:o.position}},s={horizontal:UB/2,vertical:0},l=[a[i].x+t.x,a[i].y+t.y],u=s[i],c=Gr();qr(c,c,u),Ur(c,c,l),this._axesLayout[e]={position:l,rotation:u,transform:c,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,r){null==n&&(n=0),null==r&&(r=t.count());var i=this._axesMap,o=this.dimensions,a=[],s=[];Z(o,(function(e){a.push(t.mapDimension(e)),s.push(i.get(e).model)}));for(var l=this.hasAxisBrushed(),u=n;ui*(1-c[0])?(l="jump",a=s-i*(1-c[2])):(a=s-i*c[1])>=0&&(a=s-i*(1-c[1]))<=0&&(a=0),a*=e.axisExpandWidth/u,a?NB(a,r,o,"all"):l="none";else{var p=r[1]-r[0],f=o[1]*s/p;r=[GB(0,f-p/2)],r[1]=FB(o[1],r[0]+p),r[0]=r[1]-p}return{axisExpandWindow:r,behavior:l}},t}();function XB(t,e){return FB(GB(t,e[0]),e[1])}function YB(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function $B(t,e){var n,r,i=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,c=!1;return t=0;n--)co(e[n])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var r=0,i=e.length;rsV}function IV(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function TV(t,e,n,r){var i=new Ui;return i.add(new ru({name:"main",style:LV(n),silent:!0,draggable:!0,cursor:"move",drift:it(NV,t,e,i,["n","s","w","e"]),ondragend:it(MV,e,{isEnd:!0})})),Z(r,(function(n){i.add(new ru({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:it(NV,t,e,i,n),ondragend:it(MV,e,{isEnd:!0})}))})),i}function AV(t,e,n,r){var i=r.brushStyle.lineWidth||0,o=iV(i,lV),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,c=n[0][1],h=n[1][1],p=c-o+i/2,f=h-o+i/2,d=c-a,g=h-s,v=d+i,y=g+i;kV(t,e,"main",a,s,d,g),r.transformable&&(kV(t,e,"w",l,u,o,y),kV(t,e,"e",p,u,o,y),kV(t,e,"n",l,u,v,o),kV(t,e,"s",l,f,v,o),kV(t,e,"nw",l,u,o,o),kV(t,e,"ne",p,u,o,o),kV(t,e,"sw",l,f,o,o),kV(t,e,"se",p,f,o,o))}function DV(t,e){var n=e.__brushOption,r=n.transformable,i=e.childAt(0);i.useStyle(LV(n)),i.attr({silent:!r,cursor:r?"move":"default"}),Z([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var i=e.childOfName(n.join("")),o=1===n.length?EV(t,n[0]):RV(t,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?hV[o]+"-resize":null})}))}function kV(t,e,n,r,i,o,a){var s=e.childOfName(n);s&&s.setShape(FV(VV(t,e,[[r,i],[r+o,i+a]])))}function LV(t){return W({strokeNoScale:!0},t.brushStyle)}function OV(t,e,n,r){var i=[rV(t,n),rV(e,r)],o=[iV(t,n),iV(e,r)];return[[i[0],o[0]],[i[1],o[1]]]}function PV(t){return Ax(t.group)}function EV(t,e){var n={w:"left",e:"right",n:"top",s:"bottom"},r={left:"w",right:"e",top:"n",bottom:"s"},i=kx(n[e],PV(t));return r[i]}function RV(t,e){var n=[EV(t,e[0]),EV(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function NV(t,e,n,r,i,o){var a=n.__brushOption,s=t.toRectRange(a.range),l=BV(e,i,o);Z(r,(function(t){var e=cV[t];s[e[0]][e[1]]+=l[e[0]]})),a.range=t.fromRectRange(OV(s[0][0],s[1][0],s[0][1],s[1][1])),xV(e,n),MV(e,{isEnd:!1})}function zV(t,e,n,r){var i=e.__brushOption.range,o=BV(t,n,r);Z(i,(function(t){t[0]+=o[0],t[1]+=o[1]})),xV(t,e),MV(t,{isEnd:!1})}function BV(t,e,n){var r=t.group,i=r.transformCoordToLocal(e,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function VV(t,e,n){var r=wV(t,e);return r&&r!==nV?r.clipPath(n,t._transform):F(n)}function FV(t){var e=rV(t[0][0],t[1][0]),n=rV(t[0][1],t[1][1]),r=iV(t[0][0],t[1][0]),i=iV(t[0][1],t[1][1]);return{x:e,y:n,width:r-e,height:i-n}}function GV(t,e,n){if(t._brushType&&!YV(t,e.offsetX,e.offsetY)){var r=t._zr,i=t._covers,o=bV(t,e,n);if(!t._dragging)for(var a=0;ar.getWidth()||n<0||n>r.getHeight()}var $V={lineX:ZV(0),lineY:ZV(1),rect:{createCover:function(t,e){function n(t){return t}return TV({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=IV(t);return OV(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,r){AV(t,e,n,r)},updateCommon:DV,contain:jV},polygon:{createCover:function(t,e){var n=new Ui;return n.add(new Hm({name:"main",style:LV(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new Vm({name:"main",draggable:!0,drift:it(zV,t,e),ondragend:it(MV,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,r){e.childAt(0).setShape({points:VV(t,e,n)})},updateCommon:DV,contain:jV}};function ZV(t){return{createCover:function(e,n){return TV({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=IV(e),r=rV(n[0][t],n[1][t]),i=iV(n[0][t],n[1][t]);return[r,i]},updateCoverShape:function(e,n,r,i){var o,a=wV(e,n);if(a!==nV&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(t);else{var s=e._zr;o=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[r,o];t&&l.reverse(),AV(e,n,l,i)},updateCommon:DV,contain:jV}}var KV=dV;function JV(t){return t=eF(t),function(e){return Ex(e,t)}}function QV(t,e){return t=eF(t),function(n){var r=null!=e?e:n,i=r?t.width:t.height,o=r?t.x:t.y;return[o,o+(i||0)]}}function tF(t,e,n){var r=eF(t);return function(t,i){return r.contain(i[0],i[1])&&!lP(t,e,n)}}function eF(t){return xi.create(t)}var nF=["axisLine","axisTickLabel","axisName"],rF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new KV(n.getZr())).on("brush",rt(this._onBrush,this))},e.prototype.render=function(t,e,n,r){if(!iF(t,e,r)){this.axisModel=t,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new Ui,this.group.add(this._axisGroup),t.get("show")){var o=aF(t,e),a=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,u=t.axis.dim,c=a.getAxisLayout(u),h=j({strokeContainThreshold:l},c),p=new tO(t,h);Z(nF,p.add,p),this._axisGroup.add(p.getGroup()),this._refreshBrushController(h,s,t,o,l,n),Px(i,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,e,n,r,i,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=xi.create({x:a[0],y:-i/2,width:s,height:i});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:JV(u),isTargetByCursor:tF(u,o,r),getLinearBrushOtherExtent:QV(u,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(oF(n))},e.prototype._onBrush=function(t){var e=t.areas,n=this.axisModel,r=n.axis,i=K(e,(function(t){return[r.coordToData(t.range[0],!0),r.coordToData(t.range[1],!0)]}));(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:i})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(xv);function iF(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}function oF(t){var e=t.axis;return K(t.activeIntervals,(function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}}))}function aF(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var sF=rF,lF={type:"axisAreaSelect",event:"axisAreaSelected"};function uF(t){t.registerAction(lF,(function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},(function(e){e.axis.model.setActiveIntervals(t.intervals)}))})),t.registerAction("parallelAxisExpand",(function(t,e){e.eachComponent({mainType:"parallel",query:t},(function(e){e.setAxisExpand(t)}))}))}var cF={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function hF(t){t.registerComponentView(LB),t.registerComponentModel(PB),t.registerCoordinateSystem("parallel",QB),t.registerPreprocessor(MB),t.registerComponentModel(eV),t.registerComponentView(sF),SL(t,"parallel",eV,cF),uF(t)}function pF(t){BS(hF),t.registerChartView(vB),t.registerSeriesModel(_B),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,SB)}var fF=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return t}(),dF=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.getDefaultShape=function(){return new fF},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){nc(this)},e.prototype.downplay=function(){rc(this)},e}(Fl),gF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._focusAdjacencyDisabled=!1,n}return v(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.getGraph(),o=this.group,a=t.layoutInfo,s=a.width,l=a.height,u=t.getData(),c=t.getData("edge"),h=t.get("orient");this._model=t,o.removeAll(),o.x=a.x,o.y=a.y,i.eachEdge((function(e){var n=new dF,r=mu(n);r.dataIndex=e.dataIndex,r.seriesIndex=t.seriesIndex,r.dataType="edge";var i,a,u,p,f,d,g,v,y=e.getModel(),m=y.getModel("lineStyle"),x=m.get("curveness"),_=e.node1.getLayout(),b=e.node1.getModel(),w=b.get("localX"),S=b.get("localY"),M=e.node2.getLayout(),C=e.node2.getModel(),I=C.get("localX"),T=C.get("localY"),A=e.getLayout();switch(n.shape.extent=Math.max(1,A.dy),n.shape.orient=h,"vertical"===h?(i=(null!=w?w*s:_.x)+A.sy,a=(null!=S?S*l:_.y)+_.dy,u=(null!=I?I*s:M.x)+A.ty,p=null!=T?T*l:M.y,f=i,d=a*(1-x)+p*x,g=u,v=a*x+p*(1-x)):(i=(null!=w?w*s:_.x)+_.dx,a=(null!=S?S*l:_.y)+A.sy,u=null!=I?I*s:M.x,p=(null!=T?T*l:M.y)+A.ty,f=i*(1-x)+u*x,d=a,g=i*x+u*(1-x),v=p),n.setShape({x1:i,y1:a,x2:u,y2:p,cpx1:f,cpy1:d,cpx2:g,cpy2:v}),n.useStyle(m.getItemStyle()),n.style.fill){case"source":n.style.fill=e.node1.getVisual("color"),n.style.decal=e.node1.getVisual("style").decal;break;case"target":n.style.fill=e.node2.getVisual("color"),n.style.decal=e.node2.getVisual("style").decal;break;case"gradient":var D=e.node1.getVisual("color"),k=e.node2.getVisual("color");"string"===typeof D&&"string"===typeof k&&(n.style.fill=new Qm(0,0,+("horizontal"===h),+("vertical"===h),[{color:D,offset:0},{color:k,offset:1}]))}var L=y.getModel("emphasis");Sc(n,y,"lineStyle",(function(t){return t.getItemStyle()})),o.add(n),c.setItemGraphicEl(e.dataIndex,n);var O=L.get("focus");xc(n,"adjacency"===O?e.getAdjacentDataIndices():O,L.get("blurScope")),mu(n).dataType="edge"})),i.eachNode((function(e){var n=e.getLayout(),r=e.getModel(),i=r.get("localX"),a=r.get("localY"),c=r.getModel("emphasis"),h=new ru({shape:{x:null!=i?i*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy},style:r.getModel("itemStyle").getItemStyle(),z2:10});Uc(h,qc(r),{labelFetcher:t,labelDataIndex:e.dataIndex,defaultText:e.id}),h.disableLabelAnimation=!0,h.setStyle("fill",e.getVisual("color")),h.setStyle("decal",e.getVisual("style").decal),Sc(h,r),o.add(h),u.setItemGraphicEl(e.dataIndex,h),mu(h).dataType="node";var p=c.get("focus");xc(h,"adjacency"===p?e.getAdjacentDataIndices():p,c.get("blurScope"))})),u.eachItemGraphicEl((function(e,i){var o=u.getItemModel(i);o.get("draggable")&&(e.drift=function(e,o){r._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:u.getRawIndex(i),localX:this.shape.x/s,localY:this.shape.y/l})},e.ondragend=function(){r._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")})),!this._data&&t.isAnimationEnabled()&&o.setClipPath(vF(o.getBoundingRect(),t,(function(){o.removeClipPath()}))),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Dv);function vF(t,e,n){var r=new ru({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Rc(r,{shape:{width:t.width+20}},e,n),r}var yF=gF,mF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links,r=t.data||t.nodes,i=t.levels;this.levelModels=[];for(var o=this.levelModels,a=0;a=0&&(o[i[a].depth]=new vh(i[a],this,e));if(r&&n){var s=Rz(r,n,this,!0,l);return s.data}function l(t,e){t.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,r=n.getData().getItemLayout(e);if(r){var i=r.depth,o=n.levelModels[i];o&&(t.parentModel=o)}return t})),e.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,r=n.getGraph().getEdgeByIndex(e),i=r.node1.getLayout();if(i){var o=i.depth,a=n.levelModels[o];a&&(t.parentModel=a)}return t}))}},e.prototype.setNodePosition=function(t,e){var n=this.option.data||this.option.nodes,r=n[t];r.localX=e[0],r.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function r(t){return isNaN(t)||null==t}if("edge"===n){var i=this.getDataParams(t,n),o=i.data,a=i.value,s=o.source+" -- "+o.target;return jg("nameValue",{name:s,value:a,noValue:r(a)})}var l=this.getGraph().getNodeByIndex(t),u=l.getLayout().value,c=this.getDataParams(t,n).data.name;return jg("nameValue",{name:null!=c?c+"":null,value:u,noValue:r(u)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,n){var r=t.prototype.getDataParams.call(this,e,n);if(null==r.value&&"node"===n){var i=this.getGraph().getNodeByIndex(e),o=i.getLayout().value;r.value=o}return r},e.type="series.sankey",e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(yv),xF=mF;function _F(t,e){t.eachSeriesByType("sankey",(function(t){var n=t.get("nodeWidth"),r=t.get("nodeGap"),i=bF(t,e);t.layoutInfo=i;var o=i.width,a=i.height,s=t.getGraph(),l=s.nodes,u=s.edges;SF(l);var c=Q(l,(function(t){return 0===t.getLayout().value})),h=0!==c.length?0:t.get("layoutIterations"),p=t.get("orient"),f=t.get("nodeAlign");wF(l,u,n,r,o,a,h,p,f)}))}function bF(t,e){return Rp(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function wF(t,e,n,r,i,o,a,s,l){MF(t,e,n,i,o,s,l),DF(t,e,o,i,r,a,s),HF(t,s)}function SF(t){Z(t,(function(t){var e=FF(t.outEdges,VF),n=FF(t.inEdges,VF),r=t.getValue()||0,i=Math.max(e,n,r);t.setLayout({value:i},!0)}))}function MF(t,e,n,r,i,o,a){for(var s=[],l=[],u=[],c=[],h=0,p=0;p=0;y&&v.depth>f&&(f=v.depth),g.setLayout({depth:y?v.depth:h},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var m=0;mh-1?f:h-1;a&&"left"!==a&&IF(t,a,o,S);var M="vertical"===o?(i-n)/S:(r-n)/S;AF(t,M,o)}function CF(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function IF(t,e,n,r){if("right"===e){var i=[],o=t,a=0;while(o.length){for(var s=0;s0;o--)l*=.99,PF(s,l,a),OF(s,i,n,r,a),GF(s,l,a),OF(s,i,n,r,a)}function kF(t,e){var n=[],r="vertical"===e?"y":"x",i=pa(t,(function(t){return t.getLayout()[r]}));return i.keys.sort((function(t,e){return t-e})),Z(i.keys,(function(t){n.push(i.buckets.get(t))})),n}function LF(t,e,n,r,i,o){var a=1/0;Z(t,(function(t){var e=t.length,s=0;Z(t,(function(t){s+=t.getLayout().value}));var l="vertical"===o?(r-(e-1)*i)/s:(n-(e-1)*i)/s;l0&&(a=s.getLayout()[o]+l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[h]+e;var f="vertical"===i?r:n;if(l=u-e-f,l>0){a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(p=c-2;p>=0;--p)s=t[p],l=s.getLayout()[o]+s.getLayout()[h]+e-u,l>0&&(a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function PF(t,e,n){Z(t.slice().reverse(),(function(t){Z(t,(function(t){if(t.outEdges.length){var r=FF(t.outEdges,EF,n)/FF(t.outEdges,VF);if(isNaN(r)){var i=t.outEdges.length;r=i?FF(t.outEdges,RF,n)/i:0}if("vertical"===n){var o=t.getLayout().x+(r-BF(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(r-BF(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function EF(t,e){return BF(t.node2,e)*t.getValue()}function RF(t,e){return BF(t.node2,e)}function NF(t,e){return BF(t.node1,e)*t.getValue()}function zF(t,e){return BF(t.node1,e)}function BF(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function VF(t){return t.getValue()}function FF(t,e,n){var r=0,i=t.length,o=-1;while(++oi&&(i=e)})),Z(n,(function(e){var n=new WR({type:"color",mappingMethod:"linear",dataExtent:[r,i],visual:t.get("color")}),o=n.mapValueToVisual(e.getLayout().value),a=e.getModel().get(["itemStyle","color"]);null!=a?(e.setVisual("color",a),e.setVisual("style",{fill:a})):(e.setVisual("color",o),e.setVisual("style",{fill:o}))}))}}))}function WF(t){t.registerChartView(yF),t.registerSeriesModel(xF),t.registerLayout(_F),t.registerVisual(jF),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},(function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])}))}))}var UF=function(){function t(){}return t.prototype.getInitialData=function(t,e){var n,r,i=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=i.get("type"),s=o.get("type");"category"===a?(t.layout="horizontal",n=i.getOrdinalMeta(),r=!0):"category"===s?(t.layout="vertical",n=o.getOrdinalMeta(),r=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,c=this._baseAxisDim=l[u],h=l[1-u],p=[i,o],f=p[u].get("type"),d=p[1-u].get("type"),g=t.data;if(g&&r){var v=[];Z(g,(function(t,e){var n;ot(t)?(n=t.slice(),t.unshift(e)):ot(t.value)?(n=j({},t),n.value=n.value.slice(),t.value.unshift(e)):n=t,v.push(n)})),t.data=v}var y=this.defaultValueDimensions,m=[{name:c,type:qS(f),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:qS(d),dimsDef:y.slice()}];return Kk(this,{coordDimensions:m,dimensionsCount:y.length+1,encodeDefaulter:it(lf,m,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),qF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return v(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(yv);Y(qF,UF,!0);var XF=qF,YF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r=t.getData(),i=this.group,o=this._data;this._data||i.removeAll();var a="horizontal"===t.get("layout")?1:0;r.diff(o).add((function(t){if(r.hasValue(t)){var e=r.getItemLayout(t),n=KF(e,r,t,a,!0);r.setItemGraphicEl(t,n),i.add(n)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(r.hasValue(t)){var s=r.getItemLayout(t);n?(Fc(n),JF(s,n,r,t)):n=KF(s,r,t,a),i.add(n),r.setItemGraphicEl(t,n)}else i.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&i.remove(e)})).execute(),this._data=r},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(Dv),$F=function(){function t(){}return t}(),ZF=function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return v(e,t),e.prototype.getDefaultShape=function(){return new $F},e.prototype.buildPath=function(t,e){var n=e.points,r=0;for(t.moveTo(n[r][0],n[r][1]),r++;r<4;r++)t.lineTo(n[r][0],n[r][1]);for(t.closePath();rg){var _=[y,x];r.push(_)}}}return{boxData:n,outliers:r}}var lG={type:"echarts:boxplot",transform:function(t){var e=t.upstream;if(e.sourceFormat!==Kp){var n="";0,Af(n)}var r=sG(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:r.boxData},{data:r.outliers}]}};function uG(t){t.registerSeriesModel(XF),t.registerChartView(tG),t.registerVisual(eG),t.registerLayout(rG),t.registerTransform(lG)}var cG=["color","borderColor"],hG=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){this.group.removeClipPath(),this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,r){this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,r=this.group,i=e.getLayout("isSimpleBox"),o=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();this._data||r.removeAll(),e.diff(n).add((function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(o&&gG(s,a))return;var l=dG(a,n,!0);Rc(l,{shape:{points:a.ends}},t,n),vG(l,e,n,i),r.add(l),e.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(e.hasValue(a)){var c=e.getItemLayout(a);o&&gG(s,c)?r.remove(u):(u?(Ec(u,{shape:{points:c.ends}},t,a),Fc(u)):u=dG(c,a),vG(u,e,a,i),r.add(u),e.setItemGraphicEl(a,u))}else r.remove(u)})).remove((function(t){var e=n.getItemGraphicEl(t);e&&r.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),_G(t,this.group);var e=t.get("clip",!0)?MD(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){var n,r=e.getData(),i=r.getLayout("isSimpleBox");while(null!=(n=t.next())){var o=r.getItemLayout(n),a=dG(o,n);vG(a,r,n,i),a.incremental=!0,this.group.add(a)}},e.prototype._incrementalRenderLarge=function(t,e){_G(e,this.group,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Dv),pG=function(){function t(){}return t}(),fG=function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return v(e,t),e.prototype.getDefaultShape=function(){return new pG},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(Fl);function dG(t,e,n){var r=t.ends;return new fG({shape:{points:n?yG(r,t):r},z2:100})}function gG(t,e){for(var n=!0,r=0;r0?"borderColor":"borderColor0"])||n.get(["itemStyle",t>0?"color":"color0"]),o=n.getModel("itemStyle").getItemStyle(cG);e.useStyle(o),e.style.fill=null,e.style.stroke=i}var wG=hG,SG=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return v(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var r=e.getItemLayout(t);return r&&n.rect(r.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(yv);Y(SG,UF,!0);var MG=SG;function CG(t){t&&ot(t.series)&&Z(t.series,(function(t){ct(t)&&"k"===t.type&&(t.type="candlestick")}))}var IG=["itemStyle","borderColor"],TG=["itemStyle","borderColor0"],AG=["itemStyle","color"],DG=["itemStyle","color0"],kG={seriesType:"candlestick",plan:_v(),performRawSeries:!0,reset:function(t,e){function n(t,e){return e.get(t>0?AG:DG)}function r(t,e){return e.get(t>0?IG:TG)}if(!e.isSeriesFiltered(t)){var i=t.pipelineContext.large;return!i&&{progress:function(t,e){var i;while(null!=(i=t.next())){var o=e.getItemModel(i),a=e.getItemLayout(i).sign,s=o.getItemStyle();s.fill=n(a,o),s.stroke=r(a,o)||s.fill;var l=e.ensureUniqueItemVisual(i,"style");j(l,s)}}}}}},LG=kG,OG="undefined"!==typeof Float32Array?Float32Array:Array,PG={seriesType:"candlestick",plan:_v(),reset:function(t){var e=t.coordinateSystem,n=t.getData(),r=RG(t,n),i=0,o=1,a=["x","y"],s=n.getDimensionIndex(n.mapDimension(a[i])),l=K(n.mapDimensionsAll(a[o]),n.getDimensionIndex,n),u=l[0],c=l[1],h=l[2],p=l[3];if(n.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),!(s<0||l.length<4))return{progress:t.pipelineContext.large?d:f};function f(t,n){var a,l=n.getStore();while(null!=(a=t.next())){var f=l.get(s,a),d=l.get(u,a),g=l.get(c,a),v=l.get(h,a),y=l.get(p,a),m=Math.min(d,g),x=Math.max(d,g),_=C(m,f),b=C(x,f),w=C(v,f),S=C(y,f),M=[];I(M,b,0),I(M,_,1),M.push(A(S),A(b),A(w),A(_)),n.setItemLayout(a,{sign:EG(l,a,d,g,c),initBaseline:d>g?b[o]:_[o],ends:M,brushRect:T(v,y,f)})}function C(t,n){var r=[];return r[i]=n,r[o]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(r)}function I(t,e,n){var o=e.slice(),a=e.slice();o[i]=Tx(o[i]+r/2,1,!1),a[i]=Tx(a[i]-r/2,1,!0),n?t.push(o,a):t.push(a,o)}function T(t,e,n){var a=C(t,n),s=C(e,n);return a[i]-=r/2,s[i]-=r/2,{x:a[0],y:a[1],width:o?r:s[0]-a[0],height:o?s[1]-a[1]:r}}function A(t){return t[i]=Tx(t[i],1),t}}function d(t,n){var r,a,l=new OG(4*t.count),f=0,d=[],g=[],v=n.getStore();while(null!=(a=t.next())){var y=v.get(s,a),m=v.get(u,a),x=v.get(c,a),_=v.get(h,a),b=v.get(p,a);isNaN(y)||isNaN(_)||isNaN(b)?(l[f++]=NaN,f+=3):(l[f++]=EG(v,a,m,x,c),d[i]=y,d[o]=_,r=e.dataToPoint(d,null,g),l[f++]=r?r[0]:NaN,l[f++]=r?r[1]:NaN,d[o]=b,r=e.dataToPoint(d,null,g),l[f++]=r?r[1]:NaN)}n.setLayout("largePoints",l)}}};function EG(t,e,n,r,i){var o;return o=n>r?-1:n0?t.get(i,e-1)<=r?1:-1:1,o}function RG(t,e){var n,r=t.getBaseAxis(),i="category"===r.type?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/e.count()),o=lo(xt(t.get("barMaxWidth"),i),i),a=lo(xt(t.get("barMinWidth"),1),i),s=t.get("barWidth");return null!=s?lo(s,i):Math.max(Math.min(i/2,o),a)}var NG=PG;function zG(t){t.registerChartView(wG),t.registerSeriesModel(MG),t.registerPreprocessor(CG),t.registerVisual(LG),t.registerLayout(NG)}function BG(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var VG=function(t){function e(e,n){var r=t.call(this)||this,i=new tD(e,n),o=new Ui;return r.add(i),r.add(o),r.updateData(e,n),r}return v(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,r=t.rippleNumber,i=this.childAt(1),o=0;o0&&(a=this._getLineLength(r)/l*1e3),(a!==this._period||s!==this._loop)&&(r.stopAnimation(),a>0)){var c=void 0;c="function"===typeof u?u(n):u,r.__t>0&&(c=-a*r.__t),r.__t=0;var h=r.animate("",s).when(a,{__t:1}).delay(c).during((function(){i._updateSymbolPosition(r)}));s||h.done((function(){i.remove(r)})),h.start()}this._period=a,this._loop=s}},e.prototype._getLineLength=function(t){return Kt(t.__p1,t.__cp1)+Kt(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,r=t.__cp1,i=t.__t,o=[t.x,t.y],a=o.slice(),s=Is,l=Ts;o[0]=s(e[0],r[0],n[0],i),o[1]=s(e[1],r[1],n[1],i);var u=l(e[0],r[0],n[0],i),c=l(e[1],r[1],n[1],i);t.rotation=-Math.atan2(c,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0;o--)if(r[o]<=e)break;o=Math.min(o,i-2)}else{for(o=a;oe)break;o=Math.min(o-1,i-2)}var l=(e-r[o])/(r[o+1]-r[o]),u=n[o],c=n[o+1];t.x=u[0]*(1-l)+l*c[0],t.y=u[1]*(1-l)+l*c[1];var h=c[0]-u[0],p=c[1]-u[1];t.rotation=-Math.atan2(p,h)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(XG),KG=ZG,JG=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),QG=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new JG},e.prototype.buildPath=function(t,e){var n=e.segs,r=e.curveness;if(e.polyline)for(var i=0;i0){t.moveTo(n[i++],n[i++]);for(var a=1;a0){var h=(s+u)/2-(l-c)*r,p=(l+c)/2-(u-s)*r;t.quadraticCurveTo(h,p,u,c)}else t.lineTo(u,c)}},e.prototype.findDataIndex=function(t,e){var n=this.shape,r=n.segs,i=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=r[s++],c=r[s++],h=1;h0){var d=(u+p)/2-(c-f)*i,g=(c+f)/2-(p-u)*i;if(yl(u,c,d,g,p,f,o,t,e))return a}else if(gl(u,c,p,f,o,t,e))return a;a++}return-1},e}(Fl),tH=function(){function t(){this.group=new Ui}return t.prototype.isPersistent=function(){return!this._incremental},t.prototype.updateData=function(t){this.group.removeAll();var e=new QG({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>5e5?(this._incremental||(this._incremental=new cx({silent:!0})),this.group.add(this._incremental)):this._incremental=null},t.prototype.incrementalUpdate=function(t,e){var n=new QG;n.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(n,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(n,!0):(n.rectHover=!0,n.cursor="default",n.__startIndex=t.start,this.group.add(n))},t.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},t.prototype._setCommon=function(t,e,n){var r=e.hostModel;t.setShape({polyline:r.get("polyline"),curveness:r.get(["lineStyle","curveness"])}),t.useStyle(r.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var i=e.getVisual("style");if(i&&i.stroke&&t.setStyle("stroke",i.stroke),t.setStyle("fill",null),!n){var o=mu(t);o.seriesIndex=r.seriesIndex,t.on("mousemove",(function(e){o.dataIndex=null;var n=t.findDataIndex(e.offsetX,e.offsetY);n>0&&(o.dataIndex=n+t.__startIndex)}))}},t.prototype._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},t}(),eH=tH,nH={seriesType:"lines",plan:_v(),reset:function(t){var e=t.coordinateSystem,n=t.get("polyline"),r=t.pipelineContext.large;return{progress:function(i,o){var a=[];if(r){var s=void 0,l=i.end-i.start;if(n){for(var u=0,c=i.start;c ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(yv),cH=uH;function hH(t){return t instanceof Array||(t=[t,t]),t}var pH={seriesType:"lines",reset:function(t){var e=hH(t.get("symbol")),n=hH(t.get("symbolSize")),r=t.getData();function i(t,e){var n=t.getItemModel(e),r=hH(n.getShallow("symbol",!0)),i=hH(n.getShallow("symbolSize",!0));r[0]&&t.setItemVisual(e,"fromSymbol",r[0]),r[1]&&t.setItemVisual(e,"toSymbol",r[1]),i[0]&&t.setItemVisual(e,"fromSymbolSize",i[0]),i[1]&&t.setItemVisual(e,"toSymbolSize",i[1])}return r.setVisual("fromSymbol",e&&e[0]),r.setVisual("toSymbol",e&&e[1]),r.setVisual("fromSymbolSize",n&&n[0]),r.setVisual("toSymbolSize",n&&n[1]),{dataEach:r.hasItemOption?i:null}}},fH=pH;function dH(t){t.registerChartView(oH),t.registerSeriesModel(cH),t.registerLayout(rH),t.registerVisual(fH)}var gH=256,vH=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=U();this.canvas=t}return t.prototype.update=function(t,e,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),p=t.length;c.width=e,c.height=n;for(var f=0;f0){var T=o(m)?s:l;m>0&&(m=m*C+S),_[b++]=T[I],_[b++]=T[I+1],_[b++]=T[I+2],_[b++]=T[I+3]*m*256}else b+=4}return h.putImageData(x,0,0),c},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=U()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var r=t.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-e,e,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),t},t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,r=n[e]||(n[e]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)t[e](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},t}(),yH=vH;function mH(t,e,n){var r=t[1]-t[0];e=K(e,(function(e){return{interval:[(e.interval[0]-t[0])/r,(e.interval[1]-t[0])/r]}}));var i=e.length,o=0;return function(t){var r;for(r=o;r=0;r--){a=e[r].interval;if(a[0]<=t&&t<=a[1]){o=r;break}}return r>=0&&r=e[0]&&t<=e[1]}}function _H(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var bH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(n){n===t&&(r=e)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var i=t.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):_H(i)&&this._renderOnGeo(i,t,r,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,r){var i=e.coordinateSystem;i&&(_H(i)?this.render(e,n,r):this._renderOnCartesianAndCalendar(e,r,t.start,t.end,!0))},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,r,i){var o,a,s,l,u=t.coordinateSystem;if(CD(u,"cartesian2d")){var c=u.getAxis("x"),h=u.getAxis("y");0,o=c.getBandWidth(),a=h.getBandWidth(),s=c.scale.getExtent(),l=h.scale.getExtent()}for(var p=this.group,f=t.getData(),d=t.getModel(["emphasis","itemStyle"]).getItemStyle(),g=t.getModel(["blur","itemStyle"]).getItemStyle(),v=t.getModel(["select","itemStyle"]).getItemStyle(),y=qc(t),m=t.get(["emphasis","focus"]),x=t.get(["emphasis","blurScope"]),_=CD(u,"cartesian2d")?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],b=n;bs[1]||Cl[1])continue;var I=u.dataToPoint([M,C]);w=new ru({shape:{x:Math.floor(Math.round(I[0])-o/2),y:Math.floor(Math.round(I[1])-a/2),width:Math.ceil(o),height:Math.ceil(a)},style:S})}else{if(isNaN(f.get(_[1],b)))continue;w=new ru({z2:1,shape:u.dataToRect([f.get(_[0],b)]).contentShape,style:S})}var T=f.getItemModel(b);if(f.hasItemOption){var A=T.getModel("emphasis");d=A.getModel("itemStyle").getItemStyle(),g=T.getModel(["blur","itemStyle"]).getItemStyle(),v=T.getModel(["select","itemStyle"]).getItemStyle(),m=A.get("focus"),x=A.get("blurScope"),y=qc(T)}var D=t.getRawValue(b),k="-";D&&null!=D[2]&&(k=D[2]+""),Uc(w,y,{labelFetcher:t,labelDataIndex:b,defaultOpacity:S.opacity,defaultText:k}),w.ensureState("emphasis").style=d,w.ensureState("blur").style=g,w.ensureState("select").style=v,xc(w,m,x),w.incremental=i,i&&(w.states.emphasis.hoverLayer=!0),p.add(w),f.setItemGraphicEl(b,w)}},e.prototype._renderOnGeo=function(t,e,n,r){var i=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=e.getData(),s=this._hmLayer||this._hmLayer||new yH;s.blurSize=e.get("blurSize"),s.pointSize=e.get("pointSize"),s.minOpacity=e.get("minOpacity"),s.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),u=t.getRoamTransform();l.applyTransform(u);var c=Math.max(l.x,0),h=Math.max(l.y,0),p=Math.min(l.width+l.x,r.getWidth()),f=Math.min(l.height+l.y,r.getHeight()),d=p-c,g=f-h,v=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],y=a.mapArray(v,(function(e,n,r){var i=t.dataToPoint([e,n]);return i[0]-=c,i[1]-=h,i.push(r),i})),m=n.getExtent(),x="visualMap.continuous"===n.type?xH(m,n.option.range):mH(m,n.getPieceList(),n.option.selected);s.update(y,d,g,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:o.color.getColorMapper()},x);var _=new Yl({style:{width:d,height:g,x:c,y:h,image:s.canvas},silent:!0});this.group.add(_)},e.type="heatmap",e}(Dv),wH=bH,SH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.getInitialData=function(t,e){return zM(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=jf.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(yv),MH=SH;function CH(t){t.registerChartView(wH),t.registerSeriesModel(MH)}var IH=["itemStyle","borderWidth"],TH=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],AH=new Fy,DH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r=this.group,i=t.getData(),o=this._data,a=t.coordinateSystem,s=a.getBaseAxis(),l=s.isHorizontal(),u=a.master.getRect(),c={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[u.x,u.x+u.width],[u.y,u.y+u.height]],isHorizontal:l,valueDim:TH[+l],categoryDim:TH[1-+l]};return i.diff(o).add((function(t){if(i.hasValue(t)){var e=GH(i,t),n=kH(i,t,e,c),o=WH(i,c,n);i.setItemGraphicEl(t,o),r.add(o),ZH(o,c,n)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(i.hasValue(t)){var a=GH(i,t),s=kH(i,t,a,c),l=XH(i,s);n&&l!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(t,null),n=null),n?UH(n,c,s):n=WH(i,c,s,!0),i.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,r.add(n),ZH(n,c,s)}else r.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&qH(o,t,e.__pictorialSymbolMeta.animationModel,e)})).execute(),this._data=i,this.group},e.prototype.remove=function(t,e){var n=this.group,r=this._data;t.get("animation")?r&&r.eachItemGraphicEl((function(e){qH(r,mu(e).dataIndex,t,e)})):n.removeAll()},e.type="pictorialBar",e}(Dv);function kH(t,e,n,r){var i=t.getItemLayout(e),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=n.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=n.get("symbolPatternSize")||2,h=n.isAnimationEnabled(),p={dataIndex:e,layout:i,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:h?n:null,hoverScale:h&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};LH(n,o,i,r,p),PH(t,e,i,o,a,p.boundingLength,p.pxSign,c,r,p),EH(n,p.symbolScale,u,r,p);var f=p.symbolSize,d=Qx(n.get("symbolOffset"),f);return RH(n,f,i,o,a,d,s,p.valueLineWidth,p.boundingLength,p.repeatCutLength,r,p),p}function LH(t,e,n,r,i){var o,a=r.valueDim,s=t.get("symbolBoundingData"),l=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),c=1-+(n[a.wh]<=0);if(ot(s)){var h=[OH(l,s[0])-u,OH(l,s[1])-u];h[1]0?1:o<0?-1:0}function OH(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function PH(t,e,n,r,i,o,a,s,l,u){var c,h=l.valueDim,p=l.categoryDim,f=Math.abs(n[p.wh]),d=t.getItemVisual(e,"symbolSize");c=ot(d)?d.slice():null==d?["100%","100%"]:[d,d],c[p.index]=lo(c[p.index],f),c[h.index]=lo(c[h.index],r?f:Math.abs(o)),u.symbolSize=c;var g=u.symbolScale=[c[0]/s,c[1]/s];g[h.index]*=(l.isHorizontal?-1:1)*a}function EH(t,e,n,r,i){var o=t.get(IH)||0;o&&(AH.attr({scaleX:e[0],scaleY:e[1],rotation:n}),AH.updateTransform(),o/=AH.getLineScale(),o*=e[r.valueDim.index]),i.valueLineWidth=o}function RH(t,e,n,r,i,o,a,s,l,u,c,h){var p=c.categoryDim,f=c.valueDim,d=h.pxSign,g=Math.max(e[f.index]+s,0),v=g;if(r){var y=Math.abs(l),m=mt(t.get("symbolMargin"),"15%")+"",x=!1;m.lastIndexOf("!")===m.length-1&&(x=!0,m=m.slice(0,m.length-1));var _=lo(m,e[f.index]),b=Math.max(g+2*_,0),w=x?0:2*_,S=Ao(r),M=S?r:KH((y+w)/b),C=y-M*g;_=C/2/(x?M:Math.max(M-1,1)),b=g+2*_,w=x?0:2*_,S||"fixed"===r||(M=u?KH((Math.abs(u)+w)/b):0),v=M*b-w,h.repeatTimes=M,h.symbolMargin=_}var I=d*(v/2),T=h.pathPosition=[];T[p.index]=n[p.wh]/2,T[f.index]="start"===a?I:"end"===a?l-I:l/2,o&&(T[0]+=o[0],T[1]+=o[1]);var A=h.bundlePosition=[];A[p.index]=n[p.xy],A[f.index]=n[f.xy];var D=h.barRectShape=j({},n);D[f.wh]=d*Math.max(Math.abs(n[f.wh]),Math.abs(T[f.index]+I)),D[p.wh]=n[p.wh];var k=h.clipShape={};k[p.xy]=-n[p.xy],k[p.wh]=c.ecSize[p.wh],k[f.xy]=0,k[f.wh]=n[f.wh]}function NH(t){var e=t.symbolPatternSize,n=Kx(t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function zH(t,e,n,r){var i=t.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,c=0,h=o[e.valueDim.index]+a+2*n.symbolMargin;for(YH(t,(function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=u,c0:r<0)&&(i=u-1-t),e[l.index]=h*(i-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function BH(t,e,n,r){var i=t.__pictorialBundle,o=t.__pictorialMainPath;o?$H(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(o=t.__pictorialMainPath=NH(n),i.add(o),$H(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function VH(t,e,n){var r=j({},e.barRectShape),i=t.__pictorialBarRect;i?$H(i,null,{shape:r},e,n):(i=t.__pictorialBarRect=new ru({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,t.add(i))}function FH(t,e,n,r){if(n.symbolClip){var i=t.__pictorialClipPath,o=j({},n.clipShape),a=e.valueDim,s=n.animationModel,u=n.dataIndex;if(i)Ec(i,{shape:o},s,u);else{o[a.wh]=0,i=new ru({shape:o}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var c={};c[a.wh]=n.clipShape[a.wh],l[r?"updateProps":"initProps"](i,{shape:c},s,u)}}}function GH(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=HH,n.isAnimationEnabled=jH,n}function HH(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function jH(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function WH(t,e,n,r){var i=new Ui,o=new Ui;return i.add(o),i.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?zH(i,e,n):BH(i,e,n),VH(i,n,r),FH(i,e,n,r),i.__pictorialShapeStr=XH(t,n),i.__pictorialSymbolMeta=n,i}function UH(t,e,n){var r=n.animationModel,i=n.dataIndex,o=t.__pictorialBundle;Ec(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?zH(t,e,n,!0):BH(t,e,n,!0),VH(t,n,!0),FH(t,e,n,!0)}function qH(t,e,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var o=[];YH(r,(function(t){o.push(t)})),r.__pictorialMainPath&&o.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),Z(o,(function(t){zc(t,{scaleX:0,scaleY:0},n,e,(function(){r.parent&&r.parent.remove(r)}))})),t.setItemGraphicEl(e,null)}function XH(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function YH(t,e,n){Z(t.__pictorialBundle.children(),(function(r){r!==t.__pictorialBarRect&&e.call(n,r)}))}function $H(t,e,n,r,i,o){e&&t.attr(e),r.symbolClip&&!i?n&&t.attr(n):n&&l[i?"updateProps":"initProps"](t,n,r.animationModel,r.dataIndex,o)}function ZH(t,e,n){var r=n.dataIndex,i=n.itemModel,o=i.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=o.get("focus"),h=o.get("blurScope"),p=o.get("scale");YH(t,(function(t){if(t instanceof Yl){var e=t.style;t.useStyle(j({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var r=t.ensureState("emphasis");r.style=a,p&&(r.scaleX=1.1*t.scaleX,r.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2}));var f=e.valueDim.posDesc[+(n.boundingLength>0)],d=t.__pictorialBarRect;Uc(d,qc(i),{labelFetcher:e.seriesModel,labelDataIndex:r,defaultText:ZA(e.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:f}),xc(t,c,h)}function KH(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var JH=DH,QH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return v(e,t),e.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=bh(KD.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(KD),tj=QH;function ej(t){t.registerChartView(JH),t.registerSeriesModel(tj),t.registerLayout(it(dC,"pictorialBar"))}var nj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return v(e,t),e.prototype.render=function(t,e,n){var r=t.getData(),i=this,o=this.group,a=t.getLayerSeries(),s=r.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function c(t){return t.name}o.x=0,o.y=l.y+u[0];var h=new HS(this._layersSeries||[],a,c,c),p=[];function f(e,n,s){var l=i._layers;if("remove"!==e){for(var u,c,h=[],f=[],d=a[n].indices,g=0;go&&(o=s),r.push(s)}for(var u=0;uo&&(o=h)}return{y0:i,max:o}}function hj(t){t.registerChartView(ij),t.registerSeriesModel(sj),t.registerLayout(lj),t.registerProcessor(Gk("themeRiver"))}var pj=2,fj=4,dj=function(t){function e(e,n,r,i){var o=t.call(this)||this;o.z2=pj,o.textConfig={inside:!0},mu(o).seriesIndex=n.seriesIndex;var a=new yu({z2:fj,silent:e.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,e,n,r,i),o}return v(e,t),e.prototype.updateData=function(t,e,n,r,i){this.node=e,e.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var o=this;mu(o).dataIndex=e.dataIndex;var a=e.getModel(),s=a.getModel("emphasis"),l=e.getLayout(),u=j({},l);u.label=null;var c=e.getVisual("style");c.lineJoin="bevel";var h=e.getVisual("decal");h&&(c.decal=z_(h,i));var p=Xk(a.getModel("itemStyle"),u,!0);j(u,p),Z(Iu,(function(t){var e=o.ensureState(t),n=a.getModel([t,"itemStyle"]);e.style=n.getItemStyle();var r=Xk(n,u);r&&(e.shape=r)})),t?(o.setShape(u),o.shape.r=l.r0,Ec(o,{shape:{r:l.r}},n,e.dataIndex)):(Ec(o,{shape:u},n),Fc(o)),o.useStyle(c),this._updateLabel(n);var f=a.getShallow("cursor");f&&o.attr("cursor",f),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var d=s.get("focus"),g="ancestor"===d?e.getAncestorsIndices():"descendant"===d?e.getDescendantIndices():d;xc(this,g,s.get("blurScope"))},e.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),r=n.getModel("label"),i=this.node.getLayout(),o=i.endAngle-i.startAngle,a=(i.startAngle+i.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,c=u.getTextContent(),h=this.node.dataIndex,p=r.get("minAngle")/180*Math.PI,f=r.get("show")&&!(null!=p&&Math.abs(o)Math.PI/2?"right":"left"):w&&"center"!==w?"left"===w?(y=i.r0+b,a>Math.PI/2&&(w="right")):"right"===w&&(y=i.r-b,a>Math.PI/2&&(w="left")):(y=(i.r+i.r0)/2,w="center"),f.style.align=w,f.style.verticalAlign=d(o,"verticalAlign")||"middle",f.x=y*s+i.cx,f.y=y*l+i.cy;var S=d(o,"rotate"),M=0;"radial"===S?(M=-a,M<-Math.PI/2&&(M+=Math.PI)):"tangential"===S?(M=Math.PI/2-a,M>Math.PI/2?M-=Math.PI:M<-Math.PI/2&&(M+=Math.PI)):"number"===typeof S&&(M=S*Math.PI/180),f.rotation=M})),c.dirtyStyle()},e}(Dm),gj=dj,vj="sunburstRootToNode",yj="sunburstHighlight",mj="sunburstUnhighlight";function xj(t){t.registerAction({type:vj,update:"updateView"},(function(t,e){function n(e,n){var r=RE(t,[vj],e);if(r){var i=e.getViewRoot();i&&(t.direction=zE(i,r.node)?"rollUp":"drillDown"),e.resetViewRoot(r.node)}}e.eachComponent({mainType:"series",subType:"sunburst",query:t},n)})),t.registerAction({type:yj,update:"none"},(function(t,e,n){function r(e){var n=RE(t,[yj],e);n&&(t.dataIndex=n.node.dataIndex)}t=j({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},r),n.dispatchAction(j(t,{type:"highlight"}))})),t.registerAction({type:mj,update:"updateView"},(function(t,e,n){t=j({},t),n.dispatchAction(j(t,{type:"downplay"}))}))}var _j=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n,r){var i=this;this.seriesModel=t,this.api=n,this.ecModel=e;var o=t.getData(),a=o.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),c=[];s.eachNode((function(t){c.push(t)}));var h=this._oldChildren||[];function p(t,e){function n(t){return t.getId()}function r(n,r){var i=null==n?null:t[n],o=null==r?null:e[r];f(i,o)}0===t.length&&0===e.length||new HS(e,t,n,n).add(r).update(r).remove(it(r,null)).execute()}function f(r,i){if(u||!r||r.getValue()||(r=null),r!==a&&i!==a)if(i&&i.piece)r?(i.piece.updateData(!1,r,t,e,n),o.setItemGraphicEl(r.dataIndex,i.piece)):d(i);else if(r){var s=new gj(r,t,e,n);l.add(s),o.setItemGraphicEl(r.dataIndex,s)}}function d(t){t&&t.piece&&(l.remove(t.piece),t.piece=null)}function g(r,o){o.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,t,e,n):(i.virtualPiece=new gj(r,t,e,n),l.add(i.virtualPiece)),o.piece.off("click"),i.virtualPiece.on("click",(function(t){i._rootToNode(o.parentNode)}))):i.virtualPiece&&(l.remove(i.virtualPiece),i.virtualPiece=null)}p(c,h),g(a,s),this._initEvents(),this._oldChildren=c},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var n=!1,r=t.seriesModel.getViewRoot();r.eachNode((function(r){if(!n&&r.piece&&r.piece===e.target){var i=r.getModel().get("nodeClick");if("rootToNode"===i)t._rootToNode(r);else if("link"===i){var o=r.getModel(),a=o.get("link");if(a){var s=o.get("target",!0)||"_blank";Ap(a,s)}}n=!0}}))}))},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:vj,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,e){var n=e.getData(),r=n.getItemLayout(0);if(r){var i=t[0]-r.cx,o=t[1]-r.cy,a=Math.sqrt(i*i+o*o);return a<=r.r&&a>=r.r0}},e.type="sunburst",e}(Dv),bj=_j,wj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return v(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};Sj(n);var r=this._levelModels=K(t.levels||[],(function(t){return new vh(t,this,e)}),this),i=EE.createTree(n,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=i.getNodeByDataIndex(e),o=r[n.depth];return o&&(t.parentModel=o),t}))}return i.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=BE(r,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){KE(this)},e.type="series.sunburst",e.defaultOption={zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(yv);function Sj(t){var e=0;Z(t.children,(function(t){Sj(t);var n=t.value;ot(n)&&(n=n[0]),e+=n}));var n=t.value;ot(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),ot(t.value)?t.value[0]=n:t.value=n}var Mj=wj,Cj=Math.PI/180;function Ij(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.get("center"),r=t.get("radius");ot(r)||(r=[0,r]),ot(e)||(e=[e,e]);var i=n.getWidth(),o=n.getHeight(),a=Math.min(i,o),s=lo(e[0],i),l=lo(e[1],o),u=lo(r[0],a/2),c=lo(r[1],a/2),h=-t.get("startAngle")*Cj,p=t.get("minAngle")*Cj,f=t.getData().tree.root,d=t.getViewRoot(),g=d.depth,v=t.get("sort");null!=v&&Tj(d,v);var y=0;Z(d.children,(function(t){!isNaN(t.getValue())&&y++}));var m=d.getValue(),x=Math.PI/(m||y)*2,_=d.depth>0,b=d.height-(_?-1:1),w=(c-u)/(b||1),S=t.get("clockwise"),M=t.get("stillShowZeroSum"),C=S?1:-1,I=function(e,n){if(e){var r=n;if(e!==f){var i=e.getValue(),o=0===m&&M?x:i*x;o1)i=i.parentNode;var o=n.getColorFromPalette(i.name||i.dataIndex+"",e);return t.depth>1&&"string"===typeof o&&(o=zn(o,(t.depth-1)/(r-1)*.5)),o}t.eachSeriesByType("sunburst",(function(t){var e=t.getData(),r=e.tree;r.eachNode((function(i){var o=i.getModel(),a=o.getModel("itemStyle").getItemStyle();a.fill||(a.fill=n(i,t,r.root.height));var s=e.ensureUniqueItemVisual(i.dataIndex,"style");j(s,a)}))}))}function kj(t){t.registerChartView(bj),t.registerSeriesModel(Mj),t.registerLayout(it(Ij,"sunburst")),t.registerProcessor(it(Gk,"sunburst")),t.registerVisual(Dj),xj(t)}var Lj={x:1,y:1,scaleX:1,scaleY:1,originX:1,originY:1,rotation:1},Oj={color:"fill",borderColor:"stroke"},Pj={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Ej=na(),Rj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return zM(null,this)},e.prototype.getDataParams=function(e,n,r){var i=t.prototype.getDataParams.call(this,e,n);return r&&(i.info=Ej(r).info),i},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},e}(yv),Nj=Rj;function zj(t,e){return e=e||[0,0],K(["x","y"],(function(n,r){var i=this.getAxis(n),o=e[r],a=t[r]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))}),this)}function Bj(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:rt(zj,t)}}}function Vj(t,e){return e=e||[0,0],K([0,1],(function(n){var r=e[n],i=t[n]/2,o=[],a=[];return o[n]=r-i,a[n]=r+i,o[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function Fj(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){return t.dataToPoint(e)},size:rt(Vj,t)}}}function Gj(t,e){var n=this.getAxis(),r=e instanceof Array?e[0]:e,i=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function Hj(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:rt(Gj,t)}}}function jj(t,e){return e=e||[0,0],K(["Radius","Angle"],(function(n,r){var i="get"+n+"Axis",o=this[i](),a=e[r],s=t[r]/2,l="category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-s)-o.dataToCoord(a+s));return"Angle"===n&&(l=l*Math.PI/180),l}),this)}function Wj(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),r=e.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=e.dataToRadius(r[0]),o=n.dataToAngle(r[1]),a=t.coordToPoint([i,o]);return a.push(i,o*Math.PI/180),a},size:rt(jj,t)}}}function Uj(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}function qj(t,e,n,r){return t&&(t.legacy||!1!==t.legacy&&!n&&!r&&"tspan"!==e&&("text"===e||Ot(t,"text")))}function Xj(t,e,n){var r,i,o,a=t;if("text"===e)o=a;else{o={},Ot(a,"text")&&(o.text=a.text),Ot(a,"rich")&&(o.rich=a.rich),Ot(a,"textFill")&&(o.fill=a.textFill),Ot(a,"textStroke")&&(o.stroke=a.textStroke),Ot(a,"fontFamily")&&(o.fontFamily=a.fontFamily),Ot(a,"fontSize")&&(o.fontSize=a.fontSize),Ot(a,"fontStyle")&&(o.fontStyle=a.fontStyle),Ot(a,"fontWeight")&&(o.fontWeight=a.fontWeight),i={type:"text",style:o,silent:!0},r={};var s=Ot(a,"textPosition");n?r.position=s?a.textPosition:"inside":s&&(r.position=a.textPosition),Ot(a,"textPosition")&&(r.position=a.textPosition),Ot(a,"textOffset")&&(r.offset=a.textOffset),Ot(a,"textRotation")&&(r.rotation=a.textRotation),Ot(a,"textDistance")&&(r.distance=a.textDistance)}return Yj(o,t),Z(o.rich,(function(t){Yj(t,t)})),{textConfig:r,textContent:i}}function Yj(t,e){e&&(e.font=e.textFont||e.font,Ot(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),Ot(e,"textAlign")&&(t.align=e.textAlign),Ot(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),Ot(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),Ot(e,"textWidth")&&(t.width=e.textWidth),Ot(e,"textHeight")&&(t.height=e.textHeight),Ot(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),Ot(e,"textPadding")&&(t.padding=e.textPadding),Ot(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),Ot(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),Ot(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),Ot(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),Ot(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),Ot(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),Ot(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function $j(t,e,n){var r=t;r.textPosition=r.textPosition||n.position||"inside",null!=n.offset&&(r.textOffset=n.offset),null!=n.rotation&&(r.textRotation=n.rotation),null!=n.distance&&(r.textDistance=n.distance);var i=r.textPosition.indexOf("inside")>=0,o=t.fill||"#000";Zj(r,e);var a=null==r.textFill;return i?a&&(r.textFill=n.insideFill||"#fff",!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=o),null==r.textStrokeWidth&&(r.textStrokeWidth=2)):(a&&(r.textFill=t.fill||n.outsideFill||"#000"),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=e.text,r.rich=e.rich,Z(e.rich,(function(t){Zj(t,t)})),r}function Zj(t,e){e&&(Ot(e,"fill")&&(t.textFill=e.fill),Ot(e,"stroke")&&(t.textStroke=e.fill),Ot(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),Ot(e,"font")&&(t.font=e.font),Ot(e,"fontStyle")&&(t.fontStyle=e.fontStyle),Ot(e,"fontWeight")&&(t.fontWeight=e.fontWeight),Ot(e,"fontSize")&&(t.fontSize=e.fontSize),Ot(e,"fontFamily")&&(t.fontFamily=e.fontFamily),Ot(e,"align")&&(t.textAlign=e.align),Ot(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),Ot(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),Ot(e,"width")&&(t.textWidth=e.width),Ot(e,"height")&&(t.textHeight=e.height),Ot(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),Ot(e,"padding")&&(t.textPadding=e.padding),Ot(e,"borderColor")&&(t.textBorderColor=e.borderColor),Ot(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),Ot(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),Ot(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),Ot(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),Ot(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),Ot(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),Ot(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),Ot(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),Ot(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),Ot(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var Kj={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]};function Jj(t,e,n){var r=t[n],i=Kj[n];r&&(e[i[0]]=r[0],e[i[1]]=r[1])}function Qj(t,e,n){null!=t[n]&&(e[n]=t[n])}function tW(t,e,n){n&&(t[e]=n[e])}function eW(t,e,n,r,i){var o=n[t];if(o){var a,s=e[t],l=o.enterFrom;if(i&&l){!a&&(a=r[t]={});for(var u=et(l),c=0;c=0){!a&&(a=r[t]={});var d=et(s);for(c=0;c=0){var f=t.getAnimationStyleProps(),d=f?f.style:null;if(d){!o&&(o=r.style={});var g=et(n);for(u=0;u=0?e.getStore().get(i,n):void 0}var o=e.get(r.name,n),a=r&&r.ordinalMeta;return a?a.categories[o]:o}function w(n,r){null==r&&(r=s);var i=e.getItemVisual(r,"style"),o=i&&i.fill,a=i&&i.opacity,l=m(r,uW).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:st(o)?o:"#000"},c=x(r,uW),h=Xc(c,null,u,!1,!0);h.text=c.getShallow("show")?xt(t.getFormattedLabel(r,uW),ZA(e,r)):null;var p=Yc(c,u,!1);return C(n,l),l=$j(l,h,p),n&&M(l,n),l.legacy=!0,l}function S(n,r){null==r&&(r=s);var i=m(r,lW).getItemStyle(),o=x(r,lW),a=Xc(o,null,null,!0,!0);a.text=o.getShallow("show")?_t(t.getFormattedLabel(r,lW),t.getFormattedLabel(r,uW),ZA(e,r)):null;var l=Yc(o,null,!0);return C(n,i),i=$j(i,a,l),n&&M(i,n),i.legacy=!0,i}function M(t,e){for(var n in e)Ot(e,n)&&(t[n]=e[n])}function C(t,e){t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}function I(t,n){if(null==n&&(n=s),Ot(Oj,t)){var r=e.getItemVisual(n,"style");return r?r[Oj[t]]:null}if(Ot(Pj,t))return e.getItemVisual(n,t)}function T(t){if("cartesian2d"===o.type){var e=o.getBaseAxis();return lC(W({axis:e},t))}}function A(){return n.getCurrentSeriesIndices()}function D(t){return eh(t,n)}}function RW(t){var e={};return Z(t.dimensions,(function(n){var r=t.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim,o=e[i]=e[i]||[];o[r.coordDimIndex]=t.getDimensionIndex(n)}})),e}function NW(t,e,n,r,i,o,a){if(r){var s=zW(t,e,n,r,i,o,!0);return s&&a.setItemGraphicEl(n,s),s&&xc(s,r.focus,r.blurScope),s}o.remove(e)}function zW(t,e,n,r,i,o,a){var s=-1,l=e;e&&BW(e,r,i)&&(s=q(o.childrenRef(),e),e=null);var u=!e,c=e;c?c.clearStates():(c=SW(r),l&&_W(l,c)),!1===r.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),vW.normal.cfg=vW.normal.conOpt=vW.emphasis.cfg=vW.emphasis.conOpt=vW.blur.cfg=vW.blur.conOpt=vW.select.cfg=vW.select.conOpt=null,vW.isLegacy=!1,FW(c,n,r,i,u,vW),VW(c,n,r,i,u),MW(t,c,n,r,vW,i,u,!1);for(var h=0;h=0?o.replaceAt(c,s):o.add(c),c}function BW(t,e,n){var r=Ej(t),i=e.type,o=e.shape,a=e.style;return n.isUniversalTransitionEnabled()||null!=i&&i!==r.customGraphicType||"path"===i&&KW(o)&&ZW(o)!==r.customPathData||"image"===i&&Ot(a,"image")&&a.image!==r.customImagePath}function VW(t,e,n,r,i){var o=n.clipPath;if(!1===o)t&&t.getClipPath()&&t.removeClipPath();else if(o){var a=t.getClipPath();a&&BW(a,o,r)&&(a=null),a||(a=SW(o),t.setClipPath(a)),MW(null,a,e,o,null,r,i,!1)}}function FW(t,e,n,r,i,o){if(!t.isGroup){GW(n,null,o),GW(n,lW,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=t.getTextContent();if(!1===a)c&&t.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=SW(a),t.setTextContent(c)),MW(null,c,e,a,null,r,i,!0);for(var h=a&&a.style,p=0;p=c;h--)$W(e.childAt(h),i,e)}}function UW(t){new HS(t.oldChildren,t.newChildren,qW,qW,t).add(XW).update(XW).remove(YW).execute()}function qW(t,e){var n=t&&t.name;return null!=n?n:gW+e}function XW(t,e){var n=this.context,r=null!=t?n.newChildren[t]:null,i=null!=e?n.oldChildren[e]:null;zW(n.api,i,n.dataIndex,r,n.seriesModel,n.group,!1)}function YW(t){var e=this.context,n=e.oldChildren[t];$W(n,e.seriesModel,e.group)}function $W(t,e,n){if(t){var r=Ej(t).leaveToProps;r?Ec(t,r,e,{cb:function(){n.remove(t)}}):n.remove(t)}}function ZW(t){return t&&(t.pathData||t.d)}function KW(t){return t&&(Ot(t,"pathData")||Ot(t,"d"))}function JW(t){t.registerChartView(wW),t.registerSeriesModel(Nj)}var QW=na(),tU=F,eU=rt,nU=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,n,r){var i=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,r||this._lastValue!==i||this._lastStatus!==o){this._lastValue=i,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,i,t,e,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(t,e);if(a){var h=it(rU,e,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,e)}else a=this._group=new Ui,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);sU(a,e,!0),this._renderHandle(i)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),r=t.axis,i="category"===r.type,o=e.get("snap");if(!o&&!i)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(i&&r.getBandWidth()>a)return!0;if(o){var s=lO(t).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,r,i){},t.prototype.createPointerEl=function(t,e,n,r){var i=e.pointer;if(i){var o=QW(t).pointerEl=new l[i.type](tU(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,r){if(e.label){var i=QW(t).labelEl=new yu(tU(e.label));t.add(i),oU(i,r)}},t.prototype.updatePointerEl=function(t,e,n){var r=QW(t).pointerEl;r&&e.pointer&&(r.setStyle(e.pointer.style),n(r,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,r){var i=QW(t).labelEl;i&&(i.setStyle(e.label.style),n(i,{x:e.label.x,y:e.label.y}),oU(i,r))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return i&&r.remove(i),void(this._handle=null);this._handle||(e=!0,i=this._handle=Nx(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){ke(t.event)},onmousedown:eU(this._onHandleDragMove,this,0,0),drift:eU(this._onHandleDragMove,this),ondragend:eU(this._onHandleDragEnd,this)}),r.add(i)),sU(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");ot(s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,Ev(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){rU(this._axisPointerModel,!e&&this._moveAnimation,this._handle,aU(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(aU(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(aU(r)),QW(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,r=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),r&&e.remove(r),this._group=null,this._handle=null,this._payloadInfo=null)},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}},t}();function rU(t,e,n,r){iU(QW(n).lastProp,r)||(QW(n).lastProp=r,e?Ec(n,r,t):(n.stopAnimation(),n.attr(r)))}function iU(t,e){if(ct(t)&&ct(e)){var n=!0;return Z(e,(function(e,r){n=n&&iU(t[r],e)})),!!n}return t===e}function oU(t,e){t[e.get(["label","show"])?"show":"hide"]()}function aU(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function sU(t,e,n){var r=e.get("z"),i=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=r&&(t.z=r),null!=i&&(t.zlevel=i),t.silent=n)}))}var lU=nU;function uU(t){var e,n=t.get("type"),r=t.getModel(n+"Style");return"line"===n?(e=r.getLineStyle(),e.fill=null):"shadow"===n&&(e=r.getAreaStyle(),e.stroke=null),e}function cU(t,e,n,r,i){var o=n.get("value"),a=pU(o,e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),s=n.getModel("label"),l=gp(s.get("padding")||0),u=s.getFont(),c=Ii(a,u),h=i.position,p=c.width+l[1]+l[3],f=c.height+l[0]+l[2],d=i.align;"right"===d&&(h[0]-=p),"center"===d&&(h[0]-=p/2);var g=i.verticalAlign;"bottom"===g&&(h[1]-=f),"middle"===g&&(h[1]-=f/2),hU(h,p,f,r);var v=s.get("backgroundColor");v&&"auto"!==v||(v=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:Xc(s,{text:a,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function hU(t,e,n,r){var i=r.getWidth(),o=r.getHeight();t[0]=Math.min(t[0]+e,i)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function pU(t,e,n,r,i){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:i.precision}),a=i.formatter;if(a){var s={value:QC(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};Z(r,(function(t){var e=n.getSeriesByIndex(t.seriesIndex),r=t.dataIndexInside,i=e&&e.getDataParams(r);i&&s.seriesData.push(i)})),st(a)?o=a.replace("{value}",o):at(a)&&(o=a(s))}return o}function fU(t,e,n){var r=Gr();return qr(r,r,n.rotation),Ur(r,r,n.position),Dx([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function dU(t,e,n,r,i,o){var a=tO.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get(["label","margin"]),cU(e,r,i,o,{position:fU(r.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function gU(t,e,n){return n=n||0,{x1:t[n],y1:t[1-n],x2:e[n],y2:e[1-n]}}function vU(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}}function yU(t,e,n,r,i,o){return{cx:t,cy:e,r0:n,r:r,startAngle:i,endAngle:o,clockwise:!0}}var mU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.makeElOption=function(t,e,n,r,i){var o=n.axis,a=o.grid,s=r.get("type"),l=xU(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var c=uU(r),h=_U[s](o,u,l);h.style=c,t.graphicKey=h.type,t.pointer=h}var p=PL(a.model,n);dU(e,t,p,n,r,i)},e.prototype.getHandleTransform=function(t,e,n){var r=PL(e.axis.grid.model,e,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=fU(e.axis,t,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,r){var i=n.axis,o=i.grid,a=i.getGlobalExtent(!0),s=xU(o,i).getOtherAxis(i).getGlobalExtent(),l="x"===i.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];h[l]=u[l];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:h,tooltipOption:p[l]}},e}(lU);function xU(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var _U={line:function(t,e,n){var r=gU([e,n[0]],[e,n[1]],bU(t));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(t,e,n){var r=Math.max(1,t.getBandWidth()),i=n[1]-n[0];return{type:"Rect",shape:vU([e-r/2,n[0]],[r,i],bU(t))}}};function bU(t){return"x"===t.dim?0:1}var wU=mU,SU=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="axisPointer",e.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Up),MU=SU,CU=na(),IU=Z;function TU(t,e,n){if(!S.node){var r=e.getZr();CU(r).records||(CU(r).records={}),AU(r,e);var i=CU(r).records[t]||(CU(r).records[t]={});i.handler=n}}function AU(t,e){function n(n,r){t.on(n,(function(n){var i=OU(e);IU(CU(t).records,(function(t){t&&r(t,n,i.dispatchAction)})),DU(i.pendings,e)}))}CU(t).initialized||(CU(t).initialized=!0,n("click",it(LU,"click")),n("mousemove",it(LU,"mousemove")),n("globalout",kU))}function DU(t,e){var n,r=t.showTip.length,i=t.hideTip.length;r?n=t.showTip[r-1]:i&&(n=t.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function kU(t,e,n){t.handler("leave",null,n)}function LU(t,e,n,r){e.handler(t,n,r)}function OU(t){var e={showTip:[],hideTip:[]},n=function(r){var i=e[r.type];i?i.push(r):(r.dispatchAction=n,t.dispatchAction(r))};return{dispatchAction:n,pendings:e}}function PU(t,e){if(!S.node){var n=e.getZr(),r=(CU(n).records||{})[t];r&&(CU(n).records[t]=null)}}var EU=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r=e.getComponent("tooltip"),i=t.get("triggerOn")||r&&r.get("triggerOn")||"mousemove|click";TU("axisPointer",n,(function(t,e,n){"none"!==i&&("leave"===t||i.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){PU("axisPointer",e)},e.prototype.dispose=function(t,e){PU("axisPointer",e)},e.type="axisPointer",e}(xv),RU=EU;function NU(t,e){var n,r=[],i=t.seriesIndex;if(null==i||!(n=e.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=ea(o,t);if(null==a||a<0||ot(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,p=u.dim,f="x"===h||"radius"===h?1:0,d=o.mapDimension(p),g=[];g[f]=o.get(d,a),g[1-f]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(g)||[]}else r=l.dataToPoint(o.getValues(K(l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:s}}var zU=na();function BU(t,e,n){var r=t.currTrigger,i=[t.x,t.y],o=t,a=t.dispatchAction||rt(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){YU(i)&&(i=NU({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=YU(i),u=o.axesInfo,c=s.axesInfo,h="leave"===r||YU(i),p={},f={},d={list:[],map:{}},g={showPointer:it(GU,f),showTooltip:it(HU,d)};Z(s.coordSysMap,(function(t,e){var n=l||t.containPoint(i);Z(s.coordSysAxesInfo[e],(function(t,e){var r=t.axis,o=qU(u,t);if(!h&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=r.pointToData(i)),null!=a&&VU(t,a,g,!1,p)}}))}));var v={};return Z(c,(function(t,e){var n=t.linkGroup;n&&!f[e]&&Z(n.axesInfo,(function(e,r){var i=f[r];if(e!==t&&i){var o=i.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,XU(e),XU(t)))),v[t.key]=o}}))})),Z(v,(function(t,e){VU(c[e],t,g,!0,p)})),jU(f,c,p),WU(d,i,t,a),UU(c,a,n),p}}function VU(t,e,n,r,i){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=FU(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==i.seriesIndex&&j(i,s[0]),!r&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function FU(t,e){var n=e.axis,r=n.dim,i=t,o=[],a=Number.MAX_VALUE,s=-1;return Z(e.seriesModels,(function(e,l){var u,c,h=e.getData().mapDimensionsAll(r);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(h,t,n);c=p.dataIndices,u=p.nestestValue}else{if(c=e.getData().indicesOfNearest(h[0],t,"category"===n.type?.5:null),!c.length)return;u=e.getData().get(h[0],c[0])}if(null!=u&&isFinite(u)){var f=t-u,d=Math.abs(f);d<=a&&((d=0&&s<0)&&(a=d,s=f,i=u,o.length=0),Z(c,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:i}}function GU(t,e,n,r){t[e.key]={value:n,payloadBatch:r}}function HU(t,e,n,r){var i=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&i.length){var l=e.coordSys.model,u=hO(l),c=t.map[u];c||(c=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function jU(t,e,n){var r=n.axesInfo=[];Z(e,(function(e,n){var i=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(i.status="show"),i.value=o.value,i.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(i.status="hide"),"show"===i.status&&r.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:i.value})}))}function WU(t,e,n,r){if(!YU(e)&&t.list.length){var i=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:t.list})}else r({type:"hideTip"})}function UU(t,e,n){var r=n.getZr(),i="axisPointerLastHighlights",o=zU(r)[i]||{},a=zU(r)[i]={};Z(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&Z(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];Z(o,(function(t,e){!a[e]&&l.push(t)})),Z(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function qU(t,e){for(var n=0;n<(t||[]).length;n++){var r=t[n];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}function XU(t){var e=t.axis.model,n={},r=n.axisDim=t.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=e.componentIndex,n.axisName=n[r+"AxisName"]=e.name,n.axisId=n[r+"AxisId"]=e.id,n}function YU(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function $U(t){dO.registerAxisPointerClass("CartesianAxisPointer",wU),t.registerComponentModel(MU),t.registerComponentView(RU),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!ot(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=eO(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},BU)}function ZU(t){BS(IO),BS($U)}var KU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.makeElOption=function(t,e,n,r,i){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o),l=s.getExtent(),u=o.dataToCoord(e),c=r.get("type");if(c&&"none"!==c){var h=uU(r),p=QU[c](o,a,u,l);p.style=h,t.graphicKey=p.type,t.pointer=p}var f=r.get(["label","margin"]),d=JU(e,n,r,a,f);cU(t,n,r,i,d)},e}(lU);function JU(t,e,n,r,i){var o=e.axis,a=o.dataToCoord(t),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,c,h=r.getRadiusAxis().getExtent();if("radius"===o.dim){var p=Gr();qr(p,p,s),Ur(p,p,[r.cx,r.cy]),l=Dx([a,-i],p);var f=e.getModel("axisLabel").get("rotate")||0,d=tO.innerTextLayout(s,f*Math.PI/180,-1);u=d.textAlign,c=d.textVerticalAlign}else{var g=h[1];l=r.coordToPoint([g+i,a]);var v=r.cx,y=r.cy;u=Math.abs(l[0]-v)/g<.3?"center":l[0]>v?"left":"right",c=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}var QU={line:function(t,e,n,r){return"angle"===t.dim?{type:"Line",shape:gU(e.coordToPoint([r[0],n]),e.coordToPoint([r[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,r){var i=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:yU(e.cx,e.cy,r[0],r[1],(-n-i/2)*o,(i/2-n)*o)}:{type:"Sector",shape:yU(e.cx,e.cy,n-i/2,n+i/2,0,2*Math.PI)}}},tq=KU,eq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.findAxisModel=function(t){var e,n=this.ecModel;return n.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"80%"},e}(Up),nq=eq,rq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",aa).models[0]},e.type="polarAxis",e}(Up);Y(rq,aI);var iq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="angleAxis",e}(rq),oq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="radiusAxis",e}(rq),aq=function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return v(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(LI);aq.prototype.dataToRadius=LI.prototype.dataToCoord,aq.prototype.radiusToData=LI.prototype.coordToData;var sq=aq,lq=na(),uq=function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return v(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var o=r[0],a=t.dataToCoord(o+1)-t.dataToCoord(o),s=Math.abs(a),l=Ii(null==o?"":o+"",e.getFont(),"center","top"),u=Math.max(l.height,7),c=u/s;isNaN(c)&&(c=1/0);var h=Math.max(0,Math.floor(c)),p=lq(t.model),f=p.lastAutoInterval,d=p.lastTickCount;return null!=f&&null!=d&&Math.abs(f-h)<=1&&Math.abs(d-i)<=1&&f>h?h=f:(p.lastTickCount=i,p.lastAutoInterval=h),h},e}(LI);uq.prototype.dataToAngle=LI.prototype.dataToCoord,uq.prototype.angleToData=LI.prototype.coordToData;var cq=uq,hq=["radius","angle"],pq=function(){function t(t){this.dimensions=hq,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new sq,this._angleAxis=new cq,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){var e="_"+t+"Axis";return this[e]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===t&&e.push(n),r.scale.type===t&&e.push(r),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),o=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);r.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;var l=Math.atan2(-n,e)/Math.PI*180,u=la)l+=360*u;return[s,l]},t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI,r=Math.cos(n)*e+this.cx,i=-Math.sin(n)*e+this.cy;return[r,i]},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis(),n=e.getExtent().slice();n[0]>n[1]&&n.reverse();var r=t.getExtent(),i=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-r[0]*i,endAngle:-r[1]*i,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,r=e-this.cy,i=n*n+r*r,o=this.r,a=this.r0;return i<=o*o&&i>=a*a}}},t.prototype.convertToPixel=function(t,e,n){var r=fq(e);return r===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var r=fq(e);return r===this?this.pointToData(n):null},t}();function fq(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}var dq=pq;function gq(t,e,n){var r=e.get("center"),i=n.getWidth(),o=n.getHeight();t.cx=lo(r[0],i),t.cy=lo(r[1],o);var a=t.getRadiusAxis(),s=Math.min(i,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:ot(l)||(l=[0,l]);var u=[lo(l[0],s),lo(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}function vq(t,e){var n=this,r=n.getAngleAxis(),i=n.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),t.eachSeries((function(t){if(t.coordinateSystem===n){var e=t.getData();Z(iI(e,"radius"),(function(t){i.scale.unionExtentFromData(e,t)})),Z(iI(e,"angle"),(function(t){r.scale.unionExtentFromData(e,t)}))}})),$C(r.scale,r.model),$C(i.scale,i.model),"category"===r.type&&!r.onBand){var o=r.getExtent(),a=360/r.scale.count();r.inverse?o[1]+=a:o[1]-=a,r.setExtent(o[0],o[1])}}function yq(t){return"angleAxis"===t.mainType}function mq(t,e){if(t.type=e.get("type"),t.scale=ZC(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),yq(e)){t.inverse=t.inverse!==e.get("clockwise");var n=e.get("startAngle");t.setExtent(n,n+(t.inverse?-360:360))}e.axis=t,t.model=e}var xq={dimensions:hq,create:function(t,e){var n=[];return t.eachComponent("polar",(function(t,r){var i=new dq(r+"");i.update=vq;var o=i.getRadiusAxis(),a=i.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");mq(o,s),mq(a,l),gq(i,t,e),n.push(i),t.coordinateSystem=i,i.model=t})),t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",aa).models[0];0,t.coordinateSystem=e.coordinateSystem}})),n}},_q=xq,bq=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function wq(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var r=t.coordToPoint([e[0],n]),i=t.coordToPoint([e[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function Sq(t){var e=t.getRadiusAxis();return e.inverse?0:1}function Mq(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var Cq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return v(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=K(n.getViewLabels(),(function(t){t=F(t);var e=n.scale,r="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=n.dataToCoord(r),t}));Mq(s),Mq(o),Z(bq,(function(e){!t.get([e,"show"])||n.scale.isBlank()&&"axisLine"!==e||Iq[e](this.group,t,r,o,a,i,s)}),this)}},e.type="angleAxis",e}(dO),Iq={axisLine:function(t,e,n,r,i,o){var a,s=e.getModel(["axisLine","lineStyle"]),l=Sq(n),u=l?0:1;a=0===o[u]?new Fy({shape:{cx:n.cx,cy:n.cy,r:o[l]},style:s.getLineStyle(),z2:1,silent:!0}):new Om({shape:{cx:n.cx,cy:n.cy,r:o[l],r0:o[u]},style:s.getLineStyle(),z2:1,silent:!0}),a.style.fill=null,t.add(a)},axisTick:function(t,e,n,r,i,o){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[Sq(n)],u=K(r,(function(t){return new zy({shape:wq(n,[l,l+s],t.coord)})}));t.add(Sx(u,{style:W(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,r,i,o){if(i.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[Sq(n)],c=[],h=0;hd?"left":"right",y=Math.abs(f[1]-g)/p<.3?"middle":f[1]>g?"top":"bottom";if(s&&s[h]){var m=s[h];ct(m)&&m.textStyle&&(a=new vh(m.textStyle,l,l.ecModel))}var x=new yu({silent:tO.isLabelSilent(e),style:Xc(a,{x:f[0],y:f[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:r.formattedLabel,align:v,verticalAlign:y})});if(t.add(x),c){var _=tO.makeAxisEventDataBase(e);_.targetType="axisLabel",_.value=r.rawLabel,mu(x).eventData=_}}),this)},splitLine:function(t,e,n,r,i,o){var a=e.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h=0?"p":"n",I=_;m&&(r[s][M]||(r[s][M]={p:_,n:_}),I=r[s][M][C]);var T=void 0,A=void 0,D=void 0,k=void 0;if("radius"===h.dim){var L=h.dataToCoord(S)-_,O=o.dataToCoord(M);Math.abs(L)=k})}}}))}function zq(t){var e={};Z(t,(function(t,n){var r=t.getData(),i=t.coordinateSystem,o=i.getBaseAxis(),a=Rq(i,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/r.count(),u=e[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},c=u.stacks;e[a]=u;var h=Eq(t);c[h]||u.autoWidthCount++,c[h]=c[h]||{width:0,maxWidth:0};var p=lo(t.get("barWidth"),l),f=lo(t.get("barMaxWidth"),l),d=t.get("barGap"),g=t.get("barCategoryGap");p&&!c[h].width&&(p=Math.min(u.remainedWidth,p),c[h].width=p,u.remainedWidth-=p),f&&(c[h].maxWidth=f),null!=d&&(u.gap=d),null!=g&&(u.categoryGap=g)}));var n={};return Z(e,(function(t,e){n[e]={};var r=t.stacks,i=t.bandWidth,o=lo(t.categoryGap,i),a=lo(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-o)/(l+(l-1)*a);u=Math.max(u,0),Z(r,(function(t,e){var n=t.maxWidth;n&&n=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),r=[],i="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),r[i]=e.toGlobalCoord(e.dataToCoord(+t)),r[1-i]=0===i?n.y+n.height/2:n.x+n.width/2,r},t.prototype.convertToPixel=function(t,e,n){var r=eX(e);return r===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var r=eX(e);return r===this?this.pointToData(n):null},t}();function eX(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}var nX=tX;function rX(t,e){var n=[];return t.eachComponent("singleAxis",(function(r,i){var o=new nX(r,t,e);o.name="single_"+i,o.resize(r,e),r.coordinateSystem=o,n.push(o)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",aa).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),n}var iX={create:rX,dimensions:Qq},oX=iX,aX=["x","y"],sX=["width","height"],lX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.makeElOption=function(t,e,n,r,i){var o=n.axis,a=o.coordinateSystem,s=hX(a,1-cX(o)),l=a.dataToPoint(e)[0],u=r.get("type");if(u&&"none"!==u){var c=uU(r),h=uX[u](o,l,s);h.style=c,t.graphicKey=h.type,t.pointer=h}var p=jq(n);dU(e,t,p,n,r,i)},e.prototype.getHandleTransform=function(t,e,n){var r=jq(e,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=fU(e.axis,t,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,r){var i=n.axis,o=i.coordinateSystem,a=cX(i),s=hX(o,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=hX(o,1-a),c=(u[1]+u[0])/2,h=[c,c];return h[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},e}(lU),uX={line:function(t,e,n){var r=gU([e,n[0]],[e,n[1]],cX(t));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(t,e,n){var r=t.getBandWidth(),i=n[1]-n[0];return{type:"Rect",shape:vU([e-r/2,n[0]],[r,i],cX(t))}}};function cX(t){return t.isHorizontal()?0:1}function hX(t,e){var n=t.getRect();return[n[aX[e]],n[aX[e]]+n[sX[e]]]}var pX=lX,fX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="single",e}(xv);function dX(t){BS($U),dO.registerAxisPointerClass("SingleAxisPointer",pX),t.registerComponentView(fX),t.registerComponentView(Yq),t.registerComponentModel(Zq),SL(t,"single",Zq,Zq.defaultOption),t.registerCoordinateSystem("single",oX)}var gX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(e,n,r){var i=Fp(e);t.prototype.init.apply(this,arguments),vX(e,i)},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),vX(this.option,e)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Up);function vX(t,e){var n,r=t.cellSize;n=ot(r)?r:t.cellSize=[r,r],1===n.length&&(n[1]=n[0]);var i=K([0,1],(function(t){return zp(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]}));Vp(t,e,{type:"box",ignoreSize:i})}var yX=gX,mX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){var r=this.group;r.removeAll();var i=t.coordinateSystem,o=i.getRangeInfo(),a=i.getOrient(),s=e.getLocaleModel();this._renderDayRect(t,o,r),this._renderLines(t,o,a,r),this._renderYearText(t,o,a,r),this._renderMonthText(t,s,a,r),this._renderWeekText(t,s,o,a,r)},e.prototype._renderDayRect=function(t,e,n){for(var r=t.coordinateSystem,i=t.getModel("itemStyle").getItemStyle(),o=r.getCellWidth(),a=r.getCellHeight(),s=e.start.time;s<=e.end.time;s=r.getNextNDay(s,1).time){var l=r.dataToRect([s],!1).tl,u=new ru({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:i});n.add(u)}},e.prototype._renderLines=function(t,e,n,r){var i=this,o=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,c=0;u.time<=e.end.time;c++){p(u.formatedDate),0===c&&(u=o.getDateInfo(e.start.y+"-"+e.start.m));var h=u.date;h.setMonth(h.getMonth()+1),u=o.getDateInfo(h)}function p(e){i._firstDayOfMonth.push(o.getDateInfo(e)),i._firstDayPoints.push(o.dataToRect([e],!1).tl);var l=i._getLinePointsOfOneWeek(t,e,n);i._tlpoints.push(l[0]),i._blpoints.push(l[l.length-1]),s&&i._drawSplitline(l,a,r)}p(o.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,l,n),a,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,l,n),a,r)},e.prototype._getEdgesPoints=function(t,e,n){var r=[t[0].slice(),t[t.length-1].slice()],i="horizontal"===n?0:1;return r[0][i]=r[0][i]-e/2,r[1][i]=r[1][i]+e/2,r},e.prototype._drawSplitline=function(t,e,n){var r=new Hm({z2:20,shape:{points:t},style:e});n.add(r)},e.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var r=t.coordinateSystem,i=r.getDateInfo(e),o=[],a=0;a<7;a++){var s=r.getNextNDay(i.time,a),l=r.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,e){return"string"===typeof t&&t?Sp(t,e):"function"===typeof t?t(e):e.nameMap},e.prototype._yearTextPositionControl=function(t,e,n,r,i){var o=e[0],a=e[1],s=["center","bottom"];"bottom"===r?(a+=i,s=["center","top"]):"left"===r?o-=i:"right"===r?(o+=i,s=["center","top"]):a-=i;var l=0;return"left"!==r&&"right"!==r||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},e.prototype._renderYearText=function(t,e,n,r){var i=t.getModel("yearLabel");if(i.get("show")){var o=i.get("margin"),a=i.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===n?0:1,h={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},p=e.start.y;+e.end.y>+e.start.y&&(p=p+"-"+e.end.y);var f=i.get("formatter"),d={start:e.start.y,end:e.end.y,nameMap:p},g=this._formatterLabel(f,d),v=new yu({z2:30,style:Xc(i,{text:g})});v.attr(this._yearTextPositionControl(v,h[a],n,a,o)),r.add(v)}},e.prototype._monthTextPositionControl=function(t,e,n,r,i){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=i,e&&(o="center"),"start"===r&&(a="bottom")):(s+=i,e&&(a="middle"),"start"===r&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},e.prototype._renderMonthText=function(t,e,n,r){var i=t.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),a=i.get("margin"),s=i.get("position"),l=i.get("align"),u=[this._tlpoints,this._blpoints];o&&!st(o)||(o&&(e=Oh(o)||e),o=e.get(["time","monthAbbr"])||[]);var c="start"===s?0:1,h="horizontal"===n?0:1;a="start"===s?-a:a;for(var p="center"===l,f=0;f=r.start.time&&n.timea.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var r=Math.floor(n[1].time/_X)-Math.floor(n[0].time/_X)+1,i=new Date(n[0].time),o=i.getDate(),a=n[1].date.getDate();i.setDate(o+r-1);var s=i.getDate();if(s!==a){var l=i.getTime()-n[1].time>0?1:-1;while((s=i.getDate())!==a&&(i.getTime()-n[1].time)*l>0)r-=l,i.setDate(s-l)}var u=Math.floor((r+n[0].day+6)/7),c=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:r,weeks:u,nthWeek:c,fweek:n[0].day,lweek:n[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,n){var r=this._getRangeInfo(n);if(t>r.weeks||0===t&&er.lweek)return null;var i=7*(t-1)-r.fweek+e,o=new Date(r.start.time);return o.setDate(+r.start.d+i),this.getDateInfo(o)},t.create=function(e,n){var r=[];return e.eachComponent("calendar",(function(i){var o=new t(i,e,n);r.push(o),i.coordinateSystem=o})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=r[t.get("calendarIndex")||0])})),r},t.dimensions=["time","value"],t}();function wX(t){var e=t.calendarModel,n=t.seriesModel,r=e?e.coordinateSystem:n?n.coordinateSystem:null;return r}var SX=bX;function MX(t){t.registerComponentModel(yX),t.registerComponentView(xX),t.registerCoordinateSystem("calendar",SX)}var CX=na(),IX={path:null,compoundPath:null,group:Ui,image:Yl,text:yu},TX=function(t){var e=t.graphic;ot(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])},AX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventAutoZ=!0,n}return v(e,t),e.prototype.mergeOption=function(e,n){var r=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,e,n),this.option.elements=r},e.prototype.optionUpdated=function(t,e){var n=this.option,r=(e?n:t).elements,i=n.elements=e?[]:n.elements,o=[];this._flatten(r,o,null);var a=Vo(i,o,"normalMerge"),s=this._elOptionsToUpdate=[];Z(a,(function(t,e){var n=t.newOption;n&&(s.push(n),EX(t,n),RX(i,e,n),NX(i[e],n))}),this);for(var l=i.length-1;l>=0;l--)null==i[l]?i.splice(l,1):delete i[l].$action},e.prototype._flatten=function(t,e,n){Z(t,(function(t){if(t){n&&(t.parentOption=n),e.push(t);var r=t.children;"group"===t.type&&r&&this._flatten(r,e,t),delete t.children}}),this)},e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(Up),DX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(){this._elMap=Dt()},e.prototype.render=function(t,e,n){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,n)},e.prototype._updateElements=function(t){var e=t.useElOptionsToUpdate();if(e){var n=this._elMap,r=this.group;Z(e,(function(e){var i=Yo(e.id,null),o=null!=i?n.get(i):null,a=Yo(e.parentId,null),s=null!=a?n.get(a):r,l=e.type,u=e.style;"text"===l&&u&&e.hv&&e.hv[1]&&(u.textVerticalAlign=u.textBaseline=u.verticalAlign=u.align=null);var c=e.textContent,h=e.textConfig;if(u&&qj(u,l,!!h,!!c)){var p=Xj(u,l,!0);!h&&p.textConfig&&(h=e.textConfig=p.textConfig),!c&&p.textContent&&(c=p.textContent)}var f=OX(e);var d=e.$action||"merge";"merge"===d?o?o.attr(f):kX(i,s,f,n):"replace"===d?(LX(o,n),kX(i,s,f,n)):"remove"===d&&LX(o,n);var g=n.get(i);if(g&&c)if("merge"===d){var v=g.getTextContent();v?v.attr(c):g.setTextContent(new yu(c))}else"replace"===d&&g.setTextContent(new yu(c));if(g){var y=CX(g);y.__ecGraphicWidthOption=e.width,y.__ecGraphicHeightOption=e.height,zX(g,t,e),Gx({el:g,componentModel:t,itemName:g.name,itemTooltipOption:e.tooltip})}}))}},e.prototype._relocate=function(t,e){for(var n=t.option.elements,r=this.group,i=this._elMap,o=e.getWidth(),a=e.getHeight(),s=0;s=0;s--){l=n[s],u=Yo(l.id,null),c=null!=u?i.get(u):null;if(c){h=c.parent,d=CX(h);var g=h===r?{width:o,height:a}:{width:d.__ecGraphicWidth,height:d.__ecGraphicHeight};Np(c,l,g,null,{hv:l.hv,boundingMode:l.bounding})}}},e.prototype._clear=function(){var t=this._elMap;t.each((function(e){LX(e,t)})),this._elMap=Dt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(xv);function kX(t,e,n,r){var i=n.type;var o=Ot(IX,i)?IX[i]:mx(i);var a=new o(n);e.add(a),r.set(t,a),CX(a).__ecGraphicId=t}function LX(t,e){var n=t&&t.parent;n&&("group"===t.type&&t.traverse((function(t){LX(t,e)})),e.removeKey(CX(t).__ecGraphicId),n.remove(t))}function OX(t){return t=j({},t),Z(["id","parentId","$action","hv","bounding","textContent"].concat(kp),(function(e){delete t[e]})),t}function PX(t,e){var n;return Z(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}function EX(t,e){var n=t.existing;if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var r=e.parentOption;r?e.parentId=r.id:n&&(e.parentId=n.parentId)}e.parentOption=null}function RX(t,e,n){var r=j({},n),i=t[e],o=n.$action||"merge";"merge"===o?i?(G(i,r,!0),Vp(i,r,{ignoreSize:!0}),Gp(n,i)):t[e]=r:"replace"===o?t[e]=r:"remove"===o&&i&&(t[e]=null)}function NX(t,e){if(t&&(t.hv=e.hv=[PX(e,["left","right"]),PX(e,["top","bottom"])],"group"===t.type)){var n=t,r=e;null==n.width&&(n.width=r.width=0),null==n.height&&(n.height=r.height=0)}}function zX(t,e,n){var r=mu(t).eventData;t.silent||t.ignore||r||(r=mu(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),r&&(r.info=n.info)}function BX(t){t.registerComponentModel(AX),t.registerComponentView(DX),t.registerPreprocessor(TX)}var VX=["x","y","radius","angle","single"],FX=["cartesian2d","polar","singleAxis"];function GX(t){var e=t.get("coordinateSystem");return q(FX,e)>=0}function HX(t){return t+"Axis"}function jX(t,e){var n,r=Dt(),i=[],o=Dt();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||s(t)}));do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&l(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),i.push(t),u(t)}function l(t){var e=!1;return t.eachTargetAxis((function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)})),e}function u(t){t.eachTargetAxis((function(t,e){(r.get(t)||r.set(t,[]))[e]=!0}))}return i}function WX(t){var e=t.ecModel,n={infoList:[],infoMap:Dt()};return t.eachTargetAxis((function(t,r){var i=e.getComponent(HX(t),r);if(i){var o=i.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(i)}}})),n}var UX=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),qX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return v(e,t),e.prototype.init=function(t,e,n){var r=XX(t);this.settledOption=r,this.mergeDefaultAndTheme(t,n),this._doInit(r)},e.prototype.mergeOption=function(t){var e=XX(t);G(this.option,t,!0),G(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;Z([["start","startValue"],["end","endValue"]],(function(t,r){"value"===this._rangePropMode[r]&&(e[t[0]]=n[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=Dt(),n=this._fillSpecifiedTargetAxis(e);n?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return Z(VX,(function(n){var r=this.getReferringComponents(HX(n),sa);if(r.specified){e=!0;var i=new UX;Z(r.models,(function(t){i.add(t.componentIndex)})),t.set(n,i)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,r=!0;if(r){var i="vertical"===e?"y":"x",o=n.findComponents({mainType:i+"Axis"});a(o,i)}if(r){o=n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}});a(o,"single")}function a(e,n){var i=e[0];if(i){var o=new UX;if(o.add(i.componentIndex),t.set(n,o),r=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",aa).models[0];a&&Z(e,(function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",aa).models[0]&&o.add(t.componentIndex)}))}}}r&&Z(VX,(function(e){if(r){var i=n.findComponents({mainType:HX(e),filter:function(t){return"category"===t.get("type",!0)}});if(i[0]){var o=new UX;o.add(i[0].componentIndex),t.set(e,o),r=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");Z([["start","startValue"],["end","endValue"]],(function(r,i){var o=null!=t[r[0]],a=null!=t[r[1]];o&&!a?e[i]="percent":!o&&a?e[i]="value":n?e[i]=n[i]:o&&(e[i]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(HX(e),n))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,r){Z(n.indexList,(function(n){t.call(e,r,n)}))}))},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(HX(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;Z([["start","startValue"],["end","endValue"]],(function(r){null==t[r[0]]&&null==t[r[1]]||(e[r[0]]=n[r[0]]=t[r[0]],e[r[1]]=n[r[1]]=t[r[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;Z(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),r=0;ro[1];if(c&&!h&&!p)return!0;c&&(i=!0),h&&(e=!0),p&&(n=!0)}return i&&e&&n}))}else eY(r,(function(n){if("empty"===i)t.setData(e=e.map(n,(function(t){return a(t)?t:NaN})));else{var r={};r[n]=o,e.selectRange(r)}}));eY(r,(function(t){e.setApproximateExtent(o,t)}))}}))}function a(t){return t>=o[0]&&t<=o[1]}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;eY(["min","max"],(function(r){var i=e.get(r+"Span"),o=e.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=so(n[0]+o,n,[0,100],!0):null!=i&&(o=so(i,[0,100],n,!0)-n[0]),t[r+"Span"]=i,t[r+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var r=fo(n,[0,500]);r=Math.min(r,20);var i=t.axis.scale.rawExtentInfo;0!==e[0]&&i.setDeterminedMinMax("min",+n[0].toFixed(r)),100!==e[1]&&i.setDeterminedMinMax("max",+n[1].toFixed(r)),i.freeze()}},t}();function iY(t,e,n){var r=[1/0,-1/0];eY(n,(function(t){oI(r,t.getData(),e)}));var i=t.getAxisModel(),o=UC(i.axis.scale,i,r).calculate();return[o.min,o.max]}var oY=rY,aY={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(r,i){var o=t.getComponent(HX(r),i);e(r,i,o,n)}))}))}e((function(t,e,n,r){n.__dzAxisProxy=null}));var n=[];e((function(e,r,i,o){i.__dzAxisProxy||(i.__dzAxisProxy=new oY(e,r,o,t),n.push(i.__dzAxisProxy))}));var r=Dt();return Z(n,(function(t){Z(t.getTargetSeriesModels(),(function(t){r.set(t.uid,t)}))})),r},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),t.eachTargetAxis((function(n,r){t.getAxisProxy(n,r).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),r=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}}))}},sY=aY;function lY(t){t.registerAction("dataZoom",(function(t,e){var n=jX(e,t);Z(n,(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}var uY=!1;function cY(t){uY||(uY=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,sY),lY(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function hY(t){t.registerComponentModel(ZX),t.registerComponentView(tY),cY(t)}var pY=function(){function t(){}return t}(),fY={};function dY(t,e){fY[t]=e}function gY(t){return fY[t]}var vY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;Z(this.option.feature,(function(t,n){var r=gY(n);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(e)),G(t,r.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Up),yY=vY;function mY(t,e,n){var r=e.getBoxLayoutParams(),i=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Rp(r,o,i);Pp(e.get("orient"),t,e.get("itemGap"),a.width,a.height),Np(t,r,o,i)}function xY(t,e){var n=gp(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),t=new ru({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1}),t}var _Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(t,e,n,r){var i=this.group;if(i.removeAll(),t.get("show")){var o=+t.get("itemSize"),a=t.get("feature")||{},s=this._features||(this._features={}),l=[];Z(a,(function(t,e){l.push(e)})),new HS(this._featureNames||[],l).add(u).update(u).remove(it(u,null)).execute(),this._featureNames=l,mY(i,t,n),i.add(xY(i.getBoundingRect(),t)),i.eachChild((function(t){var e=t.__title,r=t.ensureState("emphasis"),a=r.textConfig||(r.textConfig={}),s=t.getTextContent(),l=s&&s.states.emphasis;if(l&&!at(l)&&e){var u=l.style||(l.style={}),c=Ii(e,yu.makeFont(u)),h=t.x+i.x,p=t.y+i.y+o,f=!1;p+c.height>n.getHeight()&&(a.position="top",f=!0);var d=f?-5-c.height:o+8;h+c.width/2>n.getWidth()?(a.position=["100%",d],u.align="right"):h-c.width/2<0&&(a.position=[0,d],u.align="left")}}))}function u(i,o){var u,h=l[i],p=l[o],f=a[h],d=new vh(f,t,t.ecModel);if(r&&null!=r.newTitle&&r.featureName===h&&(f.title=r.newTitle),h&&!p){if(bY(h))u={onclick:d.option.onclick,featureName:h};else{var g=gY(h);if(!g)return;u=new g}s[h]=u}else if(u=s[p],!u)return;u.uid=mh("toolbox-feature"),u.model=d,u.ecModel=e,u.api=n;var v=u instanceof pY;h||!p?!d.get("show")||v&&u.unusable?v&&u.remove&&u.remove(e,n):(c(d,u,h),d.setIconStatus=function(t,e){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,r[t]&&("emphasis"===e?nc:rc)(r[t])},u instanceof pY&&u.render&&u.render(d,e,n,r)):v&&u.dispose&&u.dispose(e,n)}function c(r,a,s){var l,u,c=r.getModel("iconStyle"),h=r.getModel(["emphasis","iconStyle"]),p=a instanceof pY&&a.getIcons?a.getIcons():r.get("icon"),f=r.get("title")||{};"string"===typeof p?(l={},l[s]=p):l=p,"string"===typeof f?(u={},u[s]=f):u=f;var d=r.iconPaths={};Z(l,(function(s,l){var p=Nx(s,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(c.getItemStyle());var f=p.ensureState("emphasis");f.style=h.getItemStyle();var g=new yu({style:{text:u[l],align:h.get("textAlign"),borderRadius:h.get("textBorderRadius"),padding:h.get("textPadding"),fill:null},ignore:!0});p.setTextContent(g),Gx({el:p,componentModel:t,itemName:l,formatterParamsExtra:{title:u[l]}}),p.__title=u[l],p.on("mouseover",(function(){var e=h.getItemStyle(),n="vertical"===t.get("orient")?null==t.get("right")?"right":"left":null==t.get("bottom")?"bottom":"top";g.setStyle({fill:h.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:h.get("textBackgroundColor")}),p.setTextConfig({position:h.get("textPosition")||n}),g.ignore=!t.get("showTitle"),nc(this)})).on("mouseout",(function(){"emphasis"!==r.get(["iconStatus",l])&&rc(this),g.hide()})),("emphasis"===r.get(["iconStatus",l])?nc:rc)(p),i.add(p),p.on("click",rt(a.onclick,a,e,n,l)),d[l]=p}))}},e.prototype.updateView=function(t,e,n,r){Z(this._features,(function(t){t instanceof pY&&t.updateView&&t.updateView(t.model,e,n,r)}))},e.prototype.remove=function(t,e){Z(this._features,(function(n){n instanceof pY&&n.remove&&n.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){Z(this._features,(function(n){n instanceof pY&&n.dispose&&n.dispose(t,e)}))},e.type="toolbox",e}(xv);function bY(t){return 0===t.indexOf("my")}var wY=_Y,SY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.onclick=function(t,e){var n=this.model,r=n.get("name")||t.get("title.0.text")||"echarts",i="svg"===e.getZr().painter.getType(),o=i?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")});if("function"!==typeof MouseEvent||!S.browser.newEdge&&(S.browser.ie||S.browser.edge))if(window.navigator.msSaveOrOpenBlob||i){var s=a.split(","),l=s[0].indexOf("base64")>-1,u=i?decodeURIComponent(s[1]):s[1];l&&(u=window.atob(u));var c=r+"."+o;if(window.navigator.msSaveOrOpenBlob){var h=u.length,p=new Uint8Array(h);while(h--)p[h]=u.charCodeAt(h);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,c)}else{var d=document.createElement("iframe");document.body.appendChild(d);var g=d.contentWindow,v=g.document;v.open("image/svg+xml","replace"),v.write(u),v.close(),g.focus(),v.execCommand("SaveAs",!0,c),document.body.removeChild(d)}}else{var y=n.get("lang"),m='',x=window.open();x.document.write(m),x.document.title=r}else{var _=document.createElement("a");_.download=r+"."+o,_.target="_blank",_.href=a;var b=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});_.dispatchEvent(b)}},e.getDefaultOption=function(t){var e={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return e},e}(pY);SY.prototype.unusable=!S.canvasSupported;var MY=SY,CY="__ec_magicType_stack__",IY=[["line","bar"],["stack"]],TY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return Z(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){var e={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return e},e.prototype.onclick=function(t,e,n){var r=this.model,i=r.get(["seriesIndex",n]);if(AY[n]){var o,a={series:[]},s=function(t){var e=t.subType,i=t.id,o=AY[n](e,i,t,r);o&&(W(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim,c=u+"Axis",h=t.getReferringComponents(c,aa).models[0],p=h.componentIndex;a[c]=a[c]||[];for(var f=0;f<=p;f++)a[c][p]=a[c][p]||{};a[c][p].boundaryGap="bar"===n}}};Z(IY,(function(t){q(t,n)>=0&&Z(t,(function(t){r.setIconStatus(t,"normal")}))})),r.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},s);var l=n;"stack"===n&&(o=G({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(l="tiled")),e.dispatchAction({type:"changeMagicType",currentType:l,newOption:a,newTitle:o,featureName:"magicType"})}},e}(pY),AY={line:function(t,e,n,r){if("bar"===t)return G({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(t,e,n,r){if("line"===t)return G({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(t,e,n,r){var i=n.get("stack")===CY;if("line"===t||"bar"===t)return r.setIconStatus("stack",i?"normal":"emphasis"),G({id:e,stack:i?"":CY},r.get(["option","stack"])||{},!0)}};SS({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));var DY=TY,kY=new Array(60).join("-"),LY="\t";function OY(t){var e={},n=[],r=[];return t.eachRawSeries((function(t){var i=t.coordinateSystem;if(!i||"cartesian2d"!==i.type&&"polar"!==i.type)n.push(t);else{var o=i.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;e[a]||(e[a]={categoryAxis:o,valueAxis:i.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),e[a].series.push(t)}else n.push(t)}})),{seriesGroupByCategoryAxis:e,other:n,meta:r}}function PY(t){var e=[];return Z(t,(function(t,n){var r=t.categoryAxis,i=t.valueAxis,o=i.dim,a=[" "].concat(K(t.series,(function(t){return t.name}))),s=[r.model.getCategories()];Z(t.series,(function(t){var e=t.getRawData();s.push(t.getRawData().mapArray(e.mapDimension(o),(function(t){return t})))}));for(var l=[a.join(LY)],u=0;u=0)return!0}var BY=new RegExp("["+LY+"]+","g");function VY(t){for(var e=t.split(/\n+/g),n=NY(e.shift()).split(BY),r=[],i=K(n,(function(t){return{name:t,data:[]}})),o=0;o=0;i--){var o=n[i];if(o[r])break}if(i<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:r})[0];if(a){var s=a.getPercentRange();n[0][r]={dataZoomId:r,start:s[0],end:s[1]}}}})),n.push(e)}function YY(t){var e=KY(t),n=e[e.length-1];e.length>1&&e.pop();var r={};return UY(n,(function(t,n){for(var i=e.length-1;i>=0;i--)if(t=e[i][n],t){r[n]=t;break}})),r}function $Y(t){qY(t).snapshots=null}function ZY(t){return KY(t).length}function KY(t){var e=qY(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var JY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.onclick=function(t,e){$Y(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var e={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return e},e}(pY);SS({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(t,e){e.resetOption("recreate")}));var QY=JY,t$=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],e$=function(){function t(t,e,n){var r=this;this._targetInfoList=[];var i=r$(e,t);Z(i$,(function(t,e){(!n||!n.include||q(n.include,e)>=0)&&t(i,r._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var r=s$[t.brushType](0,n,e);t.__rangeOffset={offset:u$[t.brushType](r.values,t.range,[1,1]),xyMinMax:r.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){Z(t,(function(t){var r=this.findTargetInfo(t,e);r&&!0!==r&&Z(r.coordSyses,(function(r){var i=s$[t.brushType](1,r,t.range,!0);n(t,i.values,r,e)}))}),this)},t.prototype.setInputRanges=function(t,e){Z(t,(function(t){var n=this.findTargetInfo(t,e);if(t.range=t.range||[],n&&!0!==n){t.panelId=n.panelId;var r=s$[t.brushType](0,n.coordSys,t.coordRange),i=t.__rangeOffset;t.range=i?u$[t.brushType](r.values,i.offset,h$(r.xyMinMax,i.xyMinMax)):r.values}}),this)},t.prototype.makePanelOpts=function(t,e){return K(this._targetInfoList,(function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:JV(r),isTargetByCursor:tF(r,t,n.coordSysModel),getLinearBrushOtherExtent:QV(r)}}))},t.prototype.controlSeries=function(t,e,n){var r=this.findTargetInfo(t,n);return!0===r||r&&q(r.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,r=r$(e,t),i=0;it[1]&&t.reverse(),t}function r$(t,e){return ia(t,e,{includeMainTypes:t$})}var i$={grid:function(t,e){var n=t.xAxisModels,r=t.yAxisModels,i=t.gridModels,o=Dt(),a={},s={};(n||r||i)&&(Z(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),Z(r,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),Z(i,(function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0})),o.each((function(t){var i=t.coordinateSystem,o=[];Z(i.getCartesians(),(function(t,e){(q(n,t.getAxis("x").model)>=0||q(r,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:a$.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})})))},geo:function(t,e){Z(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:a$.geo})}))}},o$=[function(t,e){var n=t.xAxisModel,r=t.yAxisModel,i=t.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],a$={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Ax(t)),e}},s$={lineX:it(l$,0),lineY:it(l$,1),rect:function(t,e,n,r){var i=t?e.pointToData([n[0][0],n[1][0]],r):e.dataToPoint([n[0][0],n[1][0]],r),o=t?e.pointToData([n[0][1],n[1][1]],r):e.dataToPoint([n[0][1],n[1][1]],r),a=[n$([i[0],o[0]]),n$([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,r){var i=[[1/0,-1/0],[1/0,-1/0]],o=K(n,(function(n){var o=t?e.pointToData(n,r):e.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o}));return{values:o,xyMinMax:i}}};function l$(t,e,n,r){var i=n.getAxis(["x","y"][t]),o=n$(K([0,1],(function(t){return e?i.coordToData(i.toLocalCoord(r[t]),!0):i.toGlobalCoord(i.dataToCoord(r[t]))}))),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var u$={lineX:it(c$,0),lineY:it(c$,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return K(t,(function(t,r){return[t[0]-n[0]*e[r][0],t[1]-n[1]*e[r][1]]}))}};function c$(t,e,n,r){return[e[0]-r[t]*n[0],e[1]-r[t]*n[1]]}function h$(t,e){var n=p$(t),r=p$(e),i=[n[0]/r[0],n[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function p$(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var f$=e$,d$=Z,g$=Ko("toolbox-dataZoom_"),v$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(t,e,n,r){this._brushController||(this._brushController=new KV(n.getZr()),this._brushController.on("brush",rt(this._onBrush,this)).mount()),_$(t,e,this,r,n),x$(t,e)},e.prototype.onclick=function(t,e,n){y$[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},r=this.ecModel;this._brushController.updateCovers([]);var i=new f$(m$(this.model),r,{include:["grid"]});i.matchOutputRanges(e,r,(function(t,e,n){if("cartesian2d"===n.type){var r=t.brushType;"rect"===r?(o("x",n,e[0]),o("y",n,e[1])):o({lineX:"x",lineY:"y"}[r],n,e)}})),XY(r,n),this._dispatchZoomAction(n)}function o(t,e,i){var o=e.getAxis(t),s=o.model,l=a(t,s,r),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(i=NB(0,i.slice(),o.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(n[l.id]={dataZoomId:l.id,startValue:i[0],endValue:i[1]})}function a(t,e,n){var r;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){var i=n.getAxisModel(t,e.componentIndex);i&&(r=n)})),r}},e.prototype._dispatchZoomAction=function(t){var e=[];d$(t,(function(t,n){e.push(F(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){var e={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return e},e}(pY),y$={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(YY(this.ecModel))}};function m$(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function x$(t,e){t.setIconStatus("back",ZY(e)>1?"emphasis":"normal")}function _$(t,e,n,r,i){var o=n._isZoomActive;r&&"takeGlobalCursor"===r.type&&(o="dataZoomSelect"===r.key&&r.dataZoomSelectActive),n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new f$(m$(t),e,{include:["grid"]}),s=a.makePanelOpts(i,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}gf("dataZoom",(function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var r=e.getModel(n),i=[],o=m$(r),a=ia(t,o);return d$(a.xAxisModels,(function(t){return s(t,"xAxis","xAxisIndex")})),d$(a.yAxisModels,(function(t){return s(t,"yAxis","yAxisIndex")})),i}function s(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:g$+e+o};a[n]=o,i.push(a)}}));var b$=v$;function w$(t){t.registerComponentModel(yY),t.registerComponentView(wY),dY("saveAsImage",MY),dY("magicType",DY),dY("dataView",WY),dY("dataZoom",b$),dY("restore",QY),BS(hY)}var S$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Up),M$=S$;function C$(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function I$(t){if(S.domSupported)for(var e=document.documentElement.style,n=0,r=t.length;n-1?(l+="top:50%",u+="translateY(-50%) rotate("+(o="left"===a?-225:-45)+"deg)"):(l+="left:50%",u+="translateX(-50%) rotate("+(o="top"===a?225:45)+"deg)");var c=o*Math.PI/180,h=s+i,p=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),f=Math.round(100*((p-Math.SQRT2*i)/2+Math.SQRT2*i-(p-h)/2))/100;l+=";"+a+":-"+f+"px";var d=e+" solid "+i+"px;",g=["position:absolute;width:"+s+"px;height:"+s+"px;",l+";"+u+";","border-bottom:"+d,"border-right:"+d,"background-color:"+r+";"];return'
'}function N$(t,e){var n="cubic-bezier(0.23,1,0.32,1)",r=" "+t/2+"s "+n,i="opacity"+r+",visibility"+r;return e||(r=" "+t+"s "+n,i+=S.transformSupported?","+O$+r:",left"+r+",top"+r),L$+":"+i}function z$(t,e,n){var r=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!S.transformSupported)return n?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var o=S.transform3dSupported,a="translate"+(o?"3d":"")+"("+r+","+i+(o?",0":"")+")";return n?"top:0;left:0;"+O$+":"+a+";":[["top",0],["left",0],[T$,a]]}function B$(t){var e=[],n=t.get("fontSize"),r=t.getTextColor();r&&e.push("color:"+r),e.push("font:"+t.getFont()),n&&e.push("line-height:"+Math.round(3*n/2)+"px");var i=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,a=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return i&&o&&e.push("text-shadow:"+a+"px "+s+"px "+o+"px "+i),Z(["decoration","align"],(function(n){var r=t.get(n);r&&e.push("text-"+n+":"+r)})),e.join(";")}function V$(t,e,n){var r=[],i=t.get("transitionDuration"),o=t.get("backgroundColor"),a=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),u=t.get("shadowOffsetY"),c=t.getModel("textStyle"),h=ev(t,"html"),p=l+"px "+u+"px "+a+"px "+s;return r.push("box-shadow:"+p),e&&i&&r.push(N$(i,n)),o&&(S.canvasSupported?r.push("background-color:"+o):(r.push("background-color:#"+Bn(o)),r.push("filter:alpha(opacity=70)"))),Z(["width","color","radius"],(function(e){var n="border-"+e,i=dp(n),o=t.get(i);null!=o&&r.push(n+":"+o+("color"===e?"":"px"))})),r.push(B$(c)),null!=h&&r.push("padding:"+gp(h).join("px ")+"px"),r.join(";")+";"}function F$(t,e,n,r,i){var o=e&&e.painter;if(n){var a=o&&o.getViewportRoot();a&&ge(t,a,document.body,r,i)}else{t[0]=r,t[1]=i;var s=o&&o.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var G$=function(){function t(t,e,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,S.wxa)return null;var r=document.createElement("div");r.domBelongToZr=!0,this.el=r;var i=this._zr=e.getZr(),o=this._appendToBody=n&&n.appendToBody;F$(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),o?document.body.appendChild(r):t.appendChild(r),this._container=t;var a=this;r.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},r.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler,n=i.painter.getViewportRoot();Ie(n,t,!0),e.dispatch("mousemove",t)}},r.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){var e=this._container,n=k$(e,"position"),r=e.style;"absolute"!==r.position&&"absolute"!==n&&(r.position="relative");var i=t.get("alwaysShowContent");i&&this._moveIfResized(),this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=P$+V$(t,!this._firstShow,this._longHide)+z$(i[0],i[1],!0)+"border-color:"+Tp(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,r,i){var o=this.el;if(null!=t){var a="";if(st(i)&&"item"===n.get("trigger")&&!C$(n)&&(a=R$(n,r,i)),st(t))o.innerHTML=t+a;else if(t){o.innerHTML="",ot(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,r):"leave"===t&&this._hide(r))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,r){if(r.from!==this.uid&&!S.node){var i=tZ(r,n);this._ticket="";var o=r.dataByCoordSys,a=oZ(r,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:r.position,positionDefault:"bottom"},i)}else if(r.tooltip&&null!=r.x&&null!=r.y){var l=K$;l.x=r.x,l.y=r.y,l.update(),mu(l).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:l},i)}else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,r))return;var u=NU(r,e),c=u.point[0],h=u.point[1];null!=c&&null!=h&&this._tryShow({offsetX:c,offsetY:h,target:u.el,position:r.position,positionDefault:"bottom"},i)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},e.prototype.manuallyHideTip=function(t,e,n,r){var i=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(tZ(r,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,r){var i=r.seriesIndex,o=r.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=e.getSeriesByIndex(i);if(s){var l=s.getData(),u=Q$([l.getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel);if("axis"===u.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}}},e.prototype._tryShow=function(t,e){var n=t.target,r=this._tooltipModel;if(r){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,a;this._lastDataByCoordSys=null,Dy(n,(function(t){return null!=mu(t).dataIndex?(o=t,!0):null!=mu(t).tooltipConfig?(a=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):a?this._showComponentItemTooltip(t,a,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=rt(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,r=this._tooltipModel,i=[e.offsetX,e.offsetY],o=Q$([e.tooltipOption],r),a=this._renderMode,s=[],l=jg("section",{blocks:[],noHeader:!0}),u=[],c=new nv;$$(t,(function(t){$$(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var i=pU(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),o=jg("section",{header:i,noHeader:!Mt(i),sortBlocks:!0,blocks:[]});l.blocks.push(o),Z(t.seriesDataIndices,(function(l){var h=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=h.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=QC(e.axis,{value:r}),f.axisValueLabel=i,f.marker=c.makeTooltipMarker("item",Tp(f.color),a);var d=Qd(h.formatTooltip(p,!0,null));d.markupFragment&&o.blocks.push(d.markupFragment),d.markupText&&u.push(d.markupText),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var h=e.position,p=o.get("order"),f=Xg(l,c,a,p,n.get("useUTC"),o.get("textStyle"));f&&u.unshift(f);var d="richText"===a?"\n\n":"
",g=u.join(d);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,h,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],h,null,c)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var r=this._ecModel,i=mu(e),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,u=i.dataType,c=s.getData(u),h=this._renderMode,p=t.positionDefault,f=Q$([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),d=f.get("trigger");if(null==d||"item"===d){var g=s.getDataParams(l,u),v=new nv;g.marker=v.makeTooltipMarker("item",Tp(g.color),h);var y=Qd(s.formatTooltip(l,!1,u)),m=f.get("order"),x=y.markupFragment?Xg(y.markupFragment,v,h,m,r.get("useUTC"),f.get("textStyle")):y.markupText,_="item_"+s.name+"_"+l;this._showOrMove(f,(function(){this._showTooltipContent(f,x,g,_,t.offsetX,t.offsetY,t.position,t.target,v)})),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var r=mu(e),i=r.tooltipConfig,o=i.option||{};if(st(o)){var a=o;o={content:a,formatter:a}}var s=[o],l=this._ecModel.getComponent(r.componentMainType,r.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=t.positionDefault,c=Q$(s,this._tooltipModel,u?{position:u}:null),h=c.get("content"),p=Math.random()+"",f=new nv;this._showOrMove(c,(function(){var n=F(c.get("formatterParams")||{});this._showTooltipContent(c,h,n,p,t.offsetX,t.offsetY,t.position,e,f)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,r,i,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent,c=t.get("formatter");a=a||t.get("position");var h=e,p=this._getNearestPoint([i,o],n,t.get("trigger"),t.get("borderColor")),f=p.color;if(c)if(st(c)){var d=t.ecModel.get("useUTC"),g=ot(n)?n[0]:n,v=g&&g.axisType&&g.axisType.indexOf("time")>=0;h=c,v&&(h=Yh(g.axisValue,h,d)),h=wp(h,n,!0)}else if(at(c)){var y=Y$((function(e,r){e===this._ticket&&(u.setContent(r,l,t,f,a),this._updatePosition(t,a,i,o,u,n,s))}),this);this._ticket=r,h=c(n,r,y)}else h=c;u.setContent(h,l,t,f,a),u.show(t,f),this._updatePosition(t,a,i,o,u,n,s)}},e.prototype._getNearestPoint=function(t,e,n,r){return"axis"===n||ot(e)?{color:r||("html"===this._renderMode?"#fff":"none")}:ot(e)?void 0:{color:r||e.color||e.borderColor}},e.prototype._doUpdatePosition=function(t,e,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=i.getSize(),c=t.get("align"),h=t.get("verticalAlign"),p=a&&a.getBoundingRect().clone();if(a&&p.applyTransform(a.transform),at(e)&&(e=e([n,r],o,i.el,p,{viewSize:[s,l],contentSize:u.slice()})),ot(e))n=Z$(e[0],s),r=Z$(e[1],l);else if(ct(e)){var f=e;f.width=u[0],f.height=u[1];var d=Rp(f,{width:s,height:l});n=d.x,r=d.y,c=null,h=null}else if(st(e)&&a){var g=rZ(e,p,u,t.get("borderWidth"));n=g[0],r=g[1]}else{g=eZ(n,r,i,s,l,c?null:20,h?null:20);n=g[0],r=g[1]}if(c&&(n-=iZ(c)?u[0]/2:"right"===c?u[0]:0),h&&(r-=iZ(h)?u[1]/2:"bottom"===h?u[1]:0),C$(t)){g=nZ(n,r,i,s,l);n=g[0],r=g[1]}i.moveTo(n,r)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===t.length;return i&&$$(n,(function(n,o){var a=n.dataByAxis||[],s=t[o]||{},l=s.dataByAxis||[];i=i&&a.length===l.length,i&&$$(a,(function(t,n){var o=l[n]||{},a=t.seriesDataIndices||[],s=o.seriesDataIndices||[];i=i&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===s.length,i&&$$(a,(function(t,e){var n=s[e];i=i&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),r&&Z(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!i},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){S.node||(this._tooltipContent.dispose(),PU("itemTooltip",e))},e.type="tooltip",e}(xv);function Q$(t,e,n){var r,i=e.ecModel;n?(r=new vh(n,i,i),r=new vh(e.option,r,i)):r=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof vh&&(a=a.get("tooltip",!0)),st(a)&&(a={formatter:a}),a&&(r=new vh(a,r,i)))}return r}function tZ(t,e){return t.dispatchAction||rt(e.dispatchAction,e)}function eZ(t,e,n,r,i,o,a){var s=n.getSize(),l=s[0],u=s[1];return null!=o&&(t+l+o+2>r?t-=l+o:t+=o),null!=a&&(e+u+a>i?e-=u+a:e+=a),[t,e]}function nZ(t,e,n,r,i){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,r)-a,e=Math.min(e+s,i)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function rZ(t,e,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=e.width,c=e.height;switch(t){case"inside":s=e.x+u/2-i/2,l=e.y+c/2-o/2;break;case"top":s=e.x+u/2-i/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-i/2,l=e.y+c+a;break;case"left":s=e.x-i-a,l=e.y+c/2-o/2;break;case"right":s=e.x+u+a,l=e.y+c/2-o/2}return[s,l]}function iZ(t){return"center"===t||"middle"===t}function oZ(t,e,n){var r=oa(t).queryOptionMap,i=r.keys()[0];if(i&&"series"!==i){var o=la(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(a){var s,l=n.getViewOfComponentModel(a);return l.group.traverse((function(e){var n=mu(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0})),s?{componentMainType:i,componentIndex:a.componentIndex,el:s}:void 0}}}var aZ=J$;function sZ(t){BS($U),t.registerComponentModel(M$),t.registerComponentView(aZ),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}))}var lZ=["rect","polygon","keep","clear"];function uZ(t,e){var n=Eo(t?t.brush:[]);if(n.length){var r=[];Z(n,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(r=r.concat(e))}));var i=t&&t.toolbox;ot(i)&&(i=i[0]),i||(i={feature:{}},t.toolbox=[i]);var o=i.feature||(i.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,r),cZ(s),e&&!s.length&&s.push.apply(s,lZ)}}function cZ(t){var e={};Z(t,(function(t){e[t]=1})),t.length=0,Z(e,(function(e,n){t.push(n)}))}var hZ=Z;function pZ(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function fZ(t,e,n){var r={};return hZ(e,(function(e){var o=r[e]=i();hZ(t[e],(function(t,r){if(WR.isValidType(r)){var i={type:r,visual:t};n&&n(i,e),o[r]=new WR(i),"opacity"===r&&(i=F(i),i.type="colorAlpha",o.__hidden.__alphaForOpacity=new WR(i))}}))})),r;function i(){var t=function(){};t.prototype.__hidden=t.prototype;var e=new t;return e}}function dZ(t,e,n){var r;Z(n,(function(t){e.hasOwnProperty(t)&&pZ(e[t])&&(r=!0)})),r&&Z(n,(function(n){e.hasOwnProperty(n)&&pZ(e[n])?t[n]=F(e[n]):delete t[n]}))}function gZ(t,e,n,r,i,o){var a,s={};function l(t){return Sy(n,a,t)}function u(t,e){Cy(n,a,t,e)}function c(t,c){a=null==o?t:c;var h=n.getRawDataItem(a);if(!h||!1!==h.visualMap)for(var p=r.call(i,t),f=e[p],d=s[p],g=0,v=d.length;ge[0][1]&&(e[0][1]=o[0]),o[1]e[1][1]&&(e[1][1]=o[1])}return e&&LZ(e)}};function LZ(t){return new xi(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var OZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new KV(e.getZr())).on("brush",rt(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,r){this.model=t,this._updateController(t,e,n,r)},e.prototype.updateTransform=function(t,e,n,r){MZ(e),this._updateController(t,e,n,r)},e.prototype.updateVisual=function(t,e,n,r){this.updateTransform(t,e,n,r)},e.prototype.updateView=function(t,e,n,r){this._updateController(t,e,n,r)},e.prototype._updateController=function(t,e,n,r){(!r||r.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:F(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:F(n),$from:e})},e.type="brush",e}(xv),PZ=OZ,EZ="#ddd",RZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.areas=[],n.brushOption={},n}return v(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&dZ(n,t,["inBrush","outOfBrush"]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:EZ},r.hasOwnProperty("liftZ")||(r.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=K(t,(function(t){return NZ(this.option,t)}),this))},e.prototype.setBrushOption=function(t){this.brushOption=NZ(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Up);function NZ(t,e){return G({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new vh(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var zZ=RZ,BZ=["rect","polygon","lineX","lineY","keep","clear"],VZ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(t,e,n){var r,i,o;e.eachComponent({mainType:"brush"},(function(t){r=t.brushType,i=t.brushOption.brushMode||"single",o=o||!!t.areas.length})),this._brushType=r,this._brushMode=i,Z(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===i:"clear"===e?o:e===r)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return Z(t.get("type",!0),(function(t){e[t]&&(n[t]=e[t])})),n},e.prototype.onclick=function(t,e,n){var r=this._brushType,i=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?r:r!==n&&n,brushMode:"keep"===n?"multiple"===i?"single":"multiple":i}})},e.getDefaultOption=function(t){var e={show:!0,type:BZ.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return e},e}(pY),FZ=VZ;function GZ(t){t.registerComponentView(PZ),t.registerComponentModel(zZ),t.registerPreprocessor(uZ),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,CZ),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(t,e){e.eachComponent({mainType:"brush",query:t},(function(e){e.setAreas(t.areas)}))})),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){})),dY("brush",FZ)}var HZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return v(e,t),e.type="title",e.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Up),jZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var r=this.group,i=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=xt(t.get("textBaseline"),t.get("textVerticalAlign")),l=new yu({style:Xc(i,{text:t.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=t.get("subtext"),h=new yu({style:Xc(o,{text:c,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),f=t.get("sublink"),d=t.get("triggerEvent",!0);l.silent=!p&&!d,h.silent=!f&&!d,p&&l.on("click",(function(){Ap(p,"_"+t.get("target"))})),f&&h.on("click",(function(){Ap(f,"_"+t.get("subtarget"))})),mu(l).eventData=mu(h).eventData=d?{componentType:"title",componentIndex:t.componentIndex}:null,r.add(l),c&&r.add(h);var g=r.getBoundingRect(),v=t.getBoxLayoutParams();v.width=g.width,v.height=g.height;var y=Rp(v,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||(a=t.get("left")||t.get("right"),"middle"===a&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||(s=t.get("top")||t.get("bottom"),"center"===s&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),r.x=y.x,r.y=y.y,r.markRedraw();var m={align:a,verticalAlign:s};l.setStyle(m),h.setStyle(m),g=r.getBoundingRect();var x=y.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var b=new ru({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:t.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});r.add(b)}},e.type="title",e}(xv);function WZ(t){t.registerComponentModel(HZ),t.registerComponentView(jZ)}var UZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}return v(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t,e=this.option,n=e.data||[],r=e.axisType,i=this._names=[];"category"===r?(t=[],Z(n,(function(e,n){var r,o=Yo(zo(e),"");ct(e)?(r=F(e),r.value=n):r=n,t.push(r),i.push(o)}))):t=n;var o={category:"ordinal",time:"time",value:"number"}[r]||"number",a=this._data=new mM([{name:"value",type:o}],this);a.initData(t,i)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",e.defaultOption={zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Up),qZ=UZ,XZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="timeline.slider",e.defaultOption=bh(qZ.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(qZ);Y(XZ,Jd.prototype);var YZ=XZ,$Z=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="timeline",e}(xv),ZZ=$Z,KZ=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r)||this;return o.type=i||"value",o}return v(e,t),e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(LI),JZ=KZ,QZ=Math.PI,tK=na(),eK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(t,e){this.api=e},e.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var r=this._layout(t,n),i=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(r,t);t.formatTooltip=function(t){var e=a.scale.getLabel({value:t});return jg("nameValue",{noName:!0,value:e})},Z(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](r,i,a,t)}),this),this._renderAxisLabel(r,o,a,t),this._position(r,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,e){var n,r=t.get(["label","position"]),i=t.get("orient"),o=rK(t,e);n=null==r||"auto"===r?"horizontal"===i?o.y+o.height/2=0||"+"===n?"left":"right"},c={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:QZ/2},p="vertical"===i?o.height:o.width,f=t.getModel("controlStyle"),d=f.get("show",!0),g=d?f.get("itemSize"):0,v=d?f.get("itemGap"):0,y=g+v,m=t.get(["label","rotate"])||0;m=m*QZ/180;var x=f.get("position",!0),_=d&&f.get("showPlayBtn",!0),b=d&&f.get("showPrevBtn",!0),w=d&&f.get("showNextBtn",!0),S=0,M=p;"left"===x||"bottom"===x?(_&&(a=[0,0],S+=y),b&&(s=[S,0],S+=y),w&&(l=[M-g,0],M-=y)):(_&&(a=[M-g,0],M-=y),b&&(s=[0,0],S+=y),w&&(l=[M-g,0],M-=y));var C=[S,M];return t.get("inverse")&&C.reverse(),{viewRect:o,mainLength:p,orient:i,rotation:h[i],labelRotation:m,labelPosOpt:n,labelAlign:t.get(["label","align"])||u[i],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||c[i],playPosition:a,prevBtnPosition:s,nextBtnPosition:l,axisExtent:C,controlSize:g,controlGap:v}},e.prototype._position=function(t,e){var n=this._mainGroup,r=this._labelGroup,i=t.viewRect;if("vertical"===t.orient){var o=Gr(),a=i.x,s=i.y+i.height;Ur(o,o,[-a,-s]),qr(o,o,-QZ/2),Ur(o,o,[a,s]),i=i.clone(),i.applyTransform(o)}var l=v(i),u=v(n.getBoundingRect()),c=v(r.getBoundingRect()),h=[n.x,n.y],p=[r.x,r.y];p[0]=h[0]=l[0][0];var f=t.labelPosOpt;if(null==f||st(f)){var d="+"===f?0:1;y(h,u,l,1,d),y(p,c,l,1,1-d)}else{d=f>=0?0:1;y(h,u,l,1,d),p[1]=h[1]+f}function g(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function v(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function y(t,e,n,r,i){t[r]+=n[r][i]-e[r][i]}n.setPosition(h),r.setPosition(p),n.rotation=r.rotation=t.rotation,g(n),g(r)},e.prototype._createAxis=function(t,e){var n=e.getData(),r=e.get("axisType"),i=nK(e,r);i.getTicks=function(){return n.mapArray(["value"],(function(t){return{value:t}}))};var o=n.getDataExtent("value");i.setExtent(o[0],o[1]),i.niceTicks();var a=new JZ("value",i,t.axisExtent,r);return a.model=e,a},e.prototype._createGroup=function(t){var e=this[t]=new Ui;return this.group.add(e),e},e.prototype._renderAxisLine=function(t,e,n,r){var i=n.getExtent();if(r.get(["lineStyle","show"])){var o=new zy({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:j({lineCap:"round"},r.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var a=this._progressLine=new zy({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:W({lineCap:"round",lineWidth:o.style.lineWidth},r.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},e.prototype._renderAxisTick=function(t,e,n,r){var i=this,o=r.getData(),a=n.scale.getTicks();this._tickSymbols=[],Z(a,(function(t){var a=n.dataToCoord(t.value),s=o.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),c=s.getModel(["progress","itemStyle"]),h={x:a,y:0,onclick:rt(i._changeTimeline,i,t.value)},p=oK(s,l,e,h);p.ensureState("emphasis").style=u.getItemStyle(),p.ensureState("progress").style=c.getItemStyle(),xc(p);var f=mu(p);s.get("tooltip")?(f.dataIndex=t.value,f.dataModel=r):f.dataIndex=f.dataModel=null,i._tickSymbols.push(p)}))},e.prototype._renderAxisLabel=function(t,e,n,r){var i=this,o=n.getLabelModel();if(o.get("show")){var a=r.getData(),s=n.getViewLabels();this._tickLabels=[],Z(s,(function(r){var o=r.tickValue,s=a.getItemModel(o),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),c=s.getModel(["progress","label"]),h=n.dataToCoord(r.tickValue),p=new yu({x:h,y:0,rotation:t.labelRotation-t.rotation,onclick:rt(i._changeTimeline,i,o),silent:!1,style:Xc(l,{text:r.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});p.ensureState("emphasis").style=Xc(u),p.ensureState("progress").style=Xc(c),e.add(p),xc(p),tK(p).dataIndex=o,i._tickLabels.push(p)}))}},e.prototype._renderControl=function(t,e,n,r){var i=t.controlSize,o=t.rotation,a=r.getModel("controlStyle").getItemStyle(),s=r.getModel(["emphasis","controlStyle"]).getItemStyle(),l=r.getPlayState(),u=r.get("inverse",!0);function c(t,n,l,u){if(t){var c=ki(xt(r.get(["controlStyle",n+"BtnSize"]),i),i),h=[0,-c/2,c,c],p=iK(r,n+"Icon",h,{x:t[0],y:t[1],originX:i/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});p.ensureState("emphasis").style=s,e.add(p),xc(p)}}c(t.nextBtnPosition,"next",rt(this._changeTimeline,this,u?"-":"+")),c(t.prevBtnPosition,"prev",rt(this._changeTimeline,this,u?"+":"-")),c(t.playPosition,l?"stop":"play",rt(this._handlePlayClick,this,!l),!0)},e.prototype._renderCurrentPointer=function(t,e,n,r){var i=r.getData(),o=r.getCurrentIndex(),a=i.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=rt(s._handlePointerDrag,s),t.ondragend=rt(s._handlePointerDragend,s),aK(t,s._progressLine,o,n,r,!0)},onUpdate:function(t){aK(t,s._progressLine,o,n,r)}};this._currentPointer=oK(a,a,this._mainGroup,{},this._currentPointer,l)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],r=this._axis,i=co(r.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(a[o]=+a[o].toFixed(p)),[a,h]}var MK={min:it(SK,"min"),max:it(SK,"max"),average:it(SK,"average"),median:it(SK,"median")};function CK(t,e){var n=t.getData(),r=t.coordinateSystem;if(e&&!wK(e)&&!ot(e.coord)&&r){var i=r.dimensions,o=IK(e,n,r,t);if(e=F(e),e.type&&MK[e.type]&&o.baseAxis&&o.valueAxis){var a=q(i,o.baseAxis.dim),s=q(i,o.valueAxis.dim),l=MK[e.type](n,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],c=0;c<2;c++)MK[u[c]]&&(u[c]=kK(n,n.mapDimension(i[c]),u[c]));e.coord=u}}return e}function IK(t,e,n,r){var i={};return null!=t.valueIndex||null!=t.valueDim?(i.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,i.valueAxis=n.getAxis(TK(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function TK(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}function AK(t,e){return!(t&&t.containData&&e.coord&&!bK(e))||t.containData(e.coord)}function DK(t,e){return t?function(t,n,r,i){var o=i<2?t.coord&&t.coord[i]:t.value;return rg(o,e[i])}:function(t,n,r,i){return rg(t.value,e[i])}}function kK(t,e,n){if("average"===n){var r=0,i=0;return t.each(e,(function(t,e){isNaN(t)||(r+=t,i++)})),r/i}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var LK=na(),OK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.init=function(){this.markerGroupMap=Dt()},e.prototype.render=function(t,e,n){var r=this,i=this.markerGroupMap;i.each((function(t){LK(t).keep=!1})),e.eachSeries((function(t){var i=mK.getMarkerModelFromSeries(t,r.type);i&&r.renderSeries(t,i,e,n)})),i.each((function(t){!LK(t).keep&&r.group.remove(t.group)}))},e.prototype.markKeep=function(t){LK(t).keep=!0},e.prototype.blurSeries=function(t){var e=this;Z(t,(function(t){var n=mK.getMarkerModelFromSeries(t,e.type);if(n){var r=n.getData();r.eachItemGraphicEl((function(t){t&&ic(t)}))}}))},e.type="marker",e}(xv),PK=OK;function EK(t,e,n){var r=e.coordinateSystem;t.each((function(i){var o,a=t.getItemModel(i),s=lo(a.get("x"),n.getWidth()),l=lo(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,i));else if(r){var u=t.get(r.dimensions[0],i),c=t.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(i,o)}))}var RK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=mK.getMarkerModelFromSeries(t,"markPoint");e&&(EK(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,n,r){var i=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new oD),u=NK(i,t,e);e.setData(u),EK(e.getData(),t,r),u.each((function(t){var n=u.getItemModel(t),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(at(r)||at(i)||at(o)||at(s)){var c=e.getRawValue(t),h=e.getDataParams(t);at(r)&&(r=r(c,h)),at(i)&&(i=i(c,h)),at(o)&&(o=o(c,h)),at(s)&&(s=s(c,h))}var p=n.getModel("itemStyle").getItemStyle(),f=My(a,"color");p.fill||(p.fill=f),u.setItemVisual(t,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:p})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(t){t.traverse((function(t){mu(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(PK);function NK(t,e,n){var r;r=t?K(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};return j(j({},n),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new mM(r,n),o=K(n.get("data"),it(CK,e));t&&(o=Q(o,it(AK,t)));var a=DK(!!t,r);return i.initData(o,null,a),i}var zK=RK;function BK(t){t.registerComponentModel(_K),t.registerComponentView(zK),t.registerPreprocessor((function(t){dK(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})}))}var VK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,r){return new e(t,n,r)},e.type="markLine",e.defaultOption={zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(mK),FK=VK,GK=na(),HK=function(t,e,n,r){var i,o=t.getData();if(ot(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=e.getAxis(null!=r.yAxis?"y":"x"),l=mt(r.yAxis,r.xAxis);else{var u=IK(r,o,e,t);s=u.valueAxis;var c=LM(o,u.valueDataDim);l=kK(o,c,a)}var h="x"===s.dim?0:1,p=1-h,f=F(r),d={coord:[]};f.type=null,f.coord=[],f.coord[p]=-1/0,d.coord[p]=1/0;var g=n.get("precision");g>=0&&"number"===typeof l&&(l=+l.toFixed(Math.min(g,20))),f.coord[h]=d.coord[h]=l,i=[f,d,{type:a,valueIndex:r.valueIndex,value:l}]}else i=[]}var v=[CK(t,i[0]),CK(t,i[1]),j({},i[2])];return v[2].type=v[2].type||null,G(v[2],v[0]),G(v[2],v[1]),v};function jK(t){return!isNaN(t)&&!isFinite(t)}function WK(t,e,n,r){var i=1-t,o=r.dimensions[t];return jK(e[i])&&jK(n[i])&&e[t]===n[t]&&r.getAxis(o).containData(e[t])}function UK(t,e){if("cartesian2d"===t.type){var n=e[0].coord,r=e[1].coord;if(n&&r&&(WK(1,n,r,t)||WK(0,n,r,t)))return!0}return AK(t,e[0])&&AK(t,e[1])}function qK(t,e,n,r,i){var o,a=r.coordinateSystem,s=t.getItemModel(e),l=lo(s.get("x"),i.getWidth()),u=lo(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(t.getValues(t.dimensions,e));else{var c=a.dimensions,h=t.get(c[0],e),p=t.get(c[1],e);o=a.dataToPoint([h,p])}if(CD(a,"cartesian2d")){var f=a.getAxis("x"),d=a.getAxis("y");c=a.dimensions;jK(t.get(c[0],e))?o[0]=f.toGlobalCoord(f.getExtent()[n?0:1]):jK(t.get(c[1],e))&&(o[1]=d.toGlobalCoord(d.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}var XK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=mK.getMarkerModelFromSeries(t,"markLine");if(e){var r=e.getData(),i=GK(e).from,o=GK(e).to;i.each((function(e){qK(i,e,!0,t,n),qK(o,e,!1,t,n)})),r.each((function(t){r.setItemLayout(t,[i.getItemLayout(t),o.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,n,r){var i=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new yz);this.group.add(l.group);var u=YK(i,t,e),c=u.from,h=u.to,p=u.line;GK(e).from=c,GK(e).to=h,e.setData(p);var f=e.get("symbol"),d=e.get("symbolSize"),g=e.get("symbolRotate"),v=e.get("symbolOffset");function y(e,n,i){var o=e.getItemModel(n);qK(e,n,i,t,r);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=My(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:xt(o.get("symbolOffset",!0),v[i?0:1]),symbolRotate:xt(o.get("symbolRotate",!0),g[i?0:1]),symbolSize:xt(o.get("symbolSize"),d[i?0:1]),symbol:xt(o.get("symbol",!0),f[i?0:1]),style:s})}ot(f)||(f=[f,f]),ot(d)||(d=[d,d]),ot(g)||(g=[g,g]),ot(v)||(v=[v,v]),u.from.each((function(t){y(c,t,!0),y(h,t,!1)})),p.each((function(t){var e=p.getItemModel(t).getModel("lineStyle").getLineStyle();p.setItemLayout(t,[c.getItemLayout(t),h.getItemLayout(t)]),null==e.stroke&&(e.stroke=c.getItemVisual(t,"style").fill),p.setItemVisual(t,{fromSymbolKeepAspect:c.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:c.getItemVisual(t,"symbolOffset"),fromSymbolRotate:c.getItemVisual(t,"symbolRotate"),fromSymbolSize:c.getItemVisual(t,"symbolSize"),fromSymbol:c.getItemVisual(t,"symbol"),toSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(t,"symbolOffset"),toSymbolRotate:h.getItemVisual(t,"symbolRotate"),toSymbolSize:h.getItemVisual(t,"symbolSize"),toSymbol:h.getItemVisual(t,"symbol"),style:e})})),l.updateData(p),u.line.eachItemGraphicEl((function(t,n){t.traverse((function(t){mu(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(PK);function YK(t,e,n){var r;r=t?K(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};return j(j({},n),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var i=new mM(r,n),o=new mM(r,n),a=new mM([],n),s=K(n.get("data"),it(HK,e,t,n));t&&(s=Q(s,it(UK,t)));var l=DK(!!t,r);return i.initData(K(s,(function(t){return t[0]})),null,l),o.initData(K(s,(function(t){return t[1]})),null,l),a.initData(K(s,(function(t){return t[2]}))),a.hasItemOption=!0,{from:i,to:o,line:a}}var $K=XK;function ZK(t){t.registerComponentModel(FK),t.registerComponentView($K),t.registerPreprocessor((function(t){dK(t.series,"markLine")&&(t.markLine=t.markLine||{})}))}var KK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,r){return new e(t,n,r)},e.type="markArea",e.defaultOption={zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(mK),JK=KK,QK=na(),tJ=function(t,e,n,r){var i=CK(t,r[0]),o=CK(t,r[1]),a=i.coord,s=o.coord;a[0]=mt(a[0],-1/0),a[1]=mt(a[1],-1/0),s[0]=mt(s[0],1/0),s[1]=mt(s[1],1/0);var l=H([{},i,o]);return l.coord=[i.coord,o.coord],l.x0=i.x,l.y0=i.y,l.x1=o.x,l.y1=o.y,l};function eJ(t){return!isNaN(t)&&!isFinite(t)}function nJ(t,e,n,r){var i=1-t;return eJ(e[i])&&eJ(n[i])}function rJ(t,e){var n=e.coord[0],r=e.coord[1];return!!(CD(t,"cartesian2d")&&n&&r&&(nJ(1,n,r,t)||nJ(0,n,r,t)))||(AK(t,{coord:n,x:e.x0,y:e.y0})||AK(t,{coord:r,x:e.x1,y:e.y1}))}function iJ(t,e,n,r,i){var o,a=r.coordinateSystem,s=t.getItemModel(e),l=lo(s.get(n[0]),i.getWidth()),u=lo(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(t.getValues(n,e));else{var c=t.get(n[0],e),h=t.get(n[1],e),p=[c,h];a.clampData&&a.clampData(p,p),o=a.dataToPoint(p,!0)}if(CD(a,"cartesian2d")){var f=a.getAxis("x"),d=a.getAxis("y");c=t.get(n[0],e),h=t.get(n[1],e);eJ(c)?o[0]=f.toGlobalCoord(f.getExtent()["x0"===n[0]?0:1]):eJ(h)&&(o[1]=d.toGlobalCoord(d.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var oJ=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],aJ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=mK.getMarkerModelFromSeries(t,"markArea");if(e){var r=e.getData();r.each((function(e){var i=K(oJ,(function(i){return iJ(r,e,i,t,n)}));r.setItemLayout(e,i);var o=r.getItemGraphicEl(e);o.setShape("points",i)}))}}),this)},e.prototype.renderSeries=function(t,e,n,r){var i=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Ui});this.group.add(l.group),this.markKeep(l);var u=sJ(i,t,e);e.setData(u),u.each((function(e){var n=K(oJ,(function(n){return iJ(u,e,n,t,r)})),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),h=[o.parse(u.get("x0",e)),o.parse(u.get("x1",e))],p=[s.parse(u.get("y0",e)),s.parse(u.get("y1",e))];co(h),co(p);var f=!(l[0]>h[1]||l[1]p[1]||c[1]=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Up),pJ=hJ,fJ=it,dJ=Z,gJ=Ui,vJ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return v(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new gJ),this.group.add(this._selectorGroup=new gJ),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var i=t.get("align"),o=t.get("orient");i&&"auto"!==i||(i="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(i,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=t.get("padding"),h=Rp(l,u,c),p=this.layoutInner(t,i,h,r,a,s),f=Rp(W({width:p.width,height:p.height},l),u,c);this.group.x=f.x-p.x,this.group.y=f.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=xY(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,r,i,o,a){var s=this.getContentGroup(),l=Dt(),u=e.get("selectedMode"),c=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&c.push(t.id)})),dJ(e.getData(),(function(i,o){var a=i.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new gJ;return h.newline=!0,void s.add(h)}var p=n.getSeriesByName(a)[0];if(!l.get(a)){if(p){var f=p.getData(),d=f.getVisual("legendLineStyle")||{},g=f.getVisual("legendIcon"),v=f.getVisual("style"),y=this._createItem(p,a,o,i,e,t,d,v,g,u);y.on("click",fJ(xJ,a,null,r,c)).on("mouseover",fJ(bJ,p.name,null,r,c)).on("mouseout",fJ(wJ,p.name,null,r,c)),l.set(a,!0)}else n.eachRawSeries((function(n){if(!l.get(a)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(a))return;var h=s.indexOfName(a),p=s.getItemVisual(h,"style"),f=s.getItemVisual(h,"legendIcon"),d=En(p.fill);d&&0===d[3]&&(d[3]=.2,p.fill=Un(d,"rgba"));var g=this._createItem(n,a,o,i,e,t,{},p,f,u);g.on("click",fJ(xJ,null,a,r,c)).on("mouseover",fJ(bJ,null,a,r,c)).on("mouseout",fJ(wJ,null,a,r,c)),l.set(a,!0)}}),this);0}}),this),i&&this._createSelector(i,e,r,o,a)},e.prototype._createSelector=function(t,e,n,r,i){var o=this.getSelectorGroup();dJ(t,(function(t){var r=t.type,i=new yu({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect"})}});o.add(i);var a=e.getModel("selectorLabel"),s=e.getModel(["emphasis","selectorLabel"]);Uc(i,{normal:a,emphasis:s},{defaultText:t.title}),xc(i)}))},e.prototype._createItem=function(t,e,n,r,i,o,a,s,l,u){var c=t.visualDrawType,h=i.get("itemWidth"),p=i.get("itemHeight"),f=i.isSelected(e),d=r.get("symbolRotate"),g=r.get("symbolKeepAspect"),v=r.get("icon");l=v||l||"roundRect";var y=yJ(l,r,a,s,c,f),m=new gJ,x=r.getModel("textStyle");if("function"!==typeof t.getLegendIcon||v&&"inherit"!==v){var _="inherit"===v&&t.getData().getVisual("symbol")?"inherit"===d?t.getData().getVisual("symbolRotate"):d:0;m.add(mJ({itemWidth:h,itemHeight:p,icon:l,iconRotate:_,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:g}))}else m.add(t.getLegendIcon({itemWidth:h,itemHeight:p,icon:l,iconRotate:d,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:g}));var b="left"===o?h+5:-5,w=o,S=i.get("formatter"),M=e;"string"===typeof S&&S?M=S.replace("{name}",null!=e?e:""):"function"===typeof S&&(M=S(e));var C=r.get("inactiveColor");m.add(new yu({style:Xc(x,{text:M,x:b,y:p/2,fill:f?x.getTextColor():C,align:w,verticalAlign:"middle"})}));var I=new ru({shape:m.getBoundingRect(),invisible:!0}),T=r.getModel("tooltip");return T.get("show")&&Gx({el:I,componentModel:i,itemName:e,itemTooltipOption:T.option}),m.add(I),m.eachChild((function(t){t.silent=!0})),I.silent=!u,this.getContentGroup().add(m),xc(m),m.__legendDataIndex=n,m},e.prototype.layoutInner=function(t,e,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Pp(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),i){Pp("horizontal",s,t.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],p=t.get("selectorButtonGap",!0),f=t.getOrient().index,d=0===f?"width":"height",g=0===f?"height":"width",v=0===f?"y":"x";"end"===o?h[f]+=l[d]+p:u[f]+=c[d]+p,h[1-f]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[d]=l[d]+p+c[d],y[g]=Math.max(l[g],c[g]),y[v]=Math.min(0,c[v]+h[1-f]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(xv);function yJ(t,e,n,r,i,o){function a(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),dJ(t,(function(n,r){"inherit"===t[r]&&(t[r]=e[r])}))}var s=e.getModel("itemStyle"),l=s.getItemStyle(),u=0===t.lastIndexOf("empty",0)?"fill":"stroke";l.decal=r.decal,"inherit"===l.fill&&(l.fill=r[i]),"inherit"===l.stroke&&(l.stroke=r[u]),"inherit"===l.opacity&&(l.opacity=("fill"===i?r:n).opacity),a(l,r);var c=e.getModel("lineStyle"),h=c.getLineStyle();if(a(h,n),"auto"===l.fill&&(l.fill=r.fill),"auto"===l.stroke&&(l.stroke=r.fill),"auto"===h.stroke&&(h.stroke=r.fill),!o){var p=e.get("inactiveBorderWidth"),f=l[u];l.lineWidth="auto"===p?r.lineWidth>0&&f?2:0:l.lineWidth,l.fill=e.get("inactiveColor"),l.stroke=e.get("inactiveBorderColor"),h.stroke=c.get("inactiveColor"),h.lineWidth=c.get("inactiveWidth")}return{itemStyle:l,lineStyle:h}}function mJ(t){var e=t.icon||"roundRect",n=Kx(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n}function xJ(t,e,n,r){wJ(t,e,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),bJ(t,e,n,r)}function _J(t){var e,n=t.getZr().storage.getDisplayList(),r=0,i=n.length;while(rn[i],d=[-h.x,-h.y];e||(d[r]=l[s]);var g=[0,0],v=[-p.x,-p.y],y=xt(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(f){var m=t.get("pageButtonPosition",!0);"end"===m?v[r]+=n[i]-p[i]:g[r]+=p[i]+y}v[1-r]+=h[o]/2-p[o]/2,l.setPosition(d),u.setPosition(g),c.setPosition(v);var x={x:0,y:0};if(x[i]=f?n[i]:h[i],x[o]=Math.max(h[o],p[o]),x[a]=Math.min(0,p[a]+v[1-r]),u.__rectSize=n[i],f){var _={x:0,y:0};_[i]=Math.max(n[i]-p[i]-y,0),_[o]=x[o],u.setClipPath(new ru({shape:_})),u.__rectSize=_[i]}else c.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var b=this._getPageInfo(t);return null!=b.pageIndex&&Ec(l,{x:b.contentPosition[0],y:b.contentPosition[1]},f?t:null),this._updatePageInfoView(t,b),x},e.prototype._pageGo=function(t,e,n){var r=this._getPageInfo(e)[t];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;Z(["pagePrev","pageNext"],(function(r){var i=r+"DataIndex",o=null!=e[i],a=n.childOfName(r);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")}));var r=n.childOfName("pageText"),i=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;r&&i&&r.setStyle("text",st(i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=t.getOrient().index,o=OJ[i],a=PJ[i],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],c=l.length,h=c?1:0,p={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return p;var f=m(u);p.contentPosition[i]=-f.s;for(var d=s+1,g=f,v=f,y=null;d<=c;++d)y=m(l[d]),(!y&&v.e>g.s+r||y&&!x(y,g.s))&&(g=v.i>g.i?v:y,g&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=g.i),++p.pageCount)),v=y;for(d=s-1,g=f,v=f,y=null;d>=-1;--d)y=m(l[d]),y&&x(v,y.s)||!(g.i=e&&t.s<=e+r}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var e,n,r=this.getContentGroup();return r.eachChild((function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===t&&(e=i)})),null!=e?e:n},e.type="legend.scroll",e}(SJ),RJ=EJ;function NJ(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}function zJ(t){BS(TJ),t.registerComponentModel(kJ),t.registerComponentView(RJ),NJ(t)}function BJ(t){BS(TJ),BS(zJ)}var VJ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="dataZoom.inside",e.defaultOption=bh(YX.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(YX),FJ=VJ,GJ=na();function HJ(t,e,n){GJ(t).coordSysRecordMap.each((function(t){var r=t.dataZoomInfoMap.get(e.uid);r&&(r.getRange=n)}))}function jJ(t,e){for(var n=GJ(t).coordSysRecordMap,r=n.keys(),i=0;ir[n+e]&&(e=a),i=i&&o.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function $J(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=GJ(e),r=n.coordSysRecordMap||(n.coordSysRecordMap=Dt());r.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){var n=WX(t);Z(n.infoList,(function(n){var i=n.model.uid,o=r.get(i)||r.set(i,UJ(e,n.model)),a=o.dataZoomInfoMap||(o.dataZoomInfoMap=Dt());a.set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),r.each((function(t){var e,n=t.controller,i=t.dataZoomInfoMap;if(i){var o=i.keys()[0];null!=o&&(e=i.get(o))}if(e){var a=YJ(i);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),Ev(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else WJ(r,t)}))}))}var ZJ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return v(e,t),e.prototype.render=function(e,n,r){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),HJ(r,e,{pan:rt(KJ.pan,this),zoom:rt(KJ.zoom,this),scrollMove:rt(KJ.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){jJ(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(JX),KJ={zoom:function(t,e,n,r){var i=this.range,o=i.slice(),a=t.axisModels[0];if(a){var s=QJ[e](null,[r.originX,r.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return NB(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1]?o:void 0}},pan:JJ((function(t,e,n,r,i,o){var a=QJ[r]([o.oldX,o.oldY],[o.newX,o.newY],e,i,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:JJ((function(t,e,n,r,i,o){var a=QJ[r]([0,0],[o.scrollDelta,o.scrollDelta],e,i,n);return a.signal*(t[1]-t[0])*o.scrollDelta}))};function JJ(t){return function(e,n,r,i){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s){var l=t(a,s,e,n,r,i);return NB(l,a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}}var QJ={grid:function(t,e,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,r,i){var o=n.axis,a=i.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}},tQ=ZJ;function eQ(t){cY(t),t.registerComponentModel(FJ),t.registerComponentView(tQ),$J(t)}var nQ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=bh(YX.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(YX),rQ=nQ,iQ=ru,oQ=7,aQ=1,sQ=30,lQ=7,uQ="horizontal",cQ="vertical",hQ=5,pQ=["line","bar","candlestick","scatter"],fQ={easing:"cubicOut",duration:100,delay:0},dQ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._displayables={},n}return v(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=rt(this._onBrush,this),this._onBrushEnd=rt(this._onBrushEnd,this)},e.prototype.render=function(e,n,r,i){if(t.prototype.render.apply(this,arguments),Ev(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Rv(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Ui;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect"),r=n?lQ:0,i=this._findCoordRect(),o={width:e.getWidth(),height:e.getHeight()},a=this._orient===uQ?{right:o.width-i.x-i.width,top:o.height-sQ-oQ-r,width:i.width,height:sQ}:{right:oQ,top:i.y,width:sQ,height:i.height},s=Fp(t.option);Z(["right","top","width","height"],(function(t){"ph"===s[t]&&(s[t]=a[t])}));var l=Rp(s,o);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===cQ&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==uQ||i?n===uQ&&i?{scaleY:a?1:-1,scaleX:-1}:n!==cQ||i?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,r=t.get("brushSelect");n.add(new iQ({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var i=new iQ({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:rt(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=t.series,r=n.getRawData(),i=n.getShadowDim?n.getShadowDim():t.otherDim;if(null!=i){var o=r.getDataExtent(i),a=.3*(o[1]-o[0]);o=[o[0]-a,o[1]+a];var s,l=[0,e[1]],u=[0,e[0]],c=[[e[0],0],[0,0]],h=[],p=u[1]/(r.count()-1),f=0,d=Math.round(r.count()/e[0]);r.each([i],(function(t,e){if(d>0&&e%d)f+=p;else{var n=null==t||isNaN(t)||""===t,r=n?0:so(t,o,l,!0);n&&!s&&e?(c.push([c[c.length-1][0],0]),h.push([h[h.length-1][0],0])):!n&&s&&(c.push([f,0]),h.push([f,0])),c.push([f,r]),h.push([f,r]),f+=p,s=n}}));for(var g=this.dataZoomModel,v=0;v<3;v++){var y=m(1===v);this._displayables.sliderGroup.add(y),this._displayables.dataShadowSegs.push(y)}}}function m(t){var e=g.getModel(t?"selectedDataBackground":"dataBackground"),n=new Ui,r=new Vm({shape:{points:c},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new Hm({shape:{points:h},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,r=this.ecModel;return t.eachTargetAxis((function(i,o){var a=t.getAxisProxy(i,o).getTargetSeriesModels();Z(a,(function(t){if(!n&&!(!0!==e&&q(pQ,t.get("type"))<0)){var a,s=r.getComponent(HX(i),o).axis,l=gQ(i),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:i,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],r=e.handleLabels=[null,null],i=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),c=e.filler=new iQ({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});i.add(c),i.add(new iQ({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:aQ,fill:"rgba(0,0,0,0)"}})),Z([0,1],(function(e){var o=a.get("handleIcon");!Yx[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=Kx(o,-1,0,2,2,null,!0);s.attr({cursor:vQ(this._orient),draggable:!0,drift:rt(this._onDragMove,this,e),ondragend:rt(this._onDragEnd,this),onmouseover:rt(this._showDataInfo,this,!0),onmouseout:rt(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=lo(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),xc(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),i.add(n[e]=s);var h=a.getModel("textStyle");t.add(r[e]=new yu({silent:!0,invisible:!0,style:Xc(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))}),this);var h=c;if(u){var p=lo(a.get("moveHandleSize"),o[1]),f=e.moveHandle=new ru({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),d=.8*p,g=e.moveHandleIcon=Kx(a.get("moveHandleIcon"),-d/2,-d/2,d,d,"#fff",!0);g.silent=!0,g.y=o[1]+p/2-.5,f.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var v=Math.min(o[1]/2,Math.max(p,10));h=e.moveZone=new ru({invisible:!0,shape:{y:o[1]-v,height:p+v}}),h.on("mouseover",(function(){s.enterEmphasis(f)})).on("mouseout",(function(){s.leaveEmphasis(f)})),i.add(f),i.add(g),i.add(h)}h.attr({draggable:!0,cursor:vQ(this._orient),drift:rt(this._onDragMove,this,"all"),ondragstart:rt(this._showDataInfo,this,!0),ondragend:rt(this._onDragEnd,this),onmouseover:rt(this._showDataInfo,this,!0),onmouseout:rt(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[so(t[0],[0,100],e,!0),so(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];NB(e,r,i,n.get("zoomLock")?"all":t,null!=o.minSpan?so(o.minSpan,a,i,!0):null,null!=o.maxSpan?so(o.maxSpan,a,i,!0):null);var s=this._range,l=this._range=co([so(r[0],i,a,!0),so(r[1],i,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,r=co(n.slice()),i=this._size;Z([0,1],(function(t){var r=e.handles[t],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:i[1]/2-o/2})}),this),e.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,r[0],r[1],i[0]],l=0;le[0]||n[1]<0||n[1]>e[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new ui(e,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape,r=+new Date;if(!(r-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),o=[0,100];this._range=co([so(n.x,i,o,!0),so(n.x+n.width,i,o,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(ke(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new iQ({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),i.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?fQ:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=WX(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var r=this.api.getWidth(),i=this.api.getHeight();t={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return t},e.type="dataZoom.slider",e}(JX);function gQ(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function vQ(t){return"vertical"===t?"ns-resize":"ew-resize"}var yQ=dQ;function mQ(t){t.registerComponentModel(rQ),t.registerComponentView(yQ),cY(t)}function xQ(t){BS(eQ),BS(mQ)}var _Q={get:function(t,e,n){var r=F((bQ[t]||{})[e]);return n&&ot(r)?r[r.length-1]:r}},bQ={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},wQ=_Q,SQ=WR.mapVisual,MQ=WR.eachVisual,CQ=ot,IQ=Z,TQ=co,AQ=so,DQ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return v(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,e){var n=this.option;S.canvasSupported||(n.realtime=!1),!e&&dZ(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=rt(t,this),this.controllerVisuals=fZ(this.option.controller,e,t),this.targetVisuals=fZ(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,n){e.push(n)})):e=Eo(t),e},e.prototype.eachTargetSeries=function(t,e){Z(this.getTargetSeriesIndices(),(function(n){var r=this.ecModel.getSeriesByIndex(n);r&&t.call(e,r)}),this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(n){n===t&&(e=!0)})),e},e.prototype.formatValueText=function(t,e,n){var r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],ot(t)&&(t=t.slice(),r=!0);var l=e?t:r?[u(t[0]),u(t[1])]:u(t);return st(s)?s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l):at(s)?r?s(t[0],t[1]):s(t):r?t[0]===a[0]?n[0]+" "+l[1]:t[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,e=TQ([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,r=n.length-1;r>=0;r--){var i=n[r],o=t.getDimensionInfo(i);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},r=e.target||(e.target={}),i=e.controller||(e.controller={});G(r,n),G(i,n);var o=this.isCategory();function a(n){CQ(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")}}function s(t,e,n){var r=t[e],i=t[n];r&&!i&&(i=t[n]={},IQ(r,(function(t,e){if(WR.isValidType(e)){var n=wQ.get(e,"inactive",o);null!=n&&(i[e]=n,"color"!==e||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}})))}function l(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol(),a=i||"roundRect";IQ(this.stateList,(function(i){var s=this.itemSize,l=t[i];l||(l=t[i]={color:o?r:[r]}),null==l.symbol&&(l.symbol=e&&F(e)||(o?a:[a])),null==l.symbolSize&&(l.symbolSize=n&&F(n)||(o?s[0]:[s[0],s[0]])),l.symbol=SQ(l.symbol,(function(t){return"none"===t?a:t}));var u=l.symbolSize;if(null!=u){var c=-1/0;MQ(u,(function(t){t>c&&(c=t)})),l.symbolSize=SQ(u,(function(t){return AQ(t,[0,c],[0,s[0]],!0)}))}}),this)}a.call(this,r),a.call(this,i),s.call(this,r,"inRange","outOfRange"),l.call(this,i)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Up),kQ=DQ,LQ=[20,140],OQ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=LQ[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=LQ[1])},e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):ot(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),Z(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=co((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),(function(e,n){t[0]<=e&&e<=t[1]&&r.push(n)}),this),e.push({seriesId:n.id,dataIndex:r})}),this),e},e.prototype.getVisualMeta=function(t){var e=PQ(this,"outOfRange",this.getExtent()),n=PQ(this,"inRange",this.option.range.slice()),r=[];function i(e,n){r.push({value:e,color:t(e,n)})}for(var o=0,a=0,s=n.length,l=e.length;at[1])break;r.push({color:this.getControllerVisual(a,"color",e),offset:o/n})}return r.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),r},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Ui("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent();GQ([0,1],(function(l){var u=i[l];u.setStyle("fill",e.handlesColor[l]),u.y=t[l];var c=FQ(t[l],[0,a[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/a[0],u.x=a[0]-h/2;var p=Dx(n.handleLabelPoints[l],Ax(u,this.group));o[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c={convertOpacityToAlpha:!0},h=this.getControllerVisual(t,"color",c),p=this.getControllerVisual(t,"symbolSize"),f=FQ(t,o,s,!0),d=a[0]-p/2,g={x:u.x,y:u.y};u.y=f,u.x=d;var v=Dx(l.indicatorLabelPoint,Ax(u,this.group)),y=l.indicatorLabel;y.attr("invisible",!1);var m=this._applyTransform("left",l.mainGroup),x=this._orient,_="horizontal"===x;y.setStyle({text:(n||"")+i.formatValueText(e),verticalAlign:_?m:"middle",align:_?"center":m});var b={x:d,y:f,style:{fill:h}},w={style:{x:v[0],y:v[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var S={duration:100,easing:"cubicInOut",additive:!0};u.x=g.x,u.y=g.y,u.animateTo(b,S),y.animateTo(w,S)}else u.attr(b),y.attr(w);this._firstShowIndicator=!1;var M=this._shapes.handleLabels;if(M)for(var C=0;Ci[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var c=this._hoverLinkDataIndices,h=[];(e||$Q(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var p=ta(c,h);this._dispatchHighDown("downplay",VQ(p[0],n)),this._dispatchHighDown("highlight",VQ(p[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e=t.target,n=this.visualMapModel;if(e&&null!=mu(e).dataIndex){var r=mu(e),i=this.ecModel.getSeriesByIndex(r.seriesIndex);if(n.isTargetSeries(i)){var o=i.getData(r.dataType),a=o.getStore().get(n.getDataDimensionIndex(o),r.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n=0&&(i.dimension=o,r.push(i))}})),t.getData().setVisual("visualMeta",r)}}];function e0(t,e,n,r){for(var i=e.targetVisuals[r],o=WR.prepareVisualTypes(i),a={color:My(t.getData(),"color")},s=0,l=o.length;s0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction(JQ,QQ),Z(t0,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(r0))}function s0(t){t.registerComponentModel(EQ),t.registerComponentView(KQ),a0(t)}var l0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._pieceList=[],n}return v(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],u0[this._mode].call(this,this._pieceList),this._resetSelected(e,n);var i=this.option.categories;this.resetVisual((function(t,e){"categories"===r?(t.mappingMethod="category",t.categories=F(i)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=K(this._pieceList,(function(t){return t=F(t),"inRange"!==e&&(t.visual=null),t})))}))},e.prototype.completeVisualOption=function(){var e=this.option,n={},r=WR.listVisualTypes(),i=this.isCategory();function o(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}Z(e.pieces,(function(t){Z(r,(function(e){t.hasOwnProperty(e)&&(n[e]=1)}))})),Z(n,(function(t,n){var r=!1;Z(this.stateList,(function(t){r=r||o(e,t,n)||o(e.target,t,n)}),this),!r&&Z(this.stateList,(function(t){(e[t]||(e[t]={}))[n]=wQ.get(n,"inRange"===t?"active":"inactive",i)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,r=this._pieceList,i=(e?n:t).selected||{};if(n.selected=i,Z(r,(function(t,e){var n=this.getSelectedMapKey(t);i.hasOwnProperty(n)||(i[n]=!0)}),this),"single"===n.selectedMode){var o=!1;Z(r,(function(t,e){var n=this.getSelectedMapKey(t);i[n]&&(o?i[n]=!1:o=!0)}),this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=F(t)},e.prototype.getValueState=function(t){var e=WR.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries((function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),(function(e,r){var o=WR.findPieceIndex(e,n);o===t&&i.push(r)}),this),e.push({seriesId:r.id,dataIndex:i})}),this),e},e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),o=i[i.length-1].interval[1],o!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return Z(i,(function(t){var e=t.interval;e&&(e[0]>a&&s([a,e[0]],"outOfRange"),s(e.slice()),a=e[1])}),this),{stops:e,outerColors:n}}function s(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=t(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:e.push({value:i[0],color:s},{value:i[1],color:s})}},e.type="visualMap.piecewise",e.defaultOption=bh(kQ.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(kQ),u0={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),r=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;var o=(r[1]-r[0])/i;while(+o.toFixed(n)!==o&&n<5)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)}),this)}};function c0(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}var h0=l0,p0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return v(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),r=e.textStyleModel,i=r.getFont(),o=r.getTextColor(),a=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,c=mt(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,c,a),Z(l.viewPieceList,(function(r){var l=r.piece,u=new Ui;u.onclick=rt(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var h=e.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var p=this.visualMapModel.getValueState(h);u.add(new yu({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:i,fill:o,opacity:"outOfRange"===p?.5:1}}))}t.add(u)}),this),u&&this._renderEndsText(t,u[1],s,c,a),Pp(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",(function(){return r("highlight")})).on("mouseout",(function(){return r("downplay")}));var r=function(t){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:t,batch:VQ(r.findTargetDataIndices(e),r)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return BQ(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,r,i){if(e){var o=new Ui,a=this.visualMapModel.textStyleModel;o.add(new yu({style:{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:e,font:a.getFont(),fill:a.getTextColor()}})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,e=K(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),n=t.get("text"),r=t.get("orient"),i=t.get("inverse");return("horizontal"===r?i:!i)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},e.prototype._createItemSymbol=function(t,e,n){t.add(Kx(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,r=F(n.selected),i=e.getSelectedMapKey(t);"single"===n.selectedMode?(r[i]=!0,Z(r,(function(t,e){r[e]=e===i}))):r[i]=!r[i],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})},e.type="visualMap.piecewise",e}(NQ),f0=p0;function d0(t){t.registerComponentModel(h0),t.registerComponentView(f0),a0(t)}function g0(t){BS(s0),BS(d0)}var v0={label:{enabled:!0},decal:{show:!1}},y0=na(),m0={};function x0(t,e){var n=t.getModel("aria");if(n.get("enabled")){var r=F(v0);G(r.label,t.getLocaleModel().get("aria"),!1),G(n.option,r,!1),i(),o()}function i(){var e=n.getModel("decal"),r=e.get("show");if(r){var i=Dt();t.eachSeries((function(t){if(!t.isColorBySeries()){var e=i.get(t.type);e||(e={},i.set(t.type,e)),y0(t).scope=e}})),t.eachRawSeries((function(e){if(!t.isSeriesFiltered(e))if("function"!==typeof e.enableAriaDecal){var n=e.getData();if(e.isColorBySeries()){var r=_f(e.ecModel,e.name,m0,t.getSeriesCount()),i=n.getVisual("decal");n.setVisual("decal",u(i,r))}else{var o=e.getRawData(),a={},s=y0(e).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=o.count();o.each((function(t){var r=a[t],i=o.getName(t)||t+"",c=_f(e.ecModel,i,s,l),h=n.getItemVisual(r,"decal");n.setItemVisual(r,"decal",u(h,c))}))}}else e.enableAriaDecal();function u(t,e){var n=t?j(j({},e),t):e;return n.dirty=!0,n}}))}}function o(){var r=t.getLocaleModel().get("aria"),i=n.getModel("label");if(i.option=W(i.option,r),i.get("enabled")){var o=e.getZr().dom;if(i.get("description"))o.setAttribute("aria-label",i.get("description"));else{var u,c=t.getSeriesCount(),h=i.get(["data","maxCount"])||10,p=i.get(["series","maxCount"])||10,f=Math.min(c,p);if(!(c<1)){var d=s();if(d){var g=i.get(["general","withTitle"]);u=a(g,{title:d})}else u=i.get(["general","withoutTitle"]);var v=[],y=c>1?i.get(["series","multiple","prefix"]):i.get(["series","single","prefix"]);u+=a(y,{seriesCount:c}),t.eachSeries((function(t,e){if(e1?i.get(["series","multiple",o]):i.get(["series","single",o]),n=a(n,{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:l(t.subType)});var s=t.getData();if(s.count()>h){var u=i.get(["data","partialData"]);n+=a(u,{displayCnt:h})}else n+=i.get(["data","allData"]);for(var p=i.get(["data","separator","middle"]),d=i.get(["data","separator","end"]),g=[],y=0;y":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},S0=function(){function t(t){var e=this._condVal=st(t)?new RegExp(t):vt(t)?t:null;if(null==e){var n="";0,Af(n)}}return t.prototype.evaluate=function(t){var e=typeof t;return"string"===e?this._condVal.test(t):"number"===e&&this._condVal.test(t+"")},t}(),M0=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),C0=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e2&&l.push(e),e=[t,n]}function d(t,n,r,i){j0(t,r)&&j0(n,i)||e.push(t,n,r,i,r,i)}function g(t,n,r,i,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,u=nM:T2&&l.push(e),l}function U0(t,e,n,r,i,o,a,s,l,u){if(j0(t,n)&&j0(e,r)&&j0(i,a)&&j0(o,s))l.push(a,s);else{var c=2/u,h=c*c,p=a-t,f=s-e,d=Math.sqrt(p*p+f*f);p/=d,f/=d;var g=n-t,v=r-e,y=i-a,m=o-s,x=g*g+v*v,_=y*y+m*m;if(x=0&&M=0)l.push(a,s);else{var C=[],I=[];Ss(t,n,i,a,.5,C),Ss(e,r,o,s,.5,I),U0(C[0],I[0],C[1],I[1],C[2],I[2],C[3],I[3],l,u),U0(C[4],I[4],C[5],I[5],C[6],I[6],C[7],I[7],l,u)}}}}function q0(t,e){var n=W0(t),r=[];e=e||1;for(var i=0;i0)for(u=0;uMath.abs(u),h=X0([l,u],c?0:1,e),p=(c?s:u)/h.length,f=0;fi,a=X0([r,i],o?0:1,e),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",c=o?"y":"x",h=t[s]/a.length,p=0;p1?null:new ui(g*l+t,g*u+e)}function J0(t,e,n){var r=new ui;ui.sub(r,n,e),r.normalize();var i=new ui;ui.sub(i,t,e);var o=i.dot(r);return o}function Q0(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function t1(t,e,n){for(var r=t.length,i=[],o=0;oa?(u.x=c.x=s+o/2,u.y=l,c.y=l+a):(u.y=c.y=l+a/2,u.x=s,c.x=s+o),t1(e,u,c)}function n1(t,e,n,r){if(1===n)r.push(e);else{var i=Math.floor(n/2),o=t(e);n1(t,o[0],i,r),n1(t,o[1],n-i,r)}return r}function r1(t,e){for(var n=[],r=0;r0)for(var b=r/n,w=-r/2;w<=r/2;w+=b){var S=Math.sin(w),M=Math.cos(w),C=0;for(x=0;x0;u/=2){var c=0,h=0;(t&u)>0&&(c=1),(e&u)>0&&(h=1),l+=u*u*(3*c^h),0===h&&(1===c&&(t=u-1-t,e=u-1-e),s=t,t=e,e=s)}return l}function w1(t){var e=1/0,n=1/0,r=-1/0,i=-1/0,o=K(t,(function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),n=Math.min(l,n),r=Math.max(s,r),i=Math.max(l,i),[s,l]})),a=K(o,(function(o,a){return{cp:o,z:b1(o[0],o[1],e,n,r,i),path:t[a]}}));return a.sort((function(t,e){return t.z-e.z})).map((function(t){return t.path}))}function S1(t){return a1(t.path,t.count)}function M1(){return{fromIndividuals:[],toIndividuals:[],count:0}}function C1(t,e,n){var r=[];function i(t){for(var e=0;e=0;i--)if(!n[i].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[i].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var D1={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),r=0;r0){var s,l,u=r.getModel("universalTransition").get("delay"),c=Object.assign({setToFinal:!0},a);T1(t)&&(s=t,l=e),T1(e)&&(s=e,l=t);for(var h=s?s===t:t.length>e.length,p=s?A1(l,s):A1(h?e:t,[h?t:e]),f=0,d=0;dO1))for(var r=n.getIndices(),i=E1(n),o=0;o0&&i.group.traverse((function(t){t instanceof Fl&&!t.animators.length&&t.animateFrom({style:{opacity:0}},o)}))}))}function H1(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function j1(t){return ot(t)?t.sort().join(","):t}function W1(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function U1(t,e){var n=Dt(),r=Dt(),i=Dt();return Z(t.oldSeries,(function(e,n){var o=t.oldData[n],a=H1(e),s=j1(a);r.set(s,o),ot(a)&&Z(a,(function(t){i.set(t,{data:o,key:s})}))})),Z(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.getData(),o=H1(t),a=j1(o),s=r.get(a);if(s)n.set(a,{oldSeries:[{divide:W1(s),data:s}],newSeries:[{divide:W1(e),data:e}]});else if(ot(o)){0;var l=[];Z(o,(function(t){var e=r.get(t);e&&l.push({divide:W1(e),data:e})})),l.length&&n.set(a,{oldSeries:l,newSeries:[{data:e,divide:W1(e)}]})}else{var u=i.get(o);if(u){var c=n.get(u.key);c||(c={oldSeries:[{data:u.data,divide:W1(u.data)}],newSeries:[]},n.set(u.key,c)),c.newSeries.push({data:e,divide:W1(e)})}}}})),n}function q1(t,e){for(var n=0;n=0&&i.push({data:e.oldData[n],divide:W1(e.oldData[n]),dim:t.dimension})})),Z(Eo(t.to),(function(t){var e=q1(n.updatedSeries,t);if(e>=0){var r=n.updatedSeries[e].getData();o.push({data:r,divide:W1(r),dim:t.dimension})}})),i.length>0&&o.length>0&&G1(i,o,r)}function Y1(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){Z(Eo(n.seriesTransition),(function(t){Z(Eo(t.to),(function(t){for(var e=n.updatedSeries,r=0;r
'};function n(t,e,n){return tn?n:t}function r(t){return 100*(-1+t)}function i(t,n,i){var o;return o="translate3d"===e.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===e.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"},o.transition="all "+n+"ms "+i,o}t.configure=function(t){var n,r;for(n in t)r=t[n],void 0!==r&&t.hasOwnProperty(n)&&(e[n]=r);return this},t.status=null,t.set=function(r){var s=t.isStarted();r=n(r,e.minimum,1),t.status=1===r?null:r;var l=t.render(!s),u=l.querySelector(e.barSelector),c=e.speed,h=e.easing;return l.offsetWidth,o((function(n){""===e.positionUsing&&(e.positionUsing=t.getPositioningCSS()),a(u,i(r,c,h)),1===r?(a(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){a(l,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){t.remove(),n()}),c)}),c)):setTimeout(n,c)})),this},t.isStarted=function(){return"number"===typeof t.status},t.start=function(){t.status||t.set(0);var n=function(){setTimeout((function(){t.status&&(t.trickle(),n())}),e.trickleSpeed)};return e.trickle&&n(),this},t.done=function(e){return e||t.status?t.inc(.3+.5*Math.random()).set(1):this},t.inc=function(e){var r=t.status;return r?("number"!==typeof e&&(e=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+e,0,.994),t.set(r)):t.start()},t.trickle=function(){return t.inc(Math.random()*e.trickleRate)},function(){var e=0,n=0;t.promise=function(r){return r&&"resolved"!==r.state()?(0===n&&t.start(),e++,n++,r.always((function(){n--,0===n?(e=0,t.done()):t.set((e-n)/e)})),this):this}}(),t.render=function(n){if(t.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var i=document.createElement("div");i.id="nprogress",i.innerHTML=e.template;var o,s=i.querySelector(e.barSelector),u=n?"-100":r(t.status||0),c=document.querySelector(e.parent);return a(s,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),e.showSpinner||(o=i.querySelector(e.spinnerSelector),o&&h(o)),c!=document.body&&l(c,"nprogress-custom-parent"),c.appendChild(i),i},t.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(e.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&h(t)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var o=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),a=function(){var t=["Webkit","O","Moz","ms"],e={};function n(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()}))}function r(e){var n=document.body.style;if(e in n)return e;var r,i=t.length,o=e.charAt(0).toUpperCase()+e.slice(1);while(i--)if(r=t[i]+o,r in n)return r;return e}function i(t){return t=n(t),e[t]||(e[t]=r(t))}function o(t,e,n){e=i(e),t.style[e]=n}return function(t,e){var n,r,i=arguments;if(2==i.length)for(n in e)r=e[n],void 0!==r&&e.hasOwnProperty(n)&&o(t,n,r);else o(t,i[1],i[2])}}();function s(t,e){var n="string"==typeof t?t:c(t);return n.indexOf(" "+e+" ")>=0}function l(t,e){var n=c(t),r=n+e;s(n,e)||(t.className=r.substring(1))}function u(t,e){var n,r=c(t);s(t,e)&&(n=r.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function c(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function h(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return t}))},"32a6":function(t,e,n){var r=n("241e"),i=n("c3a1");n("ce7e")("keys",(function(){return function(t){return i(r(t))}}))},"32e9":function(t,e,n){var r=n("86cc"),i=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"32fc":function(t,e,n){var r=n("e53d").document;t.exports=r&&r.documentElement},"335c":function(t,e,n){var r=n("6b4c");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"33a4":function(t,e,n){var r=n("84f2"),i=n("2b4c")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},"355d":function(t,e){e.f={}.propertyIsEnumerable},"35e8":function(t,e,n){var r=n("d9f6"),i=n("aebd");t.exports=n("8e60")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"36c3":function(t,e,n){var r=n("335c"),i=n("25eb");t.exports=function(t){return r(i(t))}},3702:function(t,e,n){var r=n("481b"),i=n("5168")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},"38fd":function(t,e,n){var r=n("69a8"),i=n("4bf8"),o=n("613b")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},3934:function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},"3a38":function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},"3b2b":function(t,e,n){var r=n("7726"),i=n("5dbc"),o=n("86cc").f,a=n("9093").f,s=n("aae3"),l=n("0bfb"),u=r.RegExp,c=u,h=u.prototype,p=/a/g,f=/a/g,d=new u(p)!==p;if(n("9e1e")&&(!d||n("79e5")((function(){return f[n("2b4c")("match")]=!1,u(p)!=p||u(f)==f||"/a/i"!=u(p,"i")})))){u=function(t,e){var n=this instanceof u,r=s(t),o=void 0===e;return!n&&r&&t.constructor===u&&o?t:i(d?new c(r&&!o?t.source:t,e):c((r=t instanceof u)?t.source:t,r&&o?l.call(t):e),n?this:h,u)};for(var g=function(t){t in u||o(u,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})},v=a(c),y=0;v.length>y;)g(v[y++]);h.constructor=u,u.prototype=h,n("2aba")(r,"RegExp",u)}n("7a56")("RegExp")},"3b8d":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("795b"),i=n.n(r);function o(t,e,n,r,o,a,s){try{var l=t[a](s),u=l.value}catch(c){return void n(c)}l.done?e(u):i.a.resolve(u).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new i.a((function(r,i){var a=t.apply(e,n);function s(t){o(a,r,i,s,l,"next",t)}function l(t){o(a,r,i,s,l,"throw",t)}s(void 0)}))}}},"3c11":function(t,e,n){"use strict";var r=n("63b6"),i=n("584a"),o=n("e53d"),a=n("f201"),s=n("cd78");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then((function(){return n}))}:t,n?function(n){return s(e,t()).then((function(){throw n}))}:t)}})},"3c4e":function(t,e,n){"use strict";var r=function(t){return i(t)&&!o(t)};function i(t){return!!t&&"object"===typeof t}function o(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||l(t)}var a="function"===typeof Symbol&&Symbol.for,s=a?Symbol.for("react.element"):60103;function l(t){return t.$$typeof===s}function u(t){return Array.isArray(t)?[]:{}}function c(t,e){var n=e&&!0===e.clone;return n&&r(t)?f(u(t),t,e):t}function h(t,e,n){var i=t.slice();return e.forEach((function(e,o){"undefined"===typeof i[o]?i[o]=c(e,n):r(e)?i[o]=f(t[o],e,n):-1===t.indexOf(e)&&i.push(c(e,n))})),i}function p(t,e,n){var i={};return r(t)&&Object.keys(t).forEach((function(e){i[e]=c(t[e],n)})),Object.keys(e).forEach((function(o){r(e[o])&&t[o]?i[o]=f(t[o],e[o],n):i[o]=c(e[o],n)})),i}function f(t,e,n){var r=Array.isArray(e),i=Array.isArray(t),o=n||{arrayMerge:h},a=r===i;if(a){if(r){var s=o.arrayMerge||h;return s(t,e,n)}return p(t,e,n)}return c(e,n)}f.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce((function(t,n){return f(t,n,e)}))};var d=f;t.exports=d},"3f6b":function(t,e,n){t.exports={default:n("51b6"),__esModule:!0}},"40c3":function(t,e,n){var r=n("6b4c"),i=n("5168")("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},4178:function(t,e,n){var r,i,o,a=n("d864"),s=n("3024"),l=n("32fc"),u=n("1ec9"),c=n("e53d"),h=c.process,p=c.setImmediate,f=c.clearImmediate,d=c.MessageChannel,g=c.Dispatch,v=0,y={},m="onreadystatechange",x=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},_=function(t){x.call(t.data)};p&&f||(p=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return y[++v]=function(){s("function"==typeof t?t:Function(t),e)},r(v),v},f=function(t){delete y[t]},"process"==n("6b4c")(h)?r=function(t){h.nextTick(a(x,t,1))}:g&&g.now?r=function(t){g.now(a(x,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(t){c.postMessage(t+"","*")},c.addEventListener("message",_,!1)):r=m in u("script")?function(t){l.appendChild(u("script"))[m]=function(){l.removeChild(this),x.call(t)}}:function(t){setTimeout(a(x,t,1),0)}),t.exports={set:p,clear:f}},"41a0":function(t,e,n){"use strict";var r=n("2aeb"),i=n("4630"),o=n("7f20"),a={};n("32e9")(a,n("2b4c")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},"41b2":function(t,e,n){"use strict";e.__esModule=!0;var r=n("3f6b"),i=o(r);function o(t){return t&&t.__esModule?t:{default:t}}e.default=i.default||function(t){for(var e=1;e0?r:n)(t)}},"45f2":function(t,e,n){var r=n("d9f6").f,i=n("07e3"),o=n("5168")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"467f":function(t,e,n){"use strict";var r=n("2d83");t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},"46a7":function(t,e,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(t,e,n){var r=n("c3a1"),i=n("9aa9"),o=n("355d");t.exports=function(t){var e=r(t),n=i.f;if(n){var a,s=n(t),l=o.f,u=0;while(s.length>u)l.call(t,a=s[u++])&&e.push(a)}return e}},"481b":function(t,e){t.exports={}},4917:function(t,e,n){"use strict";var r=n("cb7c"),i=n("9def"),o=n("0390"),a=n("5f1b");n("214f")("match",1,(function(t,e,n,s){return[function(n){var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=s(n,t,this);if(e.done)return e.value;var l=r(t),u=String(this);if(!l.global)return a(l,u);var c=l.unicode;l.lastIndex=0;var h,p=[],f=0;while(null!==(h=a(l,u))){var d=String(h[0]);p[f]=d,""===d&&(l.lastIndex=o(u,i(l.lastIndex),c)),f++}return 0===f?null:p}]}))},"4a59":function(t,e,n){var r=n("9b43"),i=n("1fa8"),o=n("33a4"),a=n("cb7c"),s=n("9def"),l=n("27ee"),u={},c={};e=t.exports=function(t,e,n,h,p){var f,d,g,v,y=p?function(){return t}:l(t),m=r(n,h,e?2:1),x=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(f=s(t.length);f>x;x++)if(v=e?m(a(d=t[x])[0],d[1]):m(t[x]),v===u||v===c)return v}else for(g=y.call(t);!(d=g.next()).done;)if(v=i(g,m,d.value,e),v===u||v===c)return v};e.BREAK=u,e.RETURN=c},"4a7b":function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function o(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function a(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function s(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function l(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||o,i=e(t);r.isUndefined(i)&&e!==l||(n[t]=i)})),n}},"4bf8":function(t,e,n){var r=n("be13");t.exports=function(t){return Object(r(t))}},"4c95":function(t,e,n){"use strict";var r=n("e53d"),i=n("584a"),o=n("d9f6"),a=n("8e60"),s=n("5168")("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];a&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},"4ee1":function(t,e,n){var r=n("5168")("iterator"),i=!1;try{var o=[7][r]();o["return"]=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(a){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(a){}return n}},"4f7f":function(t,e,n){"use strict";var r=n("c26b"),i=n("b39a"),o="Set";t.exports=n("e0b8")(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,o),t=0===t?0:t,t)}},r)},"50ed":function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},5147:function(t,e,n){var r=n("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(i){}}return!0}},5168:function(t,e,n){var r=n("dbdb")("wks"),i=n("62a0"),o=n("e53d").Symbol,a="function"==typeof o,s=t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))};s.store=r},"51b6":function(t,e,n){n("a3c3"),t.exports=n("584a").Object.assign},"520a":function(t,e,n){"use strict";var r=n("0bfb"),i=RegExp.prototype.exec,o=String.prototype.replace,a=i,s="lastIndex",l=function(){var t=/a/,e=/b*/g;return i.call(t,"a"),i.call(e,"a"),0!==t[s]||0!==e[s]}(),u=void 0!==/()??/.exec("")[1],c=l||u;c&&(a=function(t){var e,n,a,c,h=this;return u&&(n=new RegExp("^"+h.source+"$(?!\\s)",r.call(h))),l&&(e=h[s]),a=i.call(h,t),l&&a&&(h[s]=h.global?a.index+a[0].length:e),u&&a&&a.length>1&&o.call(a[0],n,(function(){for(c=1;c1?arguments[1]:void 0,v=void 0!==g,y=0,m=c(p);if(v&&(g=r(g,d>2?arguments[2]:void 0,2)),void 0==m||f==Array&&s(m))for(e=l(p.length),n=new f(e);e>y;y++)u(n,y,v?g(p[y],y):p[y]);else for(h=m.call(p),n=new f;!(i=h.next()).done;y++)u(n,y,v?a(h,g,[i.value,y],!0):i.value);return n.length=y,n}})},"551c":function(t,e,n){"use strict";var r,i,o,a,s=n("2d00"),l=n("7726"),u=n("9b43"),c=n("23c6"),h=n("5ca1"),p=n("d3f4"),f=n("d8e8"),d=n("f605"),g=n("4a59"),v=n("ebd6"),y=n("1991").set,m=n("8079")(),x=n("a5b8"),_=n("9c80"),b=n("a25f"),w=n("bcaa"),S="Promise",M=l.TypeError,C=l.process,I=C&&C.versions,T=I&&I.v8||"",A=l[S],D="process"==c(C),k=function(){},L=i=x.f,O=!!function(){try{var t=A.resolve(1),e=(t.constructor={})[n("2b4c")("species")]=function(t){t(k,k)};return(D||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e&&0!==T.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(r){}}(),P=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},E=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,s=i?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{s?(i||(2==t._h&&z(t),t._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&(c.exit(),a=!0)),n===e.promise?u(M("Promise-chain cycle")):(o=P(n))?o.call(n,l,u):l(n)):u(r)}catch(h){c&&!a&&c.exit(),u(h)}};while(n.length>o)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&R(t)}))}},R=function(t){y.call(l,(function(){var e,n,r,i=t._v,o=N(t);if(o&&(e=_((function(){D?C.emit("unhandledRejection",i,t):(n=l.onunhandledrejection)?n({promise:t,reason:i}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=D||N(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},N=function(t){return 1!==t._h&&0===(t._a||t._c).length},z=function(t){y.call(l,(function(){var e;D?C.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})}))},B=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),E(e,!0))},V=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw M("Promise can't be resolved itself");(e=P(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,u(V,r,1),u(B,r,1))}catch(i){B.call(r,i)}})):(n._v=t,n._s=1,E(n,!1))}catch(r){B.call({_w:n,_d:!1},r)}}};O||(A=function(t){d(this,A,S,"_h"),f(t),r.call(this);try{t(u(V,this,1),u(B,this,1))}catch(e){B.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("dcbc")(A.prototype,{then:function(t,e){var n=L(v(this,A));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=D?C.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&E(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(V,t,1),this.reject=u(B,t,1)},x.f=L=function(t){return t===A||t===a?new o(t):i(t)}),h(h.G+h.W+h.F*!O,{Promise:A}),n("7f20")(A,S),n("7a56")(S),a=n("8378")[S],h(h.S+h.F*!O,S,{reject:function(t){var e=L(this),n=e.reject;return n(t),e.promise}}),h(h.S+h.F*(s||!O),S,{resolve:function(t){return w(s&&this===a?A:this,t)}}),h(h.S+h.F*!(O&&n("5cc5")((function(t){A.all(t)["catch"](k)}))),S,{all:function(t){var e=this,n=L(e),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;g(t,!1,(function(t){var s=o++,l=!1;n.push(void 0),a++,e.resolve(t).then((function(t){l||(l=!0,n[s]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=L(e),r=n.reject,i=_((function(){g(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},5537:function(t,e,n){var r=n("8378"),i=n("7726"),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},5559:function(t,e,n){var r=n("dbdb")("keys"),i=n("62a0");t.exports=function(t){return r[t]||(r[t]=i(t))}},"584a":function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},"597f":function(t,e){t.exports=function(t,e,n,r){var i,o=0;function a(){var a=this,s=Number(new Date)-o,l=arguments;function u(){o=Number(new Date),n.apply(a,l)}function c(){i=void 0}r&&!i&&u(),i&&clearTimeout(i),void 0===r&&s>t?u():!0!==e&&(i=setTimeout(r?c:u,void 0===r?t-s:t))}return"boolean"!==typeof e&&(r=n,n=e,e=void 0),a}},"5b4e":function(t,e,n){var r=n("36c3"),i=n("b447"),o=n("0fc9");t.exports=function(t){return function(e,n,a){var s,l=r(e),u=i(l.length),c=o(a,u);if(t&&n!=n){while(u>c)if(s=l[c++],s!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},"5bba":function(t,e,n){n("9d98");var r=n("584a").Object;t.exports=function(t,e){return r.defineProperties(t,e)}},"5c95":function(t,e,n){var r=n("35e8");t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},"5ca1":function(t,e,n){var r=n("7726"),i=n("8378"),o=n("32e9"),a=n("2aba"),s=n("9b43"),l="prototype",u=function(t,e,n){var c,h,p,f,d=t&u.F,g=t&u.G,v=t&u.S,y=t&u.P,m=t&u.B,x=g?r:v?r[e]||(r[e]={}):(r[e]||{})[l],_=g?i:i[e]||(i[e]={}),b=_[l]||(_[l]={});for(c in g&&(n=e),n)h=!d&&x&&void 0!==x[c],p=(h?x:n)[c],f=m&&h?s(p,r):y&&"function"==typeof p?s(Function.call,p):p,x&&a(x,c,p,t&u.U),_[c]!=p&&o(_,c,f),y&&b[c]!=p&&(b[c]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},"5cc5":function(t,e,n){var r=n("2b4c")("iterator"),i=!1;try{var o=[7][r]();o["return"]=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(a){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(a){}return n}},"5cce":function(t,e){t.exports={version:"0.24.0"}},"5d58":function(t,e,n){t.exports=n("d8d6")},"5dbc":function(t,e,n){var r=n("d3f4"),i=n("8b97").set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},"5df3":function(t,e,n){"use strict";var r=n("02f4")(!0);n("01f9")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},"5e83":function(t,e,n){t.exports=n("8580")},"5eda":function(t,e,n){var r=n("5ca1"),i=n("8378"),o=n("79e5");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)}},"5f02":function(t,e,n){"use strict";t.exports=function(t){return"object"===typeof t&&!0===t.isAxiosError}},"5f1b":function(t,e,n){"use strict";var r=n("23c6"),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"===typeof n){var o=n.call(t,e);if("object"!==typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},"613b":function(t,e,n){var r=n("5537")("keys"),i=n("ca5a");t.exports=function(t){return r[t]||(r[t]=i(t))}},"626a":function(t,e,n){var r=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"62a0":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},"63b6":function(t,e,n){var r=n("e53d"),i=n("584a"),o=n("d864"),a=n("35e8"),s=n("07e3"),l="prototype",u=function(t,e,n){var c,h,p,f=t&u.F,d=t&u.G,g=t&u.S,v=t&u.P,y=t&u.B,m=t&u.W,x=d?i:i[e]||(i[e]={}),_=x[l],b=d?r:g?r[e]:(r[e]||{})[l];for(c in d&&(n=e),n)h=!f&&b&&void 0!==b[c],h&&s(x,c)||(p=h?b[c]:n[c],x[c]=d&&"function"!=typeof b[c]?n[c]:y&&h?o(p,r):m&&b[c]==p?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[l]=t[l],e}(p):v&&"function"==typeof p?o(Function.call,p):p,v&&((x.virtual||(x.virtual={}))[c]=p,t&u.R&&_&&!_[c]&&a(_,c,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},"656e":function(t,e,n){"use strict";var r=n("79aa");function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},6718:function(t,e,n){var r=n("e53d"),i=n("584a"),o=n("b8e3"),a=n("ccb9"),s=n("d9f6").f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},6762:function(t,e,n){"use strict";var r=n("5ca1"),i=n("c366")(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")("includes")},"67ab":function(t,e,n){var r=n("ca5a")("meta"),i=n("d3f4"),o=n("69a8"),a=n("86cc").f,s=0,l=Object.isExtensible||function(){return!0},u=!n("79e5")((function(){return l(Object.preventExtensions({}))})),c=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},h=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[r].i},p=function(t,e){if(!o(t,r)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[r].w},f=function(t){return u&&d.NEED&&l(t)&&!o(t,r)&&c(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:h,getWeak:p,onFreeze:f}},"67bb":function(t,e,n){t.exports=n("f921")},6821:function(t,e,n){var r=n("626a"),i=n("be13");t.exports=function(t){return r(i(t))}},"696e":function(t,e,n){n("c207"),n("1654"),n("6c1c"),n("24c5"),n("3c11"),n("43fc"),t.exports=n("584a").Promise},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"69d3":function(t,e,n){n("6718")("asyncIterator")},"6a99":function(t,e,n){var r=n("d3f4");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")}},"6abf":function(t,e,n){var r=n("e6f3"),i=n("1691").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"6b4c":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"6b54":function(t,e,n){"use strict";n("3846");var r=n("cb7c"),i=n("0bfb"),o=n("9e1e"),a="toString",s=/./[a],l=function(t){n("2aba")(RegExp.prototype,a,t,!0)};n("79e5")((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?l((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):s.name!=a&&l((function(){return s.call(this)}))},"6c1c":function(t,e,n){n("c367");for(var r=n("e53d"),i=n("35e8"),o=n("481b"),a=n("5168")("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e,r=u.some((function(t){return!!~n.indexOf(t)}));r&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),p=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),A="undefined"!==typeof WeakMap?new WeakMap:new n,D=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=h.getInstance(),r=new T(e,n,this);A.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach((function(t){D.prototype[t]=function(){var e;return(e=A.get(this))[t].apply(e,arguments)}}));var k=function(){return"undefined"!==typeof i.ResizeObserver?i.ResizeObserver:D}();e["default"]=k}.call(this,n("c8ba"))},"71c1":function(t,e,n){var r=n("3a38"),i=n("25eb");t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),l=r(n),u=s.length;return l<0||l>=u?t?"":void 0:(o=s.charCodeAt(l),o<55296||o>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):o:t?s.slice(l,l+2):a-56320+(o-55296<<10)+65536)}}},7333:function(t,e,n){"use strict";var r=n("9e1e"),i=n("0d58"),o=n("2621"),a=n("52a7"),s=n("4bf8"),l=n("626a"),u=Object.assign;t.exports=!u||n("79e5")((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r}))?function(t,e){var n=s(t),u=arguments.length,c=1,h=o.f,p=a.f;while(u>c){var f,d=l(arguments[c++]),g=h?i(d).concat(h(d)):i(d),v=g.length,y=0;while(v>y)f=g[y++],r&&!p.call(d,f)||(n[f]=d[f])}return n}:u},"75fc":function(t,e,n){"use strict";var r=n("a745"),i=n.n(r),o=n("db2a");function a(t){if(i()(t))return Object(o["a"])(t)}var s=n("67bb"),l=n.n(s),u=n("5d58"),c=n.n(u),h=n("774e"),p=n.n(h);function f(t){if("undefined"!==typeof l.a&&null!=t[c.a]||null!=t["@@iterator"])return p()(t)}var d=n("e630");function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t){return a(t)||f(t)||Object(d["a"])(t)||g()}n.d(e,"a",(function(){return v}))},7618:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("67bb"),i=n.n(r),o=n("5d58"),a=n.n(o);function s(t){return s="function"==typeof i.a&&"symbol"==typeof a.a?function(t){return typeof t}:function(t){return t&&"function"==typeof i.a&&t.constructor===i.a&&t!==i.a.prototype?"symbol":typeof t},s(t)}},"765d":function(t,e,n){n("6718")("observable")},"768b":function(t,e,n){"use strict";var r=n("a745"),i=n.n(r);function o(t){if(i()(t))return t}var a=n("67bb"),s=n.n(a),l=n("5d58"),u=n.n(l);function c(t,e){var n=null==t?null:"undefined"!==typeof s.a&&t[u.a]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),e&&o.length===e)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}var h=n("e630");function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(t,e){return o(t)||c(t,e)||Object(h["a"])(t,e)||p()}n.d(e,"a",(function(){return f}))},7726: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)},"774e":function(t,e,n){t.exports=n("d2d5")},"77f1":function(t,e,n){var r=n("4588"),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},"794b":function(t,e,n){t.exports=!n("8e60")&&!n("294c")((function(){return 7!=Object.defineProperty(n("1ec9")("div"),"a",{get:function(){return 7}}).a}))},"795b":function(t,e,n){t.exports=n("696e")},"79aa":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"7a56":function(t,e,n){"use strict";var r=n("7726"),i=n("86cc"),o=n("9e1e"),a=n("2b4c")("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},"7a77":function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},"7aac":function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7b3e":function(t,e,n){"use strict";var r,i=n("a3de"); +/** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ +function o(t,e){if(!i.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,o=n in document;if(!o){var a=document.createElement("div");a.setAttribute(n,"return;"),o="function"===typeof a[n]}return!o&&r&&"wheel"===t&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=o},"7cd6":function(t,e,n){var r=n("40c3"),i=n("5168")("iterator"),o=n("481b");t.exports=n("584a").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},"7e90":function(t,e,n){var r=n("d9f6"),i=n("e4ae"),o=n("c3a1");t.exports=n("8e60")?Object.defineProperties:function(t,e){i(t);var n,a=o(e),s=a.length,l=0;while(s>l)r.f(t,n=a[l++],e[n]);return t}},"7f20":function(t,e,n){var r=n("86cc").f,i=n("69a8"),o=n("2b4c")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},"7f7f":function(t,e,n){var r=n("86cc").f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n("9e1e")&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},8079:function(t,e,n){var r=n("7726"),i=n("1991").set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,l="process"==n("2d95")(a);t.exports=function(){var t,e,n,u=function(){var r,i;l&&(r=a.domain)&&r.exit();while(t){i=t.fn,t=t.next;try{i()}catch(o){throw t?n():e=void 0,o}}e=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(u)}}else n=function(){i.call(r,u)};else{var h=!0,p=document.createTextNode("");new o(u).observe(p,{characterData:!0}),n=function(){p.data=h=!h}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},8378:function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},"83b9":function(t,e,n){"use strict";var r=n("d925"),i=n("e683");t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},8436:function(t,e){t.exports=function(){}},"848b":function(t,e,n){"use strict";var r=n("5cce").version,i={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){i[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var o={};function a(t,e,n){if("object"!==typeof t)throw new TypeError("options must be an object");var r=Object.keys(t),i=r.length;while(i-- >0){var o=r[i],a=e[o];if(a){var s=t[o],l=void 0===s||a(s,o,t);if(!0!==l)throw new TypeError("option "+o+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+o)}}i.transitional=function(t,e,n){function i(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,a){if(!1===t)throw new Error(i(r," has been removed"+(e?" in "+e:"")));return e&&!o[r]&&(o[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,a)}},t.exports={assertOptions:a,validators:i}},"84f2":function(t,e){t.exports={}},8580:function(t,e,n){n("ee6d"),t.exports=n("584a").Object.getOwnPropertyDescriptors},"85f2":function(t,e,n){t.exports=n("454f")},"86cc":function(t,e,n){var r=n("cb7c"),i=n("c69a"),o=n("6a99"),a=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8aae":function(t,e,n){n("32a6"),t.exports=n("584a").Object.keys},"8b97":function(t,e,n){var r=n("d3f4"),i=n("cb7c"),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(i){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},"8c4f":function(t,e,n){"use strict"; +/*! + * vue-router v3.0.2 + * (c) 2018 Evan You + * @license MIT + */function r(t,e){0}function i(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function o(t,e){for(var n in e)t[n]=e[n];return t}var a={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,i=e.parent,a=e.data;a.routerView=!0;var l=i.$createElement,u=n.name,c=i.$route,h=i._routerViewCache||(i._routerViewCache={}),p=0,f=!1;while(i&&i._routerRoot!==i)i.$vnode&&i.$vnode.data.routerView&&p++,i._inactive&&(f=!0),i=i.$parent;if(a.routerViewDepth=p,f)return l(h[u],a,r);var d=c.matched[p];if(!d)return h[u]=null,l();var g=h[u]=d.components[u];a.registerRouteInstance=function(t,e){var n=d.instances[u];(e&&n!==t||!e&&n===t)&&(d.instances[u]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){d.instances[u]=e.componentInstance};var v=a.props=s(c,d.props&&d.props[u]);if(v){v=a.props=o({},v);var y=a.attrs=a.attrs||{};for(var m in v)g.props&&m in g.props||(y[m]=v[m],delete v[m])}return l(g,a,r)}};function s(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}var l=/[!'()*]/g,u=function(t){return"%"+t.charCodeAt(0).toString(16)},c=/%2C/g,h=function(t){return encodeURIComponent(t).replace(l,u).replace(c,",")},p=decodeURIComponent;function f(t,e,n){void 0===e&&(e={});var r,i=n||d;try{r=i(t||"")}catch(a){r={}}for(var o in e)r[o]=e[o];return r}function d(t){var e={};return t=t.trim().replace(/^(\?|#|&)/,""),t?(t.split("&").forEach((function(t){var n=t.replace(/\+/g," ").split("="),r=p(n.shift()),i=n.length>0?p(n.join("=")):null;void 0===e[r]?e[r]=i:Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]})),e):e}function g(t){var e=t?Object.keys(t).map((function(e){var n=t[e];if(void 0===n)return"";if(null===n)return h(e);if(Array.isArray(n)){var r=[];return n.forEach((function(t){void 0!==t&&(null===t?r.push(h(e)):r.push(h(e)+"="+h(t)))})),r.join("&")}return h(e)+"="+h(n)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var v=/\/?$/;function y(t,e,n,r){var i=r&&r.options.stringifyQuery,o=e.query||{};try{o=m(o)}catch(s){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:b(e,i),matched:t?_(t):[]};return n&&(a.redirectedFrom=b(n,i)),Object.freeze(a)}function m(t){if(Array.isArray(t))return t.map(m);if(t&&"object"===typeof t){var e={};for(var n in t)e[n]=m(t[n]);return e}return t}var x=y(null,{path:"/"});function _(t){var e=[];while(t)e.unshift(t),t=t.parent;return e}function b(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var i=t.hash;void 0===i&&(i="");var o=e||g;return(n||"/")+o(r)+i}function w(t,e){return e===x?t===e:!!e&&(t.path&&e.path?t.path.replace(v,"")===e.path.replace(v,"")&&t.hash===e.hash&&S(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&S(t.query,e.query)&&S(t.params,e.params)))}function S(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every((function(n){var r=t[n],i=e[n];return"object"===typeof r&&"object"===typeof i?S(r,i):String(r)===String(i)}))}function M(t,e){return 0===t.path.replace(v,"/").indexOf(e.path.replace(v,"/"))&&(!e.hash||t.hash===e.hash)&&C(t.query,e.query)}function C(t,e){for(var n in e)if(!(n in t))return!1;return!0}var I,T=[String,Object],A=[String,Array],D={name:"RouterLink",props:{to:{type:T,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:A,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,i=n.resolve(this.to,r,this.append),a=i.location,s=i.route,l=i.href,u={},c=n.options.linkActiveClass,h=n.options.linkExactActiveClass,p=null==c?"router-link-active":c,f=null==h?"router-link-exact-active":h,d=null==this.activeClass?p:this.activeClass,g=null==this.exactActiveClass?f:this.exactActiveClass,v=a.path?y(null,a,null,n):s;u[g]=w(r,v),u[d]=this.exact?u[g]:M(r,v);var m=function(t){k(t)&&(e.replace?n.replace(a):n.push(a))},x={click:k};Array.isArray(this.event)?this.event.forEach((function(t){x[t]=m})):x[this.event]=m;var _={class:u};if("a"===this.tag)_.on=x,_.attrs={href:l};else{var b=L(this.$slots.default);if(b){b.isStatic=!1;var S=b.data=o({},b.data);S.on=x;var C=b.data.attrs=o({},b.data.attrs);C.href=l}else _.on=x}return t(this.tag,_,this.$slots.default)}};function k(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(void 0===t.button||0===t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function L(t){if(t)for(var e,n=0;n=0&&(e=t.slice(r),t=t.slice(0,r));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}function N(t){return t.replace(/\/\//g,"/")}var z=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},B=rt,V=W,F=U,G=Y,H=nt,j=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function W(t,e){var n,r=[],i=0,o=0,a="",s=e&&e.delimiter||"/";while(null!=(n=j.exec(t))){var l=n[0],u=n[1],c=n.index;if(a+=t.slice(o,c),o=c+l.length,u)a+=u[1];else{var h=t[o],p=n[2],f=n[3],d=n[4],g=n[5],v=n[6],y=n[7];a&&(r.push(a),a="");var m=null!=p&&null!=h&&h!==p,x="+"===v||"*"===v,_="?"===v||"*"===v,b=n[2]||s,w=d||g;r.push({name:f||i++,prefix:p||"",delimiter:b,optional:_,repeat:x,partial:m,asterisk:!!y,pattern:w?Z(w):y?".*":"[^"+$(b)+"]+?"})}}return o-1&&(s.params[p]=n.params[p]);if(u)return s.path=ot(u.path,s.params,'named route "'+l+'"'),c(u,s,a)}else if(s.path){s.params={};for(var f=0;f=t.length?n():t[i]?e(t[i],(function(){r(i+1)})):r(i+1)};r(0)}function Et(t){return function(e,n,r){var o=!1,a=0,s=null;Rt(t,(function(t,e,n,l){if("function"===typeof t&&void 0===t.cid){o=!0,a++;var u,c=Vt((function(e){Bt(e)&&(e=e.default),t.resolved="function"===typeof e?e:I.extend(e),n.components[l]=e,a--,a<=0&&r()})),h=Vt((function(t){var e="Failed to resolve async component "+l+": "+t;s||(s=i(t)?t:new Error(e),r(s))}));try{u=t(c,h)}catch(f){h(f)}if(u)if("function"===typeof u.then)u.then(c,h);else{var p=u.component;p&&"function"===typeof p.then&&p.then(c,h)}}})),o||r()}}function Rt(t,e){return Nt(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Nt(t){return Array.prototype.concat.apply([],t)}var zt="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function Bt(t){return t.__esModule||zt&&"Module"===t[Symbol.toStringTag]}function Vt(t){var e=!1;return function(){var n=[],r=arguments.length;while(r--)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Ft=function(t,e){this.router=t,this.base=Gt(e),this.current=x,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function Gt(t){if(!t)if(P){var e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function Ht(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n=0?e.slice(0,n):e;return r+"#"+t}function ie(t){Ct?Lt(re(t)):window.location.hash=t}function oe(t){Ct?Ot(re(t)):window.location.replace(re(t))}var ae=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){e.index=n,e.updateRoute(r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Ft),se=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ht(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Ct&&!1!==t.fallback,this.fallback&&(e="hash"),P||(e="abstract"),this.mode=e,e){case"history":this.history=new Kt(this,t.base);break;case"hash":this.history=new Qt(this,t.base,this.fallback);break;case"abstract":this.history=new ae(this,t.base);break;default:0}},le={currentRoute:{configurable:!0}};function ue(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function ce(t,e,n){var r="hash"===n?"#"+e:e;return t?N(t+"/"+r):r}se.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},le.currentRoute.get=function(){return this.history&&this.history.current},se.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var n=this.history;if(n instanceof Kt)n.transitionTo(n.getCurrentLocation());else if(n instanceof Qt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},se.prototype.beforeEach=function(t){return ue(this.beforeHooks,t)},se.prototype.beforeResolve=function(t){return ue(this.resolveHooks,t)},se.prototype.afterEach=function(t){return ue(this.afterHooks,t)},se.prototype.onReady=function(t,e){this.history.onReady(t,e)},se.prototype.onError=function(t){this.history.onError(t)},se.prototype.push=function(t,e,n){this.history.push(t,e,n)},se.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},se.prototype.go=function(t){this.history.go(t)},se.prototype.back=function(){this.go(-1)},se.prototype.forward=function(){this.go(1)},se.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},se.prototype.resolve=function(t,e,n){var r=ct(t,e||this.history.current,n,this),i=this.match(r,e),o=i.redirectedFrom||i.fullPath,a=this.history.base,s=ce(a,o,this.mode);return{location:r,route:i,href:s,normalizedTo:r,resolved:i}},se.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==x&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(se.prototype,le),se.install=O,se.version="3.0.2",P&&window.Vue&&window.Vue.use(se),e["a"]=se},"8df4":function(t,e,n){"use strict";var r=n("7a77");function i(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;en},ie64:function(){return x.ie()&&p},firefox:function(){return m()||r},opera:function(){return m()||i},webkit:function(){return m()||o},safari:function(){return x.webkit()},chrome:function(){return m()||a},windows:function(){return m()||u},osx:function(){return m()||l},linux:function(){return m()||c},iphone:function(){return m()||f},mobile:function(){return m()||f||d||h||v},nativeApp:function(){return m()||g},android:function(){return m()||h},ipad:function(){return m()||d}};t.exports=x},"8f60":function(t,e,n){"use strict";var r=n("a159"),i=n("aebd"),o=n("45f2"),a={};n("35e8")(a,n("5168")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},9003:function(t,e,n){var r=n("6b4c");t.exports=Array.isArray||function(t){return"Array"==r(t)}},9093:function(t,e,n){var r=n("ce10"),i=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},9138:function(t,e,n){t.exports=n("35e8")},"92fa":function(t,e){var n=/^(attrs|props|on|nativeOn|class|style|hook)$/;function r(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}t.exports=function(t){return t.reduce((function(t,e){var i,o,a,s,l;for(a in e)if(i=t[a],o=e[a],i&&n.test(a))if("class"===a&&("string"===typeof i&&(l=i,t[a]=i={},i[l]=!0),"string"===typeof o&&(l=o,e[a]=o={},o[l]=!0)),"on"===a||"nativeOn"===a||"hook"===a)for(s in o)i[s]=r(i[s],o[s]);else if(Array.isArray(i))t[a]=i.concat(o);else if(Array.isArray(o))t[a]=[i].concat(o);else for(s in o)i[s]=o[s];else t[a]=e[a];return t}),{})}},9306:function(t,e,n){"use strict";var r=n("8e60"),i=n("c3a1"),o=n("9aa9"),a=n("355d"),s=n("241e"),l=n("335c"),u=Object.assign;t.exports=!u||n("294c")((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r}))?function(t,e){var n=s(t),u=arguments.length,c=1,h=o.f,p=a.f;while(u>c){var f,d=l(arguments[c++]),g=h?i(d).concat(h(d)):i(d),v=g.length,y=0;while(v>y)f=g[y++],r&&!p.call(d,f)||(n[f]=d[f])}return n}:u},9619:function(t,e,n){var r=n("597f"),i=n("0e15");t.exports={throttle:r,debounce:i}},"96cf":function(t,e){!function(e){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag",u="object"===typeof t,c=e.regeneratorRuntime;if(c)u&&(t.exports=c);else{c=e.regeneratorRuntime=u?t.exports:{},c.wrap=_;var h="suspendedStart",p="suspendedYield",f="executing",d="completed",g={},v={};v[a]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(O([])));m&&m!==r&&i.call(m,a)&&(v=m);var x=M.prototype=w.prototype=Object.create(v);S.prototype=x.constructor=M,M.constructor=S,M[l]=S.displayName="GeneratorFunction",c.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===S||"GeneratorFunction"===(e.displayName||e.name))},c.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,M):(t.__proto__=M,l in t||(t[l]="GeneratorFunction")),t.prototype=Object.create(x),t},c.awrap=function(t){return{__await:t}},C(I.prototype),I.prototype[s]=function(){return this},c.AsyncIterator=I,c.async=function(t,e,n,r){var i=new I(_(t,e,n,r));return c.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},C(x),x[l]="Generator",x[a]=function(){return this},x.toString=function(){return"[object Generator]"},c.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}}}function _(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,o=Object.create(i.prototype),a=new L(r||[]);return o._invoke=T(t,n,a),o}function b(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}function w(){}function S(){}function M(){}function C(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function I(t){function e(n,r,o,a){var s=b(t[n],t,r);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"===typeof u&&i.call(u,"__await")?Promise.resolve(u.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(u).then((function(t){l.value=t,o(l)}),a)}a(s.arg)}var n;function r(t,r){function i(){return new Promise((function(n,i){e(t,r,n,i)}))}return n=n?n.then(i,i):i()}this._invoke=r}function T(t,e,n){var r=h;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return P()}n.method=i,n.arg=o;while(1){var a=n.delegate;if(a){var s=A(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=b(t,e,n);if("normal"===l.type){if(r=n.done?d:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=d,n.method="throw",n.arg=l.arg)}}}function A(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,A(t,e),"throw"===e.method))return g;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=b(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function O(t){if(t){var e=t[a];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){while(++r1)return this.getValueByKeyPath(key,options);if(templateContext&&"object"===typeof templateContext&&key in templateContext&&placeholder!==templateContext[key])return templateContext[key]=Handler.gen(templateContext[key],key,{currentContext:obj,templateCurrentContext:templateContext}),templateContext[key];if(!(key in Random)&&!(lkey in Random)&&!(okey in Random))return placeholder;for(var i=0;i1&&(i=e.context.path.slice(0),i.pop(),i=this.normalizePath(i.concat(r))),t=r[r.length-1];for(var o=e.context.root,a=e.context.templateRoot,s=1;s1/(t+e)*t?!n:n):Math.random()>=.5},bool:function(t,e,n){return this.boolean(t,e,n)},natural:function(t,e){return t="undefined"!==typeof t?parseInt(t,10):0,e="undefined"!==typeof e?parseInt(e,10):9007199254740992,Math.round(Math.random()*(e-t))+t},integer:function(t,e){return t="undefined"!==typeof t?parseInt(t,10):-9007199254740992,e="undefined"!==typeof e?parseInt(e,10):9007199254740992,Math.round(Math.random()*(e-t))+t},int:function(t,e){return this.integer(t,e)},float:function(t,e,n,r){n=void 0===n?0:n,n=Math.max(Math.min(n,17),0),r=void 0===r?17:r,r=Math.max(Math.min(r,17),0);for(var i=this.integer(t,e)+".",o=0,a=this.natural(n,r);o1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[u]=255*o;return i},hsl2hsv:function(t){var e,n,r=t[0],i=t[1]/100,o=t[2]/100;return o*=2,i*=o<=1?o:2-o,n=(o+i)/2,e=2*i/(o+i),[r,100*e,100*n]},hsv2rgb:function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},hsv2hsl:function(t){var e,n,r=t[0],i=t[1]/100,o=t[2]/100;return n=(2-i)*o,e=i*o,e/=n<=1?n:2-n,n/=2,[r,100*e,100*n]},rgb2hex:function(t,e,n){return"#"+((256+t<<8|e)<<8|n).toString(16).slice(1)},hex2rgb:function(t){return t="0x"+t.slice(1).replace(t.length>4?t:/./g,"$&$&")|0,[t>>16,t>>8&255,255&t]}}},function(t,e){t.exports={navy:{value:"#000080",nicer:"#001F3F"},blue:{value:"#0000ff",nicer:"#0074D9"},aqua:{value:"#00ffff",nicer:"#7FDBFF"},teal:{value:"#008080",nicer:"#39CCCC"},olive:{value:"#008000",nicer:"#3D9970"},green:{value:"#008000",nicer:"#2ECC40"},lime:{value:"#00ff00",nicer:"#01FF70"},yellow:{value:"#ffff00",nicer:"#FFDC00"},orange:{value:"#ffa500",nicer:"#FF851B"},red:{value:"#ff0000",nicer:"#FF4136"},maroon:{value:"#800000",nicer:"#85144B"},fuchsia:{value:"#ff00ff",nicer:"#F012BE"},purple:{value:"#800080",nicer:"#B10DC9"},silver:{value:"#c0c0c0",nicer:"#DDDDDD"},gray:{value:"#808080",nicer:"#AAAAAA"},black:{value:"#000000",nicer:"#111111"},white:{value:"#FFFFFF",nicer:"#FFFFFF"}}},function(t,e,n){var r=n(6),i=n(14);function o(t,e,n,i){return void 0===n?r.natural(t,e):void 0===i?n:r.natural(parseInt(n,10),parseInt(i,10))}t.exports={paragraph:function(t,e){for(var n=o(3,7,t,e),r=[],i=0;i1&&(e=[].slice.call(arguments,0));var n=t.options,r=n.context.templatePath.join("."),i=t.cache[r]=t.cache[r]||{index:0,array:e};return i.array[i.index++%i.array.length]}}},function(t,e){t.exports={first:function(){var t=["James","John","Robert","Michael","William","David","Richard","Charles","Joseph","Thomas","Christopher","Daniel","Paul","Mark","Donald","George","Kenneth","Steven","Edward","Brian","Ronald","Anthony","Kevin","Jason","Matthew","Gary","Timothy","Jose","Larry","Jeffrey","Frank","Scott","Eric"].concat(["Mary","Patricia","Linda","Barbara","Elizabeth","Jennifer","Maria","Susan","Margaret","Dorothy","Lisa","Nancy","Karen","Betty","Helen","Sandra","Donna","Carol","Ruth","Sharon","Michelle","Laura","Sarah","Kimberly","Deborah","Jessica","Shirley","Cynthia","Angela","Melissa","Brenda","Amy","Anna"]);return this.pick(t)},last:function(){var t=["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen"];return this.pick(t)},name:function(t){return this.first()+" "+(t?this.first()+" ":"")+this.last()},cfirst:function(){var t="王 李 张 刘 陈 杨 赵 黄 周 吴 徐 孙 胡 朱 高 林 何 郭 马 罗 梁 宋 郑 谢 韩 唐 冯 于 董 萧 程 曹 袁 邓 许 傅 沈 曾 彭 吕 苏 卢 蒋 蔡 贾 丁 魏 薛 叶 阎 余 潘 杜 戴 夏 锺 汪 田 任 姜 范 方 石 姚 谭 廖 邹 熊 金 陆 郝 孔 白 崔 康 毛 邱 秦 江 史 顾 侯 邵 孟 龙 万 段 雷 钱 汤 尹 黎 易 常 武 乔 贺 赖 龚 文".split(" ");return this.pick(t)},clast:function(){var t="伟 芳 娜 秀英 敏 静 丽 强 磊 军 洋 勇 艳 杰 娟 涛 明 超 秀兰 霞 平 刚 桂英".split(" ");return this.pick(t)},cname:function(){return this.cfirst()+this.clast()}}},function(t,e){t.exports={url:function(t,e){return(t||this.protocol())+"://"+(e||this.domain())+"/"+this.word()},protocol:function(){return this.pick("http ftp gopher mailto mid cid news nntp prospero telnet rlogin tn3270 wais".split(" "))},domain:function(t){return this.word()+"."+(t||this.tld())},tld:function(){return this.pick("com net org edu gov int mil cn com.cn net.cn gov.cn org.cn 中国 中国互联.公司 中国互联.网络 tel biz cc tv info name hk mobi asia cd travel pro museum coop aero ad ae af ag ai al am an ao aq ar as at au aw az ba bb bd be bf bg bh bi bj bm bn bo br bs bt bv bw by bz ca cc cf cg ch ci ck cl cm cn co cq cr cu cv cx cy cz de dj dk dm do dz ec ee eg eh es et ev fi fj fk fm fo fr ga gb gd ge gf gh gi gl gm gn gp gr gt gu gw gy hk hm hn hr ht hu id ie il in io iq ir is it jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc li lk lr ls lt lu lv ly ma mc md mg mh ml mm mn mo mp mq mr ms mt mv mw mx my mz na nc ne nf ng ni nl no np nr nt nu nz om qa pa pe pf pg ph pk pl pm pn pr pt pw py re ro ru rw sa sb sc sd se sg sh si sj sk sl sm sn so sr st su sy sz tc td tf tg th tj tk tm tn to tp tr tt tv tw tz ua ug uk us uy va vc ve vg vn vu wf ws ye yu za zm zr zw".split(" "))},email:function(t){return this.character("lower")+"."+this.word()+"@"+(t||this.word()+"."+this.tld())},ip:function(){return this.natural(0,255)+"."+this.natural(0,255)+"."+this.natural(0,255)+"."+this.natural(0,255)}}},function(t,e,n){var r=n(18),i=["东北","华北","华东","华中","华南","西南","西北"];t.exports={region:function(){return this.pick(i)},province:function(){return this.pick(r).name},city:function(t){var e=this.pick(r),n=this.pick(e.children);return t?[e.name,n.name].join(" "):n.name},county:function(t){var e=this.pick(r),n=this.pick(e.children),i=this.pick(n.children)||{name:"-"};return t?[e.name,n.name,i.name].join(" "):i.name},zip:function(t){for(var e="",n=0;n<(t||6);n++)e+=this.natural(0,9);return e}}},function(t,e){var n={11e4:"北京",110100:"北京市",110101:"东城区",110102:"西城区",110105:"朝阳区",110106:"丰台区",110107:"石景山区",110108:"海淀区",110109:"门头沟区",110111:"房山区",110112:"通州区",110113:"顺义区",110114:"昌平区",110115:"大兴区",110116:"怀柔区",110117:"平谷区",110228:"密云县",110229:"延庆县",110230:"其它区",12e4:"天津",120100:"天津市",120101:"和平区",120102:"河东区",120103:"河西区",120104:"南开区",120105:"河北区",120106:"红桥区",120110:"东丽区",120111:"西青区",120112:"津南区",120113:"北辰区",120114:"武清区",120115:"宝坻区",120116:"滨海新区",120221:"宁河县",120223:"静海县",120225:"蓟县",120226:"其它区",13e4:"河北省",130100:"石家庄市",130102:"长安区",130103:"桥东区",130104:"桥西区",130105:"新华区",130107:"井陉矿区",130108:"裕华区",130121:"井陉县",130123:"正定县",130124:"栾城县",130125:"行唐县",130126:"灵寿县",130127:"高邑县",130128:"深泽县",130129:"赞皇县",130130:"无极县",130131:"平山县",130132:"元氏县",130133:"赵县",130181:"辛集市",130182:"藁城市",130183:"晋州市",130184:"新乐市",130185:"鹿泉市",130186:"其它区",130200:"唐山市",130202:"路南区",130203:"路北区",130204:"古冶区",130205:"开平区",130207:"丰南区",130208:"丰润区",130223:"滦县",130224:"滦南县",130225:"乐亭县",130227:"迁西县",130229:"玉田县",130230:"曹妃甸区",130281:"遵化市",130283:"迁安市",130284:"其它区",130300:"秦皇岛市",130302:"海港区",130303:"山海关区",130304:"北戴河区",130321:"青龙满族自治县",130322:"昌黎县",130323:"抚宁县",130324:"卢龙县",130398:"其它区",130400:"邯郸市",130402:"邯山区",130403:"丛台区",130404:"复兴区",130406:"峰峰矿区",130421:"邯郸县",130423:"临漳县",130424:"成安县",130425:"大名县",130426:"涉县",130427:"磁县",130428:"肥乡县",130429:"永年县",130430:"邱县",130431:"鸡泽县",130432:"广平县",130433:"馆陶县",130434:"魏县",130435:"曲周县",130481:"武安市",130482:"其它区",130500:"邢台市",130502:"桥东区",130503:"桥西区",130521:"邢台县",130522:"临城县",130523:"内丘县",130524:"柏乡县",130525:"隆尧县",130526:"任县",130527:"南和县",130528:"宁晋县",130529:"巨鹿县",130530:"新河县",130531:"广宗县",130532:"平乡县",130533:"威县",130534:"清河县",130535:"临西县",130581:"南宫市",130582:"沙河市",130583:"其它区",130600:"保定市",130602:"新市区",130603:"北市区",130604:"南市区",130621:"满城县",130622:"清苑县",130623:"涞水县",130624:"阜平县",130625:"徐水县",130626:"定兴县",130627:"唐县",130628:"高阳县",130629:"容城县",130630:"涞源县",130631:"望都县",130632:"安新县",130633:"易县",130634:"曲阳县",130635:"蠡县",130636:"顺平县",130637:"博野县",130638:"雄县",130681:"涿州市",130682:"定州市",130683:"安国市",130684:"高碑店市",130699:"其它区",130700:"张家口市",130702:"桥东区",130703:"桥西区",130705:"宣化区",130706:"下花园区",130721:"宣化县",130722:"张北县",130723:"康保县",130724:"沽源县",130725:"尚义县",130726:"蔚县",130727:"阳原县",130728:"怀安县",130729:"万全县",130730:"怀来县",130731:"涿鹿县",130732:"赤城县",130733:"崇礼县",130734:"其它区",130800:"承德市",130802:"双桥区",130803:"双滦区",130804:"鹰手营子矿区",130821:"承德县",130822:"兴隆县",130823:"平泉县",130824:"滦平县",130825:"隆化县",130826:"丰宁满族自治县",130827:"宽城满族自治县",130828:"围场满族蒙古族自治县",130829:"其它区",130900:"沧州市",130902:"新华区",130903:"运河区",130921:"沧县",130922:"青县",130923:"东光县",130924:"海兴县",130925:"盐山县",130926:"肃宁县",130927:"南皮县",130928:"吴桥县",130929:"献县",130930:"孟村回族自治县",130981:"泊头市",130982:"任丘市",130983:"黄骅市",130984:"河间市",130985:"其它区",131e3:"廊坊市",131002:"安次区",131003:"广阳区",131022:"固安县",131023:"永清县",131024:"香河县",131025:"大城县",131026:"文安县",131028:"大厂回族自治县",131081:"霸州市",131082:"三河市",131083:"其它区",131100:"衡水市",131102:"桃城区",131121:"枣强县",131122:"武邑县",131123:"武强县",131124:"饶阳县",131125:"安平县",131126:"故城县",131127:"景县",131128:"阜城县",131181:"冀州市",131182:"深州市",131183:"其它区",14e4:"山西省",140100:"太原市",140105:"小店区",140106:"迎泽区",140107:"杏花岭区",140108:"尖草坪区",140109:"万柏林区",140110:"晋源区",140121:"清徐县",140122:"阳曲县",140123:"娄烦县",140181:"古交市",140182:"其它区",140200:"大同市",140202:"城区",140203:"矿区",140211:"南郊区",140212:"新荣区",140221:"阳高县",140222:"天镇县",140223:"广灵县",140224:"灵丘县",140225:"浑源县",140226:"左云县",140227:"大同县",140228:"其它区",140300:"阳泉市",140302:"城区",140303:"矿区",140311:"郊区",140321:"平定县",140322:"盂县",140323:"其它区",140400:"长治市",140421:"长治县",140423:"襄垣县",140424:"屯留县",140425:"平顺县",140426:"黎城县",140427:"壶关县",140428:"长子县",140429:"武乡县",140430:"沁县",140431:"沁源县",140481:"潞城市",140482:"城区",140483:"郊区",140485:"其它区",140500:"晋城市",140502:"城区",140521:"沁水县",140522:"阳城县",140524:"陵川县",140525:"泽州县",140581:"高平市",140582:"其它区",140600:"朔州市",140602:"朔城区",140603:"平鲁区",140621:"山阴县",140622:"应县",140623:"右玉县",140624:"怀仁县",140625:"其它区",140700:"晋中市",140702:"榆次区",140721:"榆社县",140722:"左权县",140723:"和顺县",140724:"昔阳县",140725:"寿阳县",140726:"太谷县",140727:"祁县",140728:"平遥县",140729:"灵石县",140781:"介休市",140782:"其它区",140800:"运城市",140802:"盐湖区",140821:"临猗县",140822:"万荣县",140823:"闻喜县",140824:"稷山县",140825:"新绛县",140826:"绛县",140827:"垣曲县",140828:"夏县",140829:"平陆县",140830:"芮城县",140881:"永济市",140882:"河津市",140883:"其它区",140900:"忻州市",140902:"忻府区",140921:"定襄县",140922:"五台县",140923:"代县",140924:"繁峙县",140925:"宁武县",140926:"静乐县",140927:"神池县",140928:"五寨县",140929:"岢岚县",140930:"河曲县",140931:"保德县",140932:"偏关县",140981:"原平市",140982:"其它区",141e3:"临汾市",141002:"尧都区",141021:"曲沃县",141022:"翼城县",141023:"襄汾县",141024:"洪洞县",141025:"古县",141026:"安泽县",141027:"浮山县",141028:"吉县",141029:"乡宁县",141030:"大宁县",141031:"隰县",141032:"永和县",141033:"蒲县",141034:"汾西县",141081:"侯马市",141082:"霍州市",141083:"其它区",141100:"吕梁市",141102:"离石区",141121:"文水县",141122:"交城县",141123:"兴县",141124:"临县",141125:"柳林县",141126:"石楼县",141127:"岚县",141128:"方山县",141129:"中阳县",141130:"交口县",141181:"孝义市",141182:"汾阳市",141183:"其它区",15e4:"内蒙古自治区",150100:"呼和浩特市",150102:"新城区",150103:"回民区",150104:"玉泉区",150105:"赛罕区",150121:"土默特左旗",150122:"托克托县",150123:"和林格尔县",150124:"清水河县",150125:"武川县",150126:"其它区",150200:"包头市",150202:"东河区",150203:"昆都仑区",150204:"青山区",150205:"石拐区",150206:"白云鄂博矿区",150207:"九原区",150221:"土默特右旗",150222:"固阳县",150223:"达尔罕茂明安联合旗",150224:"其它区",150300:"乌海市",150302:"海勃湾区",150303:"海南区",150304:"乌达区",150305:"其它区",150400:"赤峰市",150402:"红山区",150403:"元宝山区",150404:"松山区",150421:"阿鲁科尔沁旗",150422:"巴林左旗",150423:"巴林右旗",150424:"林西县",150425:"克什克腾旗",150426:"翁牛特旗",150428:"喀喇沁旗",150429:"宁城县",150430:"敖汉旗",150431:"其它区",150500:"通辽市",150502:"科尔沁区",150521:"科尔沁左翼中旗",150522:"科尔沁左翼后旗",150523:"开鲁县",150524:"库伦旗",150525:"奈曼旗",150526:"扎鲁特旗",150581:"霍林郭勒市",150582:"其它区",150600:"鄂尔多斯市",150602:"东胜区",150621:"达拉特旗",150622:"准格尔旗",150623:"鄂托克前旗",150624:"鄂托克旗",150625:"杭锦旗",150626:"乌审旗",150627:"伊金霍洛旗",150628:"其它区",150700:"呼伦贝尔市",150702:"海拉尔区",150703:"扎赉诺尔区",150721:"阿荣旗",150722:"莫力达瓦达斡尔族自治旗",150723:"鄂伦春自治旗",150724:"鄂温克族自治旗",150725:"陈巴尔虎旗",150726:"新巴尔虎左旗",150727:"新巴尔虎右旗",150781:"满洲里市",150782:"牙克石市",150783:"扎兰屯市",150784:"额尔古纳市",150785:"根河市",150786:"其它区",150800:"巴彦淖尔市",150802:"临河区",150821:"五原县",150822:"磴口县",150823:"乌拉特前旗",150824:"乌拉特中旗",150825:"乌拉特后旗",150826:"杭锦后旗",150827:"其它区",150900:"乌兰察布市",150902:"集宁区",150921:"卓资县",150922:"化德县",150923:"商都县",150924:"兴和县",150925:"凉城县",150926:"察哈尔右翼前旗",150927:"察哈尔右翼中旗",150928:"察哈尔右翼后旗",150929:"四子王旗",150981:"丰镇市",150982:"其它区",152200:"兴安盟",152201:"乌兰浩特市",152202:"阿尔山市",152221:"科尔沁右翼前旗",152222:"科尔沁右翼中旗",152223:"扎赉特旗",152224:"突泉县",152225:"其它区",152500:"锡林郭勒盟",152501:"二连浩特市",152502:"锡林浩特市",152522:"阿巴嘎旗",152523:"苏尼特左旗",152524:"苏尼特右旗",152525:"东乌珠穆沁旗",152526:"西乌珠穆沁旗",152527:"太仆寺旗",152528:"镶黄旗",152529:"正镶白旗",152530:"正蓝旗",152531:"多伦县",152532:"其它区",152900:"阿拉善盟",152921:"阿拉善左旗",152922:"阿拉善右旗",152923:"额济纳旗",152924:"其它区",21e4:"辽宁省",210100:"沈阳市",210102:"和平区",210103:"沈河区",210104:"大东区",210105:"皇姑区",210106:"铁西区",210111:"苏家屯区",210112:"东陵区",210113:"新城子区",210114:"于洪区",210122:"辽中县",210123:"康平县",210124:"法库县",210181:"新民市",210184:"沈北新区",210185:"其它区",210200:"大连市",210202:"中山区",210203:"西岗区",210204:"沙河口区",210211:"甘井子区",210212:"旅顺口区",210213:"金州区",210224:"长海县",210281:"瓦房店市",210282:"普兰店市",210283:"庄河市",210298:"其它区",210300:"鞍山市",210302:"铁东区",210303:"铁西区",210304:"立山区",210311:"千山区",210321:"台安县",210323:"岫岩满族自治县",210381:"海城市",210382:"其它区",210400:"抚顺市",210402:"新抚区",210403:"东洲区",210404:"望花区",210411:"顺城区",210421:"抚顺县",210422:"新宾满族自治县",210423:"清原满族自治县",210424:"其它区",210500:"本溪市",210502:"平山区",210503:"溪湖区",210504:"明山区",210505:"南芬区",210521:"本溪满族自治县",210522:"桓仁满族自治县",210523:"其它区",210600:"丹东市",210602:"元宝区",210603:"振兴区",210604:"振安区",210624:"宽甸满族自治县",210681:"东港市",210682:"凤城市",210683:"其它区",210700:"锦州市",210702:"古塔区",210703:"凌河区",210711:"太和区",210726:"黑山县",210727:"义县",210781:"凌海市",210782:"北镇市",210783:"其它区",210800:"营口市",210802:"站前区",210803:"西市区",210804:"鲅鱼圈区",210811:"老边区",210881:"盖州市",210882:"大石桥市",210883:"其它区",210900:"阜新市",210902:"海州区",210903:"新邱区",210904:"太平区",210905:"清河门区",210911:"细河区",210921:"阜新蒙古族自治县",210922:"彰武县",210923:"其它区",211e3:"辽阳市",211002:"白塔区",211003:"文圣区",211004:"宏伟区",211005:"弓长岭区",211011:"太子河区",211021:"辽阳县",211081:"灯塔市",211082:"其它区",211100:"盘锦市",211102:"双台子区",211103:"兴隆台区",211121:"大洼县",211122:"盘山县",211123:"其它区",211200:"铁岭市",211202:"银州区",211204:"清河区",211221:"铁岭县",211223:"西丰县",211224:"昌图县",211281:"调兵山市",211282:"开原市",211283:"其它区",211300:"朝阳市",211302:"双塔区",211303:"龙城区",211321:"朝阳县",211322:"建平县",211324:"喀喇沁左翼蒙古族自治县",211381:"北票市",211382:"凌源市",211383:"其它区",211400:"葫芦岛市",211402:"连山区",211403:"龙港区",211404:"南票区",211421:"绥中县",211422:"建昌县",211481:"兴城市",211482:"其它区",22e4:"吉林省",220100:"长春市",220102:"南关区",220103:"宽城区",220104:"朝阳区",220105:"二道区",220106:"绿园区",220112:"双阳区",220122:"农安县",220181:"九台市",220182:"榆树市",220183:"德惠市",220188:"其它区",220200:"吉林市",220202:"昌邑区",220203:"龙潭区",220204:"船营区",220211:"丰满区",220221:"永吉县",220281:"蛟河市",220282:"桦甸市",220283:"舒兰市",220284:"磐石市",220285:"其它区",220300:"四平市",220302:"铁西区",220303:"铁东区",220322:"梨树县",220323:"伊通满族自治县",220381:"公主岭市",220382:"双辽市",220383:"其它区",220400:"辽源市",220402:"龙山区",220403:"西安区",220421:"东丰县",220422:"东辽县",220423:"其它区",220500:"通化市",220502:"东昌区",220503:"二道江区",220521:"通化县",220523:"辉南县",220524:"柳河县",220581:"梅河口市",220582:"集安市",220583:"其它区",220600:"白山市",220602:"浑江区",220621:"抚松县",220622:"靖宇县",220623:"长白朝鲜族自治县",220625:"江源区",220681:"临江市",220682:"其它区",220700:"松原市",220702:"宁江区",220721:"前郭尔罗斯蒙古族自治县",220722:"长岭县",220723:"乾安县",220724:"扶余市",220725:"其它区",220800:"白城市",220802:"洮北区",220821:"镇赉县",220822:"通榆县",220881:"洮南市",220882:"大安市",220883:"其它区",222400:"延边朝鲜族自治州",222401:"延吉市",222402:"图们市",222403:"敦化市",222404:"珲春市",222405:"龙井市",222406:"和龙市",222424:"汪清县",222426:"安图县",222427:"其它区",23e4:"黑龙江省",230100:"哈尔滨市",230102:"道里区",230103:"南岗区",230104:"道外区",230106:"香坊区",230108:"平房区",230109:"松北区",230111:"呼兰区",230123:"依兰县",230124:"方正县",230125:"宾县",230126:"巴彦县",230127:"木兰县",230128:"通河县",230129:"延寿县",230181:"阿城区",230182:"双城市",230183:"尚志市",230184:"五常市",230186:"其它区",230200:"齐齐哈尔市",230202:"龙沙区",230203:"建华区",230204:"铁锋区",230205:"昂昂溪区",230206:"富拉尔基区",230207:"碾子山区",230208:"梅里斯达斡尔族区",230221:"龙江县",230223:"依安县",230224:"泰来县",230225:"甘南县",230227:"富裕县",230229:"克山县",230230:"克东县",230231:"拜泉县",230281:"讷河市",230282:"其它区",230300:"鸡西市",230302:"鸡冠区",230303:"恒山区",230304:"滴道区",230305:"梨树区",230306:"城子河区",230307:"麻山区",230321:"鸡东县",230381:"虎林市",230382:"密山市",230383:"其它区",230400:"鹤岗市",230402:"向阳区",230403:"工农区",230404:"南山区",230405:"兴安区",230406:"东山区",230407:"兴山区",230421:"萝北县",230422:"绥滨县",230423:"其它区",230500:"双鸭山市",230502:"尖山区",230503:"岭东区",230505:"四方台区",230506:"宝山区",230521:"集贤县",230522:"友谊县",230523:"宝清县",230524:"饶河县",230525:"其它区",230600:"大庆市",230602:"萨尔图区",230603:"龙凤区",230604:"让胡路区",230605:"红岗区",230606:"大同区",230621:"肇州县",230622:"肇源县",230623:"林甸县",230624:"杜尔伯特蒙古族自治县",230625:"其它区",230700:"伊春市",230702:"伊春区",230703:"南岔区",230704:"友好区",230705:"西林区",230706:"翠峦区",230707:"新青区",230708:"美溪区",230709:"金山屯区",230710:"五营区",230711:"乌马河区",230712:"汤旺河区",230713:"带岭区",230714:"乌伊岭区",230715:"红星区",230716:"上甘岭区",230722:"嘉荫县",230781:"铁力市",230782:"其它区",230800:"佳木斯市",230803:"向阳区",230804:"前进区",230805:"东风区",230811:"郊区",230822:"桦南县",230826:"桦川县",230828:"汤原县",230833:"抚远县",230881:"同江市",230882:"富锦市",230883:"其它区",230900:"七台河市",230902:"新兴区",230903:"桃山区",230904:"茄子河区",230921:"勃利县",230922:"其它区",231e3:"牡丹江市",231002:"东安区",231003:"阳明区",231004:"爱民区",231005:"西安区",231024:"东宁县",231025:"林口县",231081:"绥芬河市",231083:"海林市",231084:"宁安市",231085:"穆棱市",231086:"其它区",231100:"黑河市",231102:"爱辉区",231121:"嫩江县",231123:"逊克县",231124:"孙吴县",231181:"北安市",231182:"五大连池市",231183:"其它区",231200:"绥化市",231202:"北林区",231221:"望奎县",231222:"兰西县",231223:"青冈县",231224:"庆安县",231225:"明水县",231226:"绥棱县",231281:"安达市",231282:"肇东市",231283:"海伦市",231284:"其它区",232700:"大兴安岭地区",232702:"松岭区",232703:"新林区",232704:"呼中区",232721:"呼玛县",232722:"塔河县",232723:"漠河县",232724:"加格达奇区",232725:"其它区",31e4:"上海",310100:"上海市",310101:"黄浦区",310104:"徐汇区",310105:"长宁区",310106:"静安区",310107:"普陀区",310108:"闸北区",310109:"虹口区",310110:"杨浦区",310112:"闵行区",310113:"宝山区",310114:"嘉定区",310115:"浦东新区",310116:"金山区",310117:"松江区",310118:"青浦区",310120:"奉贤区",310230:"崇明县",310231:"其它区",32e4:"江苏省",320100:"南京市",320102:"玄武区",320104:"秦淮区",320105:"建邺区",320106:"鼓楼区",320111:"浦口区",320113:"栖霞区",320114:"雨花台区",320115:"江宁区",320116:"六合区",320124:"溧水区",320125:"高淳区",320126:"其它区",320200:"无锡市",320202:"崇安区",320203:"南长区",320204:"北塘区",320205:"锡山区",320206:"惠山区",320211:"滨湖区",320281:"江阴市",320282:"宜兴市",320297:"其它区",320300:"徐州市",320302:"鼓楼区",320303:"云龙区",320305:"贾汪区",320311:"泉山区",320321:"丰县",320322:"沛县",320323:"铜山区",320324:"睢宁县",320381:"新沂市",320382:"邳州市",320383:"其它区",320400:"常州市",320402:"天宁区",320404:"钟楼区",320405:"戚墅堰区",320411:"新北区",320412:"武进区",320481:"溧阳市",320482:"金坛市",320483:"其它区",320500:"苏州市",320505:"虎丘区",320506:"吴中区",320507:"相城区",320508:"姑苏区",320581:"常熟市",320582:"张家港市",320583:"昆山市",320584:"吴江区",320585:"太仓市",320596:"其它区",320600:"南通市",320602:"崇川区",320611:"港闸区",320612:"通州区",320621:"海安县",320623:"如东县",320681:"启东市",320682:"如皋市",320684:"海门市",320694:"其它区",320700:"连云港市",320703:"连云区",320705:"新浦区",320706:"海州区",320721:"赣榆县",320722:"东海县",320723:"灌云县",320724:"灌南县",320725:"其它区",320800:"淮安市",320802:"清河区",320803:"淮安区",320804:"淮阴区",320811:"清浦区",320826:"涟水县",320829:"洪泽县",320830:"盱眙县",320831:"金湖县",320832:"其它区",320900:"盐城市",320902:"亭湖区",320903:"盐都区",320921:"响水县",320922:"滨海县",320923:"阜宁县",320924:"射阳县",320925:"建湖县",320981:"东台市",320982:"大丰市",320983:"其它区",321e3:"扬州市",321002:"广陵区",321003:"邗江区",321023:"宝应县",321081:"仪征市",321084:"高邮市",321088:"江都区",321093:"其它区",321100:"镇江市",321102:"京口区",321111:"润州区",321112:"丹徒区",321181:"丹阳市",321182:"扬中市",321183:"句容市",321184:"其它区",321200:"泰州市",321202:"海陵区",321203:"高港区",321281:"兴化市",321282:"靖江市",321283:"泰兴市",321284:"姜堰区",321285:"其它区",321300:"宿迁市",321302:"宿城区",321311:"宿豫区",321322:"沭阳县",321323:"泗阳县",321324:"泗洪县",321325:"其它区",33e4:"浙江省",330100:"杭州市",330102:"上城区",330103:"下城区",330104:"江干区",330105:"拱墅区",330106:"西湖区",330108:"滨江区",330109:"萧山区",330110:"余杭区",330122:"桐庐县",330127:"淳安县",330182:"建德市",330183:"富阳市",330185:"临安市",330186:"其它区",330200:"宁波市",330203:"海曙区",330204:"江东区",330205:"江北区",330206:"北仑区",330211:"镇海区",330212:"鄞州区",330225:"象山县",330226:"宁海县",330281:"余姚市",330282:"慈溪市",330283:"奉化市",330284:"其它区",330300:"温州市",330302:"鹿城区",330303:"龙湾区",330304:"瓯海区",330322:"洞头县",330324:"永嘉县",330326:"平阳县",330327:"苍南县",330328:"文成县",330329:"泰顺县",330381:"瑞安市",330382:"乐清市",330383:"其它区",330400:"嘉兴市",330402:"南湖区",330411:"秀洲区",330421:"嘉善县",330424:"海盐县",330481:"海宁市",330482:"平湖市",330483:"桐乡市",330484:"其它区",330500:"湖州市",330502:"吴兴区",330503:"南浔区",330521:"德清县",330522:"长兴县",330523:"安吉县",330524:"其它区",330600:"绍兴市",330602:"越城区",330621:"绍兴县",330624:"新昌县",330681:"诸暨市",330682:"上虞市",330683:"嵊州市",330684:"其它区",330700:"金华市",330702:"婺城区",330703:"金东区",330723:"武义县",330726:"浦江县",330727:"磐安县",330781:"兰溪市",330782:"义乌市",330783:"东阳市",330784:"永康市",330785:"其它区",330800:"衢州市",330802:"柯城区",330803:"衢江区",330822:"常山县",330824:"开化县",330825:"龙游县",330881:"江山市",330882:"其它区",330900:"舟山市",330902:"定海区",330903:"普陀区",330921:"岱山县",330922:"嵊泗县",330923:"其它区",331e3:"台州市",331002:"椒江区",331003:"黄岩区",331004:"路桥区",331021:"玉环县",331022:"三门县",331023:"天台县",331024:"仙居县",331081:"温岭市",331082:"临海市",331083:"其它区",331100:"丽水市",331102:"莲都区",331121:"青田县",331122:"缙云县",331123:"遂昌县",331124:"松阳县",331125:"云和县",331126:"庆元县",331127:"景宁畲族自治县",331181:"龙泉市",331182:"其它区",34e4:"安徽省",340100:"合肥市",340102:"瑶海区",340103:"庐阳区",340104:"蜀山区",340111:"包河区",340121:"长丰县",340122:"肥东县",340123:"肥西县",340192:"其它区",340200:"芜湖市",340202:"镜湖区",340203:"弋江区",340207:"鸠江区",340208:"三山区",340221:"芜湖县",340222:"繁昌县",340223:"南陵县",340224:"其它区",340300:"蚌埠市",340302:"龙子湖区",340303:"蚌山区",340304:"禹会区",340311:"淮上区",340321:"怀远县",340322:"五河县",340323:"固镇县",340324:"其它区",340400:"淮南市",340402:"大通区",340403:"田家庵区",340404:"谢家集区",340405:"八公山区",340406:"潘集区",340421:"凤台县",340422:"其它区",340500:"马鞍山市",340503:"花山区",340504:"雨山区",340506:"博望区",340521:"当涂县",340522:"其它区",340600:"淮北市",340602:"杜集区",340603:"相山区",340604:"烈山区",340621:"濉溪县",340622:"其它区",340700:"铜陵市",340702:"铜官山区",340703:"狮子山区",340711:"郊区",340721:"铜陵县",340722:"其它区",340800:"安庆市",340802:"迎江区",340803:"大观区",340811:"宜秀区",340822:"怀宁县",340823:"枞阳县",340824:"潜山县",340825:"太湖县",340826:"宿松县",340827:"望江县",340828:"岳西县",340881:"桐城市",340882:"其它区",341e3:"黄山市",341002:"屯溪区",341003:"黄山区",341004:"徽州区",341021:"歙县",341022:"休宁县",341023:"黟县",341024:"祁门县",341025:"其它区",341100:"滁州市",341102:"琅琊区",341103:"南谯区",341122:"来安县",341124:"全椒县",341125:"定远县",341126:"凤阳县",341181:"天长市",341182:"明光市",341183:"其它区",341200:"阜阳市",341202:"颍州区",341203:"颍东区",341204:"颍泉区",341221:"临泉县",341222:"太和县",341225:"阜南县",341226:"颍上县",341282:"界首市",341283:"其它区",341300:"宿州市",341302:"埇桥区",341321:"砀山县",341322:"萧县",341323:"灵璧县",341324:"泗县",341325:"其它区",341400:"巢湖市",341421:"庐江县",341422:"无为县",341423:"含山县",341424:"和县",341500:"六安市",341502:"金安区",341503:"裕安区",341521:"寿县",341522:"霍邱县",341523:"舒城县",341524:"金寨县",341525:"霍山县",341526:"其它区",341600:"亳州市",341602:"谯城区",341621:"涡阳县",341622:"蒙城县",341623:"利辛县",341624:"其它区",341700:"池州市",341702:"贵池区",341721:"东至县",341722:"石台县",341723:"青阳县",341724:"其它区",341800:"宣城市",341802:"宣州区",341821:"郎溪县",341822:"广德县",341823:"泾县",341824:"绩溪县",341825:"旌德县",341881:"宁国市",341882:"其它区",35e4:"福建省",350100:"福州市",350102:"鼓楼区",350103:"台江区",350104:"仓山区",350105:"马尾区",350111:"晋安区",350121:"闽侯县",350122:"连江县",350123:"罗源县",350124:"闽清县",350125:"永泰县",350128:"平潭县",350181:"福清市",350182:"长乐市",350183:"其它区",350200:"厦门市",350203:"思明区",350205:"海沧区",350206:"湖里区",350211:"集美区",350212:"同安区",350213:"翔安区",350214:"其它区",350300:"莆田市",350302:"城厢区",350303:"涵江区",350304:"荔城区",350305:"秀屿区",350322:"仙游县",350323:"其它区",350400:"三明市",350402:"梅列区",350403:"三元区",350421:"明溪县",350423:"清流县",350424:"宁化县",350425:"大田县",350426:"尤溪县",350427:"沙县",350428:"将乐县",350429:"泰宁县",350430:"建宁县",350481:"永安市",350482:"其它区",350500:"泉州市",350502:"鲤城区",350503:"丰泽区",350504:"洛江区",350505:"泉港区",350521:"惠安县",350524:"安溪县",350525:"永春县",350526:"德化县",350527:"金门县",350581:"石狮市",350582:"晋江市",350583:"南安市",350584:"其它区",350600:"漳州市",350602:"芗城区",350603:"龙文区",350622:"云霄县",350623:"漳浦县",350624:"诏安县",350625:"长泰县",350626:"东山县",350627:"南靖县",350628:"平和县",350629:"华安县",350681:"龙海市",350682:"其它区",350700:"南平市",350702:"延平区",350721:"顺昌县",350722:"浦城县",350723:"光泽县",350724:"松溪县",350725:"政和县",350781:"邵武市",350782:"武夷山市",350783:"建瓯市",350784:"建阳市",350785:"其它区",350800:"龙岩市",350802:"新罗区",350821:"长汀县",350822:"永定县",350823:"上杭县",350824:"武平县",350825:"连城县",350881:"漳平市",350882:"其它区",350900:"宁德市",350902:"蕉城区",350921:"霞浦县",350922:"古田县",350923:"屏南县",350924:"寿宁县",350925:"周宁县",350926:"柘荣县",350981:"福安市",350982:"福鼎市",350983:"其它区",36e4:"江西省",360100:"南昌市",360102:"东湖区",360103:"西湖区",360104:"青云谱区",360105:"湾里区",360111:"青山湖区",360121:"南昌县",360122:"新建县",360123:"安义县",360124:"进贤县",360128:"其它区",360200:"景德镇市",360202:"昌江区",360203:"珠山区",360222:"浮梁县",360281:"乐平市",360282:"其它区",360300:"萍乡市",360302:"安源区",360313:"湘东区",360321:"莲花县",360322:"上栗县",360323:"芦溪县",360324:"其它区",360400:"九江市",360402:"庐山区",360403:"浔阳区",360421:"九江县",360423:"武宁县",360424:"修水县",360425:"永修县",360426:"德安县",360427:"星子县",360428:"都昌县",360429:"湖口县",360430:"彭泽县",360481:"瑞昌市",360482:"其它区",360483:"共青城市",360500:"新余市",360502:"渝水区",360521:"分宜县",360522:"其它区",360600:"鹰潭市",360602:"月湖区",360622:"余江县",360681:"贵溪市",360682:"其它区",360700:"赣州市",360702:"章贡区",360721:"赣县",360722:"信丰县",360723:"大余县",360724:"上犹县",360725:"崇义县",360726:"安远县",360727:"龙南县",360728:"定南县",360729:"全南县",360730:"宁都县",360731:"于都县",360732:"兴国县",360733:"会昌县",360734:"寻乌县",360735:"石城县",360781:"瑞金市",360782:"南康市",360783:"其它区",360800:"吉安市",360802:"吉州区",360803:"青原区",360821:"吉安县",360822:"吉水县",360823:"峡江县",360824:"新干县",360825:"永丰县",360826:"泰和县",360827:"遂川县",360828:"万安县",360829:"安福县",360830:"永新县",360881:"井冈山市",360882:"其它区",360900:"宜春市",360902:"袁州区",360921:"奉新县",360922:"万载县",360923:"上高县",360924:"宜丰县",360925:"靖安县",360926:"铜鼓县",360981:"丰城市",360982:"樟树市",360983:"高安市",360984:"其它区",361e3:"抚州市",361002:"临川区",361021:"南城县",361022:"黎川县",361023:"南丰县",361024:"崇仁县",361025:"乐安县",361026:"宜黄县",361027:"金溪县",361028:"资溪县",361029:"东乡县",361030:"广昌县",361031:"其它区",361100:"上饶市",361102:"信州区",361121:"上饶县",361122:"广丰县",361123:"玉山县",361124:"铅山县",361125:"横峰县",361126:"弋阳县",361127:"余干县",361128:"鄱阳县",361129:"万年县",361130:"婺源县",361181:"德兴市",361182:"其它区",37e4:"山东省",370100:"济南市",370102:"历下区",370103:"市中区",370104:"槐荫区",370105:"天桥区",370112:"历城区",370113:"长清区",370124:"平阴县",370125:"济阳县",370126:"商河县",370181:"章丘市",370182:"其它区",370200:"青岛市",370202:"市南区",370203:"市北区",370211:"黄岛区",370212:"崂山区",370213:"李沧区",370214:"城阳区",370281:"胶州市",370282:"即墨市",370283:"平度市",370285:"莱西市",370286:"其它区",370300:"淄博市",370302:"淄川区",370303:"张店区",370304:"博山区",370305:"临淄区",370306:"周村区",370321:"桓台县",370322:"高青县",370323:"沂源县",370324:"其它区",370400:"枣庄市",370402:"市中区",370403:"薛城区",370404:"峄城区",370405:"台儿庄区",370406:"山亭区",370481:"滕州市",370482:"其它区",370500:"东营市",370502:"东营区",370503:"河口区",370521:"垦利县",370522:"利津县",370523:"广饶县",370591:"其它区",370600:"烟台市",370602:"芝罘区",370611:"福山区",370612:"牟平区",370613:"莱山区",370634:"长岛县",370681:"龙口市",370682:"莱阳市",370683:"莱州市",370684:"蓬莱市",370685:"招远市",370686:"栖霞市",370687:"海阳市",370688:"其它区",370700:"潍坊市",370702:"潍城区",370703:"寒亭区",370704:"坊子区",370705:"奎文区",370724:"临朐县",370725:"昌乐县",370781:"青州市",370782:"诸城市",370783:"寿光市",370784:"安丘市",370785:"高密市",370786:"昌邑市",370787:"其它区",370800:"济宁市",370802:"市中区",370811:"任城区",370826:"微山县",370827:"鱼台县",370828:"金乡县",370829:"嘉祥县",370830:"汶上县",370831:"泗水县",370832:"梁山县",370881:"曲阜市",370882:"兖州市",370883:"邹城市",370884:"其它区",370900:"泰安市",370902:"泰山区",370903:"岱岳区",370921:"宁阳县",370923:"东平县",370982:"新泰市",370983:"肥城市",370984:"其它区",371e3:"威海市",371002:"环翠区",371081:"文登市",371082:"荣成市",371083:"乳山市",371084:"其它区",371100:"日照市",371102:"东港区",371103:"岚山区",371121:"五莲县",371122:"莒县",371123:"其它区",371200:"莱芜市",371202:"莱城区",371203:"钢城区",371204:"其它区",371300:"临沂市",371302:"兰山区",371311:"罗庄区",371312:"河东区",371321:"沂南县",371322:"郯城县",371323:"沂水县",371324:"苍山县",371325:"费县",371326:"平邑县",371327:"莒南县",371328:"蒙阴县",371329:"临沭县",371330:"其它区",371400:"德州市",371402:"德城区",371421:"陵县",371422:"宁津县",371423:"庆云县",371424:"临邑县",371425:"齐河县",371426:"平原县",371427:"夏津县",371428:"武城县",371481:"乐陵市",371482:"禹城市",371483:"其它区",371500:"聊城市",371502:"东昌府区",371521:"阳谷县",371522:"莘县",371523:"茌平县",371524:"东阿县",371525:"冠县",371526:"高唐县",371581:"临清市",371582:"其它区",371600:"滨州市",371602:"滨城区",371621:"惠民县",371622:"阳信县",371623:"无棣县",371624:"沾化县",371625:"博兴县",371626:"邹平县",371627:"其它区",371700:"菏泽市",371702:"牡丹区",371721:"曹县",371722:"单县",371723:"成武县",371724:"巨野县",371725:"郓城县",371726:"鄄城县",371727:"定陶县",371728:"东明县",371729:"其它区",41e4:"河南省",410100:"郑州市",410102:"中原区",410103:"二七区",410104:"管城回族区",410105:"金水区",410106:"上街区",410108:"惠济区",410122:"中牟县",410181:"巩义市",410182:"荥阳市",410183:"新密市",410184:"新郑市",410185:"登封市",410188:"其它区",410200:"开封市",410202:"龙亭区",410203:"顺河回族区",410204:"鼓楼区",410205:"禹王台区",410211:"金明区",410221:"杞县",410222:"通许县",410223:"尉氏县",410224:"开封县",410225:"兰考县",410226:"其它区",410300:"洛阳市",410302:"老城区",410303:"西工区",410304:"瀍河回族区",410305:"涧西区",410306:"吉利区",410307:"洛龙区",410322:"孟津县",410323:"新安县",410324:"栾川县",410325:"嵩县",410326:"汝阳县",410327:"宜阳县",410328:"洛宁县",410329:"伊川县",410381:"偃师市",410400:"平顶山市",410402:"新华区",410403:"卫东区",410404:"石龙区",410411:"湛河区",410421:"宝丰县",410422:"叶县",410423:"鲁山县",410425:"郏县",410481:"舞钢市",410482:"汝州市",410483:"其它区",410500:"安阳市",410502:"文峰区",410503:"北关区",410505:"殷都区",410506:"龙安区",410522:"安阳县",410523:"汤阴县",410526:"滑县",410527:"内黄县",410581:"林州市",410582:"其它区",410600:"鹤壁市",410602:"鹤山区",410603:"山城区",410611:"淇滨区",410621:"浚县",410622:"淇县",410623:"其它区",410700:"新乡市",410702:"红旗区",410703:"卫滨区",410704:"凤泉区",410711:"牧野区",410721:"新乡县",410724:"获嘉县",410725:"原阳县",410726:"延津县",410727:"封丘县",410728:"长垣县",410781:"卫辉市",410782:"辉县市",410783:"其它区",410800:"焦作市",410802:"解放区",410803:"中站区",410804:"马村区",410811:"山阳区",410821:"修武县",410822:"博爱县",410823:"武陟县",410825:"温县",410881:"济源市",410882:"沁阳市",410883:"孟州市",410884:"其它区",410900:"濮阳市",410902:"华龙区",410922:"清丰县",410923:"南乐县",410926:"范县",410927:"台前县",410928:"濮阳县",410929:"其它区",411e3:"许昌市",411002:"魏都区",411023:"许昌县",411024:"鄢陵县",411025:"襄城县",411081:"禹州市",411082:"长葛市",411083:"其它区",411100:"漯河市",411102:"源汇区",411103:"郾城区",411104:"召陵区",411121:"舞阳县",411122:"临颍县",411123:"其它区",411200:"三门峡市",411202:"湖滨区",411221:"渑池县",411222:"陕县",411224:"卢氏县",411281:"义马市",411282:"灵宝市",411283:"其它区",411300:"南阳市",411302:"宛城区",411303:"卧龙区",411321:"南召县",411322:"方城县",411323:"西峡县",411324:"镇平县",411325:"内乡县",411326:"淅川县",411327:"社旗县",411328:"唐河县",411329:"新野县",411330:"桐柏县",411381:"邓州市",411382:"其它区",411400:"商丘市",411402:"梁园区",411403:"睢阳区",411421:"民权县",411422:"睢县",411423:"宁陵县",411424:"柘城县",411425:"虞城县",411426:"夏邑县",411481:"永城市",411482:"其它区",411500:"信阳市",411502:"浉河区",411503:"平桥区",411521:"罗山县",411522:"光山县",411523:"新县",411524:"商城县",411525:"固始县",411526:"潢川县",411527:"淮滨县",411528:"息县",411529:"其它区",411600:"周口市",411602:"川汇区",411621:"扶沟县",411622:"西华县",411623:"商水县",411624:"沈丘县",411625:"郸城县",411626:"淮阳县",411627:"太康县",411628:"鹿邑县",411681:"项城市",411682:"其它区",411700:"驻马店市",411702:"驿城区",411721:"西平县",411722:"上蔡县",411723:"平舆县",411724:"正阳县",411725:"确山县",411726:"泌阳县",411727:"汝南县",411728:"遂平县",411729:"新蔡县",411730:"其它区",42e4:"湖北省",420100:"武汉市",420102:"江岸区",420103:"江汉区",420104:"硚口区",420105:"汉阳区",420106:"武昌区",420107:"青山区",420111:"洪山区",420112:"东西湖区",420113:"汉南区",420114:"蔡甸区",420115:"江夏区",420116:"黄陂区",420117:"新洲区",420118:"其它区",420200:"黄石市",420202:"黄石港区",420203:"西塞山区",420204:"下陆区",420205:"铁山区",420222:"阳新县",420281:"大冶市",420282:"其它区",420300:"十堰市",420302:"茅箭区",420303:"张湾区",420321:"郧县",420322:"郧西县",420323:"竹山县",420324:"竹溪县",420325:"房县",420381:"丹江口市",420383:"其它区",420500:"宜昌市",420502:"西陵区",420503:"伍家岗区",420504:"点军区",420505:"猇亭区",420506:"夷陵区",420525:"远安县",420526:"兴山县",420527:"秭归县",420528:"长阳土家族自治县",420529:"五峰土家族自治县",420581:"宜都市",420582:"当阳市",420583:"枝江市",420584:"其它区",420600:"襄阳市",420602:"襄城区",420606:"樊城区",420607:"襄州区",420624:"南漳县",420625:"谷城县",420626:"保康县",420682:"老河口市",420683:"枣阳市",420684:"宜城市",420685:"其它区",420700:"鄂州市",420702:"梁子湖区",420703:"华容区",420704:"鄂城区",420705:"其它区",420800:"荆门市",420802:"东宝区",420804:"掇刀区",420821:"京山县",420822:"沙洋县",420881:"钟祥市",420882:"其它区",420900:"孝感市",420902:"孝南区",420921:"孝昌县",420922:"大悟县",420923:"云梦县",420981:"应城市",420982:"安陆市",420984:"汉川市",420985:"其它区",421e3:"荆州市",421002:"沙市区",421003:"荆州区",421022:"公安县",421023:"监利县",421024:"江陵县",421081:"石首市",421083:"洪湖市",421087:"松滋市",421088:"其它区",421100:"黄冈市",421102:"黄州区",421121:"团风县",421122:"红安县",421123:"罗田县",421124:"英山县",421125:"浠水县",421126:"蕲春县",421127:"黄梅县",421181:"麻城市",421182:"武穴市",421183:"其它区",421200:"咸宁市",421202:"咸安区",421221:"嘉鱼县",421222:"通城县",421223:"崇阳县",421224:"通山县",421281:"赤壁市",421283:"其它区",421300:"随州市",421302:"曾都区",421321:"随县",421381:"广水市",421382:"其它区",422800:"恩施土家族苗族自治州",422801:"恩施市",422802:"利川市",422822:"建始县",422823:"巴东县",422825:"宣恩县",422826:"咸丰县",422827:"来凤县",422828:"鹤峰县",422829:"其它区",429004:"仙桃市",429005:"潜江市",429006:"天门市",429021:"神农架林区",43e4:"湖南省",430100:"长沙市",430102:"芙蓉区",430103:"天心区",430104:"岳麓区",430105:"开福区",430111:"雨花区",430121:"长沙县",430122:"望城区",430124:"宁乡县",430181:"浏阳市",430182:"其它区",430200:"株洲市",430202:"荷塘区",430203:"芦淞区",430204:"石峰区",430211:"天元区",430221:"株洲县",430223:"攸县",430224:"茶陵县",430225:"炎陵县",430281:"醴陵市",430282:"其它区",430300:"湘潭市",430302:"雨湖区",430304:"岳塘区",430321:"湘潭县",430381:"湘乡市",430382:"韶山市",430383:"其它区",430400:"衡阳市",430405:"珠晖区",430406:"雁峰区",430407:"石鼓区",430408:"蒸湘区",430412:"南岳区",430421:"衡阳县",430422:"衡南县",430423:"衡山县",430424:"衡东县",430426:"祁东县",430481:"耒阳市",430482:"常宁市",430483:"其它区",430500:"邵阳市",430502:"双清区",430503:"大祥区",430511:"北塔区",430521:"邵东县",430522:"新邵县",430523:"邵阳县",430524:"隆回县",430525:"洞口县",430527:"绥宁县",430528:"新宁县",430529:"城步苗族自治县",430581:"武冈市",430582:"其它区",430600:"岳阳市",430602:"岳阳楼区",430603:"云溪区",430611:"君山区",430621:"岳阳县",430623:"华容县",430624:"湘阴县",430626:"平江县",430681:"汨罗市",430682:"临湘市",430683:"其它区",430700:"常德市",430702:"武陵区",430703:"鼎城区",430721:"安乡县",430722:"汉寿县",430723:"澧县",430724:"临澧县",430725:"桃源县",430726:"石门县",430781:"津市市",430782:"其它区",430800:"张家界市",430802:"永定区",430811:"武陵源区",430821:"慈利县",430822:"桑植县",430823:"其它区",430900:"益阳市",430902:"资阳区",430903:"赫山区",430921:"南县",430922:"桃江县",430923:"安化县",430981:"沅江市",430982:"其它区",431e3:"郴州市",431002:"北湖区",431003:"苏仙区",431021:"桂阳县",431022:"宜章县",431023:"永兴县",431024:"嘉禾县",431025:"临武县",431026:"汝城县",431027:"桂东县",431028:"安仁县",431081:"资兴市",431082:"其它区",431100:"永州市",431102:"零陵区",431103:"冷水滩区",431121:"祁阳县",431122:"东安县",431123:"双牌县",431124:"道县",431125:"江永县",431126:"宁远县",431127:"蓝山县",431128:"新田县",431129:"江华瑶族自治县",431130:"其它区",431200:"怀化市",431202:"鹤城区",431221:"中方县",431222:"沅陵县",431223:"辰溪县",431224:"溆浦县",431225:"会同县",431226:"麻阳苗族自治县",431227:"新晃侗族自治县",431228:"芷江侗族自治县",431229:"靖州苗族侗族自治县",431230:"通道侗族自治县",431281:"洪江市",431282:"其它区",431300:"娄底市",431302:"娄星区",431321:"双峰县",431322:"新化县",431381:"冷水江市",431382:"涟源市",431383:"其它区",433100:"湘西土家族苗族自治州",433101:"吉首市",433122:"泸溪县",433123:"凤凰县",433124:"花垣县",433125:"保靖县",433126:"古丈县",433127:"永顺县",433130:"龙山县",433131:"其它区",44e4:"广东省",440100:"广州市",440103:"荔湾区",440104:"越秀区",440105:"海珠区",440106:"天河区",440111:"白云区",440112:"黄埔区",440113:"番禺区",440114:"花都区",440115:"南沙区",440116:"萝岗区",440183:"增城市",440184:"从化市",440189:"其它区",440200:"韶关市",440203:"武江区",440204:"浈江区",440205:"曲江区",440222:"始兴县",440224:"仁化县",440229:"翁源县",440232:"乳源瑶族自治县",440233:"新丰县",440281:"乐昌市",440282:"南雄市",440283:"其它区",440300:"深圳市",440303:"罗湖区",440304:"福田区",440305:"南山区",440306:"宝安区",440307:"龙岗区",440308:"盐田区",440309:"其它区",440320:"光明新区",440321:"坪山新区",440322:"大鹏新区",440323:"龙华新区",440400:"珠海市",440402:"香洲区",440403:"斗门区",440404:"金湾区",440488:"其它区",440500:"汕头市",440507:"龙湖区",440511:"金平区",440512:"濠江区",440513:"潮阳区",440514:"潮南区",440515:"澄海区",440523:"南澳县",440524:"其它区",440600:"佛山市",440604:"禅城区",440605:"南海区",440606:"顺德区",440607:"三水区",440608:"高明区",440609:"其它区",440700:"江门市",440703:"蓬江区",440704:"江海区",440705:"新会区",440781:"台山市",440783:"开平市",440784:"鹤山市",440785:"恩平市",440786:"其它区",440800:"湛江市",440802:"赤坎区",440803:"霞山区",440804:"坡头区",440811:"麻章区",440823:"遂溪县",440825:"徐闻县",440881:"廉江市",440882:"雷州市",440883:"吴川市",440884:"其它区",440900:"茂名市",440902:"茂南区",440903:"茂港区",440923:"电白县",440981:"高州市",440982:"化州市",440983:"信宜市",440984:"其它区",441200:"肇庆市",441202:"端州区",441203:"鼎湖区",441223:"广宁县",441224:"怀集县",441225:"封开县",441226:"德庆县",441283:"高要市",441284:"四会市",441285:"其它区",441300:"惠州市",441302:"惠城区",441303:"惠阳区",441322:"博罗县",441323:"惠东县",441324:"龙门县",441325:"其它区",441400:"梅州市",441402:"梅江区",441421:"梅县",441422:"大埔县",441423:"丰顺县",441424:"五华县",441426:"平远县",441427:"蕉岭县",441481:"兴宁市",441482:"其它区",441500:"汕尾市",441502:"城区",441521:"海丰县",441523:"陆河县",441581:"陆丰市",441582:"其它区",441600:"河源市",441602:"源城区",441621:"紫金县",441622:"龙川县",441623:"连平县",441624:"和平县",441625:"东源县",441626:"其它区",441700:"阳江市",441702:"江城区",441721:"阳西县",441723:"阳东县",441781:"阳春市",441782:"其它区",441800:"清远市",441802:"清城区",441821:"佛冈县",441823:"阳山县",441825:"连山壮族瑶族自治县",441826:"连南瑶族自治县",441827:"清新区",441881:"英德市",441882:"连州市",441883:"其它区",441900:"东莞市",442e3:"中山市",442101:"东沙群岛",445100:"潮州市",445102:"湘桥区",445121:"潮安区",445122:"饶平县",445186:"其它区",445200:"揭阳市",445202:"榕城区",445221:"揭东区",445222:"揭西县",445224:"惠来县",445281:"普宁市",445285:"其它区",445300:"云浮市",445302:"云城区",445321:"新兴县",445322:"郁南县",445323:"云安县",445381:"罗定市",445382:"其它区",45e4:"广西壮族自治区",450100:"南宁市",450102:"兴宁区",450103:"青秀区",450105:"江南区",450107:"西乡塘区",450108:"良庆区",450109:"邕宁区",450122:"武鸣县",450123:"隆安县",450124:"马山县",450125:"上林县",450126:"宾阳县",450127:"横县",450128:"其它区",450200:"柳州市",450202:"城中区",450203:"鱼峰区",450204:"柳南区",450205:"柳北区",450221:"柳江县",450222:"柳城县",450223:"鹿寨县",450224:"融安县",450225:"融水苗族自治县",450226:"三江侗族自治县",450227:"其它区",450300:"桂林市",450302:"秀峰区",450303:"叠彩区",450304:"象山区",450305:"七星区",450311:"雁山区",450321:"阳朔县",450322:"临桂区",450323:"灵川县",450324:"全州县",450325:"兴安县",450326:"永福县",450327:"灌阳县",450328:"龙胜各族自治县",450329:"资源县",450330:"平乐县",450331:"荔浦县",450332:"恭城瑶族自治县",450333:"其它区",450400:"梧州市",450403:"万秀区",450405:"长洲区",450406:"龙圩区",450421:"苍梧县",450422:"藤县",450423:"蒙山县",450481:"岑溪市",450482:"其它区",450500:"北海市",450502:"海城区",450503:"银海区",450512:"铁山港区",450521:"合浦县",450522:"其它区",450600:"防城港市",450602:"港口区",450603:"防城区",450621:"上思县",450681:"东兴市",450682:"其它区",450700:"钦州市",450702:"钦南区",450703:"钦北区",450721:"灵山县",450722:"浦北县",450723:"其它区",450800:"贵港市",450802:"港北区",450803:"港南区",450804:"覃塘区",450821:"平南县",450881:"桂平市",450882:"其它区",450900:"玉林市",450902:"玉州区",450903:"福绵区",450921:"容县",450922:"陆川县",450923:"博白县",450924:"兴业县",450981:"北流市",450982:"其它区",451e3:"百色市",451002:"右江区",451021:"田阳县",451022:"田东县",451023:"平果县",451024:"德保县",451025:"靖西县",451026:"那坡县",451027:"凌云县",451028:"乐业县",451029:"田林县",451030:"西林县",451031:"隆林各族自治县",451032:"其它区",451100:"贺州市",451102:"八步区",451119:"平桂管理区",451121:"昭平县",451122:"钟山县",451123:"富川瑶族自治县",451124:"其它区",451200:"河池市",451202:"金城江区",451221:"南丹县",451222:"天峨县",451223:"凤山县",451224:"东兰县",451225:"罗城仫佬族自治县",451226:"环江毛南族自治县",451227:"巴马瑶族自治县",451228:"都安瑶族自治县",451229:"大化瑶族自治县",451281:"宜州市",451282:"其它区",451300:"来宾市",451302:"兴宾区",451321:"忻城县",451322:"象州县",451323:"武宣县",451324:"金秀瑶族自治县",451381:"合山市",451382:"其它区",451400:"崇左市",451402:"江州区",451421:"扶绥县",451422:"宁明县",451423:"龙州县",451424:"大新县",451425:"天等县",451481:"凭祥市",451482:"其它区",46e4:"海南省",460100:"海口市",460105:"秀英区",460106:"龙华区",460107:"琼山区",460108:"美兰区",460109:"其它区",460200:"三亚市",460300:"三沙市",460321:"西沙群岛",460322:"南沙群岛",460323:"中沙群岛的岛礁及其海域",469001:"五指山市",469002:"琼海市",469003:"儋州市",469005:"文昌市",469006:"万宁市",469007:"东方市",469025:"定安县",469026:"屯昌县",469027:"澄迈县",469028:"临高县",469030:"白沙黎族自治县",469031:"昌江黎族自治县",469033:"乐东黎族自治县",469034:"陵水黎族自治县",469035:"保亭黎族苗族自治县",469036:"琼中黎族苗族自治县",471005:"其它区",5e5:"重庆",500100:"重庆市",500101:"万州区",500102:"涪陵区",500103:"渝中区",500104:"大渡口区",500105:"江北区",500106:"沙坪坝区",500107:"九龙坡区",500108:"南岸区",500109:"北碚区",500110:"万盛区",500111:"双桥区",500112:"渝北区",500113:"巴南区",500114:"黔江区",500115:"长寿区",500222:"綦江区",500223:"潼南县",500224:"铜梁县",500225:"大足区",500226:"荣昌县",500227:"璧山县",500228:"梁平县",500229:"城口县",500230:"丰都县",500231:"垫江县",500232:"武隆县",500233:"忠县",500234:"开县",500235:"云阳县",500236:"奉节县",500237:"巫山县",500238:"巫溪县",500240:"石柱土家族自治县",500241:"秀山土家族苗族自治县",500242:"酉阳土家族苗族自治县",500243:"彭水苗族土家族自治县",500381:"江津区",500382:"合川区",500383:"永川区",500384:"南川区",500385:"其它区",51e4:"四川省",510100:"成都市",510104:"锦江区",510105:"青羊区",510106:"金牛区",510107:"武侯区",510108:"成华区",510112:"龙泉驿区",510113:"青白江区",510114:"新都区",510115:"温江区",510121:"金堂县",510122:"双流县",510124:"郫县",510129:"大邑县",510131:"蒲江县",510132:"新津县",510181:"都江堰市",510182:"彭州市",510183:"邛崃市",510184:"崇州市",510185:"其它区",510300:"自贡市",510302:"自流井区",510303:"贡井区",510304:"大安区",510311:"沿滩区",510321:"荣县",510322:"富顺县",510323:"其它区",510400:"攀枝花市",510402:"东区",510403:"西区",510411:"仁和区",510421:"米易县",510422:"盐边县",510423:"其它区",510500:"泸州市",510502:"江阳区",510503:"纳溪区",510504:"龙马潭区",510521:"泸县",510522:"合江县",510524:"叙永县",510525:"古蔺县",510526:"其它区",510600:"德阳市",510603:"旌阳区",510623:"中江县",510626:"罗江县",510681:"广汉市",510682:"什邡市",510683:"绵竹市",510684:"其它区",510700:"绵阳市",510703:"涪城区",510704:"游仙区",510722:"三台县",510723:"盐亭县",510724:"安县",510725:"梓潼县",510726:"北川羌族自治县",510727:"平武县",510781:"江油市",510782:"其它区",510800:"广元市",510802:"利州区",510811:"昭化区",510812:"朝天区",510821:"旺苍县",510822:"青川县",510823:"剑阁县",510824:"苍溪县",510825:"其它区",510900:"遂宁市",510903:"船山区",510904:"安居区",510921:"蓬溪县",510922:"射洪县",510923:"大英县",510924:"其它区",511e3:"内江市",511002:"市中区",511011:"东兴区",511024:"威远县",511025:"资中县",511028:"隆昌县",511029:"其它区",511100:"乐山市",511102:"市中区",511111:"沙湾区",511112:"五通桥区",511113:"金口河区",511123:"犍为县",511124:"井研县",511126:"夹江县",511129:"沐川县",511132:"峨边彝族自治县",511133:"马边彝族自治县",511181:"峨眉山市",511182:"其它区",511300:"南充市",511302:"顺庆区",511303:"高坪区",511304:"嘉陵区",511321:"南部县",511322:"营山县",511323:"蓬安县",511324:"仪陇县",511325:"西充县",511381:"阆中市",511382:"其它区",511400:"眉山市",511402:"东坡区",511421:"仁寿县",511422:"彭山县",511423:"洪雅县",511424:"丹棱县",511425:"青神县",511426:"其它区",511500:"宜宾市",511502:"翠屏区",511521:"宜宾县",511522:"南溪区",511523:"江安县",511524:"长宁县",511525:"高县",511526:"珙县",511527:"筠连县",511528:"兴文县",511529:"屏山县",511530:"其它区",511600:"广安市",511602:"广安区",511603:"前锋区",511621:"岳池县",511622:"武胜县",511623:"邻水县",511681:"华蓥市",511683:"其它区",511700:"达州市",511702:"通川区",511721:"达川区",511722:"宣汉县",511723:"开江县",511724:"大竹县",511725:"渠县",511781:"万源市",511782:"其它区",511800:"雅安市",511802:"雨城区",511821:"名山区",511822:"荥经县",511823:"汉源县",511824:"石棉县",511825:"天全县",511826:"芦山县",511827:"宝兴县",511828:"其它区",511900:"巴中市",511902:"巴州区",511903:"恩阳区",511921:"通江县",511922:"南江县",511923:"平昌县",511924:"其它区",512e3:"资阳市",512002:"雁江区",512021:"安岳县",512022:"乐至县",512081:"简阳市",512082:"其它区",513200:"阿坝藏族羌族自治州",513221:"汶川县",513222:"理县",513223:"茂县",513224:"松潘县",513225:"九寨沟县",513226:"金川县",513227:"小金县",513228:"黑水县",513229:"马尔康县",513230:"壤塘县",513231:"阿坝县",513232:"若尔盖县",513233:"红原县",513234:"其它区",513300:"甘孜藏族自治州",513321:"康定县",513322:"泸定县",513323:"丹巴县",513324:"九龙县",513325:"雅江县",513326:"道孚县",513327:"炉霍县",513328:"甘孜县",513329:"新龙县",513330:"德格县",513331:"白玉县",513332:"石渠县",513333:"色达县",513334:"理塘县",513335:"巴塘县",513336:"乡城县",513337:"稻城县",513338:"得荣县",513339:"其它区",513400:"凉山彝族自治州",513401:"西昌市",513422:"木里藏族自治县",513423:"盐源县",513424:"德昌县",513425:"会理县",513426:"会东县",513427:"宁南县",513428:"普格县",513429:"布拖县",513430:"金阳县",513431:"昭觉县",513432:"喜德县",513433:"冕宁县",513434:"越西县",513435:"甘洛县",513436:"美姑县",513437:"雷波县",513438:"其它区",52e4:"贵州省",520100:"贵阳市",520102:"南明区",520103:"云岩区",520111:"花溪区",520112:"乌当区",520113:"白云区",520121:"开阳县",520122:"息烽县",520123:"修文县",520151:"观山湖区",520181:"清镇市",520182:"其它区",520200:"六盘水市",520201:"钟山区",520203:"六枝特区",520221:"水城县",520222:"盘县",520223:"其它区",520300:"遵义市",520302:"红花岗区",520303:"汇川区",520321:"遵义县",520322:"桐梓县",520323:"绥阳县",520324:"正安县",520325:"道真仡佬族苗族自治县",520326:"务川仡佬族苗族自治县",520327:"凤冈县",520328:"湄潭县",520329:"余庆县",520330:"习水县",520381:"赤水市",520382:"仁怀市",520383:"其它区",520400:"安顺市",520402:"西秀区",520421:"平坝县",520422:"普定县",520423:"镇宁布依族苗族自治县",520424:"关岭布依族苗族自治县",520425:"紫云苗族布依族自治县",520426:"其它区",522200:"铜仁市",522201:"碧江区",522222:"江口县",522223:"玉屏侗族自治县",522224:"石阡县",522225:"思南县",522226:"印江土家族苗族自治县",522227:"德江县",522228:"沿河土家族自治县",522229:"松桃苗族自治县",522230:"万山区",522231:"其它区",522300:"黔西南布依族苗族自治州",522301:"兴义市",522322:"兴仁县",522323:"普安县",522324:"晴隆县",522325:"贞丰县",522326:"望谟县",522327:"册亨县",522328:"安龙县",522329:"其它区",522400:"毕节市",522401:"七星关区",522422:"大方县",522423:"黔西县",522424:"金沙县",522425:"织金县",522426:"纳雍县",522427:"威宁彝族回族苗族自治县",522428:"赫章县",522429:"其它区",522600:"黔东南苗族侗族自治州",522601:"凯里市",522622:"黄平县",522623:"施秉县",522624:"三穗县",522625:"镇远县",522626:"岑巩县",522627:"天柱县",522628:"锦屏县",522629:"剑河县",522630:"台江县",522631:"黎平县",522632:"榕江县",522633:"从江县",522634:"雷山县",522635:"麻江县",522636:"丹寨县",522637:"其它区",522700:"黔南布依族苗族自治州",522701:"都匀市",522702:"福泉市",522722:"荔波县",522723:"贵定县",522725:"瓮安县",522726:"独山县",522727:"平塘县",522728:"罗甸县",522729:"长顺县",522730:"龙里县",522731:"惠水县",522732:"三都水族自治县",522733:"其它区",53e4:"云南省",530100:"昆明市",530102:"五华区",530103:"盘龙区",530111:"官渡区",530112:"西山区",530113:"东川区",530121:"呈贡区",530122:"晋宁县",530124:"富民县",530125:"宜良县",530126:"石林彝族自治县",530127:"嵩明县",530128:"禄劝彝族苗族自治县",530129:"寻甸回族彝族自治县",530181:"安宁市",530182:"其它区",530300:"曲靖市",530302:"麒麟区",530321:"马龙县",530322:"陆良县",530323:"师宗县",530324:"罗平县",530325:"富源县",530326:"会泽县",530328:"沾益县",530381:"宣威市",530382:"其它区",530400:"玉溪市",530402:"红塔区",530421:"江川县",530422:"澄江县",530423:"通海县",530424:"华宁县",530425:"易门县",530426:"峨山彝族自治县",530427:"新平彝族傣族自治县",530428:"元江哈尼族彝族傣族自治县",530429:"其它区",530500:"保山市",530502:"隆阳区",530521:"施甸县",530522:"腾冲县",530523:"龙陵县",530524:"昌宁县",530525:"其它区",530600:"昭通市",530602:"昭阳区",530621:"鲁甸县",530622:"巧家县",530623:"盐津县",530624:"大关县",530625:"永善县",530626:"绥江县",530627:"镇雄县",530628:"彝良县",530629:"威信县",530630:"水富县",530631:"其它区",530700:"丽江市",530702:"古城区",530721:"玉龙纳西族自治县",530722:"永胜县",530723:"华坪县",530724:"宁蒗彝族自治县",530725:"其它区",530800:"普洱市",530802:"思茅区",530821:"宁洱哈尼族彝族自治县",530822:"墨江哈尼族自治县",530823:"景东彝族自治县",530824:"景谷傣族彝族自治县",530825:"镇沅彝族哈尼族拉祜族自治县",530826:"江城哈尼族彝族自治县",530827:"孟连傣族拉祜族佤族自治县",530828:"澜沧拉祜族自治县",530829:"西盟佤族自治县",530830:"其它区",530900:"临沧市",530902:"临翔区",530921:"凤庆县",530922:"云县",530923:"永德县",530924:"镇康县",530925:"双江拉祜族佤族布朗族傣族自治县",530926:"耿马傣族佤族自治县",530927:"沧源佤族自治县",530928:"其它区",532300:"楚雄彝族自治州",532301:"楚雄市",532322:"双柏县",532323:"牟定县",532324:"南华县",532325:"姚安县",532326:"大姚县",532327:"永仁县",532328:"元谋县",532329:"武定县",532331:"禄丰县",532332:"其它区",532500:"红河哈尼族彝族自治州",532501:"个旧市",532502:"开远市",532522:"蒙自市",532523:"屏边苗族自治县",532524:"建水县",532525:"石屏县",532526:"弥勒市",532527:"泸西县",532528:"元阳县",532529:"红河县",532530:"金平苗族瑶族傣族自治县",532531:"绿春县",532532:"河口瑶族自治县",532533:"其它区",532600:"文山壮族苗族自治州",532621:"文山市",532622:"砚山县",532623:"西畴县",532624:"麻栗坡县",532625:"马关县",532626:"丘北县",532627:"广南县",532628:"富宁县",532629:"其它区",532800:"西双版纳傣族自治州",532801:"景洪市",532822:"勐海县",532823:"勐腊县",532824:"其它区",532900:"大理白族自治州",532901:"大理市",532922:"漾濞彝族自治县",532923:"祥云县",532924:"宾川县",532925:"弥渡县",532926:"南涧彝族自治县",532927:"巍山彝族回族自治县",532928:"永平县",532929:"云龙县",532930:"洱源县",532931:"剑川县",532932:"鹤庆县",532933:"其它区",533100:"德宏傣族景颇族自治州",533102:"瑞丽市",533103:"芒市",533122:"梁河县",533123:"盈江县",533124:"陇川县",533125:"其它区",533300:"怒江傈僳族自治州",533321:"泸水县",533323:"福贡县",533324:"贡山独龙族怒族自治县",533325:"兰坪白族普米族自治县",533326:"其它区",533400:"迪庆藏族自治州",533421:"香格里拉县",533422:"德钦县",533423:"维西傈僳族自治县",533424:"其它区",54e4:"西藏自治区",540100:"拉萨市",540102:"城关区",540121:"林周县",540122:"当雄县",540123:"尼木县",540124:"曲水县",540125:"堆龙德庆县",540126:"达孜县",540127:"墨竹工卡县",540128:"其它区",542100:"昌都地区",542121:"昌都县",542122:"江达县",542123:"贡觉县",542124:"类乌齐县",542125:"丁青县",542126:"察雅县",542127:"八宿县",542128:"左贡县",542129:"芒康县",542132:"洛隆县",542133:"边坝县",542134:"其它区",542200:"山南地区",542221:"乃东县",542222:"扎囊县",542223:"贡嘎县",542224:"桑日县",542225:"琼结县",542226:"曲松县",542227:"措美县",542228:"洛扎县",542229:"加查县",542231:"隆子县",542232:"错那县",542233:"浪卡子县",542234:"其它区",542300:"日喀则地区",542301:"日喀则市",542322:"南木林县",542323:"江孜县",542324:"定日县",542325:"萨迦县",542326:"拉孜县",542327:"昂仁县",542328:"谢通门县",542329:"白朗县",542330:"仁布县",542331:"康马县",542332:"定结县",542333:"仲巴县",542334:"亚东县",542335:"吉隆县",542336:"聂拉木县",542337:"萨嘎县",542338:"岗巴县",542339:"其它区",542400:"那曲地区",542421:"那曲县",542422:"嘉黎县",542423:"比如县",542424:"聂荣县",542425:"安多县",542426:"申扎县",542427:"索县",542428:"班戈县",542429:"巴青县",542430:"尼玛县",542431:"其它区",542432:"双湖县",542500:"阿里地区",542521:"普兰县",542522:"札达县",542523:"噶尔县",542524:"日土县",542525:"革吉县",542526:"改则县",542527:"措勤县",542528:"其它区",542600:"林芝地区",542621:"林芝县",542622:"工布江达县",542623:"米林县",542624:"墨脱县",542625:"波密县",542626:"察隅县",542627:"朗县",542628:"其它区",61e4:"陕西省",610100:"西安市",610102:"新城区",610103:"碑林区",610104:"莲湖区",610111:"灞桥区",610112:"未央区",610113:"雁塔区",610114:"阎良区",610115:"临潼区",610116:"长安区",610122:"蓝田县",610124:"周至县",610125:"户县",610126:"高陵县",610127:"其它区",610200:"铜川市",610202:"王益区",610203:"印台区",610204:"耀州区",610222:"宜君县",610223:"其它区",610300:"宝鸡市",610302:"渭滨区",610303:"金台区",610304:"陈仓区",610322:"凤翔县",610323:"岐山县",610324:"扶风县",610326:"眉县",610327:"陇县",610328:"千阳县",610329:"麟游县",610330:"凤县",610331:"太白县",610332:"其它区",610400:"咸阳市",610402:"秦都区",610403:"杨陵区",610404:"渭城区",610422:"三原县",610423:"泾阳县",610424:"乾县",610425:"礼泉县",610426:"永寿县",610427:"彬县",610428:"长武县",610429:"旬邑县",610430:"淳化县",610431:"武功县",610481:"兴平市",610482:"其它区",610500:"渭南市",610502:"临渭区",610521:"华县",610522:"潼关县",610523:"大荔县",610524:"合阳县",610525:"澄城县",610526:"蒲城县",610527:"白水县",610528:"富平县",610581:"韩城市",610582:"华阴市",610583:"其它区",610600:"延安市",610602:"宝塔区",610621:"延长县",610622:"延川县",610623:"子长县",610624:"安塞县",610625:"志丹县",610626:"吴起县",610627:"甘泉县",610628:"富县",610629:"洛川县",610630:"宜川县",610631:"黄龙县",610632:"黄陵县",610633:"其它区",610700:"汉中市",610702:"汉台区",610721:"南郑县",610722:"城固县",610723:"洋县",610724:"西乡县",610725:"勉县",610726:"宁强县",610727:"略阳县",610728:"镇巴县",610729:"留坝县",610730:"佛坪县",610731:"其它区",610800:"榆林市",610802:"榆阳区",610821:"神木县",610822:"府谷县",610823:"横山县",610824:"靖边县",610825:"定边县",610826:"绥德县",610827:"米脂县",610828:"佳县",610829:"吴堡县",610830:"清涧县",610831:"子洲县",610832:"其它区",610900:"安康市",610902:"汉滨区",610921:"汉阴县",610922:"石泉县",610923:"宁陕县",610924:"紫阳县",610925:"岚皋县",610926:"平利县",610927:"镇坪县",610928:"旬阳县",610929:"白河县",610930:"其它区",611e3:"商洛市",611002:"商州区",611021:"洛南县",611022:"丹凤县",611023:"商南县",611024:"山阳县",611025:"镇安县",611026:"柞水县",611027:"其它区",62e4:"甘肃省",620100:"兰州市",620102:"城关区",620103:"七里河区",620104:"西固区",620105:"安宁区",620111:"红古区",620121:"永登县",620122:"皋兰县",620123:"榆中县",620124:"其它区",620200:"嘉峪关市",620300:"金昌市",620302:"金川区",620321:"永昌县",620322:"其它区",620400:"白银市",620402:"白银区",620403:"平川区",620421:"靖远县",620422:"会宁县",620423:"景泰县",620424:"其它区",620500:"天水市",620502:"秦州区",620503:"麦积区",620521:"清水县",620522:"秦安县",620523:"甘谷县",620524:"武山县",620525:"张家川回族自治县",620526:"其它区",620600:"武威市",620602:"凉州区",620621:"民勤县",620622:"古浪县",620623:"天祝藏族自治县",620624:"其它区",620700:"张掖市",620702:"甘州区",620721:"肃南裕固族自治县",620722:"民乐县",620723:"临泽县",620724:"高台县",620725:"山丹县",620726:"其它区",620800:"平凉市",620802:"崆峒区",620821:"泾川县",620822:"灵台县",620823:"崇信县",620824:"华亭县",620825:"庄浪县",620826:"静宁县",620827:"其它区",620900:"酒泉市",620902:"肃州区",620921:"金塔县",620922:"瓜州县",620923:"肃北蒙古族自治县",620924:"阿克塞哈萨克族自治县",620981:"玉门市",620982:"敦煌市",620983:"其它区",621e3:"庆阳市",621002:"西峰区",621021:"庆城县",621022:"环县",621023:"华池县",621024:"合水县",621025:"正宁县",621026:"宁县",621027:"镇原县",621028:"其它区",621100:"定西市",621102:"安定区",621121:"通渭县",621122:"陇西县",621123:"渭源县",621124:"临洮县",621125:"漳县",621126:"岷县",621127:"其它区",621200:"陇南市",621202:"武都区",621221:"成县",621222:"文县",621223:"宕昌县",621224:"康县",621225:"西和县",621226:"礼县",621227:"徽县",621228:"两当县",621229:"其它区",622900:"临夏回族自治州",622901:"临夏市",622921:"临夏县",622922:"康乐县",622923:"永靖县",622924:"广河县",622925:"和政县",622926:"东乡族自治县",622927:"积石山保安族东乡族撒拉族自治县",622928:"其它区",623e3:"甘南藏族自治州",623001:"合作市",623021:"临潭县",623022:"卓尼县",623023:"舟曲县",623024:"迭部县",623025:"玛曲县",623026:"碌曲县",623027:"夏河县",623028:"其它区",63e4:"青海省",630100:"西宁市",630102:"城东区",630103:"城中区",630104:"城西区",630105:"城北区",630121:"大通回族土族自治县",630122:"湟中县",630123:"湟源县",630124:"其它区",632100:"海东市",632121:"平安县",632122:"民和回族土族自治县",632123:"乐都区",632126:"互助土族自治县",632127:"化隆回族自治县",632128:"循化撒拉族自治县",632129:"其它区",632200:"海北藏族自治州",632221:"门源回族自治县",632222:"祁连县",632223:"海晏县",632224:"刚察县",632225:"其它区",632300:"黄南藏族自治州",632321:"同仁县",632322:"尖扎县",632323:"泽库县",632324:"河南蒙古族自治县",632325:"其它区",632500:"海南藏族自治州",632521:"共和县",632522:"同德县",632523:"贵德县",632524:"兴海县",632525:"贵南县",632526:"其它区",632600:"果洛藏族自治州",632621:"玛沁县",632622:"班玛县",632623:"甘德县",632624:"达日县",632625:"久治县",632626:"玛多县",632627:"其它区",632700:"玉树藏族自治州",632721:"玉树市",632722:"杂多县",632723:"称多县",632724:"治多县",632725:"囊谦县",632726:"曲麻莱县",632727:"其它区",632800:"海西蒙古族藏族自治州",632801:"格尔木市",632802:"德令哈市",632821:"乌兰县",632822:"都兰县",632823:"天峻县",632824:"其它区",64e4:"宁夏回族自治区",640100:"银川市",640104:"兴庆区",640105:"西夏区",640106:"金凤区",640121:"永宁县",640122:"贺兰县",640181:"灵武市",640182:"其它区",640200:"石嘴山市",640202:"大武口区",640205:"惠农区",640221:"平罗县",640222:"其它区",640300:"吴忠市",640302:"利通区",640303:"红寺堡区",640323:"盐池县",640324:"同心县",640381:"青铜峡市",640382:"其它区",640400:"固原市",640402:"原州区",640422:"西吉县",640423:"隆德县",640424:"泾源县",640425:"彭阳县",640426:"其它区",640500:"中卫市",640502:"沙坡头区",640521:"中宁县",640522:"海原县",640523:"其它区",65e4:"新疆维吾尔自治区",650100:"乌鲁木齐市",650102:"天山区",650103:"沙依巴克区",650104:"新市区",650105:"水磨沟区",650106:"头屯河区",650107:"达坂城区",650109:"米东区",650121:"乌鲁木齐县",650122:"其它区",650200:"克拉玛依市",650202:"独山子区",650203:"克拉玛依区",650204:"白碱滩区",650205:"乌尔禾区",650206:"其它区",652100:"吐鲁番地区",652101:"吐鲁番市",652122:"鄯善县",652123:"托克逊县",652124:"其它区",652200:"哈密地区",652201:"哈密市",652222:"巴里坤哈萨克自治县",652223:"伊吾县",652224:"其它区",652300:"昌吉回族自治州",652301:"昌吉市",652302:"阜康市",652323:"呼图壁县",652324:"玛纳斯县",652325:"奇台县",652327:"吉木萨尔县",652328:"木垒哈萨克自治县",652329:"其它区",652700:"博尔塔拉蒙古自治州",652701:"博乐市",652702:"阿拉山口市",652722:"精河县",652723:"温泉县",652724:"其它区",652800:"巴音郭楞蒙古自治州",652801:"库尔勒市",652822:"轮台县",652823:"尉犁县",652824:"若羌县",652825:"且末县",652826:"焉耆回族自治县",652827:"和静县",652828:"和硕县",652829:"博湖县",652830:"其它区",652900:"阿克苏地区",652901:"阿克苏市",652922:"温宿县",652923:"库车县",652924:"沙雅县",652925:"新和县",652926:"拜城县",652927:"乌什县",652928:"阿瓦提县",652929:"柯坪县",652930:"其它区",653e3:"克孜勒苏柯尔克孜自治州",653001:"阿图什市",653022:"阿克陶县",653023:"阿合奇县",653024:"乌恰县",653025:"其它区",653100:"喀什地区",653101:"喀什市",653121:"疏附县",653122:"疏勒县",653123:"英吉沙县",653124:"泽普县",653125:"莎车县",653126:"叶城县",653127:"麦盖提县",653128:"岳普湖县",653129:"伽师县",653130:"巴楚县",653131:"塔什库尔干塔吉克自治县",653132:"其它区",653200:"和田地区",653201:"和田市",653221:"和田县",653222:"墨玉县",653223:"皮山县",653224:"洛浦县",653225:"策勒县",653226:"于田县",653227:"民丰县",653228:"其它区",654e3:"伊犁哈萨克自治州",654002:"伊宁市",654003:"奎屯市",654021:"伊宁县",654022:"察布查尔锡伯自治县",654023:"霍城县",654024:"巩留县",654025:"新源县",654026:"昭苏县",654027:"特克斯县",654028:"尼勒克县",654029:"其它区",654200:"塔城地区",654201:"塔城市",654202:"乌苏市",654221:"额敏县",654223:"沙湾县",654224:"托里县",654225:"裕民县",654226:"和布克赛尔蒙古自治县",654227:"其它区",654300:"阿勒泰地区",654301:"阿勒泰市",654321:"布尔津县",654322:"富蕴县",654323:"福海县",654324:"哈巴河县",654325:"青河县",654326:"吉木乃县",654327:"其它区",659001:"石河子市",659002:"阿拉尔市",659003:"图木舒克市",659004:"五家渠市",71e4:"台湾",710100:"台北市",710101:"中正区",710102:"大同区",710103:"中山区",710104:"松山区",710105:"大安区",710106:"万华区",710107:"信义区",710108:"士林区",710109:"北投区",710110:"内湖区",710111:"南港区",710112:"文山区",710113:"其它区",710200:"高雄市",710201:"新兴区",710202:"前金区",710203:"芩雅区",710204:"盐埕区",710205:"鼓山区",710206:"旗津区",710207:"前镇区",710208:"三民区",710209:"左营区",710210:"楠梓区",710211:"小港区",710212:"其它区",710241:"苓雅区",710242:"仁武区",710243:"大社区",710244:"冈山区",710245:"路竹区",710246:"阿莲区",710247:"田寮区",710248:"燕巢区",710249:"桥头区",710250:"梓官区",710251:"弥陀区",710252:"永安区",710253:"湖内区",710254:"凤山区",710255:"大寮区",710256:"林园区",710257:"鸟松区",710258:"大树区",710259:"旗山区",710260:"美浓区",710261:"六龟区",710262:"内门区",710263:"杉林区",710264:"甲仙区",710265:"桃源区",710266:"那玛夏区",710267:"茂林区",710268:"茄萣区",710300:"台南市",710301:"中西区",710302:"东区",710303:"南区",710304:"北区",710305:"安平区",710306:"安南区",710307:"其它区",710339:"永康区",710340:"归仁区",710341:"新化区",710342:"左镇区",710343:"玉井区",710344:"楠西区",710345:"南化区",710346:"仁德区",710347:"关庙区",710348:"龙崎区",710349:"官田区",710350:"麻豆区",710351:"佳里区",710352:"西港区",710353:"七股区",710354:"将军区",710355:"学甲区",710356:"北门区",710357:"新营区",710358:"后壁区",710359:"白河区",710360:"东山区",710361:"六甲区",710362:"下营区",710363:"柳营区",710364:"盐水区",710365:"善化区",710366:"大内区",710367:"山上区",710368:"新市区",710369:"安定区",710400:"台中市",710401:"中区",710402:"东区",710403:"南区",710404:"西区",710405:"北区",710406:"北屯区",710407:"西屯区",710408:"南屯区",710409:"其它区",710431:"太平区",710432:"大里区",710433:"雾峰区",710434:"乌日区",710435:"丰原区",710436:"后里区",710437:"石冈区",710438:"东势区",710439:"和平区",710440:"新社区",710441:"潭子区",710442:"大雅区",710443:"神冈区",710444:"大肚区",710445:"沙鹿区",710446:"龙井区",710447:"梧栖区",710448:"清水区",710449:"大甲区",710450:"外埔区",710451:"大安区",710500:"金门县",710507:"金沙镇",710508:"金湖镇",710509:"金宁乡",710510:"金城镇",710511:"烈屿乡",710512:"乌坵乡",710600:"南投县",710614:"南投市",710615:"中寮乡",710616:"草屯镇",710617:"国姓乡",710618:"埔里镇",710619:"仁爱乡",710620:"名间乡",710621:"集集镇",710622:"水里乡",710623:"鱼池乡",710624:"信义乡",710625:"竹山镇",710626:"鹿谷乡",710700:"基隆市",710701:"仁爱区",710702:"信义区",710703:"中正区",710704:"中山区",710705:"安乐区",710706:"暖暖区",710707:"七堵区",710708:"其它区",710800:"新竹市",710801:"东区",710802:"北区",710803:"香山区",710804:"其它区",710900:"嘉义市",710901:"东区",710902:"西区",710903:"其它区",711100:"新北市",711130:"万里区",711131:"金山区",711132:"板桥区",711133:"汐止区",711134:"深坑区",711135:"石碇区",711136:"瑞芳区",711137:"平溪区",711138:"双溪区",711139:"贡寮区",711140:"新店区",711141:"坪林区",711142:"乌来区",711143:"永和区",711144:"中和区",711145:"土城区",711146:"三峡区",711147:"树林区",711148:"莺歌区",711149:"三重区",711150:"新庄区",711151:"泰山区",711152:"林口区",711153:"芦洲区",711154:"五股区",711155:"八里区",711156:"淡水区",711157:"三芝区",711158:"石门区",711200:"宜兰县",711214:"宜兰市",711215:"头城镇",711216:"礁溪乡",711217:"壮围乡",711218:"员山乡",711219:"罗东镇",711220:"三星乡",711221:"大同乡",711222:"五结乡",711223:"冬山乡",711224:"苏澳镇",711225:"南澳乡",711226:"钓鱼台",711300:"新竹县",711314:"竹北市",711315:"湖口乡",711316:"新丰乡",711317:"新埔镇",711318:"关西镇",711319:"芎林乡",711320:"宝山乡",711321:"竹东镇",711322:"五峰乡",711323:"横山乡",711324:"尖石乡",711325:"北埔乡",711326:"峨眉乡",711400:"桃园县",711414:"中坜市",711415:"平镇市",711416:"龙潭乡",711417:"杨梅市",711418:"新屋乡",711419:"观音乡",711420:"桃园市",711421:"龟山乡",711422:"八德市",711423:"大溪镇",711424:"复兴乡",711425:"大园乡",711426:"芦竹乡",711500:"苗栗县",711519:"竹南镇",711520:"头份镇",711521:"三湾乡",711522:"南庄乡",711523:"狮潭乡",711524:"后龙镇",711525:"通霄镇",711526:"苑里镇",711527:"苗栗市",711528:"造桥乡",711529:"头屋乡",711530:"公馆乡",711531:"大湖乡",711532:"泰安乡",711533:"铜锣乡",711534:"三义乡",711535:"西湖乡",711536:"卓兰镇",711700:"彰化县",711727:"彰化市",711728:"芬园乡",711729:"花坛乡",711730:"秀水乡",711731:"鹿港镇",711732:"福兴乡",711733:"线西乡",711734:"和美镇",711735:"伸港乡",711736:"员林镇",711737:"社头乡",711738:"永靖乡",711739:"埔心乡",711740:"溪湖镇",711741:"大村乡",711742:"埔盐乡",711743:"田中镇",711744:"北斗镇",711745:"田尾乡",711746:"埤头乡",711747:"溪州乡",711748:"竹塘乡",711749:"二林镇",711750:"大城乡",711751:"芳苑乡",711752:"二水乡",711900:"嘉义县",711919:"番路乡",711920:"梅山乡",711921:"竹崎乡",711922:"阿里山乡",711923:"中埔乡",711924:"大埔乡",711925:"水上乡",711926:"鹿草乡",711927:"太保市",711928:"朴子市",711929:"东石乡",711930:"六脚乡",711931:"新港乡",711932:"民雄乡",711933:"大林镇",711934:"溪口乡",711935:"义竹乡",711936:"布袋镇",712100:"云林县",712121:"斗南镇",712122:"大埤乡",712123:"虎尾镇",712124:"土库镇",712125:"褒忠乡",712126:"东势乡",712127:"台西乡",712128:"仑背乡",712129:"麦寮乡",712130:"斗六市",712131:"林内乡",712132:"古坑乡",712133:"莿桐乡",712134:"西螺镇",712135:"二仑乡",712136:"北港镇",712137:"水林乡",712138:"口湖乡",712139:"四湖乡",712140:"元长乡",712400:"屏东县",712434:"屏东市",712435:"三地门乡",712436:"雾台乡",712437:"玛家乡",712438:"九如乡",712439:"里港乡",712440:"高树乡",712441:"盐埔乡",712442:"长治乡",712443:"麟洛乡",712444:"竹田乡",712445:"内埔乡",712446:"万丹乡",712447:"潮州镇",712448:"泰武乡",712449:"来义乡",712450:"万峦乡",712451:"崁顶乡",712452:"新埤乡",712453:"南州乡",712454:"林边乡",712455:"东港镇",712456:"琉球乡",712457:"佳冬乡",712458:"新园乡",712459:"枋寮乡",712460:"枋山乡",712461:"春日乡",712462:"狮子乡",712463:"车城乡",712464:"牡丹乡",712465:"恒春镇",712466:"满州乡",712500:"台东县",712517:"台东市",712518:"绿岛乡",712519:"兰屿乡",712520:"延平乡",712521:"卑南乡",712522:"鹿野乡",712523:"关山镇",712524:"海端乡",712525:"池上乡",712526:"东河乡",712527:"成功镇",712528:"长滨乡",712529:"金峰乡",712530:"大武乡",712531:"达仁乡",712532:"太麻里乡",712600:"花莲县",712615:"花莲市",712616:"新城乡",712617:"太鲁阁",712618:"秀林乡",712619:"吉安乡",712620:"寿丰乡",712621:"凤林镇",712622:"光复乡",712623:"丰滨乡",712624:"瑞穗乡",712625:"万荣乡",712626:"玉里镇",712627:"卓溪乡",712628:"富里乡",712700:"澎湖县",712707:"马公市",712708:"西屿乡",712709:"望安乡",712710:"七美乡",712711:"白沙乡",712712:"湖西乡",712800:"连江县",712805:"南竿乡",712806:"北竿乡",712807:"莒光乡",712808:"东引乡",81e4:"香港特别行政区",810100:"香港岛",810101:"中西区",810102:"湾仔",810103:"东区",810104:"南区",810200:"九龙",810201:"九龙城区",810202:"油尖旺区",810203:"深水埗区",810204:"黄大仙区",810205:"观塘区",810300:"新界",810301:"北区",810302:"大埔区",810303:"沙田区",810304:"西贡区",810305:"元朗区",810306:"屯门区",810307:"荃湾区",810308:"葵青区",810309:"离岛区",82e4:"澳门特别行政区",820100:"澳门半岛",820200:"离岛",99e4:"海外",990100:"海外"};function r(t){for(var e,n={},r=0;ri;i++)o=t.charAt(i),"\n"===o?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===o||"\u2028"===o||"\u2029"===o?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return tr!==e&&(tr>e&&(tr=0,er={line:1,column:1,seenCR:!1}),n(er,tr,e),tr=e),er}function _(t){nr>Jn||(Jn>nr&&(nr=Jn,rr=[]),rr.push(t))}function b(t){var e=0;for(t.sort();eJn?(r=t.charAt(Jn),Jn++):(r=null,0===ir&&_(Ln)),null!==r?(Qn=e,n=On(r),null===n?(Jn=e,e=n):e=n):(Jn=e,e=St)):(Jn=e,e=St),e}function ft(){var e,n,r;return e=Jn,92===t.charCodeAt(Jn)?(n=Pn,Jn++):(n=null,0===ir&&_(En)),null!==n?(Rn.test(t.charAt(Jn))?(r=t.charAt(Jn),Jn++):(r=null,0===ir&&_(Nn)),null!==r?(Qn=e,n=zn(r),null===n?(Jn=e,e=n):e=n):(Jn=e,e=St)):(Jn=e,e=St),e}function dt(){var e,n,r,i;if(e=Jn,t.substr(Jn,2)===Bn?(n=Bn,Jn+=2):(n=null,0===ir&&_(Vn)),null!==n){if(r=[],Fn.test(t.charAt(Jn))?(i=t.charAt(Jn),Jn++):(i=null,0===ir&&_(Gn)),null!==i)for(;null!==i;)r.push(i),Fn.test(t.charAt(Jn))?(i=t.charAt(Jn),Jn++):(i=null,0===ir&&_(Gn));else r=St;null!==r?(Qn=e,n=Hn(r),null===n?(Jn=e,e=n):e=n):(Jn=e,e=St)}else Jn=e,e=St;return e}function gt(){var e,n,r,i;if(e=Jn,t.substr(Jn,2)===jn?(n=jn,Jn+=2):(n=null,0===ir&&_(Wn)),null!==n){if(r=[],Un.test(t.charAt(Jn))?(i=t.charAt(Jn),Jn++):(i=null,0===ir&&_(qn)),null!==i)for(;null!==i;)r.push(i),Un.test(t.charAt(Jn))?(i=t.charAt(Jn),Jn++):(i=null,0===ir&&_(qn));else r=St;null!==r?(Qn=e,n=Xn(r),null===n?(Jn=e,e=n):e=n):(Jn=e,e=St)}else Jn=e,e=St;return e}function vt(){var e,n,r,i;if(e=Jn,t.substr(Jn,2)===Yn?(n=Yn,Jn+=2):(n=null,0===ir&&_($n)),null!==n){if(r=[],Un.test(t.charAt(Jn))?(i=t.charAt(Jn),Jn++):(i=null,0===ir&&_(qn)),null!==i)for(;null!==i;)r.push(i),Un.test(t.charAt(Jn))?(i=t.charAt(Jn),Jn++):(i=null,0===ir&&_(qn));else r=St;null!==r?(Qn=e,n=Zn(r),null===n?(Jn=e,e=n):e=n):(Jn=e,e=St)}else Jn=e,e=St;return e}function yt(){var e,n;return e=Jn,t.substr(Jn,2)===Bn?(n=Bn,Jn+=2):(n=null,0===ir&&_(Vn)),null!==n&&(Qn=e,n=Kn()),null===n?(Jn=e,e=n):e=n,e}function mt(){var e,n,r;return e=Jn,92===t.charCodeAt(Jn)?(n=Pn,Jn++):(n=null,0===ir&&_(En)),null!==n?(t.length>Jn?(r=t.charAt(Jn),Jn++):(r=null,0===ir&&_(Ln)),null!==r?(Qn=e,n=Re(r),null===n?(Jn=e,e=n):e=n):(Jn=e,e=St)):(Jn=e,e=St),e}var xt,_t=arguments.length>1?arguments[1]:{},bt={regexp:w},wt=w,St=null,Mt="",Ct="|",It='"|"',Tt=function(t,e){return e?new r(t,e[1]):t},At=function(t,e,n){return new i([t].concat(e).concat([n]))},Dt="^",kt='"^"',Lt=function(){return new n("start")},Ot="$",Pt='"$"',Et=function(){return new n("end")},Rt=function(t,e){return new s(t,e)},Nt="Quantifier",zt=function(t,e){return e&&(t.greedy=!1),t},Bt="{",Vt='"{"',Ft=",",Gt='","',Ht="}",jt='"}"',Wt=function(t,e){return new l(t,e)},Ut=",}",qt='",}"',Xt=function(t){return new l(t,1/0)},Yt=function(t){return new l(t,t)},$t="+",Zt='"+"',Kt=function(){return new l(1,1/0)},Jt="*",Qt='"*"',te=function(){return new l(0,1/0)},ee="?",ne='"?"',re=function(){return new l(0,1)},ie=/^[0-9]/,oe="[0-9]",ae=function(t){return+t.join("")},se="(",le='"("',ue=")",ce='")"',he=function(t){return t},pe=function(t){return new a(t)},fe="?:",de='"?:"',ge=function(t){return new o("non-capture-group",t)},ve="?=",ye='"?="',me=function(t){return new o("positive-lookahead",t)},xe="?!",_e='"?!"',be=function(t){return new o("negative-lookahead",t)},we="CharacterSet",Se="[",Me='"["',Ce="]",Ie='"]"',Te=function(t,e){return new u(!!t,e)},Ae="CharacterRange",De="-",ke='"-"',Le=function(t,e){return new c(t,e)},Oe="Character",Pe=/^[^\\\]]/,Ee="[^\\\\\\]]",Re=function(t){return new h(t)},Ne=".",ze='"."',Be=function(){return new n("any-character")},Ve="Literal",Fe=/^[^|\\\/.[()?+*$\^]/,Ge="[^|\\\\\\/.[()?+*$\\^]",He="\\b",je='"\\\\b"',We=function(){return new n("backspace")},Ue=function(){return new n("word-boundary")},qe="\\B",Xe='"\\\\B"',Ye=function(){return new n("non-word-boundary")},$e="\\d",Ze='"\\\\d"',Ke=function(){return new n("digit")},Je="\\D",Qe='"\\\\D"',tn=function(){return new n("non-digit")},en="\\f",nn='"\\\\f"',rn=function(){return new n("form-feed")},on="\\n",an='"\\\\n"',sn=function(){return new n("line-feed")},ln="\\r",un='"\\\\r"',cn=function(){return new n("carriage-return")},hn="\\s",pn='"\\\\s"',fn=function(){return new n("white-space")},dn="\\S",gn='"\\\\S"',vn=function(){return new n("non-white-space")},yn="\\t",mn='"\\\\t"',xn=function(){return new n("tab")},_n="\\v",bn='"\\\\v"',wn=function(){return new n("vertical-tab")},Sn="\\w",Mn='"\\\\w"',Cn=function(){return new n("word")},In="\\W",Tn='"\\\\W"',An=function(){return new n("non-word")},Dn="\\c",kn='"\\\\c"',Ln="any character",On=function(t){return new v(t)},Pn="\\",En='"\\\\"',Rn=/^[1-9]/,Nn="[1-9]",zn=function(t){return new g(t)},Bn="\\0",Vn='"\\\\0"',Fn=/^[0-7]/,Gn="[0-7]",Hn=function(t){return new d(t.join(""))},jn="\\x",Wn='"\\\\x"',Un=/^[0-9a-fA-F]/,qn="[0-9a-fA-F]",Xn=function(t){return new f(t.join(""))},Yn="\\u",$n='"\\\\u"',Zn=function(t){return new p(t.join(""))},Kn=function(){return new n("null-character")},Jn=0,Qn=0,tr=0,er={line:1,column:1,seenCR:!1},nr=0,rr=[],ir=0;if("startRule"in _t){if(!(_t.startRule in bt))throw new Error("Can't start parsing from rule \""+_t.startRule+'".');wt=bt[_t.startRule]}if(n.offset=m,n.text=y,xt=wt(),null!==xt&&Jn===t.length)return xt;throw b(rr),Qn=Math.max(Jn,nr),new e(rr,Qnr)return!0;var a={path:e,type:t,actual:n,expected:r,action:"is greater than",message:o};return a.message=l.message(a),i.push(a),!1},lessThan:function(t,e,n,r,i,o){if(n=r)return!0;var a={path:e,type:t,actual:n,expected:r,action:"is greater than or equal to",message:o};return a.message=l.message(a),i.push(a),!1},lessThanOrEqualTo:function(t,e,n,r,i,o){if(n<=r)return!0;var a={path:e,type:t,actual:n,expected:r,action:"is less than or equal to",message:o};return a.message=l.message(a),i.push(a),!1}};a.Diff=s,a.Assert=l,t.exports=a},function(t,e,n){t.exports=n(28)},function(t,e,n){var r=n(3);window._XMLHttpRequest=window.XMLHttpRequest,window._ActiveXObject=window.ActiveXObject;try{new window.Event("custom")}catch(f){window.Event=function(t,e,n,r){var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e,n,r),i}}var i={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},o="readystatechange loadstart progress abort error load timeout loadend".split(" "),a="timeout withCredentials".split(" "),s="readyState responseURL status statusText responseType response responseText responseXML".split(" "),l={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};function u(){this.custom={events:{},requestHeaders:{},responseHeaders:{}}}function c(){var t=function(){var t=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,e=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,n=location.href,r=e.exec(n.toLowerCase())||[];return t.test(r[1])}();return window.ActiveXObject?!t&&e()||n():e();function e(){try{return new window._XMLHttpRequest}catch(t){}}function n(){try{return new window._ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}function h(t){for(var e in u.Mock._mocked){var n=u.Mock._mocked[e];if((!n.rurl||i(n.rurl,t.url))&&(!n.rtype||i(n.rtype,t.type.toLowerCase())))return n}function i(t,e){return"string"===r.type(t)?t===e:"regexp"===r.type(t)?t.test(e):void 0}}function p(t,e){return r.isFunction(t.template)?t.template(e):u.Mock.mock(t.template)}u._settings={timeout:"10-100"},u.setup=function(t){return r.extend(u._settings,t),u._settings},r.extend(u,i),r.extend(u.prototype,i),u.prototype.mock=!0,u.prototype.match=!1,r.extend(u.prototype,{open:function(t,e,n,i,l){var p=this;r.extend(this.custom,{method:t,url:e,async:"boolean"!==typeof n||n,username:i,password:l,options:{url:e,type:t}}),this.custom.timeout=function(t){if("number"===typeof t)return t;if("string"===typeof t&&!~t.indexOf("-"))return parseInt(t,10);if("string"===typeof t&&~t.indexOf("-")){var e=t.split("-"),n=parseInt(e[0],10),r=parseInt(e[1],10);return Math.round(Math.random()*(r-n))+n}}(u._settings.timeout);var f=h(this.custom.options);function d(t){for(var e=0;e0?i(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},a159:function(t,e,n){var r=n("e4ae"),i=n("7e90"),o=n("1691"),a=n("5559")("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=n("1ec9")("iframe"),r=o.length,i="<",a=">";e.style.display="none",n("32fc").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+a+"document.F=Object"+i+"/script"+a),t.close(),u=t.F;while(r--)delete u[l][o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[l]=r(t),n=new s,s[l]=null,n[a]=t):n=u(),void 0===e?n:i(n,e)}},a15e:function(t,e,n){"use strict";n.r(e);var r=n("41b2"),i=n.n(r),o=n("1098"),a=n.n(o),s=/%[sdj%]/g,l=function(){};function u(){for(var t=arguments.length,e=Array(t),n=0;n=o)return t;switch(t){case"%s":return String(e[r++]);case"%d":return Number(e[r++]);case"%j":try{return JSON.stringify(e[r++])}catch(n){return"[Circular]"}break;default:return t}})),l=e[r];r()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},S={integer:function(t){return S.number(t)&&parseInt(t,10)===t},float:function(t){return S.number(t)&&!S.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(e){return!1}},date:function(t){return"function"===typeof t.getTime&&"function"===typeof t.getMonth&&"function"===typeof t.getYear},number:function(t){return!isNaN(t)&&"number"===typeof t},object:function(t){return"object"===("undefined"===typeof t?"undefined":a()(t))&&!S.array(t)},method:function(t){return"function"===typeof t},email:function(t){return"string"===typeof t&&!!t.match(w.email)&&t.length<255},url:function(t){return"string"===typeof t&&!!t.match(w.url)},hex:function(t){return"string"===typeof t&&!!t.match(w.hex)}};function M(t,e,n,r,i){if(t.required&&void 0===e)x(t,e,n,r,i);else{var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=t.type;o.indexOf(s)>-1?S[s](e)||r.push(u(i.messages.types[s],t.fullField,t.type)):s&&("undefined"===typeof e?"undefined":a()(e))!==t.type&&r.push(u(i.messages.types[s],t.fullField,t.type))}}var C=M;function I(t,e,n,r,i){var o="number"===typeof t.len,a="number"===typeof t.min,s="number"===typeof t.max,l=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=e,h=null,p="number"===typeof e,f="string"===typeof e,d=Array.isArray(e);if(p?h="number":f?h="string":d&&(h="array"),!h)return!1;d&&(c=e.length),f&&(c=e.replace(l,"_").length),o?c!==t.len&&r.push(u(i.messages[h].len,t.fullField,t.len)):a&&!s&&ct.max?r.push(u(i.messages[h].max,t.fullField,t.max)):a&&s&&(ct.max)&&r.push(u(i.messages[h].range,t.fullField,t.min,t.max))}var T=I,A="enum";function D(t,e,n,r,i){t[A]=Array.isArray(t[A])?t[A]:[],-1===t[A].indexOf(e)&&r.push(u(i.messages[A],t.fullField,t[A].join(", ")))}var k=D;function L(t,e,n,r,i){if(t.pattern)if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(e)||r.push(u(i.messages.pattern.mismatch,t.fullField,e,t.pattern));else if("string"===typeof t.pattern){var o=new RegExp(t.pattern);o.test(e)||r.push(u(i.messages.pattern.mismatch,t.fullField,e,t.pattern))}}var O=L,P={required:x,whitespace:b,type:C,range:T,enum:k,pattern:O};function E(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e,"string")&&!t.required)return n();P.required(t,e,r,o,i,"string"),h(e,"string")||(P.type(t,e,r,o,i),P.range(t,e,r,o,i),P.pattern(t,e,r,o,i),!0===t.whitespace&&P.whitespace(t,e,r,o,i))}n(o)}var R=E;function N(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),void 0!==e&&P.type(t,e,r,o,i)}n(o)}var z=N;function B(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),void 0!==e&&(P.type(t,e,r,o,i),P.range(t,e,r,o,i))}n(o)}var V=B;function F(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),void 0!==e&&P.type(t,e,r,o,i)}n(o)}var G=F;function H(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),h(e)||P.type(t,e,r,o,i)}n(o)}var j=H;function W(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),void 0!==e&&(P.type(t,e,r,o,i),P.range(t,e,r,o,i))}n(o)}var U=W;function q(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),void 0!==e&&(P.type(t,e,r,o,i),P.range(t,e,r,o,i))}n(o)}var X=q;function Y(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e,"array")&&!t.required)return n();P.required(t,e,r,o,i,"array"),h(e,"array")||(P.type(t,e,r,o,i),P.range(t,e,r,o,i))}n(o)}var $=Y;function Z(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),void 0!==e&&P.type(t,e,r,o,i)}n(o)}var K=Z,J="enum";function Q(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();P.required(t,e,r,o,i),e&&P[J](t,e,r,o,i)}n(o)}var tt=Q;function et(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e,"string")&&!t.required)return n();P.required(t,e,r,o,i),h(e,"string")||P.pattern(t,e,r,o,i)}n(o)}var nt=et;function rt(t,e,n,r,i){var o=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(h(e)&&!t.required)return n();if(P.required(t,e,r,o,i),!h(e)){var s=void 0;s="number"===typeof e?new Date(e):e,P.type(t,s,r,o,i),s&&P.range(t,s.getTime(),r,o,i)}}n(o)}var it=rt;function ot(t,e,n,r,i){var o=[],s=Array.isArray(e)?"array":"undefined"===typeof e?"undefined":a()(e);P.required(t,e,r,o,i,s),n(o)}var at=ot;function st(t,e,n,r,i){var o=t.type,a=[],s=t.required||!t.required&&r.hasOwnProperty(t.field);if(s){if(h(e,o)&&!t.required)return n();P.required(t,e,r,a,i,o),h(e,o)||P.type(t,e,r,a,i)}n(a)}var lt=st,ut={string:R,method:z,number:V,boolean:G,regexp:j,integer:U,float:X,array:$,object:K,enum:tt,pattern:nt,date:it,url:lt,hex:lt,email:lt,required:at};function ct(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var ht=ct();function pt(t){this.rules=null,this._messages=ht,this.define(t)}pt.prototype={messages:function(t){return t&&(this._messages=y(ct(),t)),this._messages},define:function(t){if(!t)throw new Error("Cannot configure a schema with no rules");if("object"!==("undefined"===typeof t?"undefined":a()(t))||Array.isArray(t))throw new Error("Rules must be an object");this.rules={};var e=void 0,n=void 0;for(e in t)t.hasOwnProperty(e)&&(n=t[e],this.rules[e]=Array.isArray(n)?n:[n])},validate:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2],o=t,s=n,c=r;if("function"===typeof s&&(c=s,s={}),this.rules&&0!==Object.keys(this.rules).length){if(s.messages){var h=this.messages();h===ht&&(h=ct()),y(h,s.messages),s.messages=h}else s.messages=this.messages();var p=void 0,f=void 0,d={},m=s.keys||Object.keys(this.rules);m.forEach((function(n){p=e.rules[n],f=o[n],p.forEach((function(r){var a=r;"function"===typeof a.transform&&(o===t&&(o=i()({},o)),f=o[n]=a.transform(f)),a="function"===typeof a?{validator:a}:i()({},a),a.validator=e.getValidationMethod(a),a.field=n,a.fullField=a.fullField||n,a.type=e.getType(a),a.validator&&(d[n]=d[n]||[],d[n].push({rule:a,value:f,source:o,field:n}))}))}));var x={};g(d,s,(function(t,e){var n=t.rule,r=("object"===n.type||"array"===n.type)&&("object"===a()(n.fields)||"object"===a()(n.defaultField));function o(t,e){return i()({},e,{fullField:n.fullField+"."+t})}function c(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],c=a;if(Array.isArray(c)||(c=[c]),c.length&&l("async-validator:",c),c.length&&n.message&&(c=[].concat(n.message)),c=c.map(v(n)),s.first&&c.length)return x[n.field]=1,e(c);if(r){if(n.required&&!t.value)return c=n.message?[].concat(n.message).map(v(n)):s.error?[s.error(n,u(s.messages.required,n.field))]:[],e(c);var h={};if(n.defaultField)for(var p in t.value)t.value.hasOwnProperty(p)&&(h[p]=n.defaultField);for(var f in h=i()({},h,t.rule.fields),h)if(h.hasOwnProperty(f)){var d=Array.isArray(h[f])?h[f]:[h[f]];h[f]=d.map(o.bind(null,f))}var g=new pt(h);g.messages(s.messages),t.rule.options&&(t.rule.options.messages=s.messages,t.rule.options.error=s.error),g.validate(t.value,t.rule.options||s,(function(t){e(t&&t.length?c.concat(t):t)}))}else e(c)}r=r&&(n.required||!n.required&&t.value),n.field=t.field;var h=n.validator(n,t.value,c,t.source,s);h&&h.then&&h.then((function(){return c()}),(function(t){return c(t)}))}),(function(t){_(t)}))}else c&&c();function _(t){var e=void 0,n=void 0,r=[],i={};function o(t){Array.isArray(t)?r=r.concat.apply(r,t):r.push(t)}for(e=0;ex;x++)if(v=e?m(a(d=t[x])[0],d[1]):m(t[x]),v===u||v===c)return v}else for(g=y.call(t);!(d=g.next()).done;)if(v=i(g,m,d.value,e),v===u||v===c)return v};e.BREAK=u,e.RETURN=c},a25f:function(t,e,n){var r=n("7726"),i=r.navigator;t.exports=i&&i.userAgent||""},a3c3:function(t,e,n){var r=n("63b6");r(r.S+r.F,"Object",{assign:n("9306")})},a3de:function(t,e,n){"use strict";var r=!("undefined"===typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=i},a481:function(t,e,n){"use strict";var r=n("cb7c"),i=n("4bf8"),o=n("9def"),a=n("4588"),s=n("0390"),l=n("5f1b"),u=Math.max,c=Math.min,h=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g,d=function(t){return void 0===t?t:String(t)};n("214f")("replace",2,(function(t,e,n,g){return[function(r,i){var o=t(this),a=void 0==r?void 0:r[e];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=g(n,t,this,e);if(i.done)return i.value;var h=r(t),p=String(this),f="function"===typeof e;f||(e=String(e));var y=h.global;if(y){var m=h.unicode;h.lastIndex=0}var x=[];while(1){var _=l(h,p);if(null===_)break;if(x.push(_),!y)break;var b=String(_[0]);""===b&&(h.lastIndex=s(p,o(h.lastIndex),m))}for(var w="",S=0,M=0;M=S&&(w+=p.slice(S,I)+L,S=I+C.length)}return w+p.slice(S)}];function v(t,e,r,o,a,s){var l=r+t.length,u=o.length,c=f;return void 0!==a&&(a=i(a),c=p),n.call(s,c,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(l);case"<":s=a[i.slice(1,-1)];break;default:var c=+i;if(0===c)return n;if(c>u){var p=h(c/10);return 0===p?n:p<=u?void 0===o[p-1]?i.charAt(1):o[p-1]+i.charAt(1):n}s=o[c-1]}return void 0===s?"":s}))}}))},a4bb:function(t,e,n){t.exports=n("8aae")},a5b8:function(t,e,n){"use strict";var r=n("d8e8");function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},a5d8:function(t,e,n){},a745:function(t,e,n){t.exports=n("f410")},a78e:function(t,e,n){var r,i; +/*! + * JavaScript Cookie v2.2.0 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */(function(o){var a=!1;if(r=o,i="function"===typeof r?r.call(e,n,e,t):r,void 0===i||(t.exports=i),a=!0,t.exports=o(),a=!0,!a){var s=window.Cookies,l=window.Cookies=o();l.noConflict=function(){return window.Cookies=s,l}}})((function(){function t(){for(var t=0,e={};t1){if(o=t({path:"/"},r.defaults,o),"number"===typeof o.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*o.expires),o.expires=s}o.expires=o.expires?o.expires.toUTCString():"";try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(v){}i=n.write?n.write(i,e):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,!0!==o[u]&&(l+="="+o[u]));return document.cookie=e+"="+i+l}e||(a={});for(var c=document.cookie?document.cookie.split("; "):[],h=/(%[0-9A-Z]{2})+/g,p=0;p0?i(r(t),9007199254740991):0}},b50d:function(t,e,n){"use strict";var r=n("c532"),i=n("467f"),o=n("7aac"),a=n("30b5"),s=n("83b9"),l=n("c345"),u=n("3934"),c=n("2d83"),h=n("2444"),p=n("7a77");t.exports=function(t){return new Promise((function(e,n){var f,d=t.data,g=t.headers,v=t.responseType;function y(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}r.isFormData(d)&&delete g["Content-Type"];var m=new XMLHttpRequest;if(t.auth){var x=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";g.Authorization="Basic "+btoa(x+":"+_)}var b=s(t.baseURL,t.url);function w(){if(m){var r="getAllResponseHeaders"in m?l(m.getAllResponseHeaders()):null,o=v&&"text"!==v&&"json"!==v?m.response:m.responseText,a={data:o,status:m.status,statusText:m.statusText,headers:r,config:t,request:m};i((function(t){e(t),y()}),(function(t){n(t),y()}),a),m=null}}if(m.open(t.method.toUpperCase(),a(b,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,"onloadend"in m?m.onloadend=w:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(w)},m.onabort=function(){m&&(n(c("Request aborted",t,"ECONNABORTED",m)),m=null)},m.onerror=function(){n(c("Network Error",t,null,m)),m=null},m.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||h.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(c(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",m)),m=null},r.isStandardBrowserEnv()){var S=(t.withCredentials||u(b))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;S&&(g[t.xsrfHeaderName]=S)}"setRequestHeader"in m&&r.forEach(g,(function(t,e){"undefined"===typeof d&&"content-type"===e.toLowerCase()?delete g[e]:m.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(m.withCredentials=!!t.withCredentials),v&&"json"!==v&&(m.responseType=t.responseType),"function"===typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(t){m&&(n(!t||t&&t.type?new p("canceled"):t),m.abort(),m=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),d||(d=null),m.send(d)}))}},b8e3:function(t,e){t.exports=!0},ba99:function(t,e,n){var r=n("6abf"),i=n("9aa9"),o=n("e4ae"),a=n("e53d").Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},bc13:function(t,e,n){var r=n("e53d"),i=r.navigator;t.exports=i&&i.userAgent||""},bc3a:function(t,e,n){t.exports=n("cee4")},bcaa:function(t,e,n){var r=n("cb7c"),i=n("d3f4"),o=n("a5b8");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),a=n.resolve;return a(e),n.promise}},bd11:function(t,e){t.exports=g,t.exports.parse=o,t.exports.compile=a,t.exports.tokensToFunction=s,t.exports.tokensToRegExp=d;var n="/",r="./",i=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function o(t,e){var o,a=[],s=0,c=0,h="",p=e&&e.delimiter||n,f=e&&e.delimiters||r,d=!1;while(null!==(o=i.exec(t))){var g=o[0],v=o[1],y=o.index;if(h+=t.slice(c,y),c=y+g.length,v)h+=v[1],d=!0;else{var m="",x=t[c],_=o[2],b=o[3],w=o[4],S=o[5];if(!d&&h.length){var M=h.length-1;f.indexOf(h[M])>-1&&(m=h[M],h=h.slice(0,M))}h&&(a.push(h),h="",d=!1);var C=""!==m&&void 0!==x&&x!==m,I="+"===S||"*"===S,T="?"===S||"*"===S,A=m||p,D=b||w;a.push({name:_||s++,prefix:m,delimiter:A,optional:T,repeat:I,partial:C,pattern:D?u(D):"[^"+l(A)+"]+?"})}}return(h||c-1;else{var y=v.repeat?"(?:"+v.pattern+")(?:"+l(v.delimiter)+"(?:"+v.pattern+"))*":v.pattern;e&&e.push(v),v.optional?v.partial?f+=l(v.prefix)+"("+y+")?":f+="(?:"+l(v.prefix)+"("+y+"))?":f+=l(v.prefix)+"("+y+")"}}return s?(o||(f+="(?:"+u+")?"),f+="$"===p?"$":"(?="+p+")"):(o||(f+="(?:"+u+"(?="+p+"))?"),d||(f+="(?="+u+"|"+p+")")),new RegExp(f,c(i))}function g(t,e,n){return t instanceof RegExp?h(t,e):Array.isArray(t)?p(t,e,n):f(t,e,n)}},bd86:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("85f2"),i=n.n(r);function o(t,e,n){return e in t?i()(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},bf0b:function(t,e,n){var r=n("355d"),i=n("aebd"),o=n("36c3"),a=n("1bc3"),s=n("07e3"),l=n("794b"),u=Object.getOwnPropertyDescriptor;e.f=n("8e60")?u:function(t,e){if(t=o(t),e=a(e,!0),l)try{return u(t,e)}catch(n){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},bf90:function(t,e,n){var r=n("36c3"),i=n("bf0b").f;n("ce7e")("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},c098:function(t,e,n){t.exports=n("d4af")},c207:function(t,e){},c26b:function(t,e,n){"use strict";var r=n("86cc").f,i=n("2aeb"),o=n("dcbc"),a=n("9b43"),s=n("f605"),l=n("4a59"),u=n("01f9"),c=n("d53b"),h=n("7a56"),p=n("9e1e"),f=n("67ab").fastKey,d=n("b39a"),g=p?"_s":"size",v=function(t,e){var n,r=f(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,u){var c=t((function(t,r){s(t,c,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[g]=0,void 0!=r&&l(r,n,t[u],t)}));return o(c.prototype,{clear:function(){for(var t=d(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var n=d(this,e),r=v(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[g]--}return!!r},forEach:function(t){d(this,e);var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);while(n=n?n.n:this._f){r(n.v,n.k,this);while(n&&n.r)n=n.p}},has:function(t){return!!v(d(this,e),t)}}),p&&r(c.prototype,"size",{get:function(){return d(this,e)[g]}}),c},def:function(t,e,n){var r,i,o=v(t,e);return o?o.v=n:(t._l=o={i:i=f(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[g]++,"F"!==i&&(t._i[i]=o)),t},getEntry:v,setStrong:function(t,e,n){u(t,e,(function(t,n){this._t=d(t,e),this._k=n,this._l=void 0}),(function(){var t=this,e=t._k,n=t._l;while(n&&n.r)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?c(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,c(1))}),n?"entries":"values",!n,!0),h(e)}}},c345:function(t,e,n){"use strict";var r=n("c532"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,a={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(a[e]&&i.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},c366:function(t,e,n){var r=n("6821"),i=n("9def"),o=n("77f1");t.exports=function(t){return function(e,n,a){var s,l=r(e),u=i(l.length),c=o(a,u);if(t&&n!=n){while(u>c)if(s=l[c++],s!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},c367:function(t,e,n){"use strict";var r=n("8436"),i=n("50ed"),o=n("481b"),a=n("36c3");t.exports=n("30f1")(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},c3a1:function(t,e,n){var r=n("e6f3"),i=n("1691");t.exports=Object.keys||function(t){return r(t,i)}},c401:function(t,e,n){"use strict";var r=n("c532"),i=n("2444");t.exports=function(t,e,n){var o=this||i;return r.forEach(n,(function(n){t=n.call(o,t,e)})),t}},c532:function(t,e,n){"use strict";var r=n("1d2b"),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function a(t){return"undefined"===typeof t}function s(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function l(t){return"[object ArrayBuffer]"===i.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,e}function h(t){return"string"===typeof t}function p(t){return"number"===typeof t}function f(t){return null!==t&&"object"===typeof t}function d(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function g(t){return"[object Date]"===i.call(t)}function v(t){return"[object File]"===i.call(t)}function y(t){return"[object Blob]"===i.call(t)}function m(t){return"[object Function]"===i.call(t)}function x(t){return f(t)&&m(t.pipe)}function _(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams}function b(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function w(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function S(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n2){e=m?e.trim():p(e,3);var n,r,i,o=e.charCodeAt(0);if(43===o||45===o){if(n=e.charCodeAt(2),88===n||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,l=e.slice(2),u=0,c=l.length;ui)return NaN;return parseInt(l,r)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof d&&(y?l((function(){v.valueOf.call(n)})):o(n)!=f)?a(new g(x(e)),n,d):x(e)};for(var _,b=n("9e1e")?u(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;b.length>w;w++)i(g,_=b[w])&&!i(d,_)&&h(d,_,c(g,_));d.prototype=v,v.constructor=d,n("2aba")(r,f,d)}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")((function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a}))},c8af:function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},ca5a:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},cadf:function(t,e,n){"use strict";var r=n("9c6c"),i=n("d53b"),o=n("84f2"),a=n("6821");t.exports=n("01f9")(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ccb9:function(t,e,n){e.f=n("5168")},cd1c:function(t,e,n){var r=n("e853");t.exports=function(t,e){return new(r(t))(e)}},cd78:function(t,e,n){var r=n("e4ae"),i=n("f772"),o=n("656e");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),a=n.resolve;return a(e),n.promise}},ce10:function(t,e,n){var r=n("69a8"),i=n("6821"),o=n("c366")(!1),a=n("613b")("IE_PROTO");t.exports=function(t,e){var n,s=i(t),l=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);while(e.length>l)r(s,n=e[l++])&&(~o(u,n)||u.push(n));return u}},ce7e:function(t,e,n){var r=n("63b6"),i=n("584a"),o=n("294c");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)}},cee4:function(t,e,n){"use strict";var r=n("c532"),i=n("1d2b"),o=n("0a06"),a=n("4a7b"),s=n("2444");function l(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n.create=function(e){return l(a(t,e))},n}var u=l(s);u.Axios=o,u.Cancel=n("7a77"),u.CancelToken=n("8df4"),u.isCancel=n("2e67"),u.VERSION=n("5cce").version,u.all=function(t){return Promise.all(t)},u.spread=n("0df6"),u.isAxiosError=n("5f02"),t.exports=u,t.exports.default=u},d2c8:function(t,e,n){var r=n("aae3"),i=n("be13");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},d2d5:function(t,e,n){n("1654"),n("549b"),t.exports=n("584a").Array.from},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d4af:function(t,e,n){"use strict";var r=n("8eb7"),i=n("7b3e"),o=10,a=40,s=800;function l(t){var e=0,n=0,r=0,i=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=e*o,i=n*o,"deltaY"in t&&(i=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||i)&&t.deltaMode&&(1==t.deltaMode?(r*=a,i*=a):(r*=s,i*=s)),r&&!e&&(e=r<1?-1:1),i&&!n&&(n=i<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:i}}l.getEventType=function(){return r.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},t.exports=l},d53b:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},d847:function(t,e,n){t.exports=n("5bba")},d864:function(t,e,n){var r=n("79aa");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)}}},d8d6:function(t,e,n){n("1654"),n("6c1c"),t.exports=n("ccb9").f("iterator")},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d925:function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},d9f6:function(t,e,n){var r=n("e4ae"),i=n("794b"),o=n("1bc3"),a=Object.defineProperty;e.f=n("8e60")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},db2a:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t){"string"!==typeof t&&(t+="");var e,n=0,r=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){n=e+1;break}}else-1===r&&(i=!1,r=e+1);return-1===r?"":t.slice(n,r)}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!r;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return e=n(i(e.split("/"),(function(t){return!!t})),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),a="/"===o(t,-1);return t=n(i(t.split("/"),(function(t){return!!t})),!r).join("/"),t||r||(t="."),t&&a&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e=0;n--)if(""!==t[n])break;return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l=1;--o)if(e=t.charCodeAt(o),47===e){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=r(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,n=0,r=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){n=a+1;break}}return-1===e||-1===r||0===o||1===o&&e===r-1&&e===n+1?"":t.slice(e,r)};var o="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n("4362"))},e017:function(t,e,n){(function(e){(function(e,n){t.exports=n()})(0,(function(){"use strict";var t=function(t){var e=t.id,n=t.viewBox,r=t.content;this.id=e,this.viewBox=n,this.content=r};t.prototype.stringify=function(){return this.content},t.prototype.toString=function(){return this.stringify()},t.prototype.destroy=function(){var t=this;["id","viewBox","content"].forEach((function(e){return delete t[e]}))};var n=function(t){var e=!!document.importNode,n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return e?document.importNode(n,!0):n};"undefined"!==typeof window?window:"undefined"!==typeof e||"undefined"!==typeof self&&self;function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}var i=r((function(t,e){(function(e,n){t.exports=n()})(0,(function(){function t(t){var e=t&&"object"===typeof t;return e&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function e(t){return Array.isArray(t)?[]:{}}function n(n,r){var i=r&&!0===r.clone;return i&&t(n)?o(e(n),n,r):n}function r(e,r,i){var a=e.slice();return r.forEach((function(r,s){"undefined"===typeof a[s]?a[s]=n(r,i):t(r)?a[s]=o(e[s],r,i):-1===e.indexOf(r)&&a.push(n(r,i))})),a}function i(e,r,i){var a={};return t(e)&&Object.keys(e).forEach((function(t){a[t]=n(e[t],i)})),Object.keys(r).forEach((function(s){t(r[s])&&e[s]?a[s]=o(e[s],r[s],i):a[s]=n(r[s],i)})),a}function o(t,e,o){var a=Array.isArray(e),s=o||{arrayMerge:r},l=s.arrayMerge||r;return a?Array.isArray(t)?l(t,e,o):n(e,o):i(t,e,o)}return o.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce((function(t,n){return o(t,n,e)}))},o}))})),o=r((function(t,e){var n={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};e.default=n,t.exports=e.default})),a=function(t){return Object.keys(t).map((function(e){var n=t[e].toString().replace(/"/g,""");return e+'="'+n+'"'})).join(" ")},s=o.svg,l=o.xlink,u={};u[s.name]=s.uri,u[l.name]=l.uri;var c=function(t,e){void 0===t&&(t="");var n=i(u,e||{}),r=a(n);return""+t+""},h=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isMounted:{}};return r.isMounted.get=function(){return!!this.node},e.createFromExistingNode=function(t){return new e({id:t.getAttribute("id"),viewBox:t.getAttribute("viewBox"),content:t.outerHTML})},e.prototype.destroy=function(){this.isMounted&&this.unmount(),t.prototype.destroy.call(this)},e.prototype.mount=function(t){if(this.isMounted)return this.node;var e="string"===typeof t?document.querySelector(t):t,n=this.render();return this.node=n,e.appendChild(n),n},e.prototype.render=function(){var t=this.stringify();return n(c(t)).childNodes[0]},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(e.prototype,r),e}(t);return h}))}).call(this,n("c8ba"))},e0b8:function(t,e,n){"use strict";var r=n("7726"),i=n("5ca1"),o=n("2aba"),a=n("dcbc"),s=n("67ab"),l=n("4a59"),u=n("f605"),c=n("d3f4"),h=n("79e5"),p=n("5cc5"),f=n("7f20"),d=n("5dbc");t.exports=function(t,e,n,g,v,y){var m=r[t],x=m,_=v?"set":"add",b=x&&x.prototype,w={},S=function(t){var e=b[t];o(b,t,"delete"==t||"has"==t?function(t){return!(y&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof x&&(y||b.forEach&&!h((function(){(new x).entries().next()})))){var M=new x,C=M[_](y?{}:-0,1)!=M,I=h((function(){M.has(1)})),T=p((function(t){new x(t)})),A=!y&&h((function(){var t=new x,e=5;while(e--)t[_](e,e);return!t.has(-0)}));T||(x=e((function(e,n){u(e,x,t);var r=d(new m,e,x);return void 0!=n&&l(n,v,r[_],r),r})),x.prototype=b,b.constructor=x),(I||A)&&(S("delete"),S("has"),v&&S("get")),(A||C)&&S(_),y&&b.clear&&delete b.clear}else x=g.getConstructor(e,t,v,_),a(x.prototype,n),s.NEED=!0;return f(x,t),w[t]=x,i(i.G+i.W+i.F*(x!=m),w),y||g.setStrong(x,t,v),x}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e265:function(t,e,n){t.exports=n("ed33")},e4ae:function(t,e,n){var r=n("f772");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},e53d: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)},e630:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("774e"),i=n.n(r),o=n("db2a");function a(t,e){if(t){if("string"===typeof t)return Object(o["a"])(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?i()(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(o["a"])(t,e):void 0}}},e683:function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},e6f3:function(t,e,n){var r=n("07e3"),i=n("36c3"),o=n("5b4e")(!1),a=n("5559")("IE_PROTO");t.exports=function(t,e){var n,s=i(t),l=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);while(e.length>l)r(s,n=e[l++])&&(~o(u,n)||u.push(n));return u}},e853:function(t,e,n){var r=n("d3f4"),i=n("1169"),o=n("2b4c")("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?Array:e}},ebd6:function(t,e,n){var r=n("cb7c"),i=n("d8e8"),o=n("2b4c")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},ebfd:function(t,e,n){var r=n("62a0")("meta"),i=n("f772"),o=n("07e3"),a=n("d9f6").f,s=0,l=Object.isExtensible||function(){return!0},u=!n("294c")((function(){return l(Object.preventExtensions({}))})),c=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},h=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[r].i},p=function(t,e){if(!o(t,r)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[r].w},f=function(t){return u&&d.NEED&&l(t)&&!o(t,r)&&c(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:h,getWeak:p,onFreeze:f}},ed33:function(t,e,n){n("014b"),t.exports=n("584a").Object.getOwnPropertySymbols},ee6d:function(t,e,n){var r=n("63b6"),i=n("ba99"),o=n("36c3"),a=n("bf0b"),s=n("20fd");r(r.S,"Object",{getOwnPropertyDescriptors:function(t){var e,n,r=o(t),l=a.f,u=i(r),c={},h=0;while(u.length>h)n=l(r,e=u[h++]),void 0!==n&&s(c,e,n);return c}})},f1ae:function(t,e,n){"use strict";var r=n("86cc"),i=n("4630");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},f201:function(t,e,n){var r=n("e4ae"),i=n("79aa"),o=n("5168")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},f410:function(t,e,n){n("1af6"),t.exports=n("584a").Array.isArray},f559:function(t,e,n){"use strict";var r=n("5ca1"),i=n("9def"),o=n("d2c8"),a="startsWith",s=""[a];r(r.P+r.F*n("5147")(a),"String",{startsWith:function(t){var e=o(this,t,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},f5df:function(t,e,n){},f605:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},f6b4:function(t,e,n){"use strict";var r=n("c532");function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},f751:function(t,e,n){var r=n("5ca1");r(r.S+r.F,"Object",{assign:n("7333")})},f772:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},f893:function(t,e,n){t.exports={default:n("f921"),__esModule:!0}},f921:function(t,e,n){n("014b"),n("c207"),n("69d3"),n("765d"),t.exports=n("584a").Symbol},fa5b:function(t,e,n){t.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,n){var r=n("7726").document;t.exports=r&&r.documentElement},fde4:function(t,e,n){n("bf90");var r=n("584a").Object;t.exports=function(t,e){return r.getOwnPropertyDescriptor(t,e)}},fdef:function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}}]); \ No newline at end of file diff --git a/discovery/.gitignore b/hippo4j-core/.gitignore similarity index 100% rename from discovery/.gitignore rename to hippo4j-core/.gitignore diff --git a/hippo4j-core/pom.xml b/hippo4j-core/pom.xml new file mode 100644 index 00000000..dda047ff --- /dev/null +++ b/hippo4j-core/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-all + ${revision} + + + hippo4j-core + jar + + ${project.artifactId} + HIPPO4J HIPPO4J-CORE 核心代码库. + + + + org.projectlombok + lombok + + + + cn.hippo4j + hippo4j-common + + + + com.aliyun + alibaba-dingtalk-service-sdk + + + + log4j + log4j + + + + + + org.springframework.boot + spring-boot-starter-tomcat + compile + true + + + + org.springframework.boot + spring-boot-starter-jetty + compile + true + + + + org.springframework.boot + spring-boot-starter-undertow + compile + true + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${project.artifactId} + ${project.version} + ${maven.build.timestamp} + chen.ma + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + + jar + + + + + + + + diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/config/BootstrapPropertiesInterface.java b/hippo4j-core/src/main/java/cn/hippo4j/core/config/BootstrapPropertiesInterface.java new file mode 100644 index 00000000..e468d07d --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/config/BootstrapPropertiesInterface.java @@ -0,0 +1,74 @@ +package cn.hippo4j.core.config; + +/** + * Bootstrap properties interface. + * + * @author chen.ma + * @date 2022/2/25 19:01 + */ +public interface BootstrapPropertiesInterface { + + /** + * Get enable. + * + * @return + */ + default Boolean getEnable() { + return null; + } + + /** + * Get username. + * + * @return + */ + default String getUsername() { + return null; + } + + /** + * Get password. + * + * @return + */ + default String getPassword() { + return null; + } + + /** + * Get namespace. + * + * @return + */ + default String getNamespace() { + return null; + } + + /** + * Get item id. + * + * @return + */ + default String getItemId() { + return null; + } + + /** + * Get server addr. + * + * @return + */ + default String getServerAddr() { + return null; + } + + /** + * Get banner. + * + * @return + */ + default Boolean getBanner() { + return null; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/config/ConfigEmptyException.java b/hippo4j-core/src/main/java/cn/hippo4j/core/config/ConfigEmptyException.java new file mode 100644 index 00000000..abe84448 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/config/ConfigEmptyException.java @@ -0,0 +1,26 @@ +package cn.hippo4j.core.config; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * Config empty exception. + * + * @author chen.ma + * @date 2021/11/28 21:58 + */ +@Data +@AllArgsConstructor +public class ConfigEmptyException extends RuntimeException { + + /** + * description + */ + private String description; + + /** + * action + */ + private String action; + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/config/UtilAutoConfiguration.java b/hippo4j-core/src/main/java/cn/hippo4j/core/config/UtilAutoConfiguration.java new file mode 100644 index 00000000..45724025 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/config/UtilAutoConfiguration.java @@ -0,0 +1,24 @@ +package cn.hippo4j.core.config; + +import cn.hippo4j.core.toolkit.inet.InetUtils; +import cn.hippo4j.core.toolkit.inet.InetUtilsProperties; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; + +/** + * Util auto configuration. + * + * @author Spencer Gibb + * @date 2021/11/12 21:34 + */ +@EnableConfigurationProperties(InetUtilsProperties.class) +public class UtilAutoConfiguration { + + @Bean + @ConditionalOnMissingBean + public InetUtils hippo4JInetUtils(InetUtilsProperties properties) { + return new InetUtils(properties); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/config/WebThreadPoolConfiguration.java b/hippo4j-core/src/main/java/cn/hippo4j/core/config/WebThreadPoolConfiguration.java new file mode 100644 index 00000000..87a014e4 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/config/WebThreadPoolConfiguration.java @@ -0,0 +1,64 @@ +package cn.hippo4j.core.config; + +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import cn.hippo4j.core.executor.web.*; +import cn.hippo4j.core.toolkit.inet.InetUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.ConfigurableEnvironment; + +/** + * Web thread pool configuration. + * + * @author chen.ma + * @date 2022/3/11 19:09 + */ +@Configuration +@RequiredArgsConstructor +public class WebThreadPoolConfiguration { + + private static final String TOMCAT_SERVLET_WEB_SERVER_FACTORY = "tomcatServletWebServerFactory"; + + private static final String JETTY_SERVLET_WEB_SERVER_FACTORY = "JettyServletWebServerFactory"; + + private static final String UNDERTOW_SERVLET_WEB_SERVER_FACTORY = "undertowServletWebServerFactory"; + + private final ConfigurableEnvironment environment; + + @Bean + public WebThreadPoolRunStateHandler webThreadPoolRunStateHandler() { + return new WebThreadPoolRunStateHandler(); + } + + @Bean + @SuppressWarnings("all") + public ThreadPoolRunStateHandler threadPoolRunStateHandler(InetUtils hippo4JInetUtils) { + return new ThreadPoolRunStateHandler(hippo4JInetUtils, environment); + } + + @Bean + @ConditionalOnBean(name = TOMCAT_SERVLET_WEB_SERVER_FACTORY) + public TomcatWebThreadPoolHandler tomcatWebThreadPoolHandler(WebThreadPoolRunStateHandler webThreadPoolRunStateHandler) { + return new TomcatWebThreadPoolHandler(webThreadPoolRunStateHandler); + } + + @Bean + @ConditionalOnBean(name = JETTY_SERVLET_WEB_SERVER_FACTORY) + public JettyWebThreadPoolHandler jettyWebThreadPoolHandler() { + return new JettyWebThreadPoolHandler(); + } + + @Bean + @ConditionalOnBean(name = UNDERTOW_SERVLET_WEB_SERVER_FACTORY) + public UndertowWebThreadPoolHandler undertowWebThreadPoolHandler() { + return new UndertowWebThreadPoolHandler(); + } + + @Bean + public WebThreadPoolHandlerChoose webThreadPoolServiceChoose() { + return new WebThreadPoolHandlerChoose(); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java b/hippo4j-core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java new file mode 100644 index 00000000..865e4593 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java @@ -0,0 +1,87 @@ +package cn.hippo4j.core.enable; + +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.core.config.BootstrapPropertiesInterface; +import cn.hippo4j.core.config.ConfigEmptyException; +import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.ConfigurableEnvironment; + +import java.util.Objects; + +/** + * Before check configuration. + * + * @author chen.ma + * @date 2021/11/28 22:44 + */ +@Configuration +@AllArgsConstructor +public class BeforeCheckConfiguration { + + private final String bootstrapPropertiesClassName = "cn.hippo4j.starter.config.BootstrapProperties"; + + @Bean + public BeforeCheckConfiguration.BeforeCheck dynamicThreadPoolBeforeCheckBean(@Autowired(required = false) BootstrapPropertiesInterface properties, + ConfigurableEnvironment environment) { + boolean checkFlag = properties != null && Objects.equals(bootstrapPropertiesClassName, properties.getClass().getName()) && properties.getEnable(); + if (checkFlag) { + String username = properties.getUsername(); + if (StringUtil.isBlank(username)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool username is empty.", + "Please check whether the [spring.dynamic.thread-pool.username] configuration is empty or an empty string." + ); + } + + String password = properties.getPassword(); + if (StringUtil.isBlank(password)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool password is empty.", + "Please check whether the [spring.dynamic.thread-pool.password] configuration is empty or an empty string." + ); + } + + String namespace = properties.getNamespace(); + if (StringUtil.isBlank(namespace)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool namespace is empty.", + "Please check whether the [spring.dynamic.thread-pool.namespace] configuration is empty or an empty string." + ); + } + + String itemId = properties.getItemId(); + if (StringUtil.isBlank(itemId)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool item id is empty.", + "Please check whether the [spring.dynamic.thread-pool.item-id] configuration is empty or an empty string." + ); + } + + String serverAddr = properties.getServerAddr(); + if (StringUtil.isBlank(serverAddr)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool server addr is empty.", + "Please check whether the [spring.dynamic.thread-pool.server-addr] configuration is empty or an empty string." + ); + } + + String applicationName = environment.getProperty("spring.application.name"); + if (StringUtil.isBlank(applicationName)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool application name is empty.", + "Please check whether the [spring.application.name] configuration is empty or an empty string." + ); + } + } + + return new BeforeCheckConfiguration.BeforeCheck(); + } + + public class BeforeCheck { + + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/enable/EnableDynamicThreadPool.java b/hippo4j-core/src/main/java/cn/hippo4j/core/enable/EnableDynamicThreadPool.java similarity index 76% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/enable/EnableDynamicThreadPool.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/enable/EnableDynamicThreadPool.java index fd717f06..a892a23a 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/enable/EnableDynamicThreadPool.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/enable/EnableDynamicThreadPool.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.enable; +package cn.hippo4j.core.enable; import org.springframework.context.annotation.Import; @@ -13,7 +13,7 @@ import java.lang.annotation.*; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented -@Import(MarkerConfiguration.class) +@Import({BeforeCheckConfiguration.class, MarkerConfiguration.class}) public @interface EnableDynamicThreadPool { } diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/enable/MarkerConfiguration.java b/hippo4j-core/src/main/java/cn/hippo4j/core/enable/MarkerConfiguration.java similarity index 79% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/enable/MarkerConfiguration.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/enable/MarkerConfiguration.java index 167071ac..2daee96d 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/enable/MarkerConfiguration.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/enable/MarkerConfiguration.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.enable; +package cn.hippo4j.core.enable; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; * @author chen.ma * @date 2021/7/8 23:30 */ -@Configuration(proxyBeanMethods = false) +@Configuration public class MarkerConfiguration { @Bean diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DynamicThreadPool.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPool.java similarity index 87% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DynamicThreadPool.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPool.java index 6f8a7ae0..34529adc 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DynamicThreadPool.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPool.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.core; +package cn.hippo4j.core.executor; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPoolExecutor.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPoolExecutor.java new file mode 100644 index 00000000..4f001993 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPoolExecutor.java @@ -0,0 +1,119 @@ +package cn.hippo4j.core.executor; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport; +import cn.hippo4j.core.proxy.RejectedProxyUtil; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; +import org.springframework.core.task.TaskDecorator; + +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Dynamic threadPool wrap. + * + * @author chen.ma + * @date 2021/7/8 21:47 + */ +public class DynamicThreadPoolExecutor extends AbstractDynamicExecutorSupport { + + @Getter + @Setter + private Long executeTimeOut; + + @Getter + @Setter + private TaskDecorator taskDecorator; + + @Getter + @Setter + private RejectedExecutionHandler redundancyHandler; + + @Getter + private final String threadPoolId; + + @Getter + private final AtomicLong rejectCount = new AtomicLong(); + + private final ThreadLocal startTime = new ThreadLocal(); + + public DynamicThreadPoolExecutor(int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + long executeTimeOut, + boolean waitForTasksToCompleteOnShutdown, + long awaitTerminationMillis, + @NonNull BlockingQueue workQueue, + @NonNull String threadPoolId, + @NonNull ThreadFactory threadFactory, + @NonNull RejectedExecutionHandler handler) { + super(corePoolSize, maximumPoolSize, keepAliveTime, unit, waitForTasksToCompleteOnShutdown, awaitTerminationMillis, workQueue, threadPoolId, threadFactory, handler); + this.threadPoolId = threadPoolId; + this.executeTimeOut = executeTimeOut; + + // Number of dynamic proxy denial policies. + RejectedExecutionHandler rejectedProxy = RejectedProxyUtil.createProxy(handler, threadPoolId, rejectCount); + setRejectedExecutionHandler(rejectedProxy); + + // Redundant fields to avoid reflecting the acquired fields when sending change information. + redundancyHandler = handler; + } + + @Override + public void execute(@NonNull Runnable command) { + if (taskDecorator != null) { + command = taskDecorator.decorate(command); + } + + super.execute(command); + } + + @Override + protected void beforeExecute(Thread t, Runnable r) { + if (executeTimeOut == null || executeTimeOut <= 0) { + return; + } + + this.startTime.set(System.currentTimeMillis()); + } + + @Override + protected void afterExecute(Runnable r, Throwable t) { + if (executeTimeOut == null || executeTimeOut <= 0) { + return; + } + + try { + long startTime = this.startTime.get(); + long endTime = System.currentTimeMillis(); + long executeTime; + boolean executeTimeAlarm = (executeTime = (endTime - startTime)) > executeTimeOut; + if (executeTimeAlarm && ApplicationContextHolder.getInstance() != null) { + ThreadPoolNotifyAlarmHandler notifyAlarmHandler = ApplicationContextHolder.getBean(ThreadPoolNotifyAlarmHandler.class); + if (notifyAlarmHandler != null) { + notifyAlarmHandler.asyncSendExecuteTimeOutAlarm(threadPoolId, executeTime, executeTimeOut, this); + } + } + } finally { + this.startTime.remove(); + } + } + + @Override + protected ExecutorService initializeExecutor() { + return this; + } + + /** + * Get reject count. + * + * @return + */ + public Long getRejectCountNum() { + return rejectCount.get(); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPoolWrapper.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPoolWrapper.java new file mode 100644 index 00000000..dda8ed69 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/DynamicThreadPoolWrapper.java @@ -0,0 +1,109 @@ +package cn.hippo4j.core.executor; + +import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport; +import cn.hippo4j.core.executor.support.CommonDynamicThreadPool; +import lombok.Data; +import org.springframework.beans.factory.DisposableBean; + +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * Dynamic threadPool wrapper. + * + * @author chen.ma + * @date 2021/6/20 16:55 + */ +@Data +public class DynamicThreadPoolWrapper implements DisposableBean { + + /** + * Tenant id + */ + private String tenantId; + + /** + * Item id + */ + private String itemId; + + /** + * Thread pool id + */ + private String tpId; + + /** + * Subscribe flag + */ + private boolean subscribeFlag; + + /** + * Init flag + */ + private boolean initFlag; + + /** + * executor + * {@link DynamicThreadPoolExecutor} + */ + private ThreadPoolExecutor executor; + + /** + * 首选服务端线程池, 为空使用默认线程池 {@link CommonDynamicThreadPool#getInstance(String)} + * + * @param threadPoolId + */ + public DynamicThreadPoolWrapper(String threadPoolId) { + this(threadPoolId, CommonDynamicThreadPool.getInstance(threadPoolId)); + } + + /** + * 首选服务端线程池, 为空使用 threadPoolExecutor. + * + * @param threadPoolId + * @param threadPoolExecutor + */ + public DynamicThreadPoolWrapper(String threadPoolId, ThreadPoolExecutor threadPoolExecutor) { + this.tpId = threadPoolId; + this.executor = threadPoolExecutor; + } + + /** + * 提交任务. + * + * @param command + */ + public void execute(Runnable command) { + executor.execute(command); + } + + /** + * 提交任务. + * + * @param task + * @return + */ + public Future submit(Runnable task) { + return executor.submit(task); + } + + /** + * 提交任务. + * + * @param task + * @param + * @return + */ + public Future submit(Callable task) { + return executor.submit(task); + } + + @Override + public void destroy() throws Exception { + if (executor != null && executor instanceof AbstractDynamicExecutorSupport) { + ((AbstractDynamicExecutorSupport) executor).destroy(); + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/ThreadPoolNotifyAlarmHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/ThreadPoolNotifyAlarmHandler.java new file mode 100644 index 00000000..9be4062f --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/ThreadPoolNotifyAlarmHandler.java @@ -0,0 +1,269 @@ +package cn.hippo4j.core.executor; + +import cn.hippo4j.common.notify.HippoSendMessageService; +import cn.hippo4j.common.notify.NotifyTypeEnum; +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import cn.hippo4j.common.notify.request.AlarmNotifyRequest; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hippo4j.core.toolkit.TraceContextUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.core.executor.manage.GlobalNotifyAlarmManage; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.support.ThreadPoolBuilder; +import cn.hippo4j.core.toolkit.CalculateUtil; +import cn.hippo4j.core.toolkit.IdentifyUtil; +import cn.hutool.core.util.StrUtil; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.CommandLineRunner; + +import java.util.List; +import java.util.Objects; +import java.util.concurrent.*; + +/** + * Thread pool alarm notify. + * + * @author chen.ma + * @date 2021/8/15 14:13 + */ +@Slf4j +@RequiredArgsConstructor +public class ThreadPoolNotifyAlarmHandler implements Runnable, CommandLineRunner { + + @NonNull + private final HippoSendMessageService hippoSendMessageService; + + @Value("${spring.profiles.active:UNKNOWN}") + private String active; + + @Value("${spring.dynamic.thread-pool.item-id:}") + private String itemId; + + @Value("${spring.application.name:UNKNOWN}") + private String applicationName; + + @Value("${spring.dynamic.thread-pool.check-state-interval:5}") + private Integer checkStateInterval; + + private final ScheduledExecutorService ALARM_NOTIFY_EXECUTOR = new ScheduledThreadPoolExecutor( + 1, + r -> new Thread(r, "client.alarm.notify") + ); + + private final ExecutorService EXECUTE_TIMEOUT_EXECUTOR = ThreadPoolBuilder.builder() + .poolThreadSize(2, 4) + .threadFactory("client.execute.timeout.alarm") + .allowCoreThreadTimeOut(true) + .keepAliveTime(60L, TimeUnit.SECONDS) + .workQueue(new LinkedBlockingQueue(4096)) + .rejected(new ThreadPoolExecutor.AbortPolicy()) + .build(); + + @Override + public void run(String... args) throws Exception { + ALARM_NOTIFY_EXECUTOR.scheduleWithFixedDelay(this, 0, checkStateInterval, TimeUnit.SECONDS); + } + + @Override + public void run() { + List listThreadPoolId = GlobalThreadPoolManage.listThreadPoolId(); + listThreadPoolId.forEach(threadPoolId -> { + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId); + if (threadPoolNotifyAlarm != null && threadPoolNotifyAlarm.getIsAlarm()) { + DynamicThreadPoolWrapper wrapper = GlobalThreadPoolManage.getExecutorService(threadPoolId); + ThreadPoolExecutor executor = wrapper.getExecutor(); + checkPoolCapacityAlarm(threadPoolId, executor); + checkPoolActivityAlarm(threadPoolId, executor); + } + }); + } + + /** + * Check thread pool capacity alarm. + * + * @param threadPoolId + * @param threadPoolExecutor + */ + public void checkPoolCapacityAlarm(String threadPoolId, ThreadPoolExecutor threadPoolExecutor) { + if (hippoSendMessageService == null) { + return; + } + + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId); + BlockingQueue blockIngQueue = threadPoolExecutor.getQueue(); + + int queueSize = blockIngQueue.size(); + int capacity = queueSize + blockIngQueue.remainingCapacity(); + int divide = CalculateUtil.divide(queueSize, capacity); + boolean isSend = threadPoolNotifyAlarm.getIsAlarm() + && divide > threadPoolNotifyAlarm.getCapacityAlarm(); + if (isSend) { + AlarmNotifyRequest alarmNotifyRequest = buildAlarmNotifyReq(threadPoolExecutor); + alarmNotifyRequest.setThreadPoolId(threadPoolId); + hippoSendMessageService.sendAlarmMessage(NotifyTypeEnum.CAPACITY, alarmNotifyRequest); + } + } + + /** + * Check thread pool activity alarm. + * + * @param threadPoolId + * @param threadPoolExecutor + */ + public void checkPoolActivityAlarm(String threadPoolId, ThreadPoolExecutor threadPoolExecutor) { + int activeCount = threadPoolExecutor.getActiveCount(); + int maximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); + int divide = CalculateUtil.divide(activeCount, maximumPoolSize); + + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId); + boolean isSend = threadPoolNotifyAlarm.getIsAlarm() + && divide > threadPoolNotifyAlarm.getActiveAlarm(); + if (isSend) { + AlarmNotifyRequest alarmNotifyRequest = buildAlarmNotifyReq(threadPoolExecutor); + alarmNotifyRequest.setThreadPoolId(threadPoolId); + hippoSendMessageService.sendAlarmMessage(NotifyTypeEnum.ACTIVITY, alarmNotifyRequest); + } + } + + /** + * Check pool rejected alarm. + * + * @param threadPoolId + */ + public void checkPoolRejectedAlarm(String threadPoolId) { + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId); + if (Objects.isNull(threadPoolNotifyAlarm) || !threadPoolNotifyAlarm.getIsAlarm()) { + return; + } + + ThreadPoolExecutor threadPoolExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); + checkPoolRejectedAlarm(threadPoolId, threadPoolExecutor); + } + + /** + * Check pool rejected alarm. + * + * @param threadPoolId + * @param threadPoolExecutor + */ + public void checkPoolRejectedAlarm(String threadPoolId, ThreadPoolExecutor threadPoolExecutor) { + if (threadPoolExecutor instanceof DynamicThreadPoolExecutor) { + AlarmNotifyRequest alarmNotifyRequest = buildAlarmNotifyReq(threadPoolExecutor); + alarmNotifyRequest.setThreadPoolId(threadPoolId); + hippoSendMessageService.sendAlarmMessage(NotifyTypeEnum.REJECT, alarmNotifyRequest); + } + } + + /** + * Async send execute time out alarm. + * + * @param threadPoolId + * @param executeTime + * @param executeTimeOut + * @param threadPoolExecutor + */ + public void asyncSendExecuteTimeOutAlarm(String threadPoolId, long executeTime, long executeTimeOut, ThreadPoolExecutor threadPoolExecutor) { + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId); + if (!threadPoolNotifyAlarm.getIsAlarm()) { + return; + } + + if (threadPoolExecutor instanceof DynamicThreadPoolExecutor) { + try { + AlarmNotifyRequest alarmNotifyRequest = buildAlarmNotifyReq(threadPoolExecutor); + alarmNotifyRequest.setThreadPoolId(threadPoolId); + alarmNotifyRequest.setExecuteTime(executeTime); + alarmNotifyRequest.setExecuteTimeOut(executeTimeOut); + + String executeTimeoutTrace = TraceContextUtil.getAndRemove(); + if (StringUtil.isNotBlank(executeTimeoutTrace)) { + alarmNotifyRequest.setExecuteTimeoutTrace(executeTimeoutTrace); + } + + Runnable task = () -> hippoSendMessageService.sendAlarmMessage(NotifyTypeEnum.TIMEOUT, alarmNotifyRequest); + EXECUTE_TIMEOUT_EXECUTOR.execute(task); + } catch (Throwable ex) { + log.error("Send thread pool execution timeout alarm error.", ex); + } + } + } + + /** + * Send pool config change. + * + * @param request + */ + public void sendPoolConfigChange(ChangeParameterNotifyRequest request) { + request.setActive(active.toUpperCase()); + String appName = StrUtil.isBlank(itemId) ? applicationName : itemId; + request.setAppName(appName); + request.setIdentify(IdentifyUtil.getIdentify()); + + hippoSendMessageService.sendChangeMessage(request); + } + + /** + * Build alarm notify req. + * + * @param threadPoolExecutor + * @return + */ + public AlarmNotifyRequest buildAlarmNotifyReq(ThreadPoolExecutor threadPoolExecutor) { + AlarmNotifyRequest request = new AlarmNotifyRequest(); + + String appName = StrUtil.isBlank(itemId) ? applicationName : itemId; + request.setAppName(appName); + + // 核心线程数 + int corePoolSize = threadPoolExecutor.getCorePoolSize(); + // 最大线程数 + int maximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); + // 线程池当前线程数 (有锁) + int poolSize = threadPoolExecutor.getPoolSize(); + // 活跃线程数 (有锁) + int activeCount = threadPoolExecutor.getActiveCount(); + // 同时进入池中的最大线程数 (有锁) + int largestPoolSize = threadPoolExecutor.getLargestPoolSize(); + // 线程池中执行任务总数量 (有锁) + long completedTaskCount = threadPoolExecutor.getCompletedTaskCount(); + + request.setActive(active.toUpperCase()); + request.setIdentify(IdentifyUtil.getIdentify()); + request.setCorePoolSize(corePoolSize); + request.setMaximumPoolSize(maximumPoolSize); + request.setPoolSize(poolSize); + request.setActiveCount(activeCount); + request.setLargestPoolSize(largestPoolSize); + request.setCompletedTaskCount(completedTaskCount); + + BlockingQueue queue = threadPoolExecutor.getQueue(); + // 队列元素个数 + int queueSize = queue.size(); + // 队列类型 + String queueType = queue.getClass().getSimpleName(); + // 队列剩余容量 + int remainingCapacity = queue.remainingCapacity(); + // 队列容量 + int queueCapacity = queueSize + remainingCapacity; + request.setQueueName(queueType); + request.setCapacity(queueCapacity); + request.setQueueSize(queueSize); + request.setRemainingCapacity(remainingCapacity); + + RejectedExecutionHandler rejectedExecutionHandler = threadPoolExecutor instanceof DynamicThreadPoolExecutor + ? ((DynamicThreadPoolExecutor) threadPoolExecutor).getRedundancyHandler() + : threadPoolExecutor.getRejectedExecutionHandler(); + request.setRejectedExecutionHandlerName(rejectedExecutionHandler.getClass().getSimpleName()); + + long rejectCount = threadPoolExecutor instanceof DynamicThreadPoolExecutor + ? ((DynamicThreadPoolExecutor) threadPoolExecutor).getRejectCountNum() + : -1L; + request.setRejectCountNum(rejectCount); + + return request; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/manage/GlobalNotifyAlarmManage.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/manage/GlobalNotifyAlarmManage.java new file mode 100644 index 00000000..b9d26972 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/manage/GlobalNotifyAlarmManage.java @@ -0,0 +1,41 @@ +package cn.hippo4j.core.executor.manage; + +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Global notify alarm manage. + * + * @author chen.ma + * @date 2022/2/24 20:12 + */ +public class GlobalNotifyAlarmManage { + + /** + * Notify alarm map. + */ + private static final Map NOTIFY_ALARM_MAP = new ConcurrentHashMap(); + + /** + * Get. + * + * @param key + * @return + */ + public static ThreadPoolNotifyAlarm get(String key) { + return NOTIFY_ALARM_MAP.get(key); + } + + /** + * Put. + * + * @param key + * @param val + */ + public static void put(String key, ThreadPoolNotifyAlarm val) { + NOTIFY_ALARM_MAP.put(key, val); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/manage/GlobalThreadPoolManage.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/manage/GlobalThreadPoolManage.java new file mode 100644 index 00000000..2f8574b0 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/manage/GlobalThreadPoolManage.java @@ -0,0 +1,100 @@ +package cn.hippo4j.core.executor.manage; + +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import com.google.common.collect.Lists; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Global threadPool manage. + * + * @author chen.ma + * @date 2021/6/20 15:57 + */ +public class GlobalThreadPoolManage { + + /** + * 动态线程池参数容器. + */ + private static final Map POOL_PARAMETER = new ConcurrentHashMap(); + + /** + * 动态线程池包装容器. + */ + private static final Map EXECUTOR_MAP = new ConcurrentHashMap(); + + /** + * 获取动态线程池包装类. + * + * @param threadPoolId + * @return + */ + public static DynamicThreadPoolWrapper getExecutorService(String threadPoolId) { + return EXECUTOR_MAP.get(threadPoolId); + } + + /** + * 获取动态线程池参数. + * + * @param threadPoolId + * @return + */ + public static PoolParameter getPoolParameter(String threadPoolId) { + return POOL_PARAMETER.get(threadPoolId); + } + + /** + * 注册动态线程池包装以及参数. + * + * @param threadPoolId + * @param poolParameter + * @param executor + */ + public static void register(String threadPoolId, PoolParameter poolParameter, DynamicThreadPoolWrapper executor) { + registerPool(threadPoolId, executor); + registerPoolParameter(threadPoolId, poolParameter); + } + + /** + * 注册动态线程池. + * + * @param threadPoolId + * @param executor + */ + public static void registerPool(String threadPoolId, DynamicThreadPoolWrapper executor) { + EXECUTOR_MAP.put(threadPoolId, executor); + } + + /** + * 注册动态线程池参数. + * + * @param threadPoolId + * @param poolParameter + */ + public static void registerPoolParameter(String threadPoolId, PoolParameter poolParameter) { + POOL_PARAMETER.put(threadPoolId, poolParameter); + } + + /** + * 获取动态线程池标识集合. + * + * @return + */ + public static List listThreadPoolId() { + return Lists.newArrayList(EXECUTOR_MAP.keySet()); + } + + /** + * 获取动态线程池数量. + * 数据在项目最初启动的时候可能不准确, 因为是异步进行注册. + * + * @return + */ + public static Integer getThreadPoolNum() { + return listThreadPoolId().size(); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java new file mode 100644 index 00000000..40e890f4 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java @@ -0,0 +1,102 @@ +package cn.hippo4j.core.executor.state; + +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.toolkit.CalculateUtil; +import cn.hutool.core.date.DateUtil; + +import java.util.Date; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Executor; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * Abstract threadPool runtime info. + * + * @author chen.ma + * @date 2021/12/7 19:44 + */ +public abstract class AbstractThreadPoolRuntime { + + /** + * Supplement. + * + * @param basePoolRunStateInfo + * @return + */ + protected abstract PoolRunStateInfo supplement(PoolRunStateInfo basePoolRunStateInfo); + + /** + * Get pool run state. + * + * @param threadPoolId + * @return + */ + public PoolRunStateInfo getPoolRunState(String threadPoolId) { + DynamicThreadPoolWrapper executorService = GlobalThreadPoolManage.getExecutorService(threadPoolId); + ThreadPoolExecutor pool = executorService.getExecutor(); + return getPoolRunState(threadPoolId, pool); + } + + /** + * Get pool run state. + * + * @param threadPoolId + * @param executor + * @return + */ + public PoolRunStateInfo getPoolRunState(String threadPoolId, Executor executor) { + PoolRunStateInfo stateInfo = new PoolRunStateInfo(); + ThreadPoolExecutor pool = (ThreadPoolExecutor) executor; + // 核心线程数 + int corePoolSize = pool.getCorePoolSize(); + // 最大线程数 + int maximumPoolSize = pool.getMaximumPoolSize(); + // 线程池当前线程数 (有锁) + int poolSize = pool.getPoolSize(); + // 活跃线程数 (有锁) + int activeCount = pool.getActiveCount(); + // 同时进入池中的最大线程数 (有锁) + int largestPoolSize = pool.getLargestPoolSize(); + // 线程池中执行任务总数量 (有锁) + long completedTaskCount = pool.getCompletedTaskCount(); + // 当前负载 + String currentLoad = CalculateUtil.divide(activeCount, maximumPoolSize) + ""; + // 峰值负载 + String peakLoad = CalculateUtil.divide(largestPoolSize, maximumPoolSize) + ""; + + BlockingQueue queue = pool.getQueue(); + // 队列元素个数 + int queueSize = queue.size(); + // 队列类型 + String queueType = queue.getClass().getSimpleName(); + // 队列剩余容量 + int remainingCapacity = queue.remainingCapacity(); + // 队列容量 + int queueCapacity = queueSize + remainingCapacity; + + stateInfo.setCoreSize(corePoolSize); + stateInfo.setTpId(threadPoolId); + stateInfo.setPoolSize(poolSize); + stateInfo.setMaximumSize(maximumPoolSize); + stateInfo.setActiveSize(activeCount); + stateInfo.setCurrentLoad(currentLoad); + stateInfo.setPeakLoad(peakLoad); + stateInfo.setQueueType(queueType); + stateInfo.setQueueSize(queueSize); + stateInfo.setQueueCapacity(queueCapacity); + stateInfo.setQueueRemainingCapacity(remainingCapacity); + stateInfo.setLargestPoolSize(largestPoolSize); + stateInfo.setCompletedTaskCount(completedTaskCount); + + long rejectCount = + pool instanceof DynamicThreadPoolExecutor ? ((DynamicThreadPoolExecutor) pool).getRejectCountNum() : -1L; + stateInfo.setRejectCount(rejectCount); + stateInfo.setClientLastRefreshTime(DateUtil.formatDateTime(new Date())); + stateInfo.setTimestamp(System.currentTimeMillis()); + return supplement(stateInfo); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java new file mode 100644 index 00000000..2c812631 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java @@ -0,0 +1,79 @@ +package cn.hippo4j.core.executor.state; + +import cn.hippo4j.common.model.ManyPoolRunStateInfo; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.toolkit.ByteConvertUtil; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport; +import cn.hippo4j.core.toolkit.inet.InetUtils; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.system.RuntimeInfo; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.env.ConfigurableEnvironment; + +import java.util.concurrent.ThreadPoolExecutor; + +import static cn.hippo4j.core.toolkit.IdentifyUtil.CLIENT_IDENTIFICATION_VALUE; + +/** + * Thread pool run state service. + * + * @author chen.ma + * @date 2021/7/12 21:25 + */ +@Slf4j +@AllArgsConstructor +public class ThreadPoolRunStateHandler extends AbstractThreadPoolRuntime { + + private final InetUtils hippo4JInetUtils; + + private final ConfigurableEnvironment environment; + + @Override + protected PoolRunStateInfo supplement(PoolRunStateInfo poolRunStateInfo) { + // 内存占比: 使用内存 / 最大内存 + RuntimeInfo runtimeInfo = new RuntimeInfo(); + String memoryProportion = StrUtil.builder( + "已分配: ", + ByteConvertUtil.getPrintSize(runtimeInfo.getTotalMemory()), + " / 最大可用: ", + ByteConvertUtil.getPrintSize(runtimeInfo.getMaxMemory()) + ).toString(); + + poolRunStateInfo.setCurrentLoad(poolRunStateInfo.getCurrentLoad() + "%"); + poolRunStateInfo.setPeakLoad(poolRunStateInfo.getPeakLoad() + "%"); + + String ipAddress = hippo4JInetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + poolRunStateInfo.setHost(ipAddress); + poolRunStateInfo.setMemoryProportion(memoryProportion); + poolRunStateInfo.setFreeMemory(ByteConvertUtil.getPrintSize(runtimeInfo.getFreeMemory())); + + String threadPoolId = poolRunStateInfo.getTpId(); + DynamicThreadPoolWrapper executorService = GlobalThreadPoolManage.getExecutorService(threadPoolId); + ThreadPoolExecutor pool = executorService.getExecutor(); + + String rejectedName; + if (pool instanceof AbstractDynamicExecutorSupport) { + rejectedName = ((DynamicThreadPoolExecutor) pool).getRedundancyHandler().getClass().getSimpleName(); + } else { + rejectedName = pool.getRejectedExecutionHandler().getClass().getSimpleName(); + } + poolRunStateInfo.setRejectedName(rejectedName); + + ManyPoolRunStateInfo manyPoolRunStateInfo = BeanUtil.toBean(poolRunStateInfo, ManyPoolRunStateInfo.class); + manyPoolRunStateInfo.setIdentify(CLIENT_IDENTIFICATION_VALUE); + + String active = environment.getProperty("spring.profiles.active", "UNKNOWN"); + manyPoolRunStateInfo.setActive(active.toUpperCase()); + + String threadPoolState = ThreadPoolStatusHandler.getThreadPoolState(pool); + manyPoolRunStateInfo.setState(threadPoolState); + + return manyPoolRunStateInfo; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolStatusHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolStatusHandler.java new file mode 100644 index 00000000..3f6354b5 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolStatusHandler.java @@ -0,0 +1,62 @@ +package cn.hippo4j.core.executor.state; + +import cn.hutool.core.util.ReflectUtil; +import lombok.extern.slf4j.Slf4j; + +import java.lang.reflect.Method; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * ThreadPool status handler. + * + * @author chen.ma + * @date 2022/1/18 20:54 + */ +@Slf4j +public class ThreadPoolStatusHandler { + + private static final String RUNNING = "Running"; + + private static final String TERMINATED = "Terminated"; + + private static final String SHUTTING_DOWN = "Shutting down"; + + private static final AtomicBoolean EXCEPTION_FLAG = new AtomicBoolean(Boolean.TRUE); + + /** + * Get thread pool state. + * + * @param executor + * @return + */ + public static String getThreadPoolState(ThreadPoolExecutor executor) { + if (EXCEPTION_FLAG.get()) { + try { + Method runStateLessThan = ReflectUtil.getMethodByName(ThreadPoolExecutor.class, "runStateLessThan"); + cn.hippo4j.common.toolkit.ReflectUtil.setAccessible(runStateLessThan); + + AtomicInteger ctl = (AtomicInteger) ReflectUtil.getFieldValue(executor, "ctl"); + int shutdown = (int) ReflectUtil.getFieldValue(executor, "SHUTDOWN"); + boolean runStateLessThanBool = ReflectUtil.invoke(executor, runStateLessThan, ctl.get(), shutdown); + if (runStateLessThanBool) { + return RUNNING; + } + + Method runStateAtLeast = ReflectUtil.getMethodByName(ThreadPoolExecutor.class, "runStateAtLeast"); + cn.hippo4j.common.toolkit.ReflectUtil.setAccessible(runStateAtLeast); + int terminated = (int) ReflectUtil.getFieldValue(executor, "TERMINATED"); + String resultStatus = ReflectUtil.invoke(executor, runStateAtLeast, ctl.get(), terminated) ? TERMINATED : SHUTTING_DOWN; + return resultStatus; + } catch (Exception ex) { + log.error("Failed to get thread pool status.", ex); + + EXCEPTION_FLAG.set(Boolean.FALSE); + } + } + + return "UNKNOWN"; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/AbstractBuildThreadPoolTemplate.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/AbstractBuildThreadPoolTemplate.java new file mode 100644 index 00000000..b5a23509 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/AbstractBuildThreadPoolTemplate.java @@ -0,0 +1,219 @@ +package cn.hippo4j.core.executor.support; + +import cn.hippo4j.common.toolkit.Assert; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import lombok.Data; +import lombok.experimental.Accessors; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.task.TaskDecorator; + +import java.util.concurrent.*; +import java.util.concurrent.locks.AbstractQueuedSynchronizer; + +/** + * Abstract build threadPool template. + * + * @author chen.ma + * @date 2021/7/5 21:45 + */ +@Slf4j +public class AbstractBuildThreadPoolTemplate { + + /** + * 线程池构建初始化参数. + *

+ * 此处本身是模版设计方法, 但是考虑创建简洁性, 移除 abstract. + * 异常参考 {@link AbstractQueuedSynchronizer#tryAcquire} + * + * @return + */ + protected static ThreadPoolInitParam initParam() { + throw new UnsupportedOperationException(); + } + + /** + * 构建线程池. + * + * @return + */ + public static ThreadPoolExecutor buildPool() { + ThreadPoolInitParam initParam = initParam(); + return buildPool(initParam); + } + + /** + * 构建线程池. + * + * @return + */ + public static ThreadPoolExecutor buildPool(ThreadPoolInitParam initParam) { + Assert.notNull(initParam); + ThreadPoolExecutor executorService; + try { + executorService = new ThreadPoolExecutorTemplate(initParam.getCorePoolNum(), + initParam.getMaxPoolNum(), + initParam.getKeepAliveTime(), + initParam.getTimeUnit(), + initParam.getWorkQueue(), + initParam.getThreadFactory(), + initParam.rejectedExecutionHandler); + } catch (IllegalArgumentException ex) { + throw new IllegalArgumentException("Error creating thread pool parameter.", ex); + } + + executorService.allowCoreThreadTimeOut(initParam.allowCoreThreadTimeOut); + return executorService; + } + + /** + * 构建快速执行线程池. + * + * @return + */ + public static ThreadPoolExecutor buildFastPool() { + ThreadPoolInitParam initParam = initParam(); + return buildFastPool(initParam); + } + + /** + * 构建快速执行线程池. + * + * @return + */ + public static ThreadPoolExecutor buildFastPool(ThreadPoolInitParam initParam) { + TaskQueue taskQueue = new TaskQueue(initParam.getCapacity()); + FastThreadPoolExecutor fastThreadPoolExecutor; + try { + fastThreadPoolExecutor = new FastThreadPoolExecutor(initParam.getCorePoolNum(), + initParam.getMaxPoolNum(), + initParam.getKeepAliveTime(), + initParam.getTimeUnit(), + taskQueue, + initParam.getThreadFactory(), + initParam.rejectedExecutionHandler); + } catch (IllegalArgumentException ex) { + throw new IllegalArgumentException("Error creating thread pool parameter.", ex); + } + + taskQueue.setExecutor(fastThreadPoolExecutor); + fastThreadPoolExecutor.allowCoreThreadTimeOut(initParam.allowCoreThreadTimeOut); + return fastThreadPoolExecutor; + } + + /** + * 构建动态线程池. + * + * @param initParam + * @return + */ + public static DynamicThreadPoolExecutor buildDynamicPool(ThreadPoolInitParam initParam) { + Assert.notNull(initParam); + DynamicThreadPoolExecutor dynamicThreadPoolExecutor; + try { + dynamicThreadPoolExecutor = new DynamicThreadPoolExecutor( + initParam.getCorePoolNum(), + initParam.getMaxPoolNum(), + initParam.getKeepAliveTime(), + initParam.getTimeUnit(), + initParam.getExecuteTimeOut(), + initParam.getWaitForTasksToCompleteOnShutdown(), + initParam.getAwaitTerminationMillis(), + initParam.getWorkQueue(), + initParam.getThreadPoolId(), + initParam.getThreadFactory(), + initParam.getRejectedExecutionHandler() + ); + } catch (IllegalArgumentException ex) { + throw new IllegalArgumentException(String.format("Error creating thread pool parameter. threadPool id :: %s", initParam.getThreadPoolId()), ex); + } + + dynamicThreadPoolExecutor.setTaskDecorator(initParam.getTaskDecorator()); + dynamicThreadPoolExecutor.allowCoreThreadTimeOut(initParam.allowCoreThreadTimeOut); + return dynamicThreadPoolExecutor; + } + + @Data + @Accessors(chain = true) + public static class ThreadPoolInitParam { + + /** + * 核心线程数量 + */ + private Integer corePoolNum; + + /** + * 最大线程数量 + */ + private Integer maxPoolNum; + + /** + * 线程存活时间 + */ + private Long keepAliveTime; + + /** + * 线程存活时间单位 + */ + private TimeUnit timeUnit; + + /** + * 执行超时时间 + */ + private Long executeTimeOut; + + /** + * 队列最大容量 + */ + private Integer capacity; + + /** + * 阻塞队列 + */ + private BlockingQueue workQueue; + + /** + * 线程池任务满时拒绝任务策略 + */ + private RejectedExecutionHandler rejectedExecutionHandler; + + /** + * 创建线程工厂 + */ + private ThreadFactory threadFactory; + + /** + * 线程 ID + */ + private String threadPoolId; + + /** + * 线程任务装饰器 + */ + private TaskDecorator taskDecorator; + + /** + * 等待终止毫秒 + */ + private Long awaitTerminationMillis; + + /** + * 等待任务在关机时完成 + */ + private Boolean waitForTasksToCompleteOnShutdown; + + /** + * 允许核心线程超时 + */ + private Boolean allowCoreThreadTimeOut = false; + + public ThreadPoolInitParam(String threadNamePrefix, boolean isDaemon) { + this.threadPoolId = threadNamePrefix; + this.threadFactory = ThreadFactoryBuilder.builder() + .prefix(threadNamePrefix) + .daemon(isDaemon) + .build(); + } + } + +} + diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/AbstractDynamicExecutorSupport.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/AbstractDynamicExecutorSupport.java new file mode 100644 index 00000000..2c265bda --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/AbstractDynamicExecutorSupport.java @@ -0,0 +1,154 @@ +package cn.hippo4j.core.executor.support; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.InitializingBean; + +import java.util.concurrent.*; + +/** + * Dynamic executor configuration support. + * + * @author chen.ma + * @date 2021/11/28 12:17 + */ +@Slf4j +public abstract class AbstractDynamicExecutorSupport extends ThreadPoolExecutor + implements InitializingBean, DisposableBean { + + private String threadPoolId; + + private ExecutorService executor; + + public long awaitTerminationMillis; + + public boolean waitForTasksToCompleteOnShutdown; + + public AbstractDynamicExecutorSupport(int corePoolSize, + int maximumPoolSize, + long keepAliveTime, + TimeUnit unit, + boolean waitForTasksToCompleteOnShutdown, + long awaitTerminationMillis, + BlockingQueue workQueue, + String threadPoolId, + ThreadFactory threadFactory, + RejectedExecutionHandler handler) { + super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler); + this.threadPoolId = threadPoolId; + this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown; + this.awaitTerminationMillis = awaitTerminationMillis; + } + + /** + * Create the target {@link java.util.concurrent.ExecutorService} instance. + * Called by {@code afterPropertiesSet}. + * + * @return a new ExecutorService instance + * @see #afterPropertiesSet() + */ + protected abstract ExecutorService initializeExecutor(); + + /** + * Calls {@code initialize()} after the container applied all property values. + * + * @see #initialize() + */ + @Override + public void afterPropertiesSet() { + initialize(); + } + + /** + * Calls {@code shutdown} when the BeanFactory destroys. + * the task executor instance. + * + * @see #shutdown() + */ + @Override + public void destroy() { + shutdownSupport(); + } + + /** + * Set up the ExecutorService. + */ + public void initialize() { + if (log.isInfoEnabled()) { + log.info("Initializing ExecutorService" + (this.threadPoolId != null ? " '" + this.threadPoolId + "'" : "")); + } + + this.executor = initializeExecutor(); + } + + /** + * Set support param. + * + * @param awaitTerminationMillis + * @param waitForTasksToCompleteOnShutdown + */ + public void setSupportParam(long awaitTerminationMillis, boolean waitForTasksToCompleteOnShutdown) { + this.awaitTerminationMillis = awaitTerminationMillis; + this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown; + } + + /** + * Perform a shutdown on the underlying ExecutorService. + * + * @see java.util.concurrent.ExecutorService#shutdown() + * @see java.util.concurrent.ExecutorService#shutdownNow() + */ + public void shutdownSupport() { + if (log.isInfoEnabled()) { + log.info("Shutting down ExecutorService" + (this.threadPoolId != null ? " '" + this.threadPoolId + "'" : "")); + } + if (this.executor != null) { + if (this.waitForTasksToCompleteOnShutdown) { + this.executor.shutdown(); + } else { + for (Runnable remainingTask : this.executor.shutdownNow()) { + cancelRemainingTask(remainingTask); + } + } + awaitTerminationIfNecessary(this.executor); + } + } + + /** + * Cancel the given remaining task which never commended execution, + * as returned from {@link ExecutorService#shutdownNow()}. + * + * @param task the task to cancel (typically a {@link RunnableFuture}) + * @see #shutdown() + * @see RunnableFuture#cancel(boolean) + * @since 5.0.5 + */ + protected void cancelRemainingTask(Runnable task) { + if (task instanceof Future) { + ((Future) task).cancel(true); + } + } + + /** + * Wait for the executor to terminate, according to the value of the. + */ + private void awaitTerminationIfNecessary(ExecutorService executor) { + if (this.awaitTerminationMillis > 0) { + try { + if (!executor.awaitTermination(this.awaitTerminationMillis, TimeUnit.MILLISECONDS)) { + if (log.isWarnEnabled()) { + log.warn("Timed out while waiting for executor" + + (this.threadPoolId != null ? " '" + this.threadPoolId + "'" : "") + " to terminate."); + } + } + } catch (InterruptedException ex) { + if (log.isWarnEnabled()) { + log.warn("Interrupted while waiting for executor" + + (this.threadPoolId != null ? " '" + this.threadPoolId + "'" : "") + " to terminate."); + } + Thread.currentThread().interrupt(); + } + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/CommonDynamicThreadPool.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/CommonDynamicThreadPool.java new file mode 100644 index 00000000..1ba4a6ae --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/CommonDynamicThreadPool.java @@ -0,0 +1,32 @@ +package cn.hippo4j.core.executor.support; + +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; + +import java.util.concurrent.TimeUnit; + +/** + * Common dynamic threadPool. + * + * @author chen.ma + * @date 2021/6/16 22:35 + */ +public class CommonDynamicThreadPool { + + /** + * Get instance. + * + * @param threadPoolId + * @return + */ + public static DynamicThreadPoolExecutor getInstance(String threadPoolId) { + DynamicThreadPoolExecutor poolExecutor = (DynamicThreadPoolExecutor) ThreadPoolBuilder.builder() + .dynamicPool() + .threadFactory(threadPoolId) + .poolThreadSize(2, 4) + .keepAliveTime(60L, TimeUnit.SECONDS) + .workQueue(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE, 1024) + .build(); + return poolExecutor; + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/FastThreadPoolExecutor.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/FastThreadPoolExecutor.java similarity index 93% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/FastThreadPoolExecutor.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/FastThreadPoolExecutor.java index f99b7ccb..200769d7 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/FastThreadPoolExecutor.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/FastThreadPoolExecutor.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; import lombok.extern.slf4j.Slf4j; @@ -48,7 +48,7 @@ public class FastThreadPoolExecutor extends ThreadPoolExecutorTemplate { try { if (!queue.retryOffer(command, 0, TimeUnit.MILLISECONDS)) { submittedTaskCount.decrementAndGet(); - throw new RejectedExecutionException("队列容量已满.", rx); + throw new RejectedExecutionException("The blocking queue capacity is full.", rx); } } catch (InterruptedException x) { submittedTaskCount.decrementAndGet(); diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/QueueTypeEnum.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java similarity index 59% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/QueueTypeEnum.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java index 4f4fda0e..389b3fb9 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/QueueTypeEnum.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/QueueTypeEnum.java @@ -1,13 +1,14 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; -import com.github.dynamic.threadpool.starter.spi.DynamicTpServiceLoader; -import com.github.dynamic.threadpool.starter.spi.CustomBlockingQueue; +import cn.hippo4j.core.spi.CustomBlockingQueue; +import cn.hippo4j.core.spi.DynamicThreadPoolServiceLoader; import java.util.Arrays; import java.util.Collection; import java.util.Objects; import java.util.Optional; import java.util.concurrent.*; +import java.util.stream.Stream; /** * Queue type enum. @@ -62,9 +63,58 @@ public enum QueueTypeEnum { } static { - DynamicTpServiceLoader.register(CustomBlockingQueue.class); + DynamicThreadPoolServiceLoader.register(CustomBlockingQueue.class); } + /** + * Create blocking queue. + * + * @param blockingQueueName + * @param capacity + * @return + */ + public static BlockingQueue createBlockingQueue(String blockingQueueName, Integer capacity) { + BlockingQueue blockingQueue = null; + QueueTypeEnum queueTypeEnum = Stream.of(QueueTypeEnum.values()) + .filter(each -> Objects.equals(each.name, blockingQueueName)) + .findFirst() + .orElse(null); + + if (queueTypeEnum != null) { + blockingQueue = createBlockingQueue(queueTypeEnum.type, capacity); + if (Objects.equals(blockingQueue.getClass().getSimpleName(), blockingQueueName)) { + return blockingQueue; + } + } + + Collection customBlockingQueues = DynamicThreadPoolServiceLoader + .getSingletonServiceInstances(CustomBlockingQueue.class); + blockingQueue = Optional.ofNullable(blockingQueue) + .orElseGet( + () -> customBlockingQueues.stream() + .filter(each -> Objects.equals(blockingQueueName, each.getName())) + .map(each -> each.generateBlockingQueue()) + .findFirst() + .orElseGet(() -> { + int temCapacity = capacity; + if (capacity == null || capacity <= 0) { + temCapacity = 1024; + } + + return new LinkedBlockingQueue(temCapacity); + }) + ); + + return blockingQueue; + } + + /** + * Create blocking queue. + * + * @param type + * @param capacity + * @return + */ public static BlockingQueue createBlockingQueue(int type, Integer capacity) { BlockingQueue blockingQueue = null; if (Objects.equals(type, ARRAY_BLOCKING_QUEUE.type)) { @@ -83,7 +133,7 @@ public enum QueueTypeEnum { blockingQueue = new ResizableCapacityLinkedBlockIngQueue(capacity); } - Collection customBlockingQueues = DynamicTpServiceLoader + Collection customBlockingQueues = DynamicThreadPoolServiceLoader .getSingletonServiceInstances(CustomBlockingQueue.class); blockingQueue = Optional.ofNullable(blockingQueue).orElseGet(() -> customBlockingQueues.stream() .filter(each -> Objects.equals(type, each.getType())) @@ -94,6 +144,12 @@ public enum QueueTypeEnum { return blockingQueue; } + /** + * Get blocking queue name by type. + * + * @param type + * @return + */ public static String getBlockingQueueNameByType(int type) { Optional queueTypeEnum = Arrays.stream(QueueTypeEnum.values()) .filter(each -> each.type == type) diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/RejectedPolicies.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/RejectedPolicies.java similarity index 64% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/RejectedPolicies.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/RejectedPolicies.java index 48fd868c..8ed4c5e8 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/RejectedPolicies.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/RejectedPolicies.java @@ -1,9 +1,10 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.BlockingQueue; import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; /** * Rejected policies. @@ -15,12 +16,12 @@ import java.util.concurrent.RejectedExecutionHandler; public class RejectedPolicies { /** - * 发生拒绝事件时, 添加新任务并运行最早的任务 - * - * @return + * 发生拒绝事件时, 添加新任务并运行最早的任务. */ - public static RejectedExecutionHandler runsOldestTaskPolicy() { - return (r, executor) -> { + public static class RunsOldestTaskPolicy implements RejectedExecutionHandler { + + @Override + public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (executor.isShutdown()) { return; } @@ -33,25 +34,27 @@ public class RejectedPolicies { if (!newTaskAdd) { executor.execute(r); } - }; + } + } /** - * 使用阻塞方法将拒绝任务添加队列, 可保证任务不丢失 - * - * @return + * 使用阻塞方法将拒绝任务添加队列, 可保证任务不丢失. */ - public static RejectedExecutionHandler syncPutQueuePolicy() { - return (r, executor) -> { + public static class SyncPutQueuePolicy implements RejectedExecutionHandler { + + @Override + public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (executor.isShutdown()) { return; } try { executor.getQueue().put(r); } catch (InterruptedException e) { - log.error("线程池添加队列任务失败", e); + log.error("Adding Queue task to thread pool failed.", e); } - }; + } + } } diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/RejectedTypeEnum.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/RejectedTypeEnum.java new file mode 100644 index 00000000..f8e995d8 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/RejectedTypeEnum.java @@ -0,0 +1,139 @@ +package cn.hippo4j.core.executor.support; + +import cn.hippo4j.core.spi.CustomRejectedExecutionHandler; +import cn.hippo4j.core.spi.DynamicThreadPoolServiceLoader; + +import java.util.Collection; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.stream.Stream; + +/** + * Reject policy type Enum. + * + * @author chen.ma + * @date 2021/7/10 23:16 + */ +public enum RejectedTypeEnum { + + /** + * 被拒绝任务的程序由主线程执行 + */ + CALLER_RUNS_POLICY(1, "CallerRunsPolicy", new ThreadPoolExecutor.CallerRunsPolicy()), + + /** + * 被拒绝任务的处理程序, 抛出异常 + */ + ABORT_POLICY(2, "AbortPolicy", new ThreadPoolExecutor.AbortPolicy()), + + /** + * 被拒绝任务的处理程序, 默默地丢弃被拒绝的任务。 + */ + DISCARD_POLICY(3, "DiscardPolicy", new ThreadPoolExecutor.DiscardPolicy()), + + /** + * 被拒绝任务的处理程序, 它丢弃最早的未处理请求, 然后重试 + */ + DISCARD_OLDEST_POLICY(4, "DiscardOldestPolicy", new ThreadPoolExecutor.DiscardOldestPolicy()), + + /** + * 发生拒绝事件时, 添加新任务并运行最早的任务 + */ + RUNS_OLDEST_TASK_POLICY(5, "RunsOldestTaskPolicy", new RejectedPolicies.RunsOldestTaskPolicy()), + + /** + * 使用阻塞方法将拒绝任务添加队列, 可保证任务不丢失 + */ + SYNC_PUT_QUEUE_POLICY(6, "SyncPutQueuePolicy", new RejectedPolicies.SyncPutQueuePolicy()); + + /** + * 类型 + */ + public Integer type; + + /** + * 名称 + */ + public String name; + + /** + * 线程池拒绝策略 + */ + public RejectedExecutionHandler rejectedHandler; + + RejectedTypeEnum(Integer type, String name, RejectedExecutionHandler rejectedHandler) { + this.type = type; + this.name = name; + this.rejectedHandler = rejectedHandler; + } + + static { + DynamicThreadPoolServiceLoader.register(CustomRejectedExecutionHandler.class); + } + + /** + * Create policy. + * + * @param name + * @return + */ + public static RejectedExecutionHandler createPolicy(String name) { + RejectedTypeEnum rejectedTypeEnum = Stream.of(RejectedTypeEnum.values()) + .filter(each -> Objects.equals(each.name, name)) + .findFirst() + .orElse(null); + + if (rejectedTypeEnum != null) { + return rejectedTypeEnum.rejectedHandler; + } + + Collection customRejectedExecutionHandlers = DynamicThreadPoolServiceLoader + .getSingletonServiceInstances(CustomRejectedExecutionHandler.class); + Optional customRejected = customRejectedExecutionHandlers.stream() + .filter(each -> Objects.equals(name, each.getName())) + .map(each -> each.generateRejected()) + .findFirst(); + + return customRejected.orElse(ABORT_POLICY.rejectedHandler); + } + + /** + * Create policy. + * + * @param type + * @return + */ + public static RejectedExecutionHandler createPolicy(int type) { + Optional rejectedTypeEnum = Stream.of(RejectedTypeEnum.values()) + .filter(each -> Objects.equals(type, each.type)) + .map(each -> each.rejectedHandler) + .findFirst(); + + // 使用 SPI 匹配拒绝策略 + RejectedExecutionHandler resultRejected = rejectedTypeEnum.orElseGet(() -> { + Collection customRejectedExecutionHandlers = DynamicThreadPoolServiceLoader + .getSingletonServiceInstances(CustomRejectedExecutionHandler.class); + Optional customRejected = customRejectedExecutionHandlers.stream() + .filter(each -> Objects.equals(type, each.getType())) + .map(each -> each.generateRejected()) + .findFirst(); + + return customRejected.orElse(ABORT_POLICY.rejectedHandler); + }); + + return resultRejected; + } + + /** + * Get rejected name by type. + * + * @param type + * @return + */ + public static String getRejectedNameByType(int type) { + return createPolicy(type).getClass().getSimpleName(); + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ResizableCapacityLinkedBlockIngQueue.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockIngQueue.java similarity index 93% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ResizableCapacityLinkedBlockIngQueue.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockIngQueue.java index e4555811..ff900969 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ResizableCapacityLinkedBlockIngQueue.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ResizableCapacityLinkedBlockIngQueue.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; import cn.hutool.core.util.ReflectUtil; import lombok.extern.slf4j.Slf4j; @@ -34,7 +34,6 @@ public class ResizableCapacityLinkedBlockIngQueue extends LinkedBlockingQueue ReflectUtil.invoke(this, "signalNotFull"); } } catch (Exception ex) { - // ignore log.error("Dynamic modification of blocking queue size failed.", ex); successFlag = false; } diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/TaskQueue.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/TaskQueue.java similarity index 96% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/TaskQueue.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/TaskQueue.java index 16391ca2..7bfd78ad 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/TaskQueue.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/TaskQueue.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.RejectedExecutionException; @@ -47,4 +47,5 @@ public class TaskQueue extends LinkedBlockingQueue } return super.offer(o, timeout, unit); } + } diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadFactoryBuilder.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadFactoryBuilder.java similarity index 92% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadFactoryBuilder.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadFactoryBuilder.java index b0265639..4a395f77 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadFactoryBuilder.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadFactoryBuilder.java @@ -1,4 +1,6 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; + +import cn.hippo4j.common.design.builder.Builder; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; @@ -40,7 +42,7 @@ public class ThreadFactoryBuilder implements Builder { private Thread.UncaughtExceptionHandler uncaughtExceptionHandler; /** - * 设置用于创建基础线程的线程工厂 + * 设置用于创建基础线程的线程工厂. * * @param backingThreadFactory 用于创建基础线程的线程工厂 * @return this @@ -51,7 +53,7 @@ public class ThreadFactoryBuilder implements Builder { } /** - * 设置线程名前缀, 例如设置前缀为 mb-thread- 则线程名为 mb-thread-1 之类 + * 设置线程名前缀, 例如设置前缀为 mb-thread- 则线程名为 mb-thread-1 之类. * * @param namePrefix 线程名前缀 * @return this @@ -62,7 +64,7 @@ public class ThreadFactoryBuilder implements Builder { } /** - * 设置是否守护线程 + * 设置是否守护线程. * * @param daemon 是否守护线程 * @return this @@ -73,7 +75,7 @@ public class ThreadFactoryBuilder implements Builder { } /** - * 设置线程优先级 + * 设置线程优先级. * * @param priority 优先级 * @return this @@ -93,7 +95,7 @@ public class ThreadFactoryBuilder implements Builder { } /** - * 设置未捕获异常的处理方式 + * 设置未捕获异常的处理方式. * * @param uncaughtExceptionHandler {@link Thread.UncaughtExceptionHandler} */ @@ -102,7 +104,7 @@ public class ThreadFactoryBuilder implements Builder { } /** - * 构建 + * 构建. * * @return */ @@ -121,7 +123,7 @@ public class ThreadFactoryBuilder implements Builder { } /** - * 构建 + * 构建. * * @param builder {@link ThreadFactoryBuilder} * @return {@link ThreadFactory} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadPoolBuilder.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java similarity index 67% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadPoolBuilder.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java index 134f662a..7d3517b1 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadPoolBuilder.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java @@ -1,8 +1,8 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; - -import com.github.dynamic.threadpool.common.toolkit.Assert; -import com.github.dynamic.threadpool.starter.alarm.ThreadPoolAlarm; +import cn.hippo4j.common.design.builder.Builder; +import cn.hippo4j.common.toolkit.Assert; +import org.springframework.core.task.TaskDecorator; import java.math.BigDecimal; import java.util.Optional; @@ -22,9 +22,9 @@ public class ThreadPoolBuilder implements Builder { private boolean isFastPool; /** - * 是否自定义线程池 + * 是否动态线程池 */ - private boolean isCustomPool; + private boolean isDynamicPool; /** * 核心线程数量 @@ -46,6 +46,11 @@ public class ThreadPoolBuilder implements Builder { */ private TimeUnit timeUnit = TimeUnit.MILLISECONDS; + /** + * 线程执行超时时间 + */ + private long executeTimeOut = 10000L; + /** * 队列最大容量 */ @@ -82,19 +87,24 @@ public class ThreadPoolBuilder implements Builder { private String threadPoolId; /** - * 是否告警 + * 线程任务装饰器 + */ + private TaskDecorator taskDecorator; + + /** + * 等待终止毫秒 */ - private boolean isAlarm = false; + private Long awaitTerminationMillis = 5000L; /** - * 容量告警 + * 等待任务在关机时完成 */ - private Integer capacityAlarm; + private Boolean waitForTasksToCompleteOnShutdown = true; /** - * 活跃度告警 + * 允许核心线程超时 */ - private Integer livenessAlarm; + private Boolean allowCoreThreadTimeOut = false; /** * 计算公式:CPU 核数 / (1 - 阻塞系数 0.8) @@ -111,8 +121,8 @@ public class ThreadPoolBuilder implements Builder { return this; } - public ThreadPoolBuilder isCustomPool(Boolean isCustomPool) { - this.isCustomPool = isCustomPool; + public ThreadPoolBuilder dynamicPool() { + this.isDynamicPool = true; return this; } @@ -137,6 +147,13 @@ public class ThreadPoolBuilder implements Builder { return this; } + public ThreadPoolBuilder singlePool() { + int singleNum = 1; + this.corePoolSize = singleNum; + this.maxPoolSize = singleNum; + return this; + } + public ThreadPoolBuilder poolThreadSize(int corePoolSize, int maxPoolSize) { this.corePoolSize = corePoolSize; this.maxPoolSize = maxPoolSize; @@ -153,6 +170,11 @@ public class ThreadPoolBuilder implements Builder { return this; } + public ThreadPoolBuilder executeTimeOut(long executeTimeOut) { + this.executeTimeOut = executeTimeOut; + return this; + } + public ThreadPoolBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit) { this.keepAliveTime = keepAliveTime; this.timeUnit = timeUnit; @@ -190,28 +212,47 @@ public class ThreadPoolBuilder implements Builder { return this; } - public ThreadPoolBuilder alarmConfig(int isAlarm, int capacityAlarm, int livenessAlarm) { - this.isAlarm = isAlarm == 1 ? true : false; - this.capacityAlarm = capacityAlarm; - this.livenessAlarm = livenessAlarm; + public ThreadPoolBuilder taskDecorator(TaskDecorator taskDecorator) { + this.taskDecorator = taskDecorator; + return this; + } + + public ThreadPoolBuilder awaitTerminationMillis(long awaitTerminationMillis) { + this.awaitTerminationMillis = awaitTerminationMillis; + return this; + } + + public ThreadPoolBuilder waitForTasksToCompleteOnShutdown(boolean waitForTasksToCompleteOnShutdown) { + this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown; + return this; + } + + public ThreadPoolBuilder dynamicSupport(boolean waitForTasksToCompleteOnShutdown, long awaitTerminationMillis) { + this.awaitTerminationMillis = awaitTerminationMillis; + this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown; + return this; + } + + public ThreadPoolBuilder allowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) { + this.allowCoreThreadTimeOut = allowCoreThreadTimeOut; return this; } /** - * 构建 + * 构建. * * @return */ @Override public ThreadPoolExecutor build() { - if (isCustomPool) { - return buildCustomPool(this); + if (isDynamicPool) { + return buildDynamicPool(this); } return isFastPool ? buildFastPool(this) : buildPool(this); } /** - * 创建 + * 创建. * * @return */ @@ -220,7 +261,7 @@ public class ThreadPoolBuilder implements Builder { } /** - * 构建普通线程池 + * 构建普通线程池. * * @param builder * @return @@ -230,7 +271,7 @@ public class ThreadPoolBuilder implements Builder { } /** - * 构建快速消费线程池 + * 构建快速消费线程池. * * @param builder * @return @@ -240,17 +281,17 @@ public class ThreadPoolBuilder implements Builder { } /** - * 构建自定义线程池 + * 构建动态线程池. * * @param builder * @return */ - private static ThreadPoolExecutor buildCustomPool(ThreadPoolBuilder builder) { - return AbstractBuildThreadPoolTemplate.buildCustomPool(buildInitParam(builder)); + private static ThreadPoolExecutor buildDynamicPool(ThreadPoolBuilder builder) { + return AbstractBuildThreadPoolTemplate.buildDynamicPool(buildInitParam(builder)); } /** - * 构建初始化参数 + * 构建初始化参数. * * @param builder * @return @@ -264,14 +305,17 @@ public class ThreadPoolBuilder implements Builder { .setMaxPoolNum(builder.maxPoolSize) .setKeepAliveTime(builder.keepAliveTime) .setCapacity(builder.capacity) + .setExecuteTimeOut(builder.executeTimeOut) .setRejectedExecutionHandler(builder.rejectedExecutionHandler) - .setTimeUnit(builder.timeUnit); + .setTimeUnit(builder.timeUnit) + .setAllowCoreThreadTimeOut(builder.allowCoreThreadTimeOut) + .setTaskDecorator(builder.taskDecorator); - if (builder.isCustomPool) { + if (builder.isDynamicPool) { String threadPoolId = Optional.ofNullable(builder.threadPoolId).orElse(builder.threadNamePrefix); initParam.setThreadPoolId(threadPoolId); - ThreadPoolAlarm threadPoolAlarm = new ThreadPoolAlarm(builder.isAlarm, builder.capacityAlarm, builder.livenessAlarm); - initParam.setThreadPoolAlarm(threadPoolAlarm); + initParam.setWaitForTasksToCompleteOnShutdown(builder.waitForTasksToCompleteOnShutdown); + initParam.setAwaitTerminationMillis(builder.awaitTerminationMillis); } if (!builder.isFastPool) { diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadPoolExecutorTemplate.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolExecutorTemplate.java similarity index 90% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadPoolExecutorTemplate.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolExecutorTemplate.java index 3d07c27a..6810b57d 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/thread/ThreadPoolExecutorTemplate.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolExecutorTemplate.java @@ -1,6 +1,7 @@ -package com.github.dynamic.threadpool.starter.toolkit.thread; +package cn.hippo4j.core.executor.support; -import com.github.dynamic.threadpool.starter.toolkit.ArrayUtil; + +import cn.hippo4j.common.toolkit.ArrayUtil; import java.util.concurrent.*; @@ -23,7 +24,7 @@ public class ThreadPoolExecutorTemplate extends ThreadPoolExecutor { } private Exception clientTrace() { - return new Exception("tread task root stack trace"); + return new Exception("Tread task root stack trace."); } @Override diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/AbstractWebThreadPoolService.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/AbstractWebThreadPoolService.java new file mode 100644 index 00000000..bb9fa7b0 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/AbstractWebThreadPoolService.java @@ -0,0 +1,59 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.WebServer; +import org.springframework.context.ApplicationContext; + +import java.util.concurrent.Executor; + +/** + * Abstract web thread pool service. + * + * @author chen.ma + * @date 2022/1/19 21:20 + */ +@Slf4j +public abstract class AbstractWebThreadPoolService implements WebThreadPoolService, ApplicationRunner { + + /** + * Thread pool executor. + */ + protected volatile Executor executor; + + /** + * Get web thread pool by server. + * + * @param webServer + * @return + */ + protected abstract Executor getWebThreadPoolByServer(WebServer webServer); + + @Override + public Executor getWebThreadPool() { + if (executor == null) { + synchronized (AbstractWebThreadPoolService.class) { + if (executor == null) { + ApplicationContext applicationContext = ApplicationContextHolder.getInstance(); + WebServer webServer = ((WebServerApplicationContext) applicationContext).getWebServer(); + executor = getWebThreadPoolByServer(webServer); + } + } + } + + return executor; + } + + @Override + public void run(ApplicationArguments args) { + try { + getWebThreadPool(); + } catch (Exception ex) { + // ignore. Adaptation unit test. + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/JettyWebThreadPoolHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/JettyWebThreadPoolHandler.java new file mode 100644 index 00000000..5c2a6cbd --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/JettyWebThreadPoolHandler.java @@ -0,0 +1,97 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.model.PoolBaseInfo; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.toolkit.ReflectUtil; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.springframework.boot.web.embedded.jetty.JettyWebServer; +import org.springframework.boot.web.server.WebServer; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Executor; + +/** + * @author : wh + * @date : 2022/2/28 16:55 + * @description: + */ +@Slf4j +public class JettyWebThreadPoolHandler extends AbstractWebThreadPoolService { + + @Override + protected Executor getWebThreadPoolByServer(WebServer webServer) { + JettyWebServer jettyWebServer = (JettyWebServer) webServer; + return jettyWebServer.getServer().getThreadPool(); + } + + @Override + public PoolBaseInfo simpleInfo() { + PoolBaseInfo poolBaseInfo = new PoolBaseInfo(); + QueuedThreadPool queuedThreadPool = (QueuedThreadPool) executor; + poolBaseInfo.setCoreSize(queuedThreadPool.getMinThreads()); + poolBaseInfo.setMaximumSize(queuedThreadPool.getMaxThreads()); + + BlockingQueue jobs = (BlockingQueue) ReflectUtil.getFieldValue(queuedThreadPool, "_jobs"); + int queueCapacity = jobs.remainingCapacity() + jobs.size(); + + poolBaseInfo.setQueueCapacity(queueCapacity); + poolBaseInfo.setQueueType(jobs.getClass().getSimpleName()); + poolBaseInfo.setKeepAliveTime((long) queuedThreadPool.getIdleTimeout()); + poolBaseInfo.setRejectedName("RejectedExecutionException"); + return poolBaseInfo; + } + + @Override + public PoolParameter getWebThreadPoolParameter() { + PoolParameterInfo parameterInfo = null; + try { + parameterInfo = new PoolParameterInfo(); + QueuedThreadPool jettyExecutor = (QueuedThreadPool) executor; + + int minThreads = jettyExecutor.getMinThreads(); + int maxThreads = jettyExecutor.getMaxThreads(); + + parameterInfo.setCoreSize(minThreads); + parameterInfo.setMaxSize(maxThreads); + } catch (Exception ex) { + log.error("Failed to get the jetty thread pool parameter.", ex); + } + + return parameterInfo; + } + + @Override + public PoolRunStateInfo getWebRunStateInfo() { + return null; + } + + @Override + public void updateWebThreadPool(PoolParameterInfo poolParameterInfo) { + try { + QueuedThreadPool jettyExecutor = (QueuedThreadPool) executor; + + int minThreads = jettyExecutor.getMinThreads(); + int maxThreads = jettyExecutor.getMaxThreads(); + + Integer coreSize = poolParameterInfo.getCoreSize(); + Integer maxSize = poolParameterInfo.getMaxSize(); + + jettyExecutor.setMinThreads(coreSize); + jettyExecutor.setMaxThreads(maxSize); + + log.info( + "[JETTY] Changed web thread pool. " + + "\n coreSize :: [{}]" + + "\n maxSize :: [{}]", + String.format("%s => %s", minThreads, jettyExecutor.getMinThreads()), + String.format("%s => %s", maxThreads, jettyExecutor.getMaxThreads()) + ); + } catch (Exception ex) { + log.error("Failed to modify the jetty thread pool parameter.", ex); + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java new file mode 100644 index 00000000..107de214 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java @@ -0,0 +1,129 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.model.PoolBaseInfo; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.core.executor.state.AbstractThreadPoolRuntime; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.tomcat.util.threads.ThreadPoolExecutor; +import org.springframework.boot.web.embedded.tomcat.TomcatWebServer; +import org.springframework.boot.web.server.WebServer; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Executor; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * Tomcat web thread pool handler. + * + * @author chen.ma + * @date 2022/1/19 20:57 + */ +@Slf4j +@RequiredArgsConstructor +public class TomcatWebThreadPoolHandler extends AbstractWebThreadPoolService { + + private final AtomicBoolean cacheFlag = new AtomicBoolean(Boolean.FALSE); + + private static String EXCEPTION_MESSAGE; + + private final AbstractThreadPoolRuntime webThreadPoolRunStateHandler; + + @Override + protected Executor getWebThreadPoolByServer(WebServer webServer) { + if (cacheFlag.get()) { + log.warn("Exception getting Tomcat thread pool. Exception message :: {}", EXCEPTION_MESSAGE); + return null; + } + + Executor tomcatExecutor = null; + try { + tomcatExecutor = ((TomcatWebServer) webServer).getTomcat().getConnector().getProtocolHandler().getExecutor(); + } catch (Exception ex) { + cacheFlag.set(Boolean.TRUE); + EXCEPTION_MESSAGE = ex.getMessage(); + log.error("Failed to get Tomcat thread pool. Message :: {}", EXCEPTION_MESSAGE); + } + + return tomcatExecutor; + } + + @Override + public PoolBaseInfo simpleInfo() { + PoolBaseInfo poolBaseInfo = new PoolBaseInfo(); + ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; + int corePoolSize = threadPoolExecutor.getCorePoolSize(); + int maximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); + RejectedExecutionHandler rejectedExecutionHandler = threadPoolExecutor.getRejectedExecutionHandler(); + long keepAliveTime = threadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); + + BlockingQueue queue = threadPoolExecutor.getQueue(); + int queueSize = queue.size(); + int remainingCapacity = queue.remainingCapacity(); + int queueCapacity = queueSize + remainingCapacity; + + poolBaseInfo.setCoreSize(corePoolSize); + poolBaseInfo.setMaximumSize(maximumPoolSize); + poolBaseInfo.setKeepAliveTime(keepAliveTime); + poolBaseInfo.setQueueType(queue.getClass().getSimpleName()); + poolBaseInfo.setQueueCapacity(queueCapacity); + poolBaseInfo.setRejectedName(rejectedExecutionHandler.getClass().getSimpleName()); + + return poolBaseInfo; + } + + @Override + public PoolParameter getWebThreadPoolParameter() { + PoolParameterInfo parameterInfo = null; + try { + parameterInfo = new PoolParameterInfo(); + ThreadPoolExecutor tomcatExecutor = (ThreadPoolExecutor) executor; + int minThreads = tomcatExecutor.getCorePoolSize(); + int maxThreads = tomcatExecutor.getMaximumPoolSize(); + long keepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS); + + parameterInfo.setCoreSize(minThreads); + parameterInfo.setMaxSize(maxThreads); + parameterInfo.setKeepAliveTime((int) keepAliveTime); + } catch (Exception ex) { + log.error("Failed to get the tomcat thread pool parameter.", ex); + } + + return parameterInfo; + } + + @Override + public PoolRunStateInfo getWebRunStateInfo() { + return webThreadPoolRunStateHandler.getPoolRunState(null, executor); + } + + @Override + public void updateWebThreadPool(PoolParameterInfo poolParameterInfo) { + try { + ThreadPoolExecutor tomcatExecutor = (ThreadPoolExecutor) executor; + int originalCoreSize = tomcatExecutor.getCorePoolSize(); + int originalMaximumPoolSize = tomcatExecutor.getMaximumPoolSize(); + long originalKeepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS); + + tomcatExecutor.setCorePoolSize(poolParameterInfo.getCoreSize()); + tomcatExecutor.setMaximumPoolSize(poolParameterInfo.getMaxSize()); + tomcatExecutor.setKeepAliveTime(poolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS); + log.info( + "[TOMCAT] Changed web thread pool. " + + "\n coreSize :: [{}]" + + "\n maxSize :: [{}]" + + "\n keepAliveTime :: [{}]", + String.format("%s => %s", originalCoreSize, poolParameterInfo.getCoreSize()), + String.format("%s => %s", originalMaximumPoolSize, poolParameterInfo.getMaxSize()), + String.format("%s => %s", originalKeepAliveTime, poolParameterInfo.getKeepAliveTime()) + ); + } catch (Exception ex) { + log.error("Failed to modify the Tomcat thread pool parameter.", ex); + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/UndertowWebThreadPoolHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/UndertowWebThreadPoolHandler.java new file mode 100644 index 00000000..1ee57db0 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/UndertowWebThreadPoolHandler.java @@ -0,0 +1,165 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.model.PoolBaseInfo; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.toolkit.CalculateUtil; +import cn.hutool.core.date.DateUtil; +import io.undertow.Undertow; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.web.embedded.undertow.UndertowWebServer; +import org.springframework.boot.web.server.WebServer; +import org.springframework.util.ReflectionUtils; +import org.xnio.Options; +import org.xnio.XnioWorker; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.Date; +import java.util.Objects; +import java.util.concurrent.Executor; + +/** + * Undertow web thread pool handler. + * + * @author chen.ma + * @date 2022/1/19 21:19 + */ +@Slf4j +public class UndertowWebThreadPoolHandler extends AbstractWebThreadPoolService { + + private static final String UNDERTOW_NAME = "undertow"; + + @Override + protected Executor getWebThreadPoolByServer(WebServer webServer) { + // There is no need to consider reflection performance because the fetch is a singleton + UndertowWebServer undertowWebServer = (UndertowWebServer) webServer; + Field undertowField = ReflectionUtils.findField(UndertowWebServer.class, UNDERTOW_NAME); + ReflectionUtils.makeAccessible(undertowField); + + Undertow undertow = (Undertow) ReflectionUtils.getField(undertowField, undertowWebServer); + return Objects.isNull(undertow) ? null : undertow.getWorker(); + } + + @Override + public PoolBaseInfo simpleInfo() { + PoolBaseInfo poolBaseInfo = new PoolBaseInfo(); + XnioWorker xnioWorker = (XnioWorker) executor; + try { + int coreSize = xnioWorker.getOption(Options.WORKER_TASK_CORE_THREADS); + int maximumPoolSize = xnioWorker.getOption(Options.WORKER_TASK_MAX_THREADS); + int keepAliveTime = xnioWorker.getOption(Options.WORKER_TASK_KEEPALIVE); + + poolBaseInfo.setCoreSize(coreSize); + poolBaseInfo.setMaximumSize(maximumPoolSize); + poolBaseInfo.setKeepAliveTime((long) keepAliveTime); + poolBaseInfo.setRejectedName("-"); + poolBaseInfo.setQueueType("-"); + } catch (Exception ex) { + log.error("The undertow container failed to get thread pool parameters.", ex); + } + + return poolBaseInfo; + } + + @Override + public PoolParameter getWebThreadPoolParameter() { + PoolParameterInfo parameterInfo = null; + try { + parameterInfo = new PoolParameterInfo(); + XnioWorker xnioWorker = (XnioWorker) executor; + int minThreads = xnioWorker.getOption(Options.WORKER_TASK_CORE_THREADS); + int maxThreads = xnioWorker.getOption(Options.WORKER_TASK_MAX_THREADS); + int keepAliveTime = xnioWorker.getOption(Options.WORKER_TASK_KEEPALIVE); + + parameterInfo.setCoreSize(minThreads); + parameterInfo.setMaxSize(maxThreads); + parameterInfo.setKeepAliveTime(keepAliveTime); + } catch (Exception ex) { + log.error("Failed to get the undertow thread pool parameter.", ex); + } + + return parameterInfo; + } + + @Override + public PoolRunStateInfo getWebRunStateInfo() { + PoolRunStateInfo stateInfo = new PoolRunStateInfo(); + XnioWorker xnioWorker = (XnioWorker) executor; + + // private final TaskPool taskPool; + Field field = ReflectionUtils.findField(XnioWorker.class, "taskPool"); + ReflectionUtils.makeAccessible(field); + Object fieldObject = ReflectionUtils.getField(field, xnioWorker); + // 核心线程数 + Method getCorePoolSize = ReflectionUtils.findMethod(fieldObject.getClass(), "getCorePoolSize"); + ReflectionUtils.makeAccessible(getCorePoolSize); + int corePoolSize = (int) ReflectionUtils.invokeMethod(getCorePoolSize, fieldObject); + // 最大线程数 + Method getMaximumPoolSize = ReflectionUtils.findMethod(fieldObject.getClass(), "getMaximumPoolSize"); + ReflectionUtils.makeAccessible(getMaximumPoolSize); + int maximumPoolSize = (int) ReflectionUtils.invokeMethod(getMaximumPoolSize, fieldObject); + // 线程池当前线程数 (有锁) + Method getPoolSize = ReflectionUtils.findMethod(fieldObject.getClass(), "getPoolSize"); + ReflectionUtils.makeAccessible(getPoolSize); + int poolSize = (int) ReflectionUtils.invokeMethod(getPoolSize, fieldObject); + // 活跃线程数 (有锁) + Method getActiveCount = ReflectionUtils.findMethod(fieldObject.getClass(), "getActiveCount"); + ReflectionUtils.makeAccessible(getActiveCount); + int activeCount = (int) ReflectionUtils.invokeMethod(getActiveCount, fieldObject); + activeCount = (activeCount <= 0) ? 0 : activeCount; + // 当前负载 + String currentLoad = CalculateUtil.divide(activeCount, maximumPoolSize) + ""; + // 峰值负载 + // 没有峰值记录,直接使用当前数据 + String peakLoad = CalculateUtil.divide(activeCount, maximumPoolSize) + ""; + + stateInfo.setCoreSize(corePoolSize); + stateInfo.setPoolSize(poolSize); + stateInfo.setMaximumSize(maximumPoolSize); + stateInfo.setActiveSize(activeCount); + stateInfo.setCurrentLoad(currentLoad); + stateInfo.setPeakLoad(peakLoad); + + long rejectCount = fieldObject instanceof DynamicThreadPoolExecutor + ? ((DynamicThreadPoolExecutor) fieldObject).getRejectCountNum() : -1L; + stateInfo.setRejectCount(rejectCount); + stateInfo.setClientLastRefreshTime(DateUtil.formatDateTime(new Date())); + stateInfo.setTimestamp(System.currentTimeMillis()); + return stateInfo; + } + + @Override + public void updateWebThreadPool(PoolParameterInfo poolParameterInfo) { + try { + XnioWorker xnioWorker = (XnioWorker) executor; + + Integer coreSize = poolParameterInfo.getCoreSize(); + Integer maxSize = poolParameterInfo.getMaxSize(); + Integer keepAliveTime = poolParameterInfo.getKeepAliveTime(); + + int originalCoreSize = xnioWorker.getOption(Options.WORKER_TASK_CORE_THREADS); + int originalMaximumPoolSize = xnioWorker.getOption(Options.WORKER_TASK_MAX_THREADS); + int originalKeepAliveTime = xnioWorker.getOption(Options.WORKER_TASK_KEEPALIVE); + + xnioWorker.setOption(Options.WORKER_TASK_CORE_THREADS, coreSize); + xnioWorker.setOption(Options.WORKER_TASK_MAX_THREADS, maxSize); + xnioWorker.setOption(Options.WORKER_TASK_KEEPALIVE, keepAliveTime); + log.info( + "[UNDERTOW] Changed web thread pool. " + + "\n coreSize :: [{}]" + + "\n maxSize :: [{}]" + + "\n keepAliveTime :: [{}]", + String.format("%s => %s", originalCoreSize, coreSize), + String.format("%s => %s", originalMaximumPoolSize, maxSize), + String.format("%s => %s", originalKeepAliveTime, keepAliveTime) + ); + + } catch (Exception ex) { + log.error("Failed to modify the undertow thread pool parameter.", ex); + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolHandlerChoose.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolHandlerChoose.java new file mode 100644 index 00000000..a5195c14 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolHandlerChoose.java @@ -0,0 +1,32 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.web.exception.ServiceException; +import lombok.extern.slf4j.Slf4j; + +/** + * Web thread pool handler choose. + * + * @author chen.ma + * @date 2022/1/20 20:15 + */ +@Slf4j +public class WebThreadPoolHandlerChoose { + + /** + * Choose the web thread pool service bean. + * + * @return + */ + public WebThreadPoolService choose() { + WebThreadPoolService webThreadPoolService; + try { + webThreadPoolService = ApplicationContextHolder.getBean(WebThreadPoolService.class); + } catch (Exception ex) { + throw new ServiceException("Web thread pool service bean not found.", ex); + } + + return webThreadPoolService; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java new file mode 100644 index 00000000..b6978dd8 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java @@ -0,0 +1,39 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.toolkit.ByteConvertUtil; +import cn.hippo4j.core.executor.state.AbstractThreadPoolRuntime; +import cn.hutool.core.util.StrUtil; +import cn.hutool.system.RuntimeInfo; +import lombok.extern.slf4j.Slf4j; + +/** + * Web thread pool run state handler. + * + * @author chen.ma + * @date 2022/1/19 21:05 + */ +@Slf4j +public class WebThreadPoolRunStateHandler extends AbstractThreadPoolRuntime { + + @Override + protected PoolRunStateInfo supplement(PoolRunStateInfo poolRunStateInfo) { + // 内存占比: 使用内存 / 最大内存 + RuntimeInfo runtimeInfo = new RuntimeInfo(); + String memoryProportion = StrUtil.builder( + "已分配: ", + ByteConvertUtil.getPrintSize(runtimeInfo.getTotalMemory()), + " / 最大可用: ", + ByteConvertUtil.getPrintSize(runtimeInfo.getMaxMemory()) + ).toString(); + + poolRunStateInfo.setCurrentLoad(poolRunStateInfo.getCurrentLoad() + "%"); + poolRunStateInfo.setPeakLoad(poolRunStateInfo.getPeakLoad() + "%"); + + poolRunStateInfo.setMemoryProportion(memoryProportion); + poolRunStateInfo.setFreeMemory(ByteConvertUtil.getPrintSize(runtimeInfo.getFreeMemory())); + + return poolRunStateInfo; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolService.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolService.java new file mode 100644 index 00000000..2f09faed --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolService.java @@ -0,0 +1,53 @@ +package cn.hippo4j.core.executor.web; + +import cn.hippo4j.common.model.PoolBaseInfo; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.model.PoolRunStateInfo; + +import java.util.concurrent.Executor; + +/** + * Web thread pool service. + * + * @author chen.ma + * @date 2022/1/19 20:51 + */ +public interface WebThreadPoolService { + + /** + * Get web thread pool. + * + * @return Tomcat、Jetty、Undertow ThreadPoolExecutor + */ + Executor getWebThreadPool(); + + /** + * Simple info. + * + * @return + */ + PoolBaseInfo simpleInfo(); + + /** + * Get web thread pool parameter. + * + * @return + */ + PoolParameter getWebThreadPoolParameter(); + + /** + * Get web run state info. + * + * @return + */ + PoolRunStateInfo getWebRunStateInfo(); + + /** + * Update web thread pool. + * + * @param poolParameterInfo + */ + void updateWebThreadPool(PoolParameterInfo poolParameterInfo); + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/handler/DynamicThreadPoolBannerHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/handler/DynamicThreadPoolBannerHandler.java similarity index 81% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/handler/DynamicThreadPoolBannerHandler.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/handler/DynamicThreadPoolBannerHandler.java index b444293b..99a90fed 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/handler/DynamicThreadPoolBannerHandler.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/handler/DynamicThreadPoolBannerHandler.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.starter.handler; +package cn.hippo4j.core.handler; -import com.github.dynamic.threadpool.starter.config.BootstrapProperties; +import cn.hippo4j.core.config.BootstrapPropertiesInterface; import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -20,10 +20,14 @@ import org.springframework.boot.ansi.AnsiStyle; public class DynamicThreadPoolBannerHandler implements InitializingBean { @NonNull - private final BootstrapProperties properties; + private final BootstrapPropertiesInterface properties; private final String DYNAMIC_THREAD_POOL = " :: Dynamic ThreadPool :: "; + private final String HIPPO4J_GITHUB = "GitHub: https://github.com/acmenlt/dynamic-threadpool"; + + private final String HIPPO4J_SITE = "Site: https://hippox.cn"; + private final int STRAP_LINE_SIZE = 50; @Override @@ -38,7 +42,7 @@ public class DynamicThreadPoolBannerHandler implements InitializingBean { "|___/ \\_, |_||_\\__,_|_|_|_|_\\__| |_| |_| \n" + " |__/ \n"; - if (properties.isBanner()) { + if (properties.getBanner()) { String version = getVersion(); version = (version != null) ? " (v" + version + ")" : "no version."; @@ -48,7 +52,8 @@ public class DynamicThreadPoolBannerHandler implements InitializingBean { } System.out.println(AnsiOutput.toString(banner, AnsiColor.GREEN, DYNAMIC_THREAD_POOL, AnsiColor.DEFAULT, - padding.toString(), AnsiStyle.FAINT, version, "\n")); + padding.toString(), AnsiStyle.FAINT, version, "\n\n", HIPPO4J_GITHUB, "\n", HIPPO4J_SITE, "\n")); + } } diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/proxy/RejectedProxyInvocationHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/proxy/RejectedProxyInvocationHandler.java new file mode 100644 index 00000000..65794502 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/proxy/RejectedProxyInvocationHandler.java @@ -0,0 +1,43 @@ +package cn.hippo4j.core.proxy; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import lombok.AllArgsConstructor; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Rejected proxy invocation handler. + * + * @author chen.ma + * @date 2022/2/17 19:45 + */ +@AllArgsConstructor +public class RejectedProxyInvocationHandler implements InvocationHandler { + + private final Object target; + + private final String threadPoolId; + + private final AtomicLong rejectCount; + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + rejectCount.incrementAndGet(); + + if (ApplicationContextHolder.getInstance() != null) { + ThreadPoolNotifyAlarmHandler alarmHandler = ApplicationContextHolder.getBean(ThreadPoolNotifyAlarmHandler.class); + alarmHandler.checkPoolRejectedAlarm(threadPoolId); + } + + try { + return method.invoke(target, args); + } catch (InvocationTargetException ex) { + throw ex.getCause(); + } + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/proxy/RejectedProxyUtil.java b/hippo4j-core/src/main/java/cn/hippo4j/core/proxy/RejectedProxyUtil.java new file mode 100644 index 00000000..745e6d06 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/proxy/RejectedProxyUtil.java @@ -0,0 +1,34 @@ +package cn.hippo4j.core.proxy; + +import java.lang.reflect.Proxy; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Rejected proxy util. + * + * @author chen.ma + * @date 2022/2/22 21:56 + */ +public class RejectedProxyUtil { + + /** + * Proxy rejected execution. + * + * @param rejectedExecutionHandler + * @param threadPoolId + * @param rejectedNum + * @return + */ + public static RejectedExecutionHandler createProxy(RejectedExecutionHandler rejectedExecutionHandler, String threadPoolId, AtomicLong rejectedNum) { + RejectedExecutionHandler rejectedProxy = (RejectedExecutionHandler) Proxy + .newProxyInstance( + rejectedExecutionHandler.getClass().getClassLoader(), + new Class[]{RejectedExecutionHandler.class}, + new RejectedProxyInvocationHandler(rejectedExecutionHandler, threadPoolId, rejectedNum) + ); + + return rejectedProxy; + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/CustomBlockingQueue.java b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/CustomBlockingQueue.java similarity index 70% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/CustomBlockingQueue.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/spi/CustomBlockingQueue.java index 9834df3a..96186138 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/CustomBlockingQueue.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/CustomBlockingQueue.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.spi; +package cn.hippo4j.core.spi; import java.util.concurrent.BlockingQueue; @@ -17,6 +17,15 @@ public interface CustomBlockingQueue { */ Integer getType(); + /** + * Adapt hippo4j core blocking queue. + * + * @return + */ + default String getName() { + return ""; + } + /** * Get custom blocking queue. * diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/CustomRejectedExecutionHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/CustomRejectedExecutionHandler.java similarity index 70% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/CustomRejectedExecutionHandler.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/spi/CustomRejectedExecutionHandler.java index 653e5640..62e4e42c 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/CustomRejectedExecutionHandler.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/CustomRejectedExecutionHandler.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.spi; +package cn.hippo4j.core.spi; import java.util.concurrent.RejectedExecutionHandler; @@ -17,6 +17,15 @@ public interface CustomRejectedExecutionHandler { */ Integer getType(); + /** + * Adapt hippo4j core rejected execution handler. + * + * @return + */ + default String getName() { + return ""; + } + /** * Get custom reject policy. * diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/DynamicTpServiceLoader.java b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/DynamicThreadPoolServiceLoader.java similarity index 73% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/DynamicTpServiceLoader.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/spi/DynamicThreadPoolServiceLoader.java index 7a138e38..c9d6ab86 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/DynamicTpServiceLoader.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/DynamicThreadPoolServiceLoader.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.spi; +package cn.hippo4j.core.spi; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @@ -10,16 +10,28 @@ import java.util.stream.Collectors; * @author chen.ma * @date 2021/7/10 23:45 */ -public class DynamicTpServiceLoader { +public class DynamicThreadPoolServiceLoader { private static final Map, Collection> SERVICES = new ConcurrentHashMap(); + /** + * Register. + * + * @param serviceInterface + */ public static void register(final Class serviceInterface) { if (!SERVICES.containsKey(serviceInterface)) { SERVICES.put(serviceInterface, load(serviceInterface)); } } + /** + * Load. + * + * @param serviceInterface + * @param + * @return + */ private static Collection load(final Class serviceInterface) { Collection result = new LinkedList<>(); for (T each : ServiceLoader.load(serviceInterface)) { @@ -28,14 +40,34 @@ public class DynamicTpServiceLoader { return result; } + /** + * Get singleton service instances. + * + * @param service + * @param + * @return + */ public static Collection getSingletonServiceInstances(final Class service) { return (Collection) SERVICES.getOrDefault(service, Collections.emptyList()); } + /** + * New service instances. + * + * @param service + * @param + * @return + */ public static Collection newServiceInstances(final Class service) { return SERVICES.containsKey(service) ? SERVICES.get(service).stream().map(each -> (T) newServiceInstance(each.getClass())).collect(Collectors.toList()) : Collections.emptyList(); } + /** + * New service instance. + * + * @param clazz + * @return + */ private static Object newServiceInstance(final Class clazz) { try { return clazz.newInstance(); diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/ServiceLoaderInstantiationException.java b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/ServiceLoaderInstantiationException.java similarity index 88% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/ServiceLoaderInstantiationException.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/spi/ServiceLoaderInstantiationException.java index 7405f1f7..9d50d42c 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/spi/ServiceLoaderInstantiationException.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/spi/ServiceLoaderInstantiationException.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.spi; +package cn.hippo4j.core.spi; /** * Service loader instantiation exception. diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/CalculateUtil.java b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/CalculateUtil.java similarity index 67% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/CalculateUtil.java rename to hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/CalculateUtil.java index 290eccdf..a61c55fc 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/CalculateUtil.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/CalculateUtil.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.toolkit; +package cn.hippo4j.core.toolkit; /** * Calculate util. @@ -8,6 +8,13 @@ package com.github.dynamic.threadpool.starter.toolkit; */ public class CalculateUtil { + /** + * Divide. + * + * @param num1 + * @param num2 + * @return + */ public static int divide(int num1, int num2) { return ((int) (Double.parseDouble(num1 + "") / Double.parseDouble(num2 + "") * 100)); } diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/IdentifyUtil.java b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/IdentifyUtil.java new file mode 100644 index 00000000..19ca5d31 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/IdentifyUtil.java @@ -0,0 +1,91 @@ +package cn.hippo4j.core.toolkit; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.core.toolkit.inet.InetUtils; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import lombok.SneakyThrows; +import org.springframework.core.env.ConfigurableEnvironment; + +import java.util.ArrayList; + +import static cn.hippo4j.common.constant.Constants.GROUP_KEY_DELIMITER; +import static cn.hippo4j.common.constant.Constants.IDENTIFY_SLICER_SYMBOL; + +/** + * Identify util. + * + * @author chen.ma + * @date 2021/12/5 22:25 + */ +public class IdentifyUtil { + + private static String IDENTIFY; + + public static final String CLIENT_IDENTIFICATION_VALUE = IdUtil.simpleUUID(); + + /** + * Generate identify. + * + * @param environment + * @param hippo4JInetUtils + * @return + */ + public static synchronized String generate(ConfigurableEnvironment environment, InetUtils hippo4JInetUtils) { + if (StrUtil.isNotBlank(IDENTIFY)) { + return IDENTIFY; + } + String ip = hippo4JInetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + String port = environment.getProperty("server.port", "8080"); + String identification = StrUtil.builder(ip, + ":", + port, + IDENTIFY_SLICER_SYMBOL, + CLIENT_IDENTIFICATION_VALUE + ).toString(); + + IDENTIFY = identification; + return identification; + } + + /** + * Get identify. + * + * @return + */ + @SneakyThrows + public static String getIdentify() { + while (StrUtil.isBlank(IDENTIFY)) { + ConfigurableEnvironment environment = ApplicationContextHolder.getBean(ConfigurableEnvironment.class); + InetUtils inetUtils = ApplicationContextHolder.getBean(InetUtils.class); + + if (environment != null && inetUtils != null) { + String identify = generate(environment, inetUtils); + return identify; + } + + Thread.sleep(500); + } + + return IDENTIFY; + } + + /** + * Get thread pool identify. + * + * @param threadPoolId + * @param itemId + * @param namespace + * @return + */ + public static String getThreadPoolIdentify(String threadPoolId, String itemId, String namespace) { + ArrayList params = Lists.newArrayList( + threadPoolId, itemId, namespace, getIdentify() + ); + + return Joiner.on(GROUP_KEY_DELIMITER).join(params); + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/TraceContextUtil.java b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/TraceContextUtil.java new file mode 100644 index 00000000..101865fe --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/TraceContextUtil.java @@ -0,0 +1,40 @@ +package cn.hippo4j.core.toolkit; + +import org.slf4j.MDC; + +import static cn.hippo4j.common.constant.Constants.EXECUTE_TIMEOUT_TRACE; + +/** + * MD util. + * + * @author chen.ma + * @date 2022/3/3 08:30 + */ +public class TraceContextUtil { + + /** + * Execute timeout trace key. + */ + private static String EXECUTE_TIMEOUT_TRACE_KEY = EXECUTE_TIMEOUT_TRACE; + + /** + * Get and remove. + * + * @return + */ + public static String getAndRemove() { + String val = MDC.get(EXECUTE_TIMEOUT_TRACE_KEY); + MDC.remove(EXECUTE_TIMEOUT_TRACE_KEY); + return val; + } + + /** + * Set execute timeout trace key. + * + * @param key + */ + public static void setExecuteTimeoutTraceKey(String key) { + EXECUTE_TIMEOUT_TRACE_KEY = key; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/DynamicThreadPoolAnnotationUtil.java b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/DynamicThreadPoolAnnotationUtil.java new file mode 100644 index 00000000..b5f48631 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/DynamicThreadPoolAnnotationUtil.java @@ -0,0 +1,47 @@ +package cn.hippo4j.core.toolkit.inet; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.context.support.AbstractApplicationContext; +import org.springframework.core.annotation.AnnotationUtils; + +import java.lang.annotation.Annotation; +import java.util.Optional; + +/** + * {@link DynamicThreadPoolAnnotationUtil} 是为了适配低版本 SpringBoot. + * + *

Spring version >= 5.2.0 下述方法才是有效的, 等同于 SpringBoot version 2.2.0.RELEASE + * {@link ListableBeanFactory#findAnnotationOnBean(java.lang.String, java.lang.Class)} + * + *

但这不是一个优雅的实现方式, 因为其中用到了很多强类型转换, 不确定后续 Spring 升级是否会受影响. + * 不过, 可以确定的是 Spring version < 5.3.14 是没问题的, 等同于 SpringBoot version < 2.6.2 + * + * @author chen.ma + * @date 2022/1/5 21:15 + */ +public class DynamicThreadPoolAnnotationUtil { + + /** + * 根据 {@param beanName} 查询注解 {@param annotationType} 是否存在. + * + * @param beanName + * @param annotationType + * @param + * @return + */ + public static A findAnnotationOnBean(String beanName, Class annotationType) { + AbstractApplicationContext context = (AbstractApplicationContext) ApplicationContextHolder.getInstance(); + ConfigurableListableBeanFactory beanFactory = context.getBeanFactory(); + A annotation = Optional.ofNullable(beanFactory) + .map(each -> (RootBeanDefinition) beanFactory.getMergedBeanDefinition(beanName)) + .map(definition -> definition.getResolvedFactoryMethod()) + .map(factoryMethod -> AnnotationUtils.getAnnotation(factoryMethod, annotationType)) + .orElse(null); + + return annotation; + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/InetUtils.java b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/InetUtils.java new file mode 100644 index 00000000..b65204c6 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/InetUtils.java @@ -0,0 +1,217 @@ +package cn.hippo4j.core.toolkit.inet; + +import cn.hippo4j.core.executor.support.ThreadPoolBuilder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.io.Closeable; +import java.io.IOException; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.UnknownHostException; +import java.nio.ByteBuffer; +import java.util.Enumeration; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +/** + * Inet utils. + * + * @author Spencer Gibb + * @date 2021/11/12 21:33 + */ +public class InetUtils implements Closeable { + + private final ExecutorService executorService; + + private final InetUtilsProperties properties; + + private final Log log = LogFactory.getLog(InetUtils.class); + + public InetUtils(InetUtilsProperties properties) { + this.properties = properties; + this.executorService = ThreadPoolBuilder.builder() + .threadFactory(InetUtilsProperties.PREFIX, Boolean.TRUE) + .corePoolSize(1) + .build(); + } + + @Override + public void close() { + this.executorService.shutdown(); + } + + public HostInfo findFirstNonLoopbackHostInfo() { + InetAddress address = findFirstNonLoopbackAddress(); + if (address != null) { + return convertAddress(address); + } + HostInfo hostInfo = new HostInfo(); + hostInfo.setHostname(this.properties.getDefaultHostname()); + hostInfo.setIpAddress(this.properties.getDefaultIpAddress()); + return hostInfo; + } + + public InetAddress findFirstNonLoopbackAddress() { + InetAddress result = null; + try { + int lowest = Integer.MAX_VALUE; + for (Enumeration nics = NetworkInterface + .getNetworkInterfaces(); nics.hasMoreElements(); ) { + NetworkInterface ifc = nics.nextElement(); + if (ifc.isUp()) { + this.log.trace("Testing interface: " + ifc.getDisplayName()); + if (ifc.getIndex() < lowest || result == null) { + lowest = ifc.getIndex(); + } else if (result != null) { + continue; + } + + // @formatter:off + if (!ignoreInterface(ifc.getDisplayName())) { + for (Enumeration addrs = ifc + .getInetAddresses(); addrs.hasMoreElements(); ) { + InetAddress address = addrs.nextElement(); + if (address instanceof Inet4Address + && !address.isLoopbackAddress() + && isPreferredAddress(address)) { + this.log.trace("Found non-loopback interface: " + + ifc.getDisplayName()); + result = address; + } + } + } + // @formatter:on + } + } + } catch (IOException ex) { + this.log.error("Cannot get first non-loopback address", ex); + } + + if (result != null) { + return result; + } + + try { + return InetAddress.getLocalHost(); + } catch (UnknownHostException e) { + this.log.warn("Unable to retrieve localhost"); + } + + return null; + } + + boolean isPreferredAddress(InetAddress address) { + + if (this.properties.isUseOnlySiteLocalInterfaces()) { + final boolean siteLocalAddress = address.isSiteLocalAddress(); + if (!siteLocalAddress) { + this.log.trace("Ignoring address: " + address.getHostAddress()); + } + return siteLocalAddress; + } + final List preferredNetworks = this.properties.getPreferredNetworks(); + if (preferredNetworks.isEmpty()) { + return true; + } + for (String regex : preferredNetworks) { + final String hostAddress = address.getHostAddress(); + if (hostAddress.matches(regex) || hostAddress.startsWith(regex)) { + return true; + } + } + this.log.trace("Ignoring address: " + address.getHostAddress()); + return false; + } + + boolean ignoreInterface(String interfaceName) { + for (String regex : this.properties.getIgnoredInterfaces()) { + if (interfaceName.matches(regex)) { + this.log.trace("Ignoring interface: " + interfaceName); + return true; + } + } + return false; + } + + public HostInfo convertAddress(final InetAddress address) { + HostInfo hostInfo = new HostInfo(); + Future result = this.executorService.submit(address::getHostName); + + String hostname; + try { + hostname = result.get(this.properties.getTimeoutSeconds(), TimeUnit.SECONDS); + } catch (Exception e) { + this.log.info("Cannot determine local hostname"); + hostname = "localhost"; + } + hostInfo.setHostname(hostname); + hostInfo.setIpAddress(address.getHostAddress()); + return hostInfo; + } + + /** + * Host information pojo. + */ + public static class HostInfo { + + /** + * Should override the host info. + */ + public boolean override; + + private String ipAddress; + + private String hostname; + + public HostInfo(String hostname) { + this.hostname = hostname; + } + + public HostInfo() { + } + + public int getIpAddressAsInt() { + InetAddress inetAddress = null; + String host = this.ipAddress; + if (host == null) { + host = this.hostname; + } + try { + inetAddress = InetAddress.getByName(host); + } catch (final UnknownHostException e) { + throw new IllegalArgumentException(e); + } + return ByteBuffer.wrap(inetAddress.getAddress()).getInt(); + } + + public boolean isOverride() { + return this.override; + } + + public void setOverride(boolean override) { + this.override = override; + } + + public String getIpAddress() { + return this.ipAddress; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public String getHostname() { + return this.hostname; + } + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + } + +} diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/InetUtilsProperties.java b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/InetUtilsProperties.java new file mode 100644 index 00000000..569d0bc6 --- /dev/null +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/toolkit/inet/InetUtilsProperties.java @@ -0,0 +1,108 @@ +package cn.hippo4j.core.toolkit.inet; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.List; + +/** + * Inet utils properties. + * + * @author chen.ma + * @date 2021/11/12 21:34 + */ +@ConfigurationProperties(InetUtilsProperties.PREFIX) +public class InetUtilsProperties { + + /** + * Prefix for the Inet Utils properties. + */ + public static final String PREFIX = "spring.cloud.inetutils"; + + /** + * The default hostname. Used in case of errors. + */ + private String defaultHostname = "localhost"; + + /** + * The default IP address. Used in case of errors. + */ + private String defaultIpAddress = "127.0.0.1"; + + /** + * Timeout, in seconds, for calculating hostname. + */ + @Value("${spring.util.timeout.sec:${SPRING_UTIL_TIMEOUT_SEC:1}}") + private int timeoutSeconds = 1; + + /** + * List of Java regular expressions for network interfaces that will be ignored. + */ + private List ignoredInterfaces = new ArrayList<>(); + + /** + * Whether to use only interfaces with site local addresses. See + * {@link InetAddress#isSiteLocalAddress()} for more details. + */ + private boolean useOnlySiteLocalInterfaces = false; + + /** + * List of Java regular expressions for network addresses that will be preferred. + */ + private List preferredNetworks = new ArrayList<>(); + + public static String getPREFIX() { + return PREFIX; + } + + public String getDefaultHostname() { + return this.defaultHostname; + } + + public void setDefaultHostname(String defaultHostname) { + this.defaultHostname = defaultHostname; + } + + public String getDefaultIpAddress() { + return this.defaultIpAddress; + } + + public void setDefaultIpAddress(String defaultIpAddress) { + this.defaultIpAddress = defaultIpAddress; + } + + public int getTimeoutSeconds() { + return this.timeoutSeconds; + } + + public void setTimeoutSeconds(int timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + } + + public List getIgnoredInterfaces() { + return this.ignoredInterfaces; + } + + public void setIgnoredInterfaces(List ignoredInterfaces) { + this.ignoredInterfaces = ignoredInterfaces; + } + + public boolean isUseOnlySiteLocalInterfaces() { + return this.useOnlySiteLocalInterfaces; + } + + public void setUseOnlySiteLocalInterfaces(boolean useOnlySiteLocalInterfaces) { + this.useOnlySiteLocalInterfaces = useOnlySiteLocalInterfaces; + } + + public List getPreferredNetworks() { + return this.preferredNetworks; + } + + public void setPreferredNetworks(List preferredNetworks) { + this.preferredNetworks = preferredNetworks; + } + +} diff --git a/hippo4j-core/src/main/resources/application.properties b/hippo4j-core/src/main/resources/application.properties new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/hippo4j-core/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/dynamic-threadpool-spring-boot-starter/.gitignore b/hippo4j-discovery/.gitignore similarity index 100% rename from dynamic-threadpool-spring-boot-starter/.gitignore rename to hippo4j-discovery/.gitignore diff --git a/discovery/pom.xml b/hippo4j-discovery/pom.xml similarity index 79% rename from discovery/pom.xml rename to hippo4j-discovery/pom.xml index c7e9778b..8a2df2d1 100644 --- a/discovery/pom.xml +++ b/hippo4j-discovery/pom.xml @@ -4,16 +4,20 @@ 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} - discovery + hippo4j-discovery ${project.artifactId} ${project.artifactId} + + true + + org.springframework.boot @@ -26,8 +30,8 @@ - com.github.dynamic-threadpool - common + cn.hippo4j + hippo4j-common diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/config/RegistryConfiguration.java b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/config/RegistryConfiguration.java similarity index 77% rename from discovery/src/main/java/com/github/dynamic/threadpool/discovery/config/RegistryConfiguration.java rename to hippo4j-discovery/src/main/java/cn/hippo4j/discovery/config/RegistryConfiguration.java index b63a5ec1..5e86c336 100644 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/config/RegistryConfiguration.java +++ b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/config/RegistryConfiguration.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.discovery.config; +package cn.hippo4j.discovery.config; -import com.github.dynamic.threadpool.discovery.core.BaseInstanceRegistry; +import cn.hippo4j.discovery.core.BaseInstanceRegistry; import lombok.AllArgsConstructor; import org.springframework.context.annotation.Configuration; diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/controller/ApplicationController.java b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/controller/ApplicationController.java similarity index 65% rename from discovery/src/main/java/com/github/dynamic/threadpool/discovery/controller/ApplicationController.java rename to hippo4j-discovery/src/main/java/cn/hippo4j/discovery/controller/ApplicationController.java index 0c769916..5e683e57 100644 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/controller/ApplicationController.java +++ b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/controller/ApplicationController.java @@ -1,19 +1,18 @@ -package com.github.dynamic.threadpool.discovery.controller; - -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.common.web.exception.ErrorCodeEnum; -import com.github.dynamic.threadpool.discovery.core.InstanceRegistry; -import com.github.dynamic.threadpool.discovery.core.Lease; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; +package cn.hippo4j.discovery.controller; + +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.common.web.exception.ErrorCodeEnum; +import cn.hippo4j.discovery.core.InstanceRegistry; +import cn.hippo4j.discovery.core.Lease; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import java.util.List; -import static com.github.dynamic.threadpool.common.constant.Constants.BASE_PATH; +import static cn.hippo4j.common.constant.Constants.BASE_PATH; /** * Application controller. @@ -23,11 +22,10 @@ import static com.github.dynamic.threadpool.common.constant.Constants.BASE_PATH; */ @Slf4j @RestController -@RequiredArgsConstructor +@AllArgsConstructor @RequestMapping(BASE_PATH + "/apps") public class ApplicationController { - @NonNull private final InstanceRegistry instanceRegistry; @GetMapping("/{appName}") @@ -52,4 +50,10 @@ public class ApplicationController { return Results.success(); } + @PostMapping("/remove") + public Result remove(@RequestBody InstanceInfo instanceInfo) { + instanceRegistry.remove(instanceInfo); + return Results.success(); + } + } diff --git a/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/BaseInstanceRegistry.java b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/BaseInstanceRegistry.java new file mode 100644 index 00000000..71a61236 --- /dev/null +++ b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/BaseInstanceRegistry.java @@ -0,0 +1,209 @@ +package cn.hippo4j.discovery.core; + +import cn.hippo4j.common.design.observer.AbstractSubjectCenter; +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.model.InstanceInfo.InstanceStatus; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.TimerTask; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; + +import static cn.hippo4j.common.constant.Constants.EVICTION_INTERVAL_TIMER_IN_MS; +import static cn.hippo4j.common.constant.Constants.SCHEDULED_THREAD_CORE_NUM; + +/** + * Base instance registry. + * + *

+ * Reference from Eureka. + * Service registration, service offline, service renewal. + *

+ * + * @author chen.ma + * @date 2021/8/8 22:46 + */ +@Slf4j +@Service +public class BaseInstanceRegistry implements InstanceRegistry { + + private final int containerSize = 1024; + + private final ConcurrentHashMap>> registry = new ConcurrentHashMap(containerSize); + + @Override + public List> listInstance(String appName) { + Map> appNameLeaseMap = registry.get(appName); + if (CollectionUtils.isEmpty(appNameLeaseMap)) { + return Lists.newArrayList(); + } + + List> appNameLeaseList = Lists.newArrayList(); + appNameLeaseMap.values().forEach(each -> appNameLeaseList.add(each)); + return appNameLeaseList; + } + + @Override + public void register(InstanceInfo registrant) { + Map> registerMap = registry.get(registrant.getAppName()); + if (registerMap == null) { + ConcurrentHashMap> registerNewMap = new ConcurrentHashMap(12); + registerMap = registry.putIfAbsent(registrant.getAppName(), registerNewMap); + if (registerMap == null) { + registerMap = registerNewMap; + } + } + + Lease existingLease = registerMap.get(registrant.getInstanceId()); + if (existingLease != null && (existingLease.getHolder() != null)) { + Long existingLastDirtyTimestamp = existingLease.getHolder().getLastDirtyTimestamp(); + Long registrationLastDirtyTimestamp = registrant.getLastDirtyTimestamp(); + + if (existingLastDirtyTimestamp > registrationLastDirtyTimestamp) { + registrant = existingLease.getHolder(); + } + } + + Lease lease = new Lease(registrant); + if (existingLease != null) { + lease.setServiceUpTimestamp(existingLease.getServiceUpTimestamp()); + } + registerMap.put(registrant.getInstanceId(), lease); + + if (InstanceStatus.UP.equals(registrant.getStatus())) { + lease.serviceUp(); + } + + registrant.setActionType(InstanceInfo.ActionType.ADDED); + registrant.setLastUpdatedTimestamp(); + } + + @Override + public boolean renew(InstanceInfo.InstanceRenew instanceRenew) { + String appName = instanceRenew.getAppName(); + String instanceId = instanceRenew.getInstanceId(); + + Map> registryMap = registry.get(appName); + Lease leaseToRenew; + if (registryMap == null || (leaseToRenew = registryMap.get(instanceId)) == null) { + return false; + } + + leaseToRenew.renew(); + return true; + } + + @Override + public void remove(InstanceInfo info) { + String appName = info.getAppName(); + String instanceId = info.getInstanceId(); + Map> leaseMap = registry.get(appName); + if (CollectionUtils.isEmpty(leaseMap)) { + log.warn("Failed to remove unhealthy node, no application found :: {}", appName); + return; + } + + Lease remove = leaseMap.remove(instanceId); + if (remove == null) { + log.warn("Failed to remove unhealthy node, no instance found :: {}", instanceId); + return; + } + + log.info("Remove unhealthy node, node ID :: {}", instanceId); + } + + public void evict(long additionalLeaseMs) { + List> expiredLeases = new ArrayList(); + for (Map.Entry>> groupEntry : registry.entrySet()) { + Map> leaseMap = groupEntry.getValue(); + if (leaseMap != null) { + for (Map.Entry> leaseEntry : leaseMap.entrySet()) { + Lease lease = leaseEntry.getValue(); + if (lease.isExpired(additionalLeaseMs) && lease.getHolder() != null) { + expiredLeases.add(lease); + } + } + } + } + + for (Lease expiredLease : expiredLeases) { + String appName = expiredLease.getHolder().getAppName(); + String id = expiredLease.getHolder().getInstanceId(); + String identify = expiredLease.getHolder().getIdentify(); + internalCancel(appName, id, identify); + } + } + + protected boolean internalCancel(String appName, String id, String identify) { + Map> registerMap = registry.get(appName); + if (!CollectionUtils.isEmpty(registerMap)) { + registerMap.remove(id); + AbstractSubjectCenter.notify(AbstractSubjectCenter.SubjectType.CLEAR_CONFIG_CACHE, () -> identify); + + log.info("Clean up unhealthy nodes. Node id :: {}", id); + } + + return true; + } + + public class EvictionTask extends TimerTask { + + private final AtomicLong lastExecutionNanosRef = new AtomicLong(0L); + + @Override + public void run() { + try { + long compensationTimeMs = getCompensationTimeMs(); + log.info("Running the evict task with compensationTime {} ms", compensationTimeMs); + evict(compensationTimeMs); + } catch (Throwable e) { + log.error("Could not run the evict task", e); + } + } + + long getCompensationTimeMs() { + long currNanos = getCurrentTimeNano(); + long lastNanos = lastExecutionNanosRef.getAndSet(currNanos); + if (lastNanos == 0L) { + return 0L; + } + + long elapsedMs = TimeUnit.NANOSECONDS.toMillis(currNanos - lastNanos); + long compensationTime = elapsedMs - EVICTION_INTERVAL_TIMER_IN_MS; + return compensationTime <= 0L ? 0L : compensationTime; + } + + long getCurrentTimeNano() { + return System.nanoTime(); + } + } + + private final ScheduledExecutorService scheduledExecutorService = + new ScheduledThreadPoolExecutor( + SCHEDULED_THREAD_CORE_NUM, + new ThreadFactoryBuilder() + .setNameFormat("registry-eviction") + .setDaemon(true) + .build() + ); + + private final AtomicReference evictionTaskRef = new AtomicReference(); + + public void postInit() { + evictionTaskRef.set(new BaseInstanceRegistry.EvictionTask()); + scheduledExecutorService.scheduleWithFixedDelay(evictionTaskRef.get(), + EVICTION_INTERVAL_TIMER_IN_MS, EVICTION_INTERVAL_TIMER_IN_MS, TimeUnit.MILLISECONDS); + } + +} diff --git a/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/ClientCloseHookRemoveNode.java b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/ClientCloseHookRemoveNode.java new file mode 100644 index 00000000..2278dfc4 --- /dev/null +++ b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/ClientCloseHookRemoveNode.java @@ -0,0 +1,39 @@ +package cn.hippo4j.discovery.core; + +import cn.hippo4j.common.api.ClientCloseHookExecute; +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.toolkit.JSONUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * Client close hook remove node. + * + * @author chen.ma + * @date 2022/1/6 22:24 + */ +@Slf4j +@Component +@AllArgsConstructor +public class ClientCloseHookRemoveNode implements ClientCloseHookExecute { + + private final InstanceRegistry instanceRegistry; + + @Override + public void closeHook(ClientCloseHookReq req) { + log.info( + "Remove Node, Execute client hook function. Req :: {}", + JSONUtil.toJSONString(req) + ); + + try { + InstanceInfo instanceInfo = new InstanceInfo(); + instanceInfo.setAppName(req.getAppName()).setInstanceId(req.getInstanceId()); + instanceRegistry.remove(instanceInfo); + } catch (Exception ex) { + log.error("Failed to delete node hook.", ex); + } + } + +} diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/InstanceRegistry.java b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/InstanceRegistry.java similarity index 75% rename from discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/InstanceRegistry.java rename to hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/InstanceRegistry.java index 908f0294..dc2f75af 100644 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/InstanceRegistry.java +++ b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/InstanceRegistry.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.discovery.core; +package cn.hippo4j.discovery.core; -import com.github.dynamic.threadpool.common.model.InstanceInfo; +import cn.hippo4j.common.model.InstanceInfo; import java.util.List; @@ -35,4 +35,11 @@ public interface InstanceRegistry { */ boolean renew(InstanceInfo.InstanceRenew instanceRenew); + /** + * Remove. + * + * @param info + */ + void remove(T info); + } diff --git a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/Lease.java b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/Lease.java similarity index 89% rename from discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/Lease.java rename to hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/Lease.java index 1c9c54b3..eaf75fbe 100644 --- a/discovery/src/main/java/com/github/dynamic/threadpool/discovery/core/Lease.java +++ b/hippo4j-discovery/src/main/java/cn/hippo4j/discovery/core/Lease.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.discovery.core; +package cn.hippo4j.discovery.core; /** * Lease. @@ -9,7 +9,20 @@ package com.github.dynamic.threadpool.discovery.core; public class Lease { enum Action { - REGISTER, CANCEL, RENEW + /** + * REGISTER + */ + REGISTER, + + /** + * CANCEL + */ + CANCEL, + + /** + * RENEW + */ + RENEW } private T holder; diff --git a/example/.gitignore b/hippo4j-example/.gitignore similarity index 100% rename from example/.gitignore rename to hippo4j-example/.gitignore diff --git a/server/.gitignore b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/.gitignore similarity index 100% rename from server/.gitignore rename to hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/.gitignore diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml new file mode 100644 index 00000000..062a4b44 --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-example + ${revision} + + + hippo4j-core-apollo-spring-boot-starter-example + ${project.artifactId} + + + true + + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + cn.hippo4j + hippo4j-example-core + ${revision} + + + + cn.hippo4j + hippo4j-core-spring-boot-starter + ${revision} + + + + com.ctrip.framework.apollo + apollo-client + 1.3.0 + + + + org.springframework.cloud + spring-cloud-context + 2.2.5.RELEASE + + + + io.micrometer + micrometer-registry-prometheus + + + + org.springframework.boot + spring-boot-starter-actuator + + + + diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java new file mode 100644 index 00000000..dc803a2a --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java @@ -0,0 +1,15 @@ +package cn.hippo4j.example.core.apollo; + +import cn.hippo4j.core.enable.EnableDynamicThreadPool; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@EnableDynamicThreadPool +@SpringBootApplication(scanBasePackages = "cn.hippo4j.example.core") +public class Hippo4jCoreApolloExampleApplication { + + public static void main(String[] args) { + SpringApplication.run(Hippo4jCoreApolloExampleApplication.class, args); + } + +} diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/bootstrap.properties b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/bootstrap.properties new file mode 100644 index 00000000..c84bce04 --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/bootstrap.properties @@ -0,0 +1,48 @@ +# Configuration reference: https://hippox.cn/pages/2f674h +server.port=8091 +server.servlet.context-path=/example + +app.id=dynamic-threadpool-example +apollo.meta=http://127.0.0.1:8080 +apollo.autoUpdateInjectedSpringProperties=true +apollo.bootstrap.enabled=true +apollo.bootstrap.namespaces=application +apollo.bootstrap.eagerLoad.enabled=true + +spring.profiles.active=dev +spring.application.name=dynamic-threadpool-example + +management.metrics.export.prometheus.enabled=true +management.server.port=29998 +management.endpoints.web.exposure.include=* + +spring.dynamic.thread-pool.enable=true +spring.dynamic.thread-pool.banner=true +spring.dynamic.thread-pool.check-state-interval=3 + +spring.dynamic.thread-pool.notify-platforms[0].platform=WECHAT +spring.dynamic.thread-pool.notify-platforms[0].secret-key=ac0426a5-c712-474c-9bff-72b8b8f5caff +spring.dynamic.thread-pool.notify-platforms[1].platform=DING +spring.dynamic.thread-pool.notify-platforms[1].secret-key=56417ebba6a27ca352f0de77a2ae9da66d01f39610b5ee8a6033c60ef9071c55 +spring.dynamic.thread-pool.notify-platforms[2].platform=LARK +spring.dynamic.thread-pool.notify-platforms[2].secret-key=2cbf2808-3839-4c26-a04d-fd201dd51f9e + +spring.dynamic.thread-pool.apollo.namespace=application +spring.dynamic.thread-pool.config-file-type=properties + +spring.dynamic.thread-pool.executors[0].thread-pool-id=message-consume +spring.dynamic.thread-pool.executors[0].core-pool-size=3 +spring.dynamic.thread-pool.executors[0].maximum-pool-size=4 +spring.dynamic.thread-pool.executors[0].queue-capacity=4 +spring.dynamic.thread-pool.executors[0].execute-time-out=1000 +spring.dynamic.thread-pool.executors[0].blocking-queue=LinkedBlockingQueue +spring.dynamic.thread-pool.executors[0].rejected-handler=AbortPolicy +spring.dynamic.thread-pool.executors[0].keep-alive-time=1000 +spring.dynamic.thread-pool.executors[0].allow-core-thread-time-out=true +spring.dynamic.thread-pool.executors[0].thread-name-prefix=message-consume +spring.dynamic.thread-pool.executors[0].notify.is-alarm=true +spring.dynamic.thread-pool.executors[0].notify.active-alarm=80 +spring.dynamic.thread-pool.executors[0].notify.capacity-alarm=80 +spring.dynamic.thread-pool.executors[0].notify.interval=8 +spring.dynamic.thread-pool.executors[0].notify.receives.WECHAT=xxx +spring.dynamic.thread-pool.executors[0].notify.receives.DING=xxx diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplicationTests.java b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplicationTests.java new file mode 100644 index 00000000..198e3253 --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplicationTests.java @@ -0,0 +1,13 @@ +package cn.hippo4j.example.core.apollo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class Hippo4jCoreApolloExampleApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/tools/.gitignore b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/.gitignore similarity index 100% rename from tools/.gitignore rename to hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/.gitignore diff --git a/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/pom.xml new file mode 100644 index 00000000..8cca93a2 --- /dev/null +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-example + ${revision} + + + hippo4j-core-nacos-spring-boot-starter-example + ${project.artifactId} + + + true + + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + cn.hippo4j + hippo4j-example-core + ${revision} + + + + cn.hippo4j + hippo4j-core-spring-boot-starter + ${revision} + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.2.5.RELEASE + + + + io.micrometer + micrometer-registry-prometheus + + + + org.springframework.boot + spring-boot-starter-actuator + + + + diff --git a/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java new file mode 100644 index 00000000..e1b92587 --- /dev/null +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java @@ -0,0 +1,15 @@ +package cn.hippo4j.example.core.nacos; + +import cn.hippo4j.core.enable.EnableDynamicThreadPool; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@EnableDynamicThreadPool +@SpringBootApplication(scanBasePackages = "cn.hippo4j.example.core") +public class Hippo4jCoreNacosExampleApplication { + + public static void main(String[] args) { + SpringApplication.run(Hippo4jCoreNacosExampleApplication.class, args); + } + +} diff --git a/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/resources/bootstrap.yaml b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/resources/bootstrap.yaml new file mode 100644 index 00000000..70a0a9ad --- /dev/null +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/resources/bootstrap.yaml @@ -0,0 +1,72 @@ +server: + port: 8089 + servlet: + context-path: /example + +management: + metrics: + export: + prometheus: + enabled: true + server: + port: 29999 + endpoints: + web: + exposure: + include: '*' + +spring: + profiles: + active: dev + + application: + name: dynamic-threadpool-example + + cloud: + nacos: + config: + password: nacos + server-addr: 127.0.0.1:8848 + username: nacos + extension-configs: + - data-id: hippo4j-nacos.yaml + group: DEFAULT_GROUP + refresh: true + + dynamic: + thread-pool: + enable: true + banner: true + collect: true + check-state-interval: 5 + notify-platforms: + - platform: 'WECHAT' + secret-key: ac0426a5-c712-474c-9bff-72b8b8f5caff + - platform: 'DING' + secret-key: 56417ebba6a27ca352f0de77a2ae9da66d01f39610b5ee8a6033c60ef9071c55 + - platform: 'LARK' + secret-key: 2cbf2808-3839-4c26-a04d-fd201dd51f9e + nacos: + data-id: 'hippo4j-nacos.yaml' + group: 'DEFAULT_GROUP' + config-file-type: yml + executors: + - thread-pool-id: 'message-consume' + core-pool-size: 1 + maximum-pool-size: 1 + queue-capacity: 1 + blocking-queue: 'LinkedBlockingQueue' + execute-time-out: 1000 + rejected-handler: 'AbortPolicy' + keep-alive-time: 6691 + allow-core-thread-time-out: true + thread-name-prefix: 'message-consume' + notify: + is-alarm: true + active-alarm: 80 + capacity-alarm: 80 + interval: 8 + receives: + WECHAT: 'xxx' # Fill in the enterprise weChat userId + DING: 'xxx' # phone + LARK: 'xxx' diff --git a/example/src/test/java/com/github/dynamic/threadpool/example/ExampleApplicationTests.java b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplicationTests.java similarity index 64% rename from example/src/test/java/com/github/dynamic/threadpool/example/ExampleApplicationTests.java rename to hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplicationTests.java index e6a0980a..c4ffe606 100644 --- a/example/src/test/java/com/github/dynamic/threadpool/example/ExampleApplicationTests.java +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplicationTests.java @@ -1,10 +1,10 @@ -package com.github.dynamic.threadpool.example; +package cn.hippo4j.example.core.nacos; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest -class ExampleApplicationTests { +class Hippo4jCoreNacosExampleApplicationTests { @Test void contextLoads() { diff --git a/tools/log-record-tool/.gitignore b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/.gitignore similarity index 100% rename from tools/log-record-tool/.gitignore rename to hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/.gitignore diff --git a/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/pom.xml new file mode 100644 index 00000000..73c3f4fe --- /dev/null +++ b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/pom.xml @@ -0,0 +1,48 @@ + + + + hippo4j-example + cn.hippo4j + ${revision} + + + 4.0.0 + hippo4j-core-zookeeper-spring-boot-starter-example + + + true + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-logging + + + + cn.hippo4j + hippo4j-core-spring-boot-starter + ${revision} + + + + org.apache.curator + curator-framework + 5.1.0 + + + + cn.hippo4j + hippo4j-example-core + ${revision} + + + + diff --git a/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/zookeeper/Hippo4jCoreZookeeperExampleApplication.java b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/zookeeper/Hippo4jCoreZookeeperExampleApplication.java new file mode 100644 index 00000000..a1c7561b --- /dev/null +++ b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/zookeeper/Hippo4jCoreZookeeperExampleApplication.java @@ -0,0 +1,18 @@ +package cn.hippo4j.example.core.zookeeper; + +import cn.hippo4j.core.enable.EnableDynamicThreadPool; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author Redick01 + * @date 2022/3/14 20:40 + */ +@EnableDynamicThreadPool +@SpringBootApplication(scanBasePackages = "cn.hippo4j.example.core") +public class Hippo4jCoreZookeeperExampleApplication { + + public static void main(String[] args) { + SpringApplication.run(Hippo4jCoreZookeeperExampleApplication.class, args); + } +} diff --git a/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/resources/application.yml b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/resources/application.yml new file mode 100644 index 00000000..25c826ed --- /dev/null +++ b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/resources/application.yml @@ -0,0 +1,19 @@ +server: + port: 8888 + +spring: + application: + name: dynamic-threadpool-zookeeper-example + + dynamic: + thread-pool: + config-file-type: properties + zookeeper: + zk-connect-str: 127.0.0.1:2181 + config-version: 1.0.0 + root-node: /configserver/userproject + node: zookeeper-demo + +#logging: +# level: +# root: DEBUG \ No newline at end of file diff --git a/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/resources/zookeeper-demo.properties b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/resources/zookeeper-demo.properties new file mode 100644 index 00000000..4fb1c7f8 --- /dev/null +++ b/hippo4j-example/hippo4j-core-zookeeper-spring-boot-starter-example/src/main/resources/zookeeper-demo.properties @@ -0,0 +1,40 @@ +# Export from zookeeper configuration group: [/configserver/userproject] - [1.0.0] - [zookeeper-demo]. + +spring.application.name=dynamic-threadpool-zookeeper-example +spring.dynamic.thread-pool.banner=true +spring.dynamic.thread-pool.check-state-interval=5 +spring.dynamic.thread-pool.collect=true +spring.dynamic.thread-pool.config-file-type=properties +spring.dynamic.thread-pool.enable=true +spring.dynamic.thread-pool.executors[0].allow-core-thread-time-out=true +spring.dynamic.thread-pool.executors[0].blocking-queue=LinkedBlockingQueue +spring.dynamic.thread-pool.executors[0].core-pool-size=2 +spring.dynamic.thread-pool.executors[0].execute-time-out=1000 +spring.dynamic.thread-pool.executors[0].keep-alive-time=6691 +spring.dynamic.thread-pool.executors[0].maximum-pool-size=4 +spring.dynamic.thread-pool.executors[0].notify.active-alarm=80 +spring.dynamic.thread-pool.executors[0].notify.capacity-alarm=80 +spring.dynamic.thread-pool.executors[0].notify.interval=8 +spring.dynamic.thread-pool.executors[0].notify.is-alarm=true +spring.dynamic.thread-pool.executors[0].notify.receives.DING=177****6993 +spring.dynamic.thread-pool.executors[0].queue-capacity=100 +spring.dynamic.thread-pool.executors[0].rejected-handler=AbortPolicy +spring.dynamic.thread-pool.executors[0].thread-name-prefix=message-consume +spring.dynamic.thread-pool.executors[0].thread-pool-id=message-consume +spring.dynamic.thread-pool.executors[1].allow-core-thread-time-out=true +spring.dynamic.thread-pool.executors[1].blocking-queue=LinkedBlockingQueue +spring.dynamic.thread-pool.executors[1].core-pool-size=1 +spring.dynamic.thread-pool.executors[1].execute-time-out=1000 +spring.dynamic.thread-pool.executors[1].keep-alive-time=6691 +spring.dynamic.thread-pool.executors[1].maximum-pool-size=1 +spring.dynamic.thread-pool.executors[1].notify.active-alarm=80 +spring.dynamic.thread-pool.executors[1].notify.capacity-alarm=80 +spring.dynamic.thread-pool.executors[1].notify.interval=8 +spring.dynamic.thread-pool.executors[1].notify.is-alarm=true +spring.dynamic.thread-pool.executors[1].notify.receives.DING=177****6993 +spring.dynamic.thread-pool.executors[1].queue-capacity=1 +spring.dynamic.thread-pool.executors[1].rejected-handler=AbortPolicy +spring.dynamic.thread-pool.executors[1].thread-name-prefix=message-produce +spring.dynamic.thread-pool.executors[1].thread-pool-id=message-produce +spring.dynamic.thread-pool.notify-platforms[0].platform=DING +spring.dynamic.thread-pool.notify-platforms[0].secret-key=aab197577f6d8cc3aa8b52ee38adb6e16a46642a9c4986f5e45ca6946fdcea6f \ No newline at end of file diff --git a/tools/open-change-tool/.gitignore b/hippo4j-example/hippo4j-example-core/.gitignore similarity index 100% rename from tools/open-change-tool/.gitignore rename to hippo4j-example/hippo4j-example-core/.gitignore diff --git a/common/pom.xml b/hippo4j-example/hippo4j-example-core/pom.xml similarity index 53% rename from common/pom.xml rename to hippo4j-example/hippo4j-example-core/pom.xml index 07d7bb71..8bb2ce33 100644 --- a/common/pom.xml +++ b/hippo4j-example/hippo4j-example-core/pom.xml @@ -2,18 +2,19 @@ 4.0.0 - - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-example ${revision} - common - jar + hippo4j-example-core + hippo4j-example-core + Hippo4J 实例工程核心包. - ${project.artifactId} - ${project.artifactId} + + true + @@ -22,13 +23,14 @@ - com.alibaba - fastjson + org.springframework.boot + spring-boot-starter-test + test - org.projectlombok - lombok + cn.hippo4j + hippo4j-core diff --git a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/config/ThreadPoolConfig.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/config/ThreadPoolConfig.java new file mode 100644 index 00000000..f369f417 --- /dev/null +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/config/ThreadPoolConfig.java @@ -0,0 +1,64 @@ +package cn.hippo4j.example.core.config; + +import cn.hippo4j.core.executor.DynamicThreadPool; +import cn.hippo4j.core.executor.support.ThreadPoolBuilder; +import cn.hippo4j.example.core.handler.TaskTraceBuilderHandler; +import cn.hippo4j.example.core.inittest.TaskDecoratorTest; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.concurrent.ThreadPoolExecutor; + +import static cn.hippo4j.example.core.constant.GlobalTestConstant.MESSAGE_CONSUME; +import static cn.hippo4j.example.core.constant.GlobalTestConstant.MESSAGE_PRODUCE; + +/** + * Thread pool config. + * + * @author chen.ma + * @date 2021/6/20 17:16 + */ +@Slf4j +@Configuration +public class ThreadPoolConfig { + + @Bean + @DynamicThreadPool + public ThreadPoolExecutor messageConsumeDynamicThreadPool() { + String threadPoolId = MESSAGE_CONSUME; + ThreadPoolExecutor customExecutor = ThreadPoolBuilder.builder() + .dynamicPool() + .threadFactory(threadPoolId) + .threadPoolId(threadPoolId) + .executeTimeOut(800L) + .waitForTasksToCompleteOnShutdown(true) + .awaitTerminationMillis(5000L) + .taskDecorator(new TaskTraceBuilderHandler()) + .build(); + + return customExecutor; + } + + @Bean + @DynamicThreadPool + public ThreadPoolExecutor messageProduceDynamicThreadPool() { + String threadPoolId = MESSAGE_PRODUCE; + ThreadPoolExecutor produceExecutor = ThreadPoolBuilder.builder() + .dynamicPool() + .threadFactory(threadPoolId) + .threadPoolId(threadPoolId) + .executeTimeOut(900L) + .waitForTasksToCompleteOnShutdown(true) + .awaitTerminationMillis(5000L) + /** + * 测试线程任务装饰器. + * 如果需要查看详情, 跳转 {@link TaskDecoratorTest} + */ + .taskDecorator(new TaskDecoratorTest.ContextCopyingDecorator()) + .build(); + + return produceExecutor; + } + +} diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/constant/GlobalTestConstant.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/constant/GlobalTestConstant.java similarity index 68% rename from example/src/main/java/com/github/dynamic/threadpool/example/constant/GlobalTestConstant.java rename to hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/constant/GlobalTestConstant.java index bdb251d5..de007535 100644 --- a/example/src/main/java/com/github/dynamic/threadpool/example/constant/GlobalTestConstant.java +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/constant/GlobalTestConstant.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.example.constant; +package cn.hippo4j.example.core.constant; /** * Global test variables. @@ -8,9 +8,8 @@ package com.github.dynamic.threadpool.example.constant; */ public class GlobalTestConstant { - public static final String CUSTOM_POOL = "custom-pool"; - public static final String MESSAGE_PRODUCE = "message-produce"; public static final String MESSAGE_CONSUME = "message-consume"; + } diff --git a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/handler/ErrorLogRejectedExecutionHandler.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/handler/ErrorLogRejectedExecutionHandler.java new file mode 100644 index 00000000..fc30872b --- /dev/null +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/handler/ErrorLogRejectedExecutionHandler.java @@ -0,0 +1,38 @@ +package cn.hippo4j.example.core.handler; + +import cn.hippo4j.core.spi.CustomRejectedExecutionHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 自定义拒绝策略. + * + * @author chen.ma + * @date 2022/1/4 22:19 + */ +public class ErrorLogRejectedExecutionHandler implements CustomRejectedExecutionHandler { + + @Override + public Integer getType() { + return 12; + } + + @Override + public RejectedExecutionHandler generateRejected() { + return new CustomErrorLogRejectedExecutionHandler(); + } + + public static class CustomErrorLogRejectedExecutionHandler implements RejectedExecutionHandler { + + @Override + public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { + Logger logger = LoggerFactory.getLogger(this.getClass()); + logger.error("线程池抛出拒绝策略."); + } + + } + +} diff --git a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/handler/TaskTraceBuilderHandler.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/handler/TaskTraceBuilderHandler.java new file mode 100644 index 00000000..79050a0c --- /dev/null +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/handler/TaskTraceBuilderHandler.java @@ -0,0 +1,32 @@ +package cn.hippo4j.example.core.handler; + +import cn.hippo4j.common.toolkit.StringUtil; +import org.slf4j.MDC; +import org.springframework.core.task.TaskDecorator; + +import static cn.hippo4j.common.constant.Constants.EXECUTE_TIMEOUT_TRACE; + +/** + * Task trace builder handler. + * + * @author chen.ma + * @date 2022/3/2 20:46 + */ +public final class TaskTraceBuilderHandler implements TaskDecorator { + + @Override + public Runnable decorate(Runnable runnable) { + String executeTimeoutTrace = MDC.get(EXECUTE_TIMEOUT_TRACE); + + Runnable taskRun = () -> { + if (StringUtil.isNotBlank(executeTimeoutTrace)) { + MDC.put(EXECUTE_TIMEOUT_TRACE, executeTimeoutTrace); + } + runnable.run(); + // 此处不用进行清理操作, 统一在线程任务执行后清理 + }; + + return taskRun; + } + +} diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/AlarmSendMessageTest.java similarity index 63% rename from example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java rename to hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/AlarmSendMessageTest.java index 73243045..17c11dde 100644 --- a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/AlarmSendMessageTest.java @@ -1,8 +1,9 @@ -package com.github.dynamic.threadpool.example.inittest; +package cn.hippo4j.example.core.inittest; +import cn.hippo4j.example.core.constant.GlobalTestConstant; import cn.hutool.core.thread.ThreadUtil; -import com.github.dynamic.threadpool.starter.core.GlobalThreadPoolManage; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -11,8 +12,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import static com.github.dynamic.threadpool.example.constant.GlobalTestConstant.MESSAGE_PRODUCE; - /** * Test alarm send message. * @@ -23,13 +22,16 @@ import static com.github.dynamic.threadpool.example.constant.GlobalTestConstant. @Component public class AlarmSendMessageTest { - // @PostConstruct + /** + * 测试报警通知. + * 如果需要运行此单测, 方法上添加 @PostConstruct + */ @SuppressWarnings("all") public void alarmSendMessageTest() { ScheduledExecutorService scheduledThreadPool = Executors.newSingleThreadScheduledExecutor(); scheduledThreadPool.scheduleWithFixedDelay(() -> { - DynamicThreadPoolWrap executorService = GlobalThreadPoolManage.getExecutorService(MESSAGE_PRODUCE); - ThreadPoolExecutor poolExecutor = executorService.getPool(); + DynamicThreadPoolWrapper poolWrapper = GlobalThreadPoolManage.getExecutorService(GlobalTestConstant.MESSAGE_PRODUCE); + ThreadPoolExecutor poolExecutor = poolWrapper.getExecutor(); try { poolExecutor.execute(() -> ThreadUtil.sleep(10240124)); } catch (Exception ex) { diff --git a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java new file mode 100644 index 00000000..979d5052 --- /dev/null +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java @@ -0,0 +1,79 @@ +package cn.hippo4j.example.core.inittest; + +import cn.hutool.core.thread.ThreadUtil; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.MDC; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.util.Random; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; + +import static cn.hippo4j.common.constant.Constants.EXECUTE_TIMEOUT_TRACE; + +/** + * Test run time metrics. + * + * @author chen.ma + * @date 2021/8/15 21:00 + */ +@Slf4j +@Component +public class RunStateHandlerTest { + + @Resource + private ThreadPoolExecutor messageConsumeDynamicThreadPool; + + @Resource + private ThreadPoolExecutor messageProduceDynamicThreadPool; + + @PostConstruct + @SuppressWarnings("all") + public void runStateHandlerTest() { + log.info("Test thread pool runtime state interface..."); + + // 启动动态线程池模拟运行任务 + runTask(messageConsumeDynamicThreadPool); + + // 启动动态线程池模拟运行任务 + runTask(messageProduceDynamicThreadPool); + } + + private void runTask(ExecutorService executorService) { + // 模拟任务运行 + new Thread(() -> { + /** + * 当线程池任务执行超时, 向 MDC 放入 Trace 标识, 报警时打印出来. + */ + MDC.put(EXECUTE_TIMEOUT_TRACE, "https://github.com/acmenlt/dynamic-threadpool 感觉不错来个 Star."); + ThreadUtil.sleep(5000); + for (int i = 0; i < Integer.MAX_VALUE; i++) { + try { + executorService.execute(() -> { + try { + int maxRandom = 10; + int temp = 2; + Random random = new Random(); + // Assignment thread pool completedTaskCount + if (random.nextInt(maxRandom) % temp == 0) { + Thread.sleep(1000); + } else { + Thread.sleep(3000); + } + } catch (InterruptedException e) { + // ignore + } + }); + } catch (Exception ex) { + // ignore + } + + ThreadUtil.sleep(500); + } + + }).start(); + } + +} diff --git a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/TaskDecoratorTest.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/TaskDecoratorTest.java new file mode 100644 index 00000000..b762475e --- /dev/null +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/TaskDecoratorTest.java @@ -0,0 +1,64 @@ +package cn.hippo4j.example.core.inittest; + +import cn.hippo4j.example.core.constant.GlobalTestConstant; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import cn.hutool.core.thread.ThreadUtil; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.MDC; +import org.springframework.core.task.TaskDecorator; +import org.springframework.stereotype.Component; + +import java.util.concurrent.ThreadPoolExecutor; + +/** + * TaskDecorator test. + * + * @author chen.ma + * @date 2021/11/28 13:01 + */ +@Slf4j +@Component +public class TaskDecoratorTest { + + public static final String PLACEHOLDER = "site"; + + /** + * 测试动态线程池传递 {@link TaskDecorator} + * 如果需要运行此单测, 方法上添加 @PostConstruct + */ + public void taskDecoratorTest() { + new Thread(() -> { + MDC.put(PLACEHOLDER, "查看官网: https://www.hippox.cn"); + ThreadUtil.sleep(5000); + DynamicThreadPoolWrapper poolWrapper = GlobalThreadPoolManage.getExecutorService(GlobalTestConstant.MESSAGE_PRODUCE); + ThreadPoolExecutor threadPoolExecutor = poolWrapper.getExecutor(); + threadPoolExecutor.execute(() -> { + /** + * 此处打印不为空, taskDecorator 即为生效. + * taskDecorator 配置查看 {@link ThreadPoolConfig#messageConsumeDynamicThreadPool()} + */ + log.info("通过 taskDecorator MDC 传递上下文 :: {}", MDC.get(PLACEHOLDER)); + }); + }).start(); + + } + + public static class ContextCopyingDecorator implements TaskDecorator { + + @Override + public Runnable decorate(Runnable runnable) { + String placeholderVal = MDC.get(PLACEHOLDER); + // other context... + return () -> { + try { + MDC.put(PLACEHOLDER, placeholderVal); + runnable.run(); + } finally { + MDC.clear(); + } + }; + } + } + +} diff --git a/hippo4j-example/hippo4j-spring-boot-starter-example/.gitignore b/hippo4j-example/hippo4j-spring-boot-starter-example/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-example/hippo4j-spring-boot-starter-example/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/example/pom.xml b/hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml similarity index 54% rename from example/pom.xml rename to hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml index 085e4745..768117d6 100644 --- a/example/pom.xml +++ b/hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml @@ -2,50 +2,61 @@ 4.0.0 - - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-example ${revision} - example - jar - + hippo4j-spring-boot-starter-example ${project.artifactId} - Demo project for Spring Boot + + + true + - org.springframework.boot - spring-boot-starter + cn.hippo4j + hippo4j-example-core + ${revision} + cn.hippo4j + hippo4j-spring-boot-starter + ${revision} + + + org.springframework.boot - spring-boot-starter-test - test + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + - com.github.dynamic-threadpool - dynamic-threadpool-spring-boot-starter - ${revision} + org.springframework.boot + spring-boot-starter-undertow - - com.github.dynamic-threadpool - open-change-tool - + - hippo-example + ${project.artifactId} org.springframework.boot diff --git a/hippo4j-example/hippo4j-spring-boot-starter-example/src/main/java/cn/hippo4j/example/server/Hippo4JServerExampleApplication.java b/hippo4j-example/hippo4j-spring-boot-starter-example/src/main/java/cn/hippo4j/example/server/Hippo4JServerExampleApplication.java new file mode 100644 index 00000000..5f5f22de --- /dev/null +++ b/hippo4j-example/hippo4j-spring-boot-starter-example/src/main/java/cn/hippo4j/example/server/Hippo4JServerExampleApplication.java @@ -0,0 +1,15 @@ +package cn.hippo4j.example.server; + +import cn.hippo4j.core.enable.EnableDynamicThreadPool; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@EnableDynamicThreadPool +@SpringBootApplication(scanBasePackages = "cn.hippo4j.example.core") +public class Hippo4JServerExampleApplication { + + public static void main(String[] args) { + SpringApplication.run(Hippo4JServerExampleApplication.class, args); + } + +} diff --git a/hippo4j-example/hippo4j-spring-boot-starter-example/src/main/resources/application.yml b/hippo4j-example/hippo4j-spring-boot-starter-example/src/main/resources/application.yml new file mode 100644 index 00000000..1ab654c8 --- /dev/null +++ b/hippo4j-example/hippo4j-spring-boot-starter-example/src/main/resources/application.yml @@ -0,0 +1,19 @@ +server: + port: 8088 + servlet: + context-path: /example + +spring: + profiles: + active: dev + + application: + name: dynamic-threadpool-example + + dynamic: + thread-pool: + server-addr: http://localhost:6691 + namespace: prescription + item-id: dynamic-threadpool-example + username: admin + password: 123456 diff --git a/hippo4j-example/pom.xml b/hippo4j-example/pom.xml new file mode 100644 index 00000000..f21be879 --- /dev/null +++ b/hippo4j-example/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + + cn.hippo4j + hippo4j-all + ${revision} + + + hippo4j-example + pom + + ${project.artifactId} + ${project.artifactId} + + + true + + + + + hippo4j-example-core + + hippo4j-spring-boot-starter-example + + hippo4j-core-nacos-spring-boot-starter-example + + hippo4j-core-apollo-spring-boot-starter-example + hippo4j-core-zookeeper-spring-boot-starter-example + + + diff --git a/hippo4j-server/.gitignore b/hippo4j-server/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-server/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/hippo4j-server/bin/shutdown.cmd b/hippo4j-server/bin/shutdown.cmd new file mode 100644 index 00000000..4365ce71 --- /dev/null +++ b/hippo4j-server/bin/shutdown.cmd @@ -0,0 +1,13 @@ +@echo off + +if not exist "%JAVA_HOME%\bin\jps.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! & EXIT /B 1 + +setlocal + +set "PATH=%JAVA_HOME%\bin;%PATH%" + +echo killing hippo4j server + +for /f "tokens=1" %%i in ('jps -m ^| find "hippo4j.hippo4j"') do ( taskkill /F /PID %%i ) + +echo Done! diff --git a/hippo4j-server/bin/shutdown.sh b/hippo4j-server/bin/shutdown.sh new file mode 100644 index 00000000..9dbf842b --- /dev/null +++ b/hippo4j-server/bin/shutdown.sh @@ -0,0 +1,14 @@ +cd `dirname $0`/../target +target_dir=`pwd` + +pid=`ps ax | grep -i 'hippo4j.hippo4j' | grep ${target_dir} | grep java | grep -v grep | awk '{print $1}'` +if [ -z "$pid" ] ; then + echo "No hippo4jServer running." + exit -1; +fi + +echo "The hippo4jServer(${pid}) is running..." + +kill ${pid} + +echo "Send shutdown request to hippo4jServer(${pid}) OK" \ No newline at end of file diff --git a/hippo4j-server/bin/startup.cmd b/hippo4j-server/bin/startup.cmd new file mode 100644 index 00000000..c844d03f --- /dev/null +++ b/hippo4j-server/bin/startup.cmd @@ -0,0 +1,35 @@ +@echo off + +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! & EXIT /B 1 +set "JAVA=%JAVA_HOME%\bin\java.exe" + +setlocal enabledelayedexpansion + +set BASE_DIR=%~dp0 +rem added double quotation marks to avoid the issue caused by the folder names containing spaces. +rem removed the last 5 chars(which means \bin\) to get the base DIR. +set BASE_DIR="%BASE_DIR:~0,-5%" + +set CUSTOM_SEARCH_LOCATIONS=%BASE_DIR%/conf/application.properties + +set SERVER=hippo4j-server + +echo "hippo4j is starting with standalone" +set "HIPPO4J_JVM_OPTS=-Xms1024m -Xmx1024m -Xmn512m -Dhippo4j.standalone=true -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%BASE_DIR%\logs\java_heapdump.hprof -XX:-UseLargePages" + +set "HIPPO4J_OPTS=%HIPPO4J_OPTS% -Dhippo4j.home=%BASE_DIR%" +set "HIPPO4J_OPTS=%HIPPO4J_OPTS% -jar %BASE_DIR%\target\%SERVER%.jar" + + +rem set hippo4j spring config location +set "HIPPO4J_CONFIG_OPTS=--spring.config.location=%CUSTOM_SEARCH_LOCATIONS%" +set "HIPPO4J_CONFIG_OPTS=%HIPPO4J_OPTS% --server.tomcat.basedir=%BASE_DIR%/bin" + + +rem set hippo4j logback file location +set "HIPPO4J_LOGBACK_OPTS=--logging.config=%BASE_DIR%/conf/hippo4j-logback.xml" + +set COMMAND="%JAVA%" %HIPPO4J_JVM_OPTS% %HIPPO4J_OPTS% %HIPPO4J_CONFIG_OPTS% %HIPPO4J_LOGBACK_OPTS% hippo4j.hippo4j %* + +rem start hippo4j command +%COMMAND% diff --git a/hippo4j-server/bin/startup.sh b/hippo4j-server/bin/startup.sh new file mode 100644 index 00000000..07cbaac7 --- /dev/null +++ b/hippo4j-server/bin/startup.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +export JAVA_HOME +export JAVA="$JAVA_HOME/bin/java" +export BASE_DIR=`cd $(dirname $0)/..; pwd` +export CUSTOM_SEARCH_LOCATIONS=${BASE_DIR}/conf/application.properties + +export SERVER="hippo4j-server" + +JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p') +if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then + JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASE_DIR}/logs/hippo4j_gc.log:time,tags:filecount=10,filesize=102400" +else + JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext" + JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/hippo4j_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M" +fi + +JAVA_OPT="${JAVA_OPT} -Xms1024m -Xmx1024m -Xmn512m" +JAVA_OPT="${JAVA_OPT} -Dhippo4j.standalone=true" +JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/logs/java_heapdump.hprof" +JAVA_OPT="${JAVA_OPT} -Dhippo4j.home=${BASE_DIR}" +JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/target/${SERVER}.jar" +JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}" +JAVA_OPT="${JAVA_OPT} --spring.config.location=${CUSTOM_SEARCH_LOCATIONS}" +JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/hippo4j-logback.xml" +JAVA_OPT="${JAVA_OPT} --server.max-http-header-size=524288" +JAVA_OPT="${JAVA_OPT} --server.tomcat.basedir=${BASE_DIR}/bin" + +if [ ! -d "${BASE_DIR}/logs" ]; then + mkdir ${BASE_DIR}/logs +fi + +echo "$JAVA ${JAVA_OPT}" + +echo "hippo4j is starting with standalone" + +if [ ! -f "${BASE_DIR}/logs/start.out" ]; then + touch "${BASE_DIR}/logs/start.out" +fi + +echo "$JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/start.out 2>&1 & +nohup $JAVA ${JAVA_OPT} hippo4j.hippo4j >> ${BASE_DIR}/logs/start.out 2>&1 & +echo "hippo4j is starting,you can check the ${BASE_DIR}/logs/start.out" diff --git a/hippo4j-server/conf/application.properties b/hippo4j-server/conf/application.properties new file mode 100644 index 00000000..ecab75a1 --- /dev/null +++ b/hippo4j-server/conf/application.properties @@ -0,0 +1,47 @@ +#*************** Spring Boot Related Configurations ***************# +### Default Web Context Path +# server.servlet.contextPath=/hippo4j + +### Server Startup Port +server.port=6691 + +### Server Tomcat +server.tomcat.accesslog.enabled=true +server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i + +### Default Current Work Dir +server.tomcat.basedir= + +#*************** Dynamic Thread Pool Custom Configuration ***************# +### Custom Logging Tenant +tenant=hippo4j + +### Regularly clean up the historical running data of thread pool. unit: minute. +hippo4j.core.clean-history-data-period=30 +hippo4j.core.clean-history-data-enable=true + + +#*************** Config Module Related Configurations ***************# +### Data source customization section +spring.datasource.url=jdbc:mysql://localhost:3306/hippo4j_manager?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +spring.datasource.username=root +spring.datasource.password=root + +### Hikari Datasource +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.hikari.pool-name=Hikari +spring.datasource.hikari.connectionTimeout=30000 +spring.datasource.hikari.idleTimeout=30000 +spring.datasource.hikari.validationTimeout=3000 +spring.datasource.hikari.maxLifetime=120000 +spring.datasource.hikari.loginTimeout=5 +spring.datasource.hikari.minimumIdle=5 +spring.datasource.hikari.maximumPoolSize=15 +spring.datasource.hikari.connection-test-query=SELECT 1 + +### Mybatis-Plus Config +mybatis-plus.global-config.banner=false +# mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.global-config.db-config.logic-delete-field=delFlag +mybatis-plus.global-config.db-config.logic-delete-value=1 +mybatis-plus.global-config.db-config.logic-not-delete-value=0 diff --git a/hippo4j-server/conf/hippo4j-logback.xml b/hippo4j-server/conf/hippo4j-logback.xml new file mode 100644 index 00000000..80b844bf --- /dev/null +++ b/hippo4j-server/conf/hippo4j-logback.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + ${FILE_LOG_PATTERN} + + + + + ${logPath}/${appName}-info.log + + ${logPath}/${appName}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + ${FILE_LOG_PATTERN} + UTF-8 + + + + + ${logPath}/${appName}-error.log + + ${logPath}/${appName}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + ${FILE_LOG_PATTERN} + + + ERROR + + + + + + + + + + + + + diff --git a/hippo4j-server/conf/hippo4j_manager.sql b/hippo4j-server/conf/hippo4j_manager.sql new file mode 100644 index 00000000..7f25d307 --- /dev/null +++ b/hippo4j-server/conf/hippo4j_manager.sql @@ -0,0 +1,234 @@ +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hippo4j_manager` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; + +USE `hippo4j_manager`; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = tenant */ +/******************************************/ +DROP TABLE IF EXISTS `tenant`, `tenant_info`; +CREATE TABLE `tenant` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `tenant_name` varchar(128) DEFAULT NULL COMMENT '租户名称', + `tenant_desc` varchar(256) DEFAULT NULL COMMENT '租户介绍', + `owner` varchar(32) DEFAULT '-' COMMENT '负责人', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + KEY `uk_tenantinfo_tenantid` (`tenant_id`,`del_flag`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='租户表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = item */ +/******************************************/ +DROP TABLE IF EXISTS `item`, `item_info`; +CREATE TABLE `item` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(128) DEFAULT NULL COMMENT '项目ID', + `item_name` varchar(128) DEFAULT NULL COMMENT '项目名称', + `item_desc` varchar(256) DEFAULT NULL COMMENT '项目介绍', + `owner` varchar(32) DEFAULT NULL COMMENT '负责人', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + UNIQUE KEY `uk_iteminfo_tenantitem` (`tenant_id`,`item_id`,`del_flag`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='项目表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = config */ +/******************************************/ +DROP TABLE IF EXISTS `config`, `config_info`; +CREATE TABLE `config` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `tp_name` varchar(56) DEFAULT NULL COMMENT '线程池名称', + `core_size` int(11) DEFAULT NULL COMMENT '核心线程数', + `max_size` int(11) DEFAULT NULL COMMENT '最大线程数', + `queue_type` int(11) DEFAULT NULL COMMENT '队列类型...', + `capacity` int(11) DEFAULT NULL COMMENT '队列大小', + `rejected_type` int(11) DEFAULT NULL COMMENT '拒绝策略', + `keep_alive_time` int(11) DEFAULT NULL COMMENT '线程存活时间', + `allow_core_thread_time_out` tinyint(1) DEFAULT NULL COMMENT '允许核心线程超时', + `content` longtext COMMENT '线程池内容', + `md5` varchar(32) NOT NULL COMMENT 'MD5', + `is_alarm` tinyint(1) DEFAULT NULL COMMENT '是否报警', + `capacity_alarm` int(11) DEFAULT NULL COMMENT '容量报警', + `liveness_alarm` int(11) DEFAULT NULL COMMENT '活跃度报警', + `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + UNIQUE KEY `uk_configinfo_datagrouptenant` (`tenant_id`,`item_id`,`tp_id`,`del_flag`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = inst_config */ +/******************************************/ +DROP TABLE IF EXISTS `inst_config`; +CREATE TABLE `inst_config` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', + `content` longtext COMMENT '线程池内容', + `md5` varchar(32) NOT NULL COMMENT 'MD5', + `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + KEY `idx_config_instance` (`tenant_id`,`item_id`,`tp_id`,`instance_id`) USING BTREE, + KEY `idx_instance` (`instance_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置实例表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = his_run_data */ +/******************************************/ +DROP TABLE IF EXISTS `his_run_data`; +CREATE TABLE `his_run_data` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', + `current_load` bigint(20) DEFAULT NULL COMMENT '当前负载', + `peak_load` bigint(20) DEFAULT NULL COMMENT '峰值负载', + `pool_size` bigint(20) DEFAULT NULL COMMENT '线程数', + `active_size` bigint(20) DEFAULT NULL COMMENT '活跃线程数', + `queue_capacity` bigint(20) DEFAULT NULL COMMENT '队列容量', + `queue_size` bigint(20) DEFAULT NULL COMMENT '队列元素', + `queue_remaining_capacity` bigint(20) DEFAULT NULL COMMENT '队列剩余容量', + `completed_task_count` bigint(20) DEFAULT NULL COMMENT '已完成任务计数', + `reject_count` bigint(20) DEFAULT NULL COMMENT '拒绝次数', + `timestamp` bigint(20) DEFAULT NULL COMMENT '时间戳', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`), + KEY `idx_group_key` (`tenant_id`,`item_id`,`tp_id`,`instance_id`) USING BTREE, + KEY `idx_timestamp` (`timestamp`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='历史运行数据表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = log_record_info */ +/******************************************/ +DROP TABLE IF EXISTS `log_record_info`; +CREATE TABLE `log_record_info` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `tenant` varchar(128) NOT NULL DEFAULT '' COMMENT '租户标识', + `biz_key` varchar(128) NOT NULL DEFAULT '' COMMENT '日志业务标识', + `biz_no` varchar(128) NOT NULL DEFAULT '' COMMENT '业务码标识', + `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人', + `action` varchar(128) NOT NULL DEFAULT '' COMMENT '动作', + `category` varchar(128) NOT NULL DEFAULT '' COMMENT '种类', + `detail` varchar(2048) NOT NULL DEFAULT '' COMMENT '修改的详细信息,可以为json', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `idx_biz_key` (`biz_key`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='操作日志表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = user */ +/******************************************/ +DROP TABLE IF EXISTS `user`; +CREATE TABLE `user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `user_name` varchar(64) NOT NULL COMMENT '用户名', + `password` varchar(512) NOT NULL COMMENT '用户密码', + `role` varchar(50) NOT NULL COMMENT '角色', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = role */ +/******************************************/ +DROP TABLE IF EXISTS `role`; +CREATE TABLE `role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role` varchar(64) NOT NULL COMMENT '角色', + `user_name` varchar(64) NOT NULL COMMENT '用户名', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = permission */ +/******************************************/ +DROP TABLE IF EXISTS `permission`; +CREATE TABLE `permission` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role` varchar(512) NOT NULL COMMENT '角色', + `resource` varchar(512) NOT NULL COMMENT '资源', + `action` varchar(8) NOT NULL COMMENT '读写权限', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='权限表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = notify */ +/******************************************/ +DROP TABLE IF EXISTS `alarm`, `notify`; +CREATE TABLE `notify` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT '租户ID', + `item_id` varchar(128) NOT NULL COMMENT '项目ID', + `tp_id` varchar(128) NOT NULL COMMENT '线程池ID', + `platform` varchar(32) NOT NULL COMMENT '通知平台', + `type` varchar(32) NOT NULL COMMENT '通知类型', + `secret_key` varchar(256) NOT NULL COMMENT '密钥', + `interval` int(11) DEFAULT NULL COMMENT '报警间隔', + `receives` varchar(512) NOT NULL COMMENT '接收者', + `enable` tinyint(1) DEFAULT NULL COMMENT '是否启用', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_notify_biz_key` (`tenant_id`,`item_id`,`tp_id`,`platform`,`type`,`del_flag`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='通知表'; + +/* 租户 */ +INSERT INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', '处方组', '负责维护处方服务, 包括不限于电子处方等业务', '谢良辰', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); + +/* 项目 */ +INSERT INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); + +/* 线程池 */ +INSERT INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `allow_core_thread_time_out`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '5', '10', '9', '1024', '2', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-consume\",\"coreSize\":5,\"maxSize\":10,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":2,\"isAlarm\":0,\"capacityAlarm\":80,\"livenessAlarm\":80,\"allowCoreThreadTimeOut\":0}', 'f80ea89044889fb6cec20e1a517f2ec3', '0', '80', '80', '2021-10-24 10:24:00', '2021-12-22 08:58:55', '0'), +('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '5', '15', '9', '1024', '1', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-produce\",\"coreSize\":5,\"maxSize\":15,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":1,\"isAlarm\":0,\"capacityAlarm\":30,\"livenessAlarm\":30,\"allowCoreThreadTimeOut\":0}', '525e1429468bcfe98df7e70a75710051', '0', '30', '30', '2021-10-24 10:24:00', '2021-12-22 08:59:02', '0'); + +/* 用户 */ +INSERT INTO `user` (`id`, `user_name`, `password`, `role`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'admin', '$2a$10$2KCqRbra0Yn2TwvkZxtfLuWuUP5KyCWsljO/ci5pLD27pqR3TV1vy', 'ROLE_ADMIN', '2021-11-04 21:35:17', '2021-11-15 23:04:59', '0'); + +/* 通知表 */ +INSERT INTO `notify` (`id`, `tenant_id`, `item_id`, `tp_id`, `platform`, `type`, `secret_key`, `interval`, `receives`, `enable`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'CONFIG', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', NULL, '15601166691', '0', '2021-11-18 22:49:50', '2021-11-18 22:49:50', '0'), +('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'ALARM', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', '30', '15601166691', '0', '2021-11-18 22:50:06', '2021-11-18 22:50:06', '0'); + +/* 1.1.0 Upgrade Start */ +ALTER TABLE `config` DROP INDEX `uk_configinfo_datagrouptenant`; +ALTER TABLE `item` DROP INDEX `uk_iteminfo_tenantitem`; +ALTER TABLE `tenant` DROP INDEX `uk_tenantinfo_tenantid`; +/* 1.1.0 Upgrade End */ diff --git a/hippo4j-server/conf/sql-upgrade/1.1.0_upgrade.sql b/hippo4j-server/conf/sql-upgrade/1.1.0_upgrade.sql new file mode 100644 index 00000000..0b4be247 --- /dev/null +++ b/hippo4j-server/conf/sql-upgrade/1.1.0_upgrade.sql @@ -0,0 +1,5 @@ +ALTER TABLE `config` DROP INDEX `uk_configinfo_datagrouptenant`; + +ALTER TABLE `item` DROP INDEX `uk_iteminfo_tenantitem`; + +ALTER TABLE `tenant` DROP INDEX `uk_tenantinfo_tenantid`; diff --git a/hippo4j-server/pom.xml b/hippo4j-server/pom.xml new file mode 100644 index 00000000..39ef1bd0 --- /dev/null +++ b/hippo4j-server/pom.xml @@ -0,0 +1,98 @@ + + + 4.0.0 + + + cn.hippo4j + hippo4j-all + ${revision} + + + hippo4j-server + jar + + ${project.artifactId} + ${project.artifactId} + + + true + + + + + cn.hippo4j + hippo4j-config + + + + cn.hippo4j + hippo4j-console + + + + cn.hippo4j + hippo4j-discovery + + + + + javax.xml.bind + jaxb-api + 2.3.0 + + + + com.sun.xml.bind + jaxb-impl + 2.3.0 + + + + com.sun.xml.bind + jaxb-core + 2.3.0 + + + + javax.activation + activation + 1.1.1 + + + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${project.artifactId} + ${project.version} + ${maven.build.timestamp} + chen.ma + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/ServerApplication.java b/hippo4j-server/src/main/java/cn/hippo4j/server/ServerApplication.java new file mode 100644 index 00000000..74f676cd --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/ServerApplication.java @@ -0,0 +1,23 @@ +package cn.hippo4j.server; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * Example application. + * + * @author chen.ma + * @date 2022/01/23 21:06 + */ +@EnableTransactionManagement +@SpringBootApplication(scanBasePackages = "cn.hippo4j") +@MapperScan(basePackages = {"cn.hippo4j.config.mapper", "cn.hippo4j.auth.mapper"}) +public class ServerApplication { + + public static void main(String[] args) { + SpringApplication.run(ServerApplication.class, args); + } + +} diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/listener/BaseSpringApplicationRunListener.java b/hippo4j-server/src/main/java/cn/hippo4j/server/listener/BaseSpringApplicationRunListener.java new file mode 100644 index 00000000..be143e31 --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/listener/BaseSpringApplicationRunListener.java @@ -0,0 +1,59 @@ +package cn.hippo4j.server.listener; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.SpringApplicationRunListener; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.Ordered; + +import java.util.ArrayList; +import java.util.List; + +/** + * Base spring application run listener. + * + * @author chen.ma + * @date 2022/2/9 04:29 + */ +public class BaseSpringApplicationRunListener implements SpringApplicationRunListener, Ordered { + + private final SpringApplication application; + + private final String[] args; + + private List hippo4JApplicationListeners = new ArrayList(); + + { + hippo4JApplicationListeners.add(new StartingApplicationListener()); + } + + public BaseSpringApplicationRunListener(SpringApplication application, String[] args) { + this.application = application; + this.args = args; + } + + @Override + public void starting() { + hippo4JApplicationListeners.forEach(each -> each.starting()); + } + + @Override + public void contextPrepared(ConfigurableApplicationContext context) { + hippo4JApplicationListeners.forEach(each -> each.contextPrepared(context)); + } + + @Override + public void started(ConfigurableApplicationContext context) { + hippo4JApplicationListeners.forEach(each -> each.started(context)); + } + + @Override + public void failed(ConfigurableApplicationContext context, Throwable exception) { + hippo4JApplicationListeners.forEach(each -> each.failed(context, exception)); + } + + @Override + public int getOrder() { + return HIGHEST_PRECEDENCE; + } + +} diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/listener/Hippo4JApplicationListener.java b/hippo4j-server/src/main/java/cn/hippo4j/server/listener/Hippo4JApplicationListener.java new file mode 100644 index 00000000..232cb809 --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/listener/Hippo4JApplicationListener.java @@ -0,0 +1,40 @@ +package cn.hippo4j.server.listener; + +import org.springframework.context.ConfigurableApplicationContext; + +/** + * Hippo4J application listener. + * + * @author chen.ma + * @date 2022/2/9 04:35 + */ +public interface Hippo4JApplicationListener { + + /** + * {@link BaseSpringApplicationRunListener#starting} + */ + void starting(); + + /** + * {@link BaseSpringApplicationRunListener#contextPrepared} + * + * @param context + */ + void contextPrepared(ConfigurableApplicationContext context); + + /** + * {@link BaseSpringApplicationRunListener#started} + * + * @param context context + */ + void started(ConfigurableApplicationContext context); + + /** + * {@link BaseSpringApplicationRunListener#failed} + * + * @param context + * @param exception + */ + void failed(ConfigurableApplicationContext context, Throwable exception); + +} diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/listener/StartingApplicationListener.java b/hippo4j-server/src/main/java/cn/hippo4j/server/listener/StartingApplicationListener.java new file mode 100644 index 00000000..102935df --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/listener/StartingApplicationListener.java @@ -0,0 +1,78 @@ +package cn.hippo4j.server.listener; + +import cn.hippo4j.config.toolkit.EnvUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.ConfigurableApplicationContext; + +import java.nio.file.Paths; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * Starting application listener. + * + * @author chen.ma + * @date 2022/2/9 04:39 + */ +@Slf4j +public class StartingApplicationListener implements Hippo4JApplicationListener { + + private volatile boolean starting; + + private ScheduledExecutorService scheduledExecutorService; + + @Override + public void starting() { + starting = true; + } + + @Override + public void contextPrepared(ConfigurableApplicationContext context) { + if (EnvUtil.getStandaloneMode()) { + scheduledExecutorService = new ScheduledThreadPoolExecutor( + 1, + r -> { + Thread thread = new Thread(r); + thread.setName("server.hippo4j-starting"); + return thread; + } + ); + + scheduledExecutorService.scheduleWithFixedDelay(() -> { + if (starting) { + log.info("Hippo4J is starting..."); + } + }, 1, 1, TimeUnit.SECONDS); + } + } + + @Override + public void started(ConfigurableApplicationContext context) { + starting = false; + + closeExecutor(); + + if (EnvUtil.getStandaloneMode()) { + log.info("Hippo4J started successfully..."); + } + } + + @Override + public void failed(ConfigurableApplicationContext context, Throwable exception) { + log.error("Startup errors : {}", exception); + + closeExecutor(); + context.close(); + + log.error("Hippo4J failed to start, please see {} for more details.", + Paths.get(EnvUtil.getHippo4JHome(), "logs/hippo4j.log")); + } + + private void closeExecutor() { + if (scheduledExecutorService != null) { + scheduledExecutorService.shutdownNow(); + } + } + +} diff --git a/hippo4j-server/src/main/resources/META-INF/spring.factories b/hippo4j-server/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..1c596c4b --- /dev/null +++ b/hippo4j-server/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.boot.SpringApplicationRunListener=cn.hippo4j.server.listener.BaseSpringApplicationRunListener diff --git a/hippo4j-server/src/main/resources/application.properties b/hippo4j-server/src/main/resources/application.properties new file mode 100644 index 00000000..ecab75a1 --- /dev/null +++ b/hippo4j-server/src/main/resources/application.properties @@ -0,0 +1,47 @@ +#*************** Spring Boot Related Configurations ***************# +### Default Web Context Path +# server.servlet.contextPath=/hippo4j + +### Server Startup Port +server.port=6691 + +### Server Tomcat +server.tomcat.accesslog.enabled=true +server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i + +### Default Current Work Dir +server.tomcat.basedir= + +#*************** Dynamic Thread Pool Custom Configuration ***************# +### Custom Logging Tenant +tenant=hippo4j + +### Regularly clean up the historical running data of thread pool. unit: minute. +hippo4j.core.clean-history-data-period=30 +hippo4j.core.clean-history-data-enable=true + + +#*************** Config Module Related Configurations ***************# +### Data source customization section +spring.datasource.url=jdbc:mysql://localhost:3306/hippo4j_manager?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +spring.datasource.username=root +spring.datasource.password=root + +### Hikari Datasource +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.hikari.pool-name=Hikari +spring.datasource.hikari.connectionTimeout=30000 +spring.datasource.hikari.idleTimeout=30000 +spring.datasource.hikari.validationTimeout=3000 +spring.datasource.hikari.maxLifetime=120000 +spring.datasource.hikari.loginTimeout=5 +spring.datasource.hikari.minimumIdle=5 +spring.datasource.hikari.maximumPoolSize=15 +spring.datasource.hikari.connection-test-query=SELECT 1 + +### Mybatis-Plus Config +mybatis-plus.global-config.banner=false +# mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.global-config.db-config.logic-delete-field=delFlag +mybatis-plus.global-config.db-config.logic-delete-value=1 +mybatis-plus.global-config.db-config.logic-not-delete-value=0 diff --git a/hippo4j-server/src/main/resources/banner.txt b/hippo4j-server/src/main/resources/banner.txt new file mode 100644 index 00000000..984bfed3 --- /dev/null +++ b/hippo4j-server/src/main/resources/banner.txt @@ -0,0 +1,15 @@ + + ,--, ,--, ,---._ + ,--.'| ,--.'| .-- -.' \ Hippo4J ${application.version} + ,--, | : ,--, ,-.----. ,-.----. ,--, | : | | : Port: ${server.port} +,---.'| : ',--.'| \ / \ \ / \ ,---. ,---.'| : ' : ; | PID: ${pid} +| | : _' || |, | : || : | ' ,'\ ; : | | ; : | Console: http://127.0.0.1:${server.port}/index.html +: : |.' |`--'_ | | .\ :| | .\ : / / || | : _' | | : : +| ' ' ; :,' ,'| . : |: |. : |: |. ; ,. :: : |.' | : https://hippox.cn +' | .'. |' | | | | \ :| | \ :' | |: :| ' ' ; : | ; | +| | : | '| | : | : . || : . |' | .; :\ \ .'. | ___ l +' : | : ;' : |__ : |`-': |`-'| : | `---`: | ' / /\ J : +| | ' ,/ | | '.'|: : : : : : \ \ / ' ; |/ ../ `..- , +; : ;--' ; : ;| | : | | : `----' | : ;\ \ ; +| ,/ | , / `---'.| `---'.| ' ,/ \ \ ,' +'---' ---`-' `---` `---` '--' "---....--' diff --git a/hippo4j-spring-boot/.gitignore b/hippo4j-spring-boot/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-spring-boot/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/.gitignore b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/pom.xml b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/pom.xml new file mode 100644 index 00000000..6718084c --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-spring-boot + ${revision} + + + hippo4j-core-spring-boot-starter + jar + + ${project.artifactId} + 强大的动态线程池框架, 包含线程池动态调参、报警以及监控等功能, 依赖配置中心. + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + cn.hippo4j + hippo4j-core + + + + com.aliyun + alibaba-dingtalk-service-sdk + + + + log4j + log4j + + + + + + com.alibaba.nacos + nacos-client + 2.0.4 + true + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2.2.5.RELEASE + true + + + + com.ctrip.framework.apollo + apollo-client + ${apollo.version} + compile + true + + + + org.apache.curator + curator-framework + 5.1.0 + compile + true + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + io.micrometer + micrometer-core + 1.8.4 + true + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${project.artifactId} + ${project.version} + ${maven.build.timestamp} + chen.ma + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + + jar + + + + + + + + diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/common/ConfigFileTypeEnum.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/common/ConfigFileTypeEnum.java new file mode 100644 index 00000000..8d228651 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/common/ConfigFileTypeEnum.java @@ -0,0 +1,48 @@ +package cn.hippo4j.core.starter.common; + +/** + * Config file type enum. + * + * @author chen.ma + * @date 2022/2/26 18:12 + */ +public enum ConfigFileTypeEnum { + + /** + * PROPERTIES + */ + PROPERTIES { + @Override + public String type() { + return "properties"; + } + }, + + /*** + * YML + */ + YML { + @Override + public String type() { + return "yml"; + } + }, + + /*** + * YAML + */ + YAML { + @Override + public String type() { + return "yaml"; + } + }; + + /** + * Type. + * + * @return + */ + public abstract String type(); + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/BootstrapCoreProperties.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/BootstrapCoreProperties.java new file mode 100644 index 00000000..972cefd4 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/BootstrapCoreProperties.java @@ -0,0 +1,133 @@ +package cn.hippo4j.core.starter.config; + +import cn.hippo4j.core.config.BootstrapPropertiesInterface; +import cn.hippo4j.core.starter.monitor.DynamicThreadPoolMonitor; +import cn.hippo4j.core.starter.parser.ConfigFileTypeEnum; +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; +import java.util.Map; + +/** + * Bootstrap properties. + * + * @author chen.ma + * @date 2022/2/25 00:35 + */ +@Getter +@Setter +@ConfigurationProperties(prefix = BootstrapCoreProperties.PREFIX) +public class BootstrapCoreProperties implements BootstrapPropertiesInterface { + + public static final String PREFIX = "spring.dynamic.thread-pool"; + + /** + * Enable dynamic thread pool. + */ + private Boolean enable = Boolean.TRUE; + + /** + * Enabled banner. + */ + private Boolean banner = Boolean.TRUE; + + /*** + * Collect thread pool runtime indicators. + */ + private Boolean collect = Boolean.TRUE; + + /** + * Type of collection thread pool running data. eg: log,metric. Multiple can be used at the same time. + * Custom SPI support {@link DynamicThreadPoolMonitor}. + */ + private String collectType; + + /** + * Delay starting data acquisition task. unit: ms + */ + private Long initialDelay = 10000L; + + /** + * Collect interval. unit: ms + */ + private Long collectInterval = 5000L; + + /** + * Config file type. + */ + private ConfigFileTypeEnum configFileType; + + /** + * Nacos config. + */ + private Map nacos; + + /** + * Apollo config. + */ + private Map apollo; + + /** + * Zookeeper config. + */ + private Map zookeeper; + + /** + * Tomcat thread pool config. + */ + private WebThreadPoolProperties tomcat; + + /** + * Undertow thread pool config. + */ + private WebThreadPoolProperties undertow; + + /** + * Jetty thread pool config. + * KeepAliveTime is not supported temporarily. + */ + private WebThreadPoolProperties jetty; + + /** + * Notify platforms. + */ + private List notifyPlatforms; + + /** + * Whether to enable thread pool running alarm. + */ + private Boolean alarm = Boolean.TRUE; + + /** + * Check thread pool running status interval. + */ + private Integer checkStateInterval; + + /** + * Active alarm. + */ + private Integer activeAlarm; + + /** + * Capacity alarm. + */ + private Integer capacityAlarm; + + /** + * Thread pool run alarm interval. unit: s + */ + private Integer alarmInterval; + + /** + * Receive. + */ + private String receive; + + /** + * Executors. + */ + private List executors; + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/DynamicThreadPoolCoreAutoConfiguration.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/DynamicThreadPoolCoreAutoConfiguration.java new file mode 100644 index 00000000..8f522a24 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/DynamicThreadPoolCoreAutoConfiguration.java @@ -0,0 +1,149 @@ +package cn.hippo4j.core.starter.config; + +import cn.hippo4j.common.api.NotifyConfigBuilder; +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.notify.AlarmControlHandler; +import cn.hippo4j.common.notify.HippoBaseSendMessageService; +import cn.hippo4j.common.notify.HippoSendMessageService; +import cn.hippo4j.common.notify.SendMessageHandler; +import cn.hippo4j.common.notify.platform.DingSendMessageHandler; +import cn.hippo4j.common.notify.platform.LarkSendMessageHandler; +import cn.hippo4j.common.notify.platform.WeChatSendMessageHandler; +import cn.hippo4j.core.config.UtilAutoConfiguration; +import cn.hippo4j.core.config.WebThreadPoolConfiguration; +import cn.hippo4j.core.enable.MarkerConfiguration; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import cn.hippo4j.core.starter.monitor.DynamicThreadPoolMonitorExecutor; +import cn.hippo4j.core.starter.monitor.LogMonitorHandler; +import cn.hippo4j.core.starter.monitor.MetricMonitorHandler; +import cn.hippo4j.core.starter.notify.CoreNotifyConfigBuilder; +import cn.hippo4j.core.starter.refresher.ApolloRefresherHandler; +import cn.hippo4j.core.starter.refresher.NacosCloudRefresherHandler; +import cn.hippo4j.core.starter.refresher.NacosRefresherHandler; +import cn.hippo4j.core.starter.refresher.ZookeeperRefresherHandler; +import cn.hippo4j.core.starter.support.DynamicThreadPoolPostProcessor; +import lombok.AllArgsConstructor; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; + +/** + * Dynamic thread pool auto configuration. + * + * @author chen.ma + * @date 2022/2/25 00:21 + */ +@Configuration +@AllArgsConstructor +@ConditionalOnBean(MarkerConfiguration.Marker.class) +@EnableConfigurationProperties(BootstrapCoreProperties.class) +@ImportAutoConfiguration({UtilAutoConfiguration.class, WebThreadPoolConfiguration.class}) +@ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, value = "enable", matchIfMissing = true, havingValue = "true") +public class DynamicThreadPoolCoreAutoConfiguration { + + private final BootstrapCoreProperties bootstrapCoreProperties; + + private static final String NACOS_CONFIG_MANAGER_KEY = "com.alibaba.cloud.nacos.NacosConfigManager"; + + private static final String NACOS_CONFIG_KEY = "com.alibaba.nacos.api.config"; + + private static final String APOLLO_CONFIG_KEY = "com.ctrip.framework.apollo.ConfigService"; + + private static final String ZK_CONFIG_KEY = "org.apache.curator.framework.CuratorFramework"; + + @Bean + @Order(Ordered.HIGHEST_PRECEDENCE) + public ApplicationContextHolder hippo4JApplicationContextHolder() { + return new ApplicationContextHolder(); + } + + @Bean + public AlarmControlHandler alarmControlHandler() { + return new AlarmControlHandler(); + } + + @Bean + public NotifyConfigBuilder notifyConfigBuilder(AlarmControlHandler alarmControlHandler) { + return new CoreNotifyConfigBuilder(alarmControlHandler, bootstrapCoreProperties); + } + + @Bean + public HippoSendMessageService hippoSendMessageService(NotifyConfigBuilder notifyConfigBuilder, + AlarmControlHandler alarmControlHandler) { + return new HippoBaseSendMessageService(notifyConfigBuilder, alarmControlHandler); + } + + @Bean + public ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler(HippoSendMessageService hippoSendMessageService) { + return new ThreadPoolNotifyAlarmHandler(hippoSendMessageService); + } + + @Bean + public SendMessageHandler dingSendMessageHandler() { + return new DingSendMessageHandler(); + } + + @Bean + public SendMessageHandler larkSendMessageHandler() { + return new LarkSendMessageHandler(); + } + + @Bean + public SendMessageHandler weChatSendMessageHandler() { + return new WeChatSendMessageHandler(); + } + + @Bean + public DynamicThreadPoolPostProcessor dynamicThreadPoolPostProcessor(ApplicationContextHolder hippo4JApplicationContextHolder) { + return new DynamicThreadPoolPostProcessor(bootstrapCoreProperties); + } + + @Bean + @ConditionalOnClass(name = NACOS_CONFIG_KEY) + @ConditionalOnMissingClass(NACOS_CONFIG_MANAGER_KEY) + public NacosRefresherHandler nacosRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler) { + return new NacosRefresherHandler(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + } + + @Bean + @ConditionalOnClass(name = NACOS_CONFIG_MANAGER_KEY) + public NacosCloudRefresherHandler nacosCloudRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler) { + return new NacosCloudRefresherHandler(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + } + + @Bean + @ConditionalOnClass(name = APOLLO_CONFIG_KEY) + public ApolloRefresherHandler apolloRefresher(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler) { + return new ApolloRefresherHandler(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + } + + @Bean + @ConditionalOnClass(name = ZK_CONFIG_KEY) + public ZookeeperRefresherHandler zookeeperRefresher(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler) { + return new ZookeeperRefresherHandler(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + } + + @Bean + public DynamicThreadPoolMonitorExecutor hippo4jDynamicThreadPoolMonitorExecutor() { + return new DynamicThreadPoolMonitorExecutor(bootstrapCoreProperties); + } + + @Bean + public LogMonitorHandler hippo4jLogMonitorHandler(ThreadPoolRunStateHandler threadPoolRunStateHandler) { + return new LogMonitorHandler(threadPoolRunStateHandler); + } + + @Bean + public MetricMonitorHandler hippo4jMetricMonitorHandler(ThreadPoolRunStateHandler threadPoolRunStateHandler) { + return new MetricMonitorHandler(threadPoolRunStateHandler); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java new file mode 100644 index 00000000..5704ca1a --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java @@ -0,0 +1,80 @@ +package cn.hippo4j.core.starter.config; + +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import com.google.common.collect.Maps; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Map; +import java.util.Objects; + +/** + * Executor properties. + * + * @author chen.ma + * @date 2022/2/25 00:40 + */ +@Data +@Accessors(chain = true) +public class ExecutorProperties { + + /** + * threadPoolId + */ + private String threadPoolId; + + /** + * corePoolSize + */ + private Integer corePoolSize; + + /** + * maximumPoolSize + */ + private Integer maximumPoolSize; + + /** + * queueCapacity + */ + private Integer queueCapacity; + + /** + * blockingQueue + */ + private String blockingQueue; + + /** + * rejectedHandler + */ + private String rejectedHandler; + + /** + * keepAliveTime + */ + private Long keepAliveTime; + + /** + * executeTimeOut + */ + private Long executeTimeOut; + + /** + * allowCoreThreadTimeOut + */ + private Boolean allowCoreThreadTimeOut; + + /** + * threadNamePrefix + */ + private String threadNamePrefix; + + /** + * Notify + */ + private ThreadPoolNotifyAlarm notify; + + public Map receives() { + return Objects.isNull(this.notify) || this.notify.getReceives() == null ? Maps.newHashMap() : this.notify.getReceives(); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/NotifyPlatformProperties.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/NotifyPlatformProperties.java new file mode 100644 index 00000000..157fff36 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/NotifyPlatformProperties.java @@ -0,0 +1,24 @@ +package cn.hippo4j.core.starter.config; + +import lombok.Data; + +/** + * Notify platform properties. + * + * @author chen.ma + * @date 2022/2/25 19:29 + */ +@Data +public class NotifyPlatformProperties { + + /** + * Platform. + */ + private String platform; + + /** + * Secret key. + */ + private String secretKey; + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/WebThreadPoolProperties.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/WebThreadPoolProperties.java new file mode 100644 index 00000000..8794863c --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/WebThreadPoolProperties.java @@ -0,0 +1,29 @@ +package cn.hippo4j.core.starter.config; + +import lombok.Data; + +/** + * Web thread pool properties. + * + * @author chen.ma + * @date 2022/3/11 19:23 + */ +@Data +public class WebThreadPoolProperties { + + /** + * Core pool size + */ + private Integer corePoolSize; + + /** + * Maximum pool size + */ + private Integer maximumPoolSize; + + /** + * Keep alive time + */ + private Integer keepAliveTime; + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/AbstractDynamicThreadPoolMonitor.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/AbstractDynamicThreadPoolMonitor.java new file mode 100644 index 00000000..2c7e2680 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/AbstractDynamicThreadPoolMonitor.java @@ -0,0 +1,37 @@ +package cn.hippo4j.core.starter.monitor; + +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +/** + * Abstract dynamic thread-pool monitor. + * + * @author chen.ma + * @date 2022/3/25 12:07 + */ +@RequiredArgsConstructor +public abstract class AbstractDynamicThreadPoolMonitor implements DynamicThreadPoolMonitor { + + private final ThreadPoolRunStateHandler threadPoolRunStateHandler; + + /** + * Execute. + * + * @param poolRunStateInfo + */ + protected abstract void execute(PoolRunStateInfo poolRunStateInfo); + + @Override + public void collect() { + List listDynamicThreadPoolId = GlobalThreadPoolManage.listThreadPoolId(); + for (String each : listDynamicThreadPoolId) { + PoolRunStateInfo poolRunState = threadPoolRunStateHandler.getPoolRunState(each); + execute(poolRunState); + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/DynamicThreadPoolMonitor.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/DynamicThreadPoolMonitor.java new file mode 100644 index 00000000..f97a0fc1 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/DynamicThreadPoolMonitor.java @@ -0,0 +1,11 @@ +package cn.hippo4j.core.starter.monitor; + +/** + * Dynamic thread-pool monitor. + * + * @author chen.ma + * @date 2022/3/25 19:03 + */ +public interface DynamicThreadPoolMonitor extends ThreadPoolMonitor { + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/DynamicThreadPoolMonitorExecutor.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/DynamicThreadPoolMonitorExecutor.java new file mode 100644 index 00000000..da5f5c20 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/DynamicThreadPoolMonitorExecutor.java @@ -0,0 +1,83 @@ +package cn.hippo4j.core.starter.monitor; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import cn.hippo4j.core.spi.DynamicThreadPoolServiceLoader; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import com.google.common.collect.Lists; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * Dynamic thread-pool monitor executor. + * + * @author chen.ma + * @date 2022/3/25 19:29 + */ +@Slf4j +@RequiredArgsConstructor +public class DynamicThreadPoolMonitorExecutor implements ApplicationRunner { + + private final BootstrapCoreProperties properties; + + private ScheduledThreadPoolExecutor collectExecutor; + + private List threadPoolMonitors; + + @Override + public void run(ApplicationArguments args) throws Exception { + String collectType = properties.getCollectType(); + if (!properties.getCollect() || StringUtil.isBlank(collectType)) { + return; + } + + log.info("Start monitoring the running status of dynamic thread pool."); + threadPoolMonitors = Lists.newArrayList(); + + String collectTaskName = "client.scheduled.collect.data"; + collectExecutor = new ScheduledThreadPoolExecutor( + new Integer(1), + ThreadFactoryBuilder.builder().daemon(true).prefix(collectTaskName).build() + ); + + // Get dynamic thread pool monitoring component. + List collectTypes = Arrays.asList(collectType.split(",")); + ApplicationContextHolder.getBeansOfType(ThreadPoolMonitor.class) + .forEach((key, val) -> { + if (collectTypes.contains(val.getType())) { + threadPoolMonitors.add(val); + } + }); + Collection dynamicThreadPoolMonitors = + DynamicThreadPoolServiceLoader.getSingletonServiceInstances(DynamicThreadPoolMonitor.class); + dynamicThreadPoolMonitors.stream().filter(each -> collectTypes.contains(each.getType())).forEach(each -> threadPoolMonitors.add(each)); + + // Execute dynamic thread pool monitoring component. + collectExecutor.scheduleWithFixedDelay( + () -> scheduleRunnable(), + properties.getInitialDelay(), + properties.getCollectInterval(), + TimeUnit.MILLISECONDS + ); + } + + private void scheduleRunnable() { + for (ThreadPoolMonitor each : threadPoolMonitors) { + try { + each.collect(); + } catch (Exception ex) { + log.error("Error monitoring the running status of dynamic thread pool. Type :: {}", each.getType(), ex); + } + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/LogMonitorHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/LogMonitorHandler.java new file mode 100644 index 00000000..74101241 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/LogMonitorHandler.java @@ -0,0 +1,31 @@ +package cn.hippo4j.core.starter.monitor; + +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import lombok.extern.slf4j.Slf4j; + +/** + * Log monitor handler. + * + * @author chen.ma + * @date 2022/3/25 19:22 + */ +@Slf4j +public class LogMonitorHandler extends AbstractDynamicThreadPoolMonitor { + + public LogMonitorHandler(ThreadPoolRunStateHandler threadPoolRunStateHandler) { + super(threadPoolRunStateHandler); + } + + @Override + protected void execute(PoolRunStateInfo poolRunStateInfo) { + log.info("{}", JSONUtil.toJSONString(poolRunStateInfo)); + } + + @Override + public String getType() { + return "log"; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/MetricMonitorHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/MetricMonitorHandler.java new file mode 100644 index 00000000..5c72592b --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/MetricMonitorHandler.java @@ -0,0 +1,78 @@ +package cn.hippo4j.core.starter.monitor; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import cn.hutool.core.bean.BeanUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import io.micrometer.core.instrument.Metrics; +import io.micrometer.core.instrument.Tag; +import org.springframework.core.env.Environment; + +import java.util.Map; + +/** + * Metric monitor handler. + * + * @author chen.ma + * @date 2022/3/25 20:37 + */ +public class MetricMonitorHandler extends AbstractDynamicThreadPoolMonitor { + + private final static String METRIC_NAME_PREFIX = "dynamic.thread-pool"; + + private final static String DYNAMIC_THREAD_POOL_ID_TAG = METRIC_NAME_PREFIX + ".id"; + + private final static String APPLICATION_NAME_TAG = "application.name"; + + private final Map RUN_STATE_CACHE = Maps.newConcurrentMap(); + + public MetricMonitorHandler(ThreadPoolRunStateHandler threadPoolRunStateHandler) { + super(threadPoolRunStateHandler); + } + + @Override + protected void execute(PoolRunStateInfo poolRunStateInfo) { + PoolRunStateInfo stateInfo = RUN_STATE_CACHE.get(poolRunStateInfo.getTpId()); + if (stateInfo == null) { + RUN_STATE_CACHE.put(poolRunStateInfo.getTpId(), poolRunStateInfo); + } else { + BeanUtil.copyProperties(poolRunStateInfo, stateInfo); + } + + Environment environment = ApplicationContextHolder.getInstance().getEnvironment(); + String applicationName = environment.getProperty("spring.application.name", "application"); + Iterable tags = Lists.newArrayList( + Tag.of(DYNAMIC_THREAD_POOL_ID_TAG, poolRunStateInfo.getTpId()), + Tag.of(APPLICATION_NAME_TAG, applicationName) + ); + + // load + Metrics.gauge(metricName("current.load"), tags, poolRunStateInfo, PoolRunStateInfo::getSimpleCurrentLoad); + Metrics.gauge(metricName("peak.load"), tags, poolRunStateInfo, PoolRunStateInfo::getSimplePeakLoad); + // thread pool + Metrics.gauge(metricName("core.size"), tags, poolRunStateInfo, PoolRunStateInfo::getCoreSize); + Metrics.gauge(metricName("maximum.size"), tags, poolRunStateInfo, PoolRunStateInfo::getMaximumSize); + Metrics.gauge(metricName("current.size"), tags, poolRunStateInfo, PoolRunStateInfo::getPoolSize); + Metrics.gauge(metricName("largest.size"), tags, poolRunStateInfo, PoolRunStateInfo::getLargestPoolSize); + Metrics.gauge(metricName("active.size"), tags, poolRunStateInfo, PoolRunStateInfo::getActiveSize); + // queue + Metrics.gauge(metricName("queue.size"), tags, poolRunStateInfo, PoolRunStateInfo::getQueueSize); + Metrics.gauge(metricName("queue.capacity"), tags, poolRunStateInfo, PoolRunStateInfo::getQueueCapacity); + Metrics.gauge(metricName("queue.remaining.capacity"), tags, poolRunStateInfo, PoolRunStateInfo::getQueueRemainingCapacity); + // other + Metrics.gauge(metricName("completed.task.count"), tags, poolRunStateInfo, PoolRunStateInfo::getCompletedTaskCount); + Metrics.gauge(metricName("reject.count"), tags, poolRunStateInfo, PoolRunStateInfo::getRejectCount); + } + + private String metricName(String name) { + return String.join(".", METRIC_NAME_PREFIX, name); + } + + @Override + public String getType() { + return "metric"; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/ThreadPoolMonitor.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/ThreadPoolMonitor.java new file mode 100644 index 00000000..0bc00ddb --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/monitor/ThreadPoolMonitor.java @@ -0,0 +1,23 @@ +package cn.hippo4j.core.starter.monitor; + +/** + * Thread-pool monitor. + * + * @author chen.ma + * @date 2022/3/25 19:03 + */ +public interface ThreadPoolMonitor { + + /** + * Get type. + * + * @return + */ + String getType(); + + /** + * Collect data. + */ + void collect(); + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java new file mode 100644 index 00000000..320797e0 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java @@ -0,0 +1,118 @@ +package cn.hippo4j.core.starter.notify; + +import cn.hippo4j.common.api.NotifyConfigBuilder; +import cn.hippo4j.common.notify.AlarmControlHandler; +import cn.hippo4j.common.notify.NotifyConfigDTO; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.starter.config.ExecutorProperties; +import cn.hippo4j.core.starter.config.NotifyPlatformProperties; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.AllArgsConstructor; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * Core notify config builder. + * + * @author chen.ma + * @date 2022/2/25 00:24 + */ +@AllArgsConstructor +public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { + + private final AlarmControlHandler alarmControlHandler; + + private final BootstrapCoreProperties bootstrapCoreProperties; + + @Override + public Map> buildNotify() { + Map> resultMap = Maps.newHashMap(); + + List executors = bootstrapCoreProperties.getExecutors(); + if (null != executors) { + for (ExecutorProperties executor : executors) { + resultMap.putAll(buildSingleNotifyConfig(executor)); + } + } + + return resultMap; + } + + /** + * Build single notify config. + * + * @param executor + * @return + */ + public Map> buildSingleNotifyConfig(ExecutorProperties executor) { + Map> resultMap = Maps.newHashMap(); + String threadPoolId = executor.getThreadPoolId(); + String alarmBuildKey = threadPoolId + "+ALARM"; + List alarmNotifyConfigs = Lists.newArrayList(); + + List notifyPlatforms = bootstrapCoreProperties.getNotifyPlatforms(); + for (NotifyPlatformProperties platformProperties : notifyPlatforms) { + NotifyConfigDTO notifyConfig = new NotifyConfigDTO(); + notifyConfig.setPlatform(platformProperties.getPlatform()); + notifyConfig.setTpId(threadPoolId); + notifyConfig.setType("ALARM"); + notifyConfig.setSecretKey(platformProperties.getSecretKey()); + int interval = Optional.ofNullable(executor.getNotify()) + .map(each -> each.getInterval()) + .orElseGet(() -> bootstrapCoreProperties.getAlarmInterval() != null ? bootstrapCoreProperties.getAlarmInterval() : 5); + notifyConfig.setInterval(interval); + notifyConfig.setReceives(buildReceive(executor, platformProperties)); + alarmNotifyConfigs.add(notifyConfig); + } + resultMap.put(alarmBuildKey, alarmNotifyConfigs); + + String changeBuildKey = threadPoolId + "+CONFIG"; + List changeNotifyConfigs = Lists.newArrayList(); + + for (NotifyPlatformProperties platformProperties : notifyPlatforms) { + NotifyConfigDTO notifyConfig = new NotifyConfigDTO(); + notifyConfig.setPlatform(platformProperties.getPlatform()); + notifyConfig.setTpId(threadPoolId); + notifyConfig.setType("CONFIG"); + notifyConfig.setSecretKey(platformProperties.getSecretKey()); + notifyConfig.setReceives(buildReceive(executor, platformProperties)); + changeNotifyConfigs.add(notifyConfig); + } + resultMap.put(changeBuildKey, changeNotifyConfigs); + + resultMap.forEach( + (key, val) -> val.stream() + .filter(each -> StrUtil.equals("ALARM", each.getType())) + .forEach(each -> alarmControlHandler.initCacheAndLock(each.getTpId(), each.getPlatform(), each.getInterval())) + ); + + return resultMap; + } + + private String buildReceive(ExecutorProperties executor, NotifyPlatformProperties platformProperties) { + String receive; + if (executor.getNotify() != null) { + receive = executor.getNotify().getReceive(); + if (StrUtil.isBlank(receive)) { + receive = bootstrapCoreProperties.getReceive(); + if (StrUtil.isBlank(receive)) { + Map receives = executor.receives(); + receive = receives.get(platformProperties.getPlatform()); + } + } + } else { + receive = bootstrapCoreProperties.getReceive(); + if (StrUtil.isBlank(receive)) { + Map receives = executor.receives(); + receive = receives.get(platformProperties.getPlatform()); + } + } + + return receive; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/AbstractConfigParser.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/AbstractConfigParser.java new file mode 100644 index 00000000..cc59920c --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/AbstractConfigParser.java @@ -0,0 +1,15 @@ +package cn.hippo4j.core.starter.parser; + +/** + * @author : wh + * @date : 2022/3/1 07:50 + * @description: + */ +public abstract class AbstractConfigParser implements ConfigParser { + + @Override + public boolean supports(ConfigFileTypeEnum type) { + return getConfigFileTypes().contains(type); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigFileTypeEnum.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigFileTypeEnum.java new file mode 100644 index 00000000..cba9c46d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigFileTypeEnum.java @@ -0,0 +1,35 @@ +package cn.hippo4j.core.starter.parser; + +import lombok.Getter; + +/** + * @author : wh + * @date : 2022/3/1 07:47 + * @description: + */ +@Getter +public enum ConfigFileTypeEnum { + + PROPERTIES("properties"), + XML("xml"), + JSON("json"), + YML("yml"), + YAML("yaml"), + TXT("txt"); + + private final String value; + + ConfigFileTypeEnum(String value) { + this.value = value; + } + + public static ConfigFileTypeEnum of(String value) { + for (ConfigFileTypeEnum typeEnum : ConfigFileTypeEnum.values()) { + if (typeEnum.value.equals(value)) { + return typeEnum; + } + } + return PROPERTIES; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigParser.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigParser.java new file mode 100644 index 00000000..eb4e0a8f --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigParser.java @@ -0,0 +1,38 @@ +package cn.hippo4j.core.starter.parser; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * @author : wh + * @date : 2022/3/1 07:47 + * @description: + */ +public interface ConfigParser { + + /** + * Supports. + * + * @param type + * @return + */ + boolean supports(ConfigFileTypeEnum type); + + /** + * Do parse. + * + * @param content + * @return + * @throws IOException + */ + Map doParse(String content) throws IOException; + + /** + * Get config file types. + * + * @return + */ + List getConfigFileTypes(); + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigParserHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigParserHandler.java new file mode 100644 index 00000000..b349f556 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/ConfigParserHandler.java @@ -0,0 +1,48 @@ +package cn.hippo4j.core.starter.parser; + +import com.google.common.collect.Lists; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.ServiceLoader; + +/** + * @author : wh + * @date : 2022/3/1 08:02 + * @description: + */ +public class ConfigParserHandler { + + private static final List PARSERS = Lists.newArrayList(); + + private ConfigParserHandler() { + ServiceLoader loader = ServiceLoader.load(ConfigParser.class); + for (ConfigParser configParser : loader) { + PARSERS.add(configParser); + } + + PARSERS.add(new PropertiesConfigParser()); + PARSERS.add(new YamlConfigParser()); + } + + public Map parseConfig(String content, ConfigFileTypeEnum type) throws IOException { + for (ConfigParser parser : PARSERS) { + if (parser.supports(type)) { + return parser.doParse(content); + } + } + + return Collections.emptyMap(); + } + + public static ConfigParserHandler getInstance() { + return ConfigParserHandlerHolder.INSTANCE; + } + + private static class ConfigParserHandlerHolder { + private static final ConfigParserHandler INSTANCE = new ConfigParserHandler(); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/PropertiesConfigParser.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/PropertiesConfigParser.java new file mode 100644 index 00000000..aed1b724 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/PropertiesConfigParser.java @@ -0,0 +1,30 @@ +package cn.hippo4j.core.starter.parser; + +import com.google.common.collect.Lists; + +import java.io.IOException; +import java.io.StringReader; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +/** + * @author : wh + * @date : 2022/3/1 07:49 + * @description: + */ +public class PropertiesConfigParser extends AbstractConfigParser { + + @Override + public Map doParse(String content) throws IOException { + Properties properties = new Properties(); + properties.load(new StringReader(content)); + return properties; + } + + @Override + public List getConfigFileTypes() { + return Lists.newArrayList(ConfigFileTypeEnum.PROPERTIES); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/YamlConfigParser.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/YamlConfigParser.java new file mode 100644 index 00000000..5ae8f54b --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/parser/YamlConfigParser.java @@ -0,0 +1,36 @@ +package cn.hippo4j.core.starter.parser; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.util.StringUtils; + +import java.util.List; +import java.util.Map; + +/** + * @author : wh + * @date : 2022/3/1 07:57 + * @description: + */ +public class YamlConfigParser extends AbstractConfigParser { + + @Override + public Map doParse(String content) { + if (StringUtils.isEmpty(content)) { + return Maps.newHashMapWithExpectedSize(0); + } + + YamlPropertiesFactoryBean bean = new YamlPropertiesFactoryBean(); + bean.setResources(new ByteArrayResource(content.getBytes())); + + return bean.getObject(); + } + + @Override + public List getConfigFileTypes() { + return Lists.newArrayList(ConfigFileTypeEnum.YML, ConfigFileTypeEnum.YAML); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java new file mode 100644 index 00000000..db041b04 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java @@ -0,0 +1,321 @@ +package cn.hippo4j.core.starter.refresher; + +import cn.hippo4j.common.api.ThreadPoolDynamicRefresh; +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.notify.HippoBaseSendMessageService; +import cn.hippo4j.common.notify.NotifyConfigDTO; +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hippo4j.core.executor.web.WebThreadPoolHandlerChoose; +import cn.hippo4j.core.executor.web.WebThreadPoolService; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.executor.manage.GlobalNotifyAlarmManage; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.support.*; +import cn.hippo4j.core.proxy.RejectedProxyUtil; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.starter.config.ExecutorProperties; +import cn.hippo4j.core.starter.config.WebThreadPoolProperties; +import cn.hippo4j.core.starter.notify.CoreNotifyConfigBuilder; +import cn.hippo4j.core.starter.parser.ConfigParserHandler; +import cn.hippo4j.core.starter.support.GlobalCoreThreadPoolManage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.InitializingBean; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Abstract core thread pool dynamic refresh. + * + * @author chen.ma + * @date 2022/2/26 12:42 + */ +@Slf4j +@AllArgsConstructor +public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh, InitializingBean { + + private final ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler; + + protected final BootstrapCoreProperties bootstrapCoreProperties; + + protected final ExecutorService dynamicRefreshExecutorService = ThreadPoolBuilder.builder() + .threadFactory("client.dynamic.refresh") + .singlePool() + .build(); + + @Override + public void dynamicRefresh(String content) { + Map configInfo; + try { + configInfo = ConfigParserHandler.getInstance().parseConfig(content, bootstrapCoreProperties.getConfigFileType()); + } catch (IOException e) { + log.error("dynamic-thread-pool parse config file error, content: {}, fileType: {}", + content, bootstrapCoreProperties.getConfigFileType(), e); + return; + } + + BootstrapCoreProperties bindableCoreProperties = BootstrapCorePropertiesBinderAdapt.bootstrapCorePropertiesBinder(configInfo, bootstrapCoreProperties); + + // web pool + refreshWebExecutor(bindableCoreProperties); + // platforms + refreshPlatforms(bindableCoreProperties); + // executors + refreshExecutors(bindableCoreProperties); + } + + /** + * register notify alarm manage + */ + public void registerNotifyAlarmManage() { + bootstrapCoreProperties.getExecutors().forEach(executorProperties -> { + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = new ThreadPoolNotifyAlarm( + executorProperties.getNotify().getIsAlarm(), + executorProperties.getNotify().getCapacityAlarm(), + executorProperties.getNotify().getActiveAlarm() + ); + + threadPoolNotifyAlarm.setInterval(executorProperties.getNotify().getInterval()); + threadPoolNotifyAlarm.setReceives(executorProperties.receives()); + GlobalNotifyAlarmManage.put(executorProperties.getThreadPoolId(), threadPoolNotifyAlarm); + }); + } + + /** + * Refresh web executor. + * + * @param bindableCoreProperties + */ + private void refreshWebExecutor(BootstrapCoreProperties bindableCoreProperties) { + boolean isNullFlag = bindableCoreProperties.getJetty() == null + || bindableCoreProperties.getUndertow() == null + || bindableCoreProperties.getTomcat() == null; + if (isNullFlag) { + return; + } + + try { + PoolParameterInfo nowParameter = buildWebPoolParameter(bindableCoreProperties); + if (nowParameter != null) { + WebThreadPoolHandlerChoose webThreadPoolHandlerChoose = ApplicationContextHolder.getBean(WebThreadPoolHandlerChoose.class); + WebThreadPoolService webThreadPoolService = webThreadPoolHandlerChoose.choose(); + + PoolParameter beforeParameter = webThreadPoolService.getWebThreadPoolParameter(); + if (!Objects.equals(beforeParameter.getCoreSize(), nowParameter.getCoreSize()) + || !Objects.equals(beforeParameter.getMaxSize(), nowParameter.getMaxSize()) + || !Objects.equals(beforeParameter.getMaxSize(), nowParameter.getMaxSize())) { + webThreadPoolService.updateWebThreadPool(nowParameter); + } + } + } catch (Exception ex) { + log.error("Failed to modify web thread pool.", ex); + } + } + + /** + * Refresh platform. + * + * @param bindableCoreProperties + */ + private void refreshPlatforms(BootstrapCoreProperties bindableCoreProperties) { + List executors = bindableCoreProperties.getExecutors(); + for (ExecutorProperties executor : executors) { + String threadPoolId = executor.getThreadPoolId(); + DynamicThreadPoolWrapper wrapper = GlobalThreadPoolManage.getExecutorService(threadPoolId); + if (!wrapper.isInitFlag()) { + HippoBaseSendMessageService sendMessageService = ApplicationContextHolder.getBean(HippoBaseSendMessageService.class); + CoreNotifyConfigBuilder configBuilder = ApplicationContextHolder.getBean(CoreNotifyConfigBuilder.class); + Map> notifyConfig = configBuilder.buildSingleNotifyConfig(executor); + sendMessageService.putPlatform(notifyConfig); + + wrapper.setInitFlag(Boolean.TRUE); + } + } + } + + /** + * Refresh executors. + * + * @param bindableCoreProperties + */ + private void refreshExecutors(BootstrapCoreProperties bindableCoreProperties) { + List executors = bindableCoreProperties.getExecutors(); + for (ExecutorProperties properties : executors) { + String threadPoolId = properties.getThreadPoolId(); + if (!checkConsistency(threadPoolId, properties)) { + continue; + } + + dynamicRefreshPool(threadPoolId, properties); + + ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId()); + ChangeParameterNotifyRequest changeRequest = new ChangeParameterNotifyRequest(); + changeRequest.setBeforeCorePoolSize(beforeProperties.getCorePoolSize()); + changeRequest.setBeforeMaximumPoolSize(beforeProperties.getMaximumPoolSize()); + changeRequest.setBeforeAllowsCoreThreadTimeOut(beforeProperties.getAllowCoreThreadTimeOut()); + changeRequest.setBeforeKeepAliveTime(beforeProperties.getKeepAliveTime()); + changeRequest.setBlockingQueueName(beforeProperties.getBlockingQueue()); + changeRequest.setBeforeQueueCapacity(beforeProperties.getQueueCapacity()); + changeRequest.setBeforeRejectedName(beforeProperties.getRejectedHandler()); + changeRequest.setBeforeExecuteTimeOut(beforeProperties.getExecuteTimeOut()); + changeRequest.setThreadPoolId(beforeProperties.getThreadPoolId()); + + changeRequest.setNowCorePoolSize(properties.getCorePoolSize()); + changeRequest.setNowMaximumPoolSize(properties.getMaximumPoolSize()); + changeRequest.setNowAllowsCoreThreadTimeOut(properties.getAllowCoreThreadTimeOut()); + changeRequest.setNowKeepAliveTime(properties.getKeepAliveTime()); + changeRequest.setNowQueueCapacity(properties.getQueueCapacity()); + changeRequest.setNowRejectedName(properties.getRejectedHandler()); + changeRequest.setNowExecuteTimeOut(properties.getExecuteTimeOut()); + + GlobalCoreThreadPoolManage.refresh(threadPoolId, properties); + log.info( + "[{}] Changed thread pool. " + + "\n coreSize :: [{}]" + + "\n maxSize :: [{}]" + + "\n queueType :: [{}]" + + "\n capacity :: [{}]" + + "\n keepAliveTime :: [{}]" + + "\n executeTimeOut :: [{}]" + + "\n rejectedType :: [{}]" + + "\n allowCoreThreadTimeOut :: [{}]", + threadPoolId.toUpperCase(), + String.format("%s => %s", beforeProperties.getCorePoolSize(), properties.getCorePoolSize()), + String.format("%s => %s", beforeProperties.getMaximumPoolSize(), properties.getMaximumPoolSize()), + String.format("%s => %s", beforeProperties.getBlockingQueue(), properties.getBlockingQueue()), + String.format("%s => %s", beforeProperties.getQueueCapacity(), properties.getQueueCapacity()), + String.format("%s => %s", beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime()), + String.format("%s => %s", beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut()), + String.format("%s => %s", beforeProperties.getRejectedHandler(), properties.getRejectedHandler()), + String.format("%s => %s", beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut()) + ); + + try { + threadPoolNotifyAlarmHandler.sendPoolConfigChange(changeRequest); + } catch (Throwable ex) { + log.error("Failed to send change notice. Message :: {}", ex.getMessage()); + } + } + } + + /** + * Check consistency. + * + * @param threadPoolId + * @param properties + */ + private boolean checkConsistency(String threadPoolId, ExecutorProperties properties) { + ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId()); + ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); + + boolean result = !Objects.equals(beforeProperties.getCorePoolSize(), properties.getCorePoolSize()) + || !Objects.equals(beforeProperties.getMaximumPoolSize(), properties.getMaximumPoolSize()) + || !Objects.equals(beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut()) + || !Objects.equals(beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut()) + || !Objects.equals(beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime()) + || !Objects.equals(beforeProperties.getRejectedHandler(), properties.getRejectedHandler()) + || + ( + !Objects.equals(beforeProperties.getQueueCapacity(), properties.getQueueCapacity()) + && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.name, executor.getQueue().getClass().getSimpleName()) + ); + + return result; + } + + /** + * Dynamic refresh pool. + * + * @param threadPoolId + * @param properties + */ + private void dynamicRefreshPool(String threadPoolId, ExecutorProperties properties) { + ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId()); + + ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); + if (!Objects.equals(beforeProperties.getCorePoolSize(), properties.getCorePoolSize())) { + executor.setCorePoolSize(properties.getCorePoolSize()); + } + + if (!Objects.equals(beforeProperties.getMaximumPoolSize(), properties.getMaximumPoolSize())) { + executor.setMaximumPoolSize(properties.getMaximumPoolSize()); + } + + if (!Objects.equals(beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut())) { + executor.allowCoreThreadTimeOut(properties.getAllowCoreThreadTimeOut()); + } + + if (!Objects.equals(beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut())) { + if (executor instanceof AbstractDynamicExecutorSupport) { + ((DynamicThreadPoolExecutor) executor).setExecuteTimeOut(properties.getExecuteTimeOut()); + } + } + + if (!Objects.equals(beforeProperties.getRejectedHandler(), properties.getRejectedHandler())) { + RejectedExecutionHandler rejectedExecutionHandler = RejectedTypeEnum.createPolicy(properties.getRejectedHandler()); + if (executor instanceof AbstractDynamicExecutorSupport) { + DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) executor; + dynamicExecutor.setRedundancyHandler(rejectedExecutionHandler); + AtomicLong rejectCount = dynamicExecutor.getRejectCount(); + rejectedExecutionHandler = RejectedProxyUtil.createProxy(rejectedExecutionHandler, threadPoolId, rejectCount); + } + + executor.setRejectedExecutionHandler(rejectedExecutionHandler); + } + + if (!Objects.equals(beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime())) { + executor.setKeepAliveTime(properties.getKeepAliveTime(), TimeUnit.SECONDS); + } + + if (!Objects.equals(beforeProperties.getQueueCapacity(), properties.getQueueCapacity()) + && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.name, executor.getQueue().getClass().getSimpleName())) { + if (executor.getQueue() instanceof ResizableCapacityLinkedBlockIngQueue) { + ResizableCapacityLinkedBlockIngQueue queue = (ResizableCapacityLinkedBlockIngQueue) executor.getQueue(); + queue.setCapacity(properties.getQueueCapacity()); + } else { + log.warn("The queue length cannot be modified. Queue type mismatch. Current queue type :: {}", executor.getQueue().getClass().getSimpleName()); + } + } + } + + /** + * Build web pool parameter. + * + * @param bindableCoreProperties + * @return + */ + private PoolParameterInfo buildWebPoolParameter(BootstrapCoreProperties bindableCoreProperties) { + PoolParameterInfo parameterInfo = null; + WebThreadPoolProperties poolProperties = null; + if (bindableCoreProperties.getTomcat() != null) { + poolProperties = bindableCoreProperties.getTomcat(); + } else if (bindableCoreProperties.getUndertow() != null) { + poolProperties = bindableCoreProperties.getUndertow(); + } else if (bindableCoreProperties.getJetty() != null) { + poolProperties = bindableCoreProperties.getJetty(); + } + + if (poolProperties != null) { + parameterInfo = new PoolParameterInfo(); + parameterInfo.setCoreSize(poolProperties.getCorePoolSize()); + parameterInfo.setMaxSize(poolProperties.getMaximumPoolSize()); + parameterInfo.setKeepAliveTime(poolProperties.getKeepAliveTime()); + } + + return parameterInfo; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/ApolloRefresherHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/ApolloRefresherHandler.java new file mode 100644 index 00000000..b168a5d2 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/ApolloRefresherHandler.java @@ -0,0 +1,50 @@ +package cn.hippo4j.core.starter.refresher; + +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import com.ctrip.framework.apollo.Config; +import com.ctrip.framework.apollo.ConfigChangeListener; +import com.ctrip.framework.apollo.ConfigFile; +import com.ctrip.framework.apollo.ConfigService; +import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; + +/** + * @author : wh + * @date : 2022/2/28 21:32 + * @description: + */ +@Slf4j +public class ApolloRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh { + + private static final String APOLLO_PROPERTY = "${spring.dynamic.thread-pool.apollo.namespace:application}"; + + @Value(APOLLO_PROPERTY) + private String namespace; + + public ApolloRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler, BootstrapCoreProperties bootstrapCoreProperties) { + super(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + } + + @Override + public void afterPropertiesSet() { + String[] apolloNamespaces = this.namespace.split(","); + this.namespace = apolloNamespaces[0]; + Config config = ConfigService.getConfig(namespace); + + ConfigChangeListener configChangeListener = configChangeEvent -> { + ConfigFile configFile = ConfigService.getConfigFile( + namespace, + ConfigFileFormat.fromString(bootstrapCoreProperties.getConfigFileType().getValue()) + ); + + String configInfo = configFile.getContent(); + dynamicRefresh(configInfo); + }; + + config.addChangeListener(configChangeListener); + log.info("dynamic-thread-pool refresher, add apollo listener success, namespace: {}", namespace); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/BootstrapCorePropertiesBinderAdapt.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/BootstrapCorePropertiesBinderAdapt.java new file mode 100644 index 00000000..dfdfc98d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/BootstrapCorePropertiesBinderAdapt.java @@ -0,0 +1,172 @@ +package cn.hippo4j.core.starter.refresher; + +import cn.hippo4j.common.notify.NotifyPlatformEnum; +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import cn.hippo4j.common.toolkit.CollectionUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.starter.config.ExecutorProperties; +import cn.hippo4j.core.starter.config.NotifyPlatformProperties; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.springframework.boot.context.properties.bind.Bindable; +import org.springframework.boot.context.properties.bind.Binder; +import org.springframework.boot.context.properties.source.ConfigurationPropertySource; +import org.springframework.boot.context.properties.source.MapConfigurationPropertySource; + +import java.util.List; +import java.util.Map; + +import static cn.hippo4j.core.starter.config.BootstrapCoreProperties.PREFIX; + +/** + * Bootstrap core properties binder adapt. + * + * @author chen.ma + * @date 2022/3/9 19:04 + */ +public class BootstrapCorePropertiesBinderAdapt { + + /** + * Bootstrap core properties binder. + * + * @param configInfo + * @param bootstrapCoreProperties + * @return + */ + public static BootstrapCoreProperties bootstrapCorePropertiesBinder(Map configInfo, BootstrapCoreProperties bootstrapCoreProperties) { + BootstrapCoreProperties bindableCoreProperties = null; + try { + ConfigurationPropertySource sources = new MapConfigurationPropertySource(configInfo); + Binder binder = new Binder(sources); + bindableCoreProperties = binder.bind(PREFIX, Bindable.ofInstance(bootstrapCoreProperties)).get(); + } catch (Exception ex) { + try { + Class.forName("org.springframework.boot.context.properties.bind.Binder"); + } catch (ClassNotFoundException notEx) { + bindableCoreProperties = adapt(configInfo); + } + } + + return bindableCoreProperties; + } + + /** + * 此处采用硬编码适配低版本 SpringBoot 1.5.x, 如果有更好的方法进行逻辑转换的话, 欢迎 PR. + * + * @param configInfo + * @return + */ + @Deprecated + private static BootstrapCoreProperties adapt(Map configInfo) { + BootstrapCoreProperties bindableCoreProperties; + try { + // filter + Map targetMap = Maps.newHashMap(); + configInfo.forEach((key, val) -> { + boolean containFlag = key != null + && StringUtil.isNotBlank((String) key) + && ( + ((String) key).indexOf(PREFIX + ".executors") != -1 + || ((String) key).indexOf(PREFIX + ".notify-platforms") != -1 + || ((String) key).indexOf(PREFIX + ".notifyPlatforms") != -1 + ); + if (containFlag) { + String targetKey = key.toString().replace(PREFIX + ".", ""); + targetMap.put(targetKey, val); + } + }); + + // convert + List executorPropertiesList = Lists.newArrayList(); + List notifyPropertiesList = Lists.newArrayList(); + for (int i = 0; i < Integer.MAX_VALUE; i++) { + Map executorSingleMap = Maps.newHashMap(); + Map platformSingleMap = Maps.newHashMap(); + Map notifySingleMap = Maps.newHashMap(); + + for (Map.Entry entry : targetMap.entrySet()) { + String key = entry.getKey().toString(); + if (key.indexOf("executors[" + i + "].") != -1) { + if (key.indexOf("executors[" + i + "].notify.") != -1) { + key = key.replace("executors[" + i + "].notify.", ""); + String[] notifyKeySplit = key.split("-"); + if (notifyKeySplit != null && notifyKeySplit.length > 0) { + key = key.replace("-", "_"); + } + + notifySingleMap.put(key, entry.getValue()); + } else { + key = key.replace("executors[" + i + "].", ""); + + String[] keySplit = key.split("-"); + if (keySplit != null && keySplit.length > 0) { + key = key.replace("-", "_"); + } + executorSingleMap.put(key, entry.getValue()); + } + } + + + if (key.indexOf("notify-platforms[" + i + "].") != -1 || key.indexOf("notifyPlatforms[" + i + "].") != -1) { + if (key.indexOf("notify-platforms[" + i + "].") != -1) { + key = key.replace("notify-platforms[" + i + "].", ""); + } else { + key = key.replace("notifyPlatforms[" + i + "].", ""); + } + + String[] keySplit = key.split("-"); + if (keySplit != null && keySplit.length > 0) { + key = key.replace("-", "_"); + } + + platformSingleMap.put(key, entry.getValue()); + } + } + + if (CollectionUtil.isEmpty(executorSingleMap) && CollectionUtil.isEmpty(platformSingleMap)) { + break; + } + + if (CollectionUtil.isNotEmpty(executorSingleMap)) { + ExecutorProperties executorProperties = BeanUtil.mapToBean(executorSingleMap, ExecutorProperties.class, true, CopyOptions.create()); + if (executorProperties != null) { + if (CollectionUtil.isNotEmpty(notifySingleMap)) { + ThreadPoolNotifyAlarm alarm = BeanUtil.mapToBean(notifySingleMap, ThreadPoolNotifyAlarm.class, true, CopyOptions.create()); + Map notifyReceivesMap = Maps.newHashMap(); + for (NotifyPlatformEnum value : NotifyPlatformEnum.values()) { + Object receives = targetMap.get("executors[" + i + "].notify.receives." + value.name()); + if (receives != null && StringUtil.isNotBlank((String) receives)) { + notifyReceivesMap.put(value.name(), (String) receives); + } + } + + alarm.setReceives(notifyReceivesMap); + executorProperties.setNotify(alarm); + } + + executorPropertiesList.add(executorProperties); + } + } + + if (CollectionUtil.isNotEmpty(platformSingleMap)) { + NotifyPlatformProperties notifyPlatformProperties = BeanUtil.mapToBean(platformSingleMap, NotifyPlatformProperties.class, true, CopyOptions.create()); + if (notifyPlatformProperties != null) { + notifyPropertiesList.add(notifyPlatformProperties); + } + } + } + + bindableCoreProperties = new BootstrapCoreProperties(); + bindableCoreProperties.setExecutors(executorPropertiesList); + bindableCoreProperties.setNotifyPlatforms(notifyPropertiesList); + } catch (Exception ex) { + throw ex; + } + + return bindableCoreProperties; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/NacosCloudRefresherHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/NacosCloudRefresherHandler.java new file mode 100644 index 00000000..1a3fd991 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/NacosCloudRefresherHandler.java @@ -0,0 +1,48 @@ +package cn.hippo4j.core.starter.refresher; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import com.alibaba.cloud.nacos.NacosConfigManager; +import com.alibaba.nacos.api.config.listener.Listener; +import lombok.extern.slf4j.Slf4j; + +import java.util.Map; +import java.util.concurrent.Executor; + +/** + * Nacos cloud refresher handler. + * + * @author chen.ma + * @date 2022/2/26 11:21 + */ +@Slf4j +public class NacosCloudRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh { + + private final NacosConfigManager nacosConfigManager; + + public NacosCloudRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler, + BootstrapCoreProperties bootstrapCoreProperties) { + super(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + nacosConfigManager = ApplicationContextHolder.getBean(NacosConfigManager.class); + } + + @Override + public void afterPropertiesSet() throws Exception { + Map nacosConfig = bootstrapCoreProperties.getNacos(); + + nacosConfigManager.getConfigService().addListener(nacosConfig.get("data-id"), + nacosConfig.get("group"), new Listener() { + @Override + public Executor getExecutor() { + return dynamicRefreshExecutorService; + } + + @Override + public void receiveConfigInfo(String configInfo) { + dynamicRefresh(configInfo); + } + }); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/NacosRefresherHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/NacosRefresherHandler.java new file mode 100644 index 00000000..62e8007f --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/NacosRefresherHandler.java @@ -0,0 +1,49 @@ +package cn.hippo4j.core.starter.refresher; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import com.alibaba.nacos.api.config.ConfigService; +import com.alibaba.nacos.api.config.listener.Listener; +import lombok.extern.slf4j.Slf4j; + +import java.util.Map; +import java.util.concurrent.Executor; + +/** + * Nacos refresher handler. + * + * @author chen.ma + * @date 2022/2/26 00:10 + */ +@Slf4j +public class NacosRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh { + + private final ConfigService configService; + + public NacosRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler, + BootstrapCoreProperties bootstrapCoreProperties) { + super(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + configService = ApplicationContextHolder.getBean(ConfigService.class); + } + + @Override + public void afterPropertiesSet() throws Exception { + Map nacosConfig = bootstrapCoreProperties.getNacos(); + + configService.addListener(nacosConfig.get("data-id"), nacosConfig.get("group"), + new Listener() { + @Override + public Executor getExecutor() { + return dynamicRefreshExecutorService; + } + + @Override + public void receiveConfigInfo(String configInfo) { + dynamicRefresh(configInfo); + } + } + ); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/ZookeeperRefresherHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/ZookeeperRefresherHandler.java new file mode 100644 index 00000000..5653c128 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/ZookeeperRefresherHandler.java @@ -0,0 +1,99 @@ +package cn.hippo4j.core.starter.refresher; + +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import com.google.common.base.Charsets; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.api.CuratorListener; +import org.apache.curator.framework.api.GetChildrenBuilder; +import org.apache.curator.framework.api.GetDataBuilder; +import org.apache.curator.framework.state.ConnectionState; +import org.apache.curator.framework.state.ConnectionStateListener; +import org.apache.curator.retry.ExponentialBackoffRetry; +import org.apache.curator.utils.ZKPaths; +import org.apache.zookeeper.WatchedEvent; + +import java.util.List; +import java.util.Map; + +/** + * @author Redick01 + * @date 2022/3/14 16:03 + */ +@Slf4j +public class ZookeeperRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh { + + private CuratorFramework curatorFramework; + + public ZookeeperRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler, BootstrapCoreProperties bootstrapCoreProperties) { + super(threadPoolNotifyAlarmHandler, bootstrapCoreProperties); + } + + @Override + public void afterPropertiesSet() { + Map zkConfigs = bootstrapCoreProperties.getZookeeper(); + curatorFramework = CuratorFrameworkFactory.newClient(zkConfigs.get("zk-connect-str"), + new ExponentialBackoffRetry(1000, 3)); + String nodePath = ZKPaths.makePath(ZKPaths.makePath(zkConfigs.get("root-node"), + zkConfigs.get("config-version")), zkConfigs.get("node")); + final ConnectionStateListener connectionStateListener = (client, newState) -> { + if (newState == ConnectionState.CONNECTED) { + loadNode(nodePath); + } else if (newState == ConnectionState.RECONNECTED) { + loadNode(nodePath); + } + }; + + final CuratorListener curatorListener = (client, curatorEvent) -> { + final WatchedEvent watchedEvent = curatorEvent.getWatchedEvent(); + if (null != watchedEvent) { + switch (watchedEvent.getType()) { + case NodeChildrenChanged: + case NodeDataChanged: + loadNode(nodePath); + break; + default: + break; + } + } + }; + + curatorFramework.getConnectionStateListenable().addListener(connectionStateListener); + curatorFramework.getCuratorListenable().addListener(curatorListener); + curatorFramework.start(); + } + + /** + * load config info and refresh. + * + * @param nodePath zk config node path. + */ + public void loadNode(String nodePath) { + try { + final GetChildrenBuilder childrenBuilder = curatorFramework.getChildren(); + final List children = childrenBuilder.watched().forPath(nodePath); + StringBuilder content = new StringBuilder(); + children.forEach(c -> { + String n = ZKPaths.makePath(nodePath, c); + final String nodeName = ZKPaths.getNodeFromPath(n); + final GetDataBuilder data = curatorFramework.getData(); + String value = ""; + try { + value = new String(data.watched().forPath(n), Charsets.UTF_8); + } catch (Exception e) { + e.printStackTrace(); + } + + content.append(nodeName).append("=").append(value).append("\n"); + }); + + dynamicRefresh(content.toString()); + registerNotifyAlarmManage(); + } catch (Exception e) { + log.error("load zk node error, nodePath is {}", nodePath, e); + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java new file mode 100644 index 00000000..81de4f32 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java @@ -0,0 +1,198 @@ +package cn.hippo4j.core.starter.support; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.core.executor.DynamicThreadPool; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import cn.hippo4j.core.executor.manage.GlobalNotifyAlarmManage; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.support.*; +import cn.hippo4j.core.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.starter.config.ExecutorProperties; +import cn.hippo4j.core.toolkit.inet.DynamicThreadPoolAnnotationUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.core.task.TaskDecorator; + +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * Dynamic threadPool post processor. + * + * @author chen.ma + * @date 2021/8/2 20:40 + */ +@Slf4j +@AllArgsConstructor +public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { + + private final BootstrapCoreProperties bootstrapCoreProperties; + + @Override + public Object postProcessBeforeInitialization(Object bean, String beanName) { + return bean; + } + + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { + if (bean instanceof DynamicThreadPoolExecutor) { + DynamicThreadPool dynamicThreadPool; + try { + dynamicThreadPool = ApplicationContextHolder.findAnnotationOnBean(beanName, DynamicThreadPool.class); + if (Objects.isNull(dynamicThreadPool)) { + // 适配低版本 SpringBoot + dynamicThreadPool = DynamicThreadPoolAnnotationUtil.findAnnotationOnBean(beanName, DynamicThreadPool.class); + if (Objects.isNull(dynamicThreadPool)) { + return bean; + } + } + } catch (Exception ex) { + log.error("Failed to create dynamic thread pool in annotation mode.", ex); + return bean; + } + + DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) bean; + DynamicThreadPoolWrapper wrap = new DynamicThreadPoolWrapper(dynamicExecutor.getThreadPoolId(), dynamicExecutor); + ThreadPoolExecutor remoteExecutor = fillPoolAndRegister(wrap); + return remoteExecutor; + } + + if (bean instanceof DynamicThreadPoolWrapper) { + DynamicThreadPoolWrapper wrap = (DynamicThreadPoolWrapper) bean; + registerAndSubscribe(wrap); + } + + return bean; + } + + /** + * Register and subscribe. + * + * @param dynamicThreadPoolWrap + */ + protected void registerAndSubscribe(DynamicThreadPoolWrapper dynamicThreadPoolWrap) { + fillPoolAndRegister(dynamicThreadPoolWrap); + } + + /** + * Fill the thread pool and register. + * + * @param dynamicThreadPoolWrap + */ + protected ThreadPoolExecutor fillPoolAndRegister(DynamicThreadPoolWrapper dynamicThreadPoolWrap) { + String threadPoolId = dynamicThreadPoolWrap.getTpId(); + ThreadPoolExecutor newDynamicPoolExecutor = dynamicThreadPoolWrap.getExecutor(); + ExecutorProperties executorProperties = null; + if (null != bootstrapCoreProperties.getExecutors()) { + executorProperties = bootstrapCoreProperties.getExecutors() + .stream() + .filter(each -> Objects.equals(threadPoolId, each.getThreadPoolId())) + .findFirst() + .orElse(null); + if (executorProperties != null) { + try { + // 使用相关参数创建线程池 + BlockingQueue workQueue = QueueTypeEnum.createBlockingQueue(executorProperties.getBlockingQueue(), executorProperties.getQueueCapacity()); + String threadNamePrefix = executorProperties.getThreadNamePrefix(); + newDynamicPoolExecutor = ThreadPoolBuilder.builder() + .dynamicPool() + .workQueue(workQueue) + .threadFactory(StringUtil.isNotBlank(threadNamePrefix) ? threadNamePrefix : threadPoolId) + .executeTimeOut(Optional.ofNullable(executorProperties.getExecuteTimeOut()).orElse(0L)) + .poolThreadSize(executorProperties.getCorePoolSize(), executorProperties.getMaximumPoolSize()) + .keepAliveTime(executorProperties.getKeepAliveTime(), TimeUnit.SECONDS) + .rejected(RejectedTypeEnum.createPolicy(executorProperties.getRejectedHandler())) + .allowCoreThreadTimeOut(executorProperties.getAllowCoreThreadTimeOut()) + .build(); + } catch (Exception ex) { + log.error("Failed to initialize thread pool configuration. error :: {}", ex); + } finally { + if (Objects.isNull(dynamicThreadPoolWrap.getExecutor())) { + dynamicThreadPoolWrap.setExecutor(CommonDynamicThreadPool.getInstance(threadPoolId)); + } + dynamicThreadPoolWrap.setInitFlag(Boolean.TRUE); + } + } + + if (dynamicThreadPoolWrap.getExecutor() instanceof AbstractDynamicExecutorSupport) { + // 设置动态线程池增强参数 + ThreadPoolNotifyAlarm notify = executorProperties.getNotify(); + boolean isAlarm = Optional.ofNullable(notify) + .map(each -> each.getIsAlarm()) + .orElseGet(() -> bootstrapCoreProperties.getAlarm() != null ? bootstrapCoreProperties.getAlarm() : true); + int activeAlarm = Optional.ofNullable(notify) + .map(each -> each.getActiveAlarm()) + .orElseGet(() -> bootstrapCoreProperties.getActiveAlarm() != null ? bootstrapCoreProperties.getActiveAlarm() : 80); + int capacityAlarm = Optional.ofNullable(notify) + .map(each -> each.getActiveAlarm()) + .orElseGet(() -> bootstrapCoreProperties.getCapacityAlarm() != null ? bootstrapCoreProperties.getCapacityAlarm() : 80); + int interval = Optional.ofNullable(notify) + .map(each -> each.getInterval()) + .orElseGet(() -> bootstrapCoreProperties.getAlarmInterval() != null ? bootstrapCoreProperties.getAlarmInterval() : 5); + String receive = Optional.ofNullable(notify) + .map(each -> each.getReceive()) + .orElseGet(() -> bootstrapCoreProperties.getReceive() != null ? bootstrapCoreProperties.getReceive() : null); + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = new ThreadPoolNotifyAlarm(isAlarm, activeAlarm, capacityAlarm); + threadPoolNotifyAlarm.setInterval(interval); + threadPoolNotifyAlarm.setReceive(receive); + GlobalNotifyAlarmManage.put(threadPoolId, threadPoolNotifyAlarm); + + TaskDecorator taskDecorator = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).getTaskDecorator(); + ((DynamicThreadPoolExecutor) newDynamicPoolExecutor).setTaskDecorator(taskDecorator); + + long awaitTerminationMillis = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).awaitTerminationMillis; + boolean waitForTasksToCompleteOnShutdown = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).waitForTasksToCompleteOnShutdown; + ((DynamicThreadPoolExecutor) newDynamicPoolExecutor).setSupportParam(awaitTerminationMillis, waitForTasksToCompleteOnShutdown); + } + + dynamicThreadPoolWrap.setExecutor(newDynamicPoolExecutor); + } + + GlobalThreadPoolManage.registerPool(dynamicThreadPoolWrap.getTpId(), dynamicThreadPoolWrap); + GlobalCoreThreadPoolManage.register( + threadPoolId, + executorProperties == null + ? buildExecutorProperties(threadPoolId, newDynamicPoolExecutor) + : executorProperties + ); + + return newDynamicPoolExecutor; + } + + /** + * Build executor properties. + * + * @param threadPoolId + * @param executor + * @return + */ + private ExecutorProperties buildExecutorProperties(String threadPoolId, ThreadPoolExecutor executor) { + ExecutorProperties executorProperties = new ExecutorProperties(); + BlockingQueue queue = executor.getQueue(); + int queueSize = queue.size(); + String queueType = queue.getClass().getSimpleName(); + int remainingCapacity = queue.remainingCapacity(); + int queueCapacity = queueSize + remainingCapacity; + + executorProperties.setCorePoolSize(executor.getCorePoolSize()) + .setMaximumPoolSize(executor.getMaximumPoolSize()) + .setAllowCoreThreadTimeOut(executor.allowsCoreThreadTimeOut()) + .setKeepAliveTime(executor.getKeepAliveTime(TimeUnit.SECONDS)) + .setBlockingQueue(queueType) + .setExecuteTimeOut(10000L) + .setQueueCapacity(queueCapacity) + .setRejectedHandler(((DynamicThreadPoolExecutor) executor).getRedundancyHandler().getClass().getSimpleName()) + .setThreadPoolId(threadPoolId); + + return executorProperties; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/GlobalCoreThreadPoolManage.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/GlobalCoreThreadPoolManage.java new file mode 100644 index 00000000..e388485c --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/GlobalCoreThreadPoolManage.java @@ -0,0 +1,48 @@ +package cn.hippo4j.core.starter.support; + +import cn.hippo4j.core.starter.config.ExecutorProperties; +import com.google.common.collect.Maps; + +import java.util.Map; + +/** + * Global core thread pool manage. + * + * @author chen.ma + * @date 2022/2/26 19:47 + */ +public class GlobalCoreThreadPoolManage { + + private static final Map EXECUTOR_PROPERTIES = Maps.newConcurrentMap(); + + /** + * Get properties. + * + * @param threadPoolId + * @return + */ + public static ExecutorProperties getProperties(String threadPoolId) { + return EXECUTOR_PROPERTIES.get(threadPoolId); + } + + /** + * Register. + * + * @param threadPoolId + * @param executorProperties + */ + public static void register(String threadPoolId, ExecutorProperties executorProperties) { + EXECUTOR_PROPERTIES.put(threadPoolId, executorProperties); + } + + /** + * Refresh. + * + * @param threadPoolId + * @param executorProperties + */ + public static void refresh(String threadPoolId, ExecutorProperties executorProperties) { + EXECUTOR_PROPERTIES.put(threadPoolId, executorProperties); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/resources/META-INF/LICENSE b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/resources/META-INF/LICENSE new file mode 100644 index 00000000..ff773796 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/resources/META-INF/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + https://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. diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/resources/META-INF/spring.factories b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..6b409eb7 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.core.starter.config.DynamicThreadPoolCoreAutoConfiguration diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/.gitignore b/hippo4j-spring-boot/hippo4j-spring-boot-starter/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/pom.xml b/hippo4j-spring-boot/hippo4j-spring-boot-starter/pom.xml new file mode 100644 index 00000000..f63bacef --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/pom.xml @@ -0,0 +1,120 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-spring-boot + ${revision} + + + hippo4j-spring-boot-starter + jar + + ${project.artifactId} + 强大的动态线程池框架, 包含线程池动态调参、报警、状态查看以及监控等功能, 依赖 hippo4j server. + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + com.squareup.okhttp3 + okhttp + + + + cn.hippo4j + hippo4j-core + + + + cn.hippo4j + hippo4j-common + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + org.projectlombok + lombok + + + + com.aliyun + alibaba-dingtalk-service-sdk + + + + log4j + log4j + + + + + + org.springframework.boot + spring-boot-starter-tomcat + compile + true + + + + org.springframework.boot + spring-boot-starter-jetty + compile + true + + + + org.springframework.boot + spring-boot-starter-undertow + compile + true + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${project.artifactId} + ${project.version} + ${maven.build.timestamp} + chen.ma + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + + jar + + + + + + + + diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/BootstrapProperties.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/BootstrapProperties.java new file mode 100644 index 00000000..bd5b5c09 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/BootstrapProperties.java @@ -0,0 +1,83 @@ +package cn.hippo4j.starter.config; + +import cn.hippo4j.core.config.BootstrapPropertiesInterface; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Bootstrap properties. + * + * @author chen.ma + * @date 2021/6/22 09:14 + */ +@Slf4j +@Getter +@Setter +@ConfigurationProperties(prefix = BootstrapProperties.PREFIX) +public class BootstrapProperties implements BootstrapPropertiesInterface { + + public static final String PREFIX = "spring.dynamic.thread-pool"; + + /** + * Username. + */ + private String username; + + /** + * Password. + */ + private String password; + + /** + * Server addr + */ + private String serverAddr; + + /** + * Namespace + */ + private String namespace; + + /** + * Item id + */ + private String itemId; + + /** + * Whether to enable dynamic thread pool + */ + private Boolean enable = true; + + /** + * Print dynamic thread pool banner + */ + private Boolean banner = true; + + /** + * Enable client data collect + */ + private Boolean collect = true; + + /** + * Task buffer container capacity + */ + private Integer taskBufferSize = 4096; + + /** + * Delay starting data acquisition task. unit: ms + */ + private Long initialDelay = 10000L; + + /** + * Time interval for client to collect monitoring data. unit: ms + */ + private Long collectInterval = 5000L; + + /** + * JSON serialization type. + */ + private String jsonSerializeType = "JACKSON"; + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java new file mode 100644 index 00000000..a07d91dd --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DiscoveryConfiguration.java @@ -0,0 +1,77 @@ +package cn.hippo4j.starter.config; + +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.toolkit.ContentUtil; +import cn.hippo4j.core.toolkit.IdentifyUtil; +import cn.hippo4j.core.toolkit.inet.InetUtils; +import cn.hippo4j.starter.core.DiscoveryClient; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hutool.core.text.StrBuilder; +import lombok.AllArgsConstructor; +import lombok.SneakyThrows; +import org.springframework.context.annotation.Bean; +import org.springframework.core.env.ConfigurableEnvironment; + +import java.net.InetAddress; + +import static cn.hippo4j.common.constant.Constants.GROUP_KEY_DELIMITER; +import static cn.hippo4j.core.toolkit.IdentifyUtil.CLIENT_IDENTIFICATION_VALUE; +import static cn.hippo4j.starter.toolkit.CloudCommonIdUtil.getDefaultInstanceId; +import static cn.hippo4j.starter.toolkit.CloudCommonIdUtil.getIpApplicationName; + +/** + * Dynamic threadPool discovery config. + * + * @author chen.ma + * @date 2021/8/6 21:35 + */ +@AllArgsConstructor +public class DiscoveryConfiguration { + + private final ConfigurableEnvironment environment; + + private final BootstrapProperties properties; + + private final InetUtils hippo4JInetUtils; + + @Bean + @SneakyThrows + public InstanceInfo instanceConfig() { + String namespace = properties.getNamespace(); + String itemId = properties.getItemId(); + String port = environment.getProperty("server.port", "8080"); + String applicationName = environment.getProperty("spring.dynamic.thread-pool.item-id"); + String active = environment.getProperty("spring.profiles.active", "UNKNOWN"); + + InstanceInfo instanceInfo = new InstanceInfo(); + String instanceId = getDefaultInstanceId(environment, hippo4JInetUtils); + instanceId = StrBuilder.create().append(instanceId).append(":").append(CLIENT_IDENTIFICATION_VALUE).toString(); + + String contextPath = environment.getProperty("server.servlet.context-path", ""); + instanceInfo.setInstanceId(instanceId) + .setIpApplicationName(getIpApplicationName(environment, hippo4JInetUtils)) + .setHostName(InetAddress.getLocalHost().getHostAddress()) + .setGroupKey(itemId + GROUP_KEY_DELIMITER + namespace) + .setAppName(applicationName) + .setPort(port) + .setClientBasePath(contextPath) + .setGroupKey(ContentUtil.getGroupKey(itemId, namespace)); + + String callBackUrl = new StringBuilder().append(instanceInfo.getHostName()).append(":") + .append(port).append(instanceInfo.getClientBasePath()) + .toString(); + instanceInfo.setCallBackUrl(callBackUrl); + + String identify = IdentifyUtil.generate(environment, hippo4JInetUtils); + instanceInfo.setIdentify(identify); + instanceInfo.setActive(active.toUpperCase()); + + return instanceInfo; + } + + @Bean + public DiscoveryClient hippo4JDiscoveryClient(HttpAgent httpAgent, InstanceInfo instanceInfo) { + return new DiscoveryClient(httpAgent, instanceInfo); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DynamicThreadPoolAutoConfiguration.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DynamicThreadPoolAutoConfiguration.java new file mode 100644 index 00000000..e0581d2e --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/DynamicThreadPoolAutoConfiguration.java @@ -0,0 +1,133 @@ +package cn.hippo4j.starter.config; + +import cn.hippo4j.common.api.ThreadDetailState; +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.core.config.UtilAutoConfiguration; +import cn.hippo4j.core.config.WebThreadPoolConfiguration; +import cn.hippo4j.core.enable.MarkerConfiguration; +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import cn.hippo4j.core.executor.web.WebThreadPoolHandlerChoose; +import cn.hippo4j.core.handler.DynamicThreadPoolBannerHandler; +import cn.hippo4j.core.toolkit.IdentifyUtil; +import cn.hippo4j.core.toolkit.inet.InetUtils; +import cn.hippo4j.starter.controller.PoolRunStateController; +import cn.hippo4j.starter.controller.WebThreadPoolController; +import cn.hippo4j.starter.core.*; +import cn.hippo4j.starter.event.ApplicationContentPostProcessor; +import cn.hippo4j.starter.monitor.ReportingEventExecutor; +import cn.hippo4j.starter.monitor.collect.RunTimeInfoCollector; +import cn.hippo4j.starter.monitor.send.HttpConnectSender; +import cn.hippo4j.starter.monitor.send.MessageSender; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hippo4j.starter.remote.HttpScheduledHealthCheck; +import cn.hippo4j.starter.remote.ServerHealthCheck; +import lombok.AllArgsConstructor; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.core.env.ConfigurableEnvironment; + +/** + * DynamicTp auto configuration. + * + * @author chen.ma + * @date 2021/6/22 09:20 + */ +@Configuration +@AllArgsConstructor +@ConditionalOnBean(MarkerConfiguration.Marker.class) +@EnableConfigurationProperties(BootstrapProperties.class) +@ConditionalOnProperty(prefix = BootstrapProperties.PREFIX, value = "enable", matchIfMissing = true, havingValue = "true") +@ImportAutoConfiguration({HttpClientConfiguration.class, DiscoveryConfiguration.class, MessageNotifyConfiguration.class, UtilAutoConfiguration.class, WebThreadPoolConfiguration.class}) +public class DynamicThreadPoolAutoConfiguration { + + private final BootstrapProperties properties; + + private final ConfigurableEnvironment environment; + + @Bean + public DynamicThreadPoolBannerHandler threadPoolBannerHandler() { + return new DynamicThreadPoolBannerHandler(properties); + } + + @Bean + @Order(Ordered.HIGHEST_PRECEDENCE) + public ApplicationContextHolder hippo4JApplicationContextHolder() { + return new ApplicationContextHolder(); + } + + @Bean + @SuppressWarnings("all") + public ConfigService configService(HttpAgent httpAgent, InetUtils hippo4JInetUtils, ServerHealthCheck serverHealthCheck) { + String identify = IdentifyUtil.generate(environment, hippo4JInetUtils); + return new ThreadPoolConfigService(httpAgent, identify, serverHealthCheck); + } + + @Bean + public ThreadPoolOperation threadPoolOperation(ConfigService configService) { + return new ThreadPoolOperation(properties, configService); + } + + @Bean + @SuppressWarnings("all") + public DynamicThreadPoolPostProcessor threadPoolBeanPostProcessor(HttpAgent httpAgent, + ThreadPoolOperation threadPoolOperation, + ApplicationContextHolder hippo4JApplicationContextHolder, + ServerThreadPoolDynamicRefresh threadPoolDynamicRefresh) { + return new DynamicThreadPoolPostProcessor(properties, httpAgent, threadPoolOperation, threadPoolDynamicRefresh); + } + + @Bean + @ConditionalOnMissingBean(value = ThreadDetailState.class) + public ThreadDetailState baseThreadDetailStateHandler() { + return new BaseThreadDetailStateHandler(); + } + + @Bean + public PoolRunStateController poolRunStateController(ThreadPoolRunStateHandler threadPoolRunStateHandler, + ThreadDetailState threadDetailState) { + return new PoolRunStateController(threadPoolRunStateHandler, threadDetailState); + } + + @Bean + @SuppressWarnings("all") + public HttpConnectSender httpMvcSender(HttpAgent httpAgent) { + return new HttpConnectSender(httpAgent); + } + + @Bean + public ReportingEventExecutor reportingEventExecutor(BootstrapProperties properties, MessageSender messageSender, + ServerHealthCheck serverHealthCheck) { + return new ReportingEventExecutor(properties, messageSender, serverHealthCheck); + } + + @Bean + @SuppressWarnings("all") + public ServerHealthCheck httpScheduledHealthCheck(HttpAgent httpAgent) { + return new HttpScheduledHealthCheck(httpAgent); + } + + @Bean + public RunTimeInfoCollector runTimeInfoCollector() { + return new RunTimeInfoCollector(properties); + } + + @Bean + public ApplicationContentPostProcessor applicationContentPostProcessor() { + return new ApplicationContentPostProcessor(); + } + + @Bean + public WebThreadPoolController webThreadPoolController(WebThreadPoolHandlerChoose webThreadPoolServiceChoose) { + return new WebThreadPoolController(webThreadPoolServiceChoose); + } + +} + + diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/HttpClientConfig.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/HttpClientConfiguration.java similarity index 79% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/HttpClientConfig.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/HttpClientConfiguration.java index f41f3e29..f48635b8 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/config/HttpClientConfig.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/HttpClientConfiguration.java @@ -1,8 +1,8 @@ -package com.github.dynamic.threadpool.starter.config; +package cn.hippo4j.starter.config; -import com.github.dynamic.threadpool.starter.remote.HttpAgent; -import com.github.dynamic.threadpool.starter.remote.ServerHttpAgent; -import com.github.dynamic.threadpool.starter.toolkit.HttpClientUtil; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hippo4j.starter.remote.ServerHttpAgent; +import cn.hippo4j.starter.toolkit.HttpClientUtil; import lombok.SneakyThrows; import okhttp3.OkHttpClient; import org.springframework.context.annotation.Bean; @@ -19,10 +19,10 @@ import java.util.concurrent.TimeUnit; * @author chen.ma * @date 2021/6/10 13:28 */ -public class HttpClientConfig { +public class HttpClientConfiguration { @Bean - public OkHttpClient okHttpClient() { + public OkHttpClient hippo4JOkHttpClient() { OkHttpClient.Builder build = new OkHttpClient.Builder(); build.connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) @@ -32,13 +32,14 @@ public class HttpClientConfig { } @Bean - public HttpClientUtil httpClientUtil() { + public HttpClientUtil hippo4JHttpClientUtil() { return new HttpClientUtil(); } @Bean - public HttpAgent httpAgent(BootstrapProperties properties, HttpClientUtil httpClientUtil) { - return new ServerHttpAgent(properties, httpClientUtil); + @SuppressWarnings("all") + public HttpAgent httpAgent(BootstrapProperties properties, HttpClientUtil hippo4JHttpClientUtil) { + return new ServerHttpAgent(properties, hippo4JHttpClientUtil); } @SneakyThrows diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/MessageNotifyConfiguration.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/MessageNotifyConfiguration.java new file mode 100644 index 00000000..93940f9f --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/config/MessageNotifyConfiguration.java @@ -0,0 +1,67 @@ +package cn.hippo4j.starter.config; + +import cn.hippo4j.common.api.NotifyConfigBuilder; +import cn.hippo4j.common.notify.*; +import cn.hippo4j.common.notify.platform.DingSendMessageHandler; +import cn.hippo4j.common.notify.platform.LarkSendMessageHandler; +import cn.hippo4j.common.notify.platform.WeChatSendMessageHandler; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.starter.core.ServerThreadPoolDynamicRefresh; +import cn.hippo4j.starter.notify.ServerNotifyConfigBuilder; +import cn.hippo4j.starter.remote.HttpAgent; +import lombok.AllArgsConstructor; +import org.springframework.context.annotation.Bean; + +/** + * Message notify config. + * + * @author chen.ma + * @date 2021/8/15 15:39 + */ +@AllArgsConstructor +public class MessageNotifyConfiguration { + + @Bean + public AlarmControlHandler alarmControlHandler() { + return new AlarmControlHandler(); + } + + @Bean + public NotifyConfigBuilder notifyConfigBuilder(HttpAgent httpAgent, + BootstrapProperties properties, + AlarmControlHandler alarmControlHandler) { + return new ServerNotifyConfigBuilder(httpAgent, properties, alarmControlHandler); + } + + @Bean + public HippoSendMessageService hippoSendMessageService(NotifyConfigBuilder notifyConfigBuilder, + AlarmControlHandler alarmControlHandler) { + return new HippoBaseSendMessageService(notifyConfigBuilder, alarmControlHandler); + } + + @Bean + public ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler(HippoSendMessageService hippoSendMessageService) { + return new ThreadPoolNotifyAlarmHandler(hippoSendMessageService); + } + + @Bean + public SendMessageHandler dingSendMessageHandler() { + return new DingSendMessageHandler(); + } + + @Bean + public SendMessageHandler larkSendMessageHandler() { + return new LarkSendMessageHandler(); + } + + @Bean + public SendMessageHandler weChatSendMessageHandler() { + return new WeChatSendMessageHandler(); + } + + @Bean + public ServerThreadPoolDynamicRefresh threadPoolDynamicRefresh(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler) { + return new ServerThreadPoolDynamicRefresh(threadPoolNotifyAlarmHandler); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/controller/PoolRunStateController.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/controller/PoolRunStateController.java new file mode 100644 index 00000000..41249864 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/controller/PoolRunStateController.java @@ -0,0 +1,44 @@ +package cn.hippo4j.starter.controller; + +import cn.hippo4j.common.api.ThreadDetailState; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.model.ThreadDetailStateInfo; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * Pool run state controller. + * + * @author chen.ma + * @date 2021/7/7 21:34 + */ +@CrossOrigin +@RestController +@AllArgsConstructor +public class PoolRunStateController { + + private final ThreadPoolRunStateHandler threadPoolRunStateHandler; + + private final ThreadDetailState threadDetailState; + + @GetMapping("/run/state/{threadPoolId}") + public Result getPoolRunState(@PathVariable("threadPoolId") String threadPoolId) { + PoolRunStateInfo poolRunState = threadPoolRunStateHandler.getPoolRunState(threadPoolId); + return Results.success(poolRunState); + } + + @GetMapping("/run/thread/state/{threadPoolId}") + public Result> getThreadStateDetail(@PathVariable("threadPoolId") String threadPoolId) { + List detailStateInfo = threadDetailState.getThreadDetailStateInfo(threadPoolId); + return Results.success(detailStateInfo); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/controller/WebThreadPoolController.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/controller/WebThreadPoolController.java new file mode 100644 index 00000000..b8fdd27d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/controller/WebThreadPoolController.java @@ -0,0 +1,45 @@ +package cn.hippo4j.starter.controller; + +import cn.hippo4j.common.model.PoolBaseInfo; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.core.executor.web.WebThreadPoolHandlerChoose; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +/** + * Web thread pool controller. + * + *

At present, only Tomcat is well supported, and other web containers need to be improved. + * + * @author chen.ma + * @date 2022/1/19 20:54 + */ +@CrossOrigin +@RestController +@AllArgsConstructor +public class WebThreadPoolController { + + private final WebThreadPoolHandlerChoose webThreadPoolServiceChoose; + + @GetMapping("/web/base/info") + public Result getPoolBaseState() { + PoolBaseInfo poolBaseInfo = webThreadPoolServiceChoose.choose().simpleInfo(); + return Results.success(poolBaseInfo); + } + + @GetMapping("/web/run/state") + public Result getPoolRunState() { + PoolRunStateInfo poolRunState = webThreadPoolServiceChoose.choose().getWebRunStateInfo(); + return Results.success(poolRunState); + } + + @PostMapping("/web/update/pool") + public Result updateWebThreadPool(@RequestBody PoolParameterInfo poolParameterInfo) { + webThreadPoolServiceChoose.choose().updateWebThreadPool(poolParameterInfo); + return Results.success(); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/BaseThreadDetailStateHandler.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/BaseThreadDetailStateHandler.java new file mode 100644 index 00000000..8d928c4a --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/BaseThreadDetailStateHandler.java @@ -0,0 +1,84 @@ +package cn.hippo4j.starter.core; + +import cn.hippo4j.common.api.ThreadDetailState; +import cn.hippo4j.common.model.ThreadDetailStateInfo; +import cn.hippo4j.common.toolkit.CollectionUtil; +import cn.hippo4j.common.toolkit.ReflectUtil; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * Base thread detail state handler. + * + *

The Java 8 implementation is temporarily provided, + * {@link ThreadDetailState} interface can be customized. + * + * @author chen.ma + * @date 2022/1/9 13:01 + */ +@Slf4j +public class BaseThreadDetailStateHandler implements ThreadDetailState { + + private final String WORKERS = "workers"; + + private final String THREAD = "thread"; + + @Override + public List getThreadDetailStateInfo(String threadPoolId) { + DynamicThreadPoolWrapper poolWrapper = GlobalThreadPoolManage.getExecutorService(threadPoolId); + ThreadPoolExecutor executor = poolWrapper.getExecutor(); + return getThreadDetailStateInfo(executor); + } + + @Override + public List getThreadDetailStateInfo(ThreadPoolExecutor threadPoolExecutor) { + List resultThreadState = new ArrayList(); + try { + // TODO: Should the object be copied deeply to avoid the destruction of the worker + HashSet workers = (HashSet) ReflectUtil.getFieldValue(threadPoolExecutor, WORKERS); + if (CollectionUtil.isEmpty(workers)) { + return resultThreadState; + } + + for (Object worker : workers) { + Thread thread; + try { + thread = (Thread) ReflectUtil.getFieldValue(worker, THREAD); + if (thread == null) { + log.warn("Reflection get worker thread is null. Worker :: {}", worker); + continue; + } + } catch (Exception ex) { + log.error("Reflection get worker thread exception. Worker :: {}", worker, ex); + continue; + } + + long threadId = thread.getId(); + String threadName = thread.getName(); + String threadStatus = thread.getState().name(); + StackTraceElement[] stackTrace = thread.getStackTrace(); + List stacks = new ArrayList(stackTrace.length); + for (int i = 0; i < stackTrace.length; i++) { + stacks.add(stackTrace[i].toString()); + } + ThreadDetailStateInfo threadState = new ThreadDetailStateInfo(); + threadState.setThreadId(threadId) + .setThreadName(threadName) + .setThreadStatus(threadStatus) + .setThreadStack(stacks); + resultThreadState.add(threadState); + } + } catch (Exception ex) { + log.error("Failed to get thread status.", ex); + } + + return resultThreadState; + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/CacheData.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java similarity index 68% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/CacheData.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java index 4eb1e6b8..3ec96337 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/CacheData.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java @@ -1,9 +1,10 @@ -package com.github.dynamic.threadpool.starter.core; +package cn.hippo4j.starter.core; -import com.github.dynamic.threadpool.starter.wrap.ManagerListenerWrap; -import com.github.dynamic.threadpool.common.toolkit.ContentUtil; -import com.github.dynamic.threadpool.common.toolkit.Md5Util; -import com.github.dynamic.threadpool.common.constant.Constants; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.starter.wrapper.ManagerListenerWrapper; +import cn.hippo4j.common.toolkit.ContentUtil; +import cn.hippo4j.common.toolkit.Md5Util; +import cn.hippo4j.common.constant.Constants; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.CopyOnWriteArrayList; @@ -33,7 +34,7 @@ public class CacheData { private volatile long localConfigLastModified; - private final CopyOnWriteArrayList listeners; + private final CopyOnWriteArrayList listeners; public CacheData(String tenantId, String itemId, String tpId) { this.tenantId = tenantId; @@ -42,39 +43,40 @@ public class CacheData { this.content = ContentUtil.getPoolContent(GlobalThreadPoolManage.getPoolParameter(tpId)); this.md5 = getMd5String(content); this.listeners = new CopyOnWriteArrayList(); - } public void addListener(Listener listener) { if (null == listener) { - throw new IllegalArgumentException("listener is null"); + throw new IllegalArgumentException("Listener is null."); } - ManagerListenerWrap managerListenerWrap = new ManagerListenerWrap(md5, listener); - + ManagerListenerWrapper managerListenerWrap = new ManagerListenerWrapper(md5, listener); if (listeners.addIfAbsent(managerListenerWrap)) { - log.info("Add listener status :: ok, tpId :: {}, cnt :: {}", tpId, listeners.size()); + log.info("Add listener status :: ok, thread pool id :: {}, listeners count :: {}", tpId, listeners.size()); } } public void checkListenerMd5() { - for (ManagerListenerWrap wrap : listeners) { + for (ManagerListenerWrapper wrap : listeners) { if (!md5.equals(wrap.getLastCallMd5())) { safeNotifyListener(content, md5, wrap); } } } - private void safeNotifyListener(String content, String md5, ManagerListenerWrap wrap) { + private void safeNotifyListener(String content, String md5, ManagerListenerWrapper wrap) { Listener listener = wrap.getListener(); Runnable runnable = () -> { wrap.setLastCallMd5(md5); - listener.receiveConfigInfo(content); }; - listener.getExecutor().execute(runnable); + try { + listener.getExecutor().execute(runnable); + } catch (Exception ex) { + log.error("Failed to execute listener. message :: {}", ex.getMessage()); + } } public void setContent(String content) { diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ClientWorker.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ClientWorker.java similarity index 69% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ClientWorker.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ClientWorker.java index bf80561f..70f8016a 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ClientWorker.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ClientWorker.java @@ -1,25 +1,23 @@ -package com.github.dynamic.threadpool.starter.core; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; -import com.github.dynamic.threadpool.common.model.PoolParameterInfo; -import com.github.dynamic.threadpool.common.toolkit.ContentUtil; -import com.github.dynamic.threadpool.common.toolkit.GroupKey; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.starter.remote.HttpAgent; +package cn.hippo4j.starter.core; + +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.toolkit.ContentUtil; +import cn.hippo4j.common.toolkit.GroupKey; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hippo4j.starter.remote.ServerHealthCheck; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import cn.hutool.core.util.IdUtil; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.util.StringUtils; import java.net.URLDecoder; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.*; -import static com.github.dynamic.threadpool.common.constant.Constants.*; +import static cn.hippo4j.common.constant.Constants.*; /** * Client worker. @@ -30,24 +28,30 @@ import static com.github.dynamic.threadpool.common.constant.Constants.*; @Slf4j public class ClientWorker { - private double currentLongingTaskCount = 0; - private long timeout; + private double currentLongingTaskCount = 0; + private final HttpAgent agent; + private final String identification; + + private final ServerHealthCheck serverHealthCheck; + private final ScheduledExecutorService executor; private final ScheduledExecutorService executorService; - private AtomicBoolean isHealthServer = new AtomicBoolean(true); + private final CountDownLatch awaitApplicationComplete = new CountDownLatch(1); private final ConcurrentHashMap cacheMap = new ConcurrentHashMap(16); @SuppressWarnings("all") - public ClientWorker(HttpAgent httpAgent) { + public ClientWorker(HttpAgent httpAgent, String identification, ServerHealthCheck serverHealthCheck) { this.agent = httpAgent; + this.identification = identification; this.timeout = CONFIG_LONG_POLL_TIMEOUT; + this.serverHealthCheck = serverHealthCheck; this.executor = Executors.newScheduledThreadPool(1, r -> { Thread t = new Thread(r); @@ -56,21 +60,23 @@ public class ClientWorker { return t; }); - int threadSize = Runtime.getRuntime().availableProcessors(); - this.executorService = Executors.newScheduledThreadPool(threadSize, r -> { - Thread t = new Thread(r); - t.setName("client.long.polling.executor"); - t.setDaemon(true); - return t; - }); + this.executorService = Executors.newSingleThreadScheduledExecutor( + ThreadFactoryBuilder.builder().prefix("client.long.polling.executor").daemon(true).build() + ); + + log.info("Client identity :: {}", identification); this.executor.scheduleWithFixedDelay(() -> { try { + // 等待 spring 容器启动成功 + awaitApplicationComplete.await(); + + // 检查动态线程池配置是否被更新 checkConfigInfo(); } catch (Throwable e) { - log.error("[Sub check] rotate check error", e); + log.error("Sub check rotate check error.", e); } - }, 1L, 10L, TimeUnit.MILLISECONDS); + }, 1L, 1024L, TimeUnit.MILLISECONDS); } public void checkConfigInfo() { @@ -88,27 +94,18 @@ public class ClientWorker { class LongPollingRunnable implements Runnable { - @SneakyThrows - private void checkStatus() { - // 服务端状态不正常睡眠 30s - if (!isHealthServer.get()) { - log.error("[Check config] Error. exception message, Thread sleep 30 s."); - Thread.sleep(30000); - } - } - @Override @SneakyThrows public void run() { - checkStatus(); + serverHealthCheck.isHealthStatus(); List cacheDataList = new ArrayList(); List inInitializingCacheList = new ArrayList(); cacheMap.forEach((key, val) -> cacheDataList.add(val)); List changedTpIds = checkUpdateDataIds(cacheDataList, inInitializingCacheList); - for (String each : changedTpIds) { - String[] keys = StrUtil.split(each, GROUP_KEY_DELIMITER); + for (String groupKey : changedTpIds) { + String[] keys = groupKey.split(GROUP_KEY_DELIMITER_TRANSLATION); String tpId = keys[0]; String itemId = keys[1]; String namespace = keys[2]; @@ -116,10 +113,11 @@ public class ClientWorker { try { String content = getServerConfig(namespace, itemId, tpId, 3000L); CacheData cacheData = cacheMap.get(tpId); - String poolContent = ContentUtil.getPoolContent(JSON.parseObject(content, PoolParameterInfo.class)); + String poolContent = ContentUtil.getPoolContent(JSONUtil.parseObject(content, PoolParameterInfo.class)); cacheData.setContent(poolContent); } catch (Exception ex) { // ignore + log.error("Failed to get the latest thread pool configuration.", ex); } } @@ -141,8 +139,9 @@ public class ClientWorker { for (CacheData cacheData : cacheDataList) { sb.append(cacheData.tpId).append(WORD_SEPARATOR); sb.append(cacheData.itemId).append(WORD_SEPARATOR); - sb.append(cacheData.getMd5()).append(WORD_SEPARATOR); - sb.append(cacheData.tenantId).append(LINE_SEPARATOR); + sb.append(cacheData.tenantId).append(WORD_SEPARATOR); + sb.append(identification).append(WORD_SEPARATOR); + sb.append(cacheData.getMd5()).append(LINE_SEPARATOR); if (cacheData.isInitializing()) { inInitializingCacheList.add(GroupKey.getKeyTenant(cacheData.tpId, cacheData.itemId, cacheData.tenantId)); @@ -156,9 +155,13 @@ public class ClientWorker { public List checkUpdateTpIds(String probeUpdateString, boolean isInitializingCacheList) { Map params = new HashMap(2); params.put(PROBE_MODIFY_REQUEST, probeUpdateString); + params.put(WEIGHT_CONFIGS, IdUtil.simpleUUID()); Map headers = new HashMap(2); headers.put(LONG_PULLING_TIMEOUT, "" + timeout); + // 确认客户端身份, 修改线程池配置时可单独修改 + headers.put(LONG_PULLING_CLIENT_IDENTIFICATION, identification); + // told server do not hang me up if new initializing cacheData added in if (isInitializingCacheList) { headers.put(LONG_PULLING_TIMEOUT_NO_HANGUP, "true"); @@ -172,15 +175,12 @@ public class ClientWorker { long readTimeoutMs = timeout + (long) Math.round(timeout >> 1); Result result = agent.httpPostByConfig(LISTENER_PATH, headers, params, readTimeoutMs); - // Server 端重启后会进入非健康状态, 不进入 catch 则为健康调用 - isHealthServer.set(true); if (result != null && result.isSuccess()) { - setHealthServer(true); return parseUpdateDataIdResponse(result.getData().toString()); } } catch (Exception ex) { setHealthServer(false); - log.error("[Check update] get changed dataId exception. error message :: {}", ex.getMessage()); + log.error("Check update get changed dataId exception. error message :: {}", ex.getMessage()); } return Collections.emptyList(); @@ -191,13 +191,14 @@ public class ClientWorker { params.put("namespace", namespace); params.put("itemId", itemId); params.put("tpId", tpId); + params.put("instanceId", identification); Result result = agent.httpGetByConfig(CONFIG_CONTROLLER_PATH, null, params, readTimeout); if (result.isSuccess()) { - return result.getData().toString(); + return JSONUtil.toJSONString(result.getData()); } - log.error("[Sub server] namespace :: {}, itemId :: {}, tpId :: {}, result code :: {}", + log.error("Sub server namespace :: {}, itemId :: {}, tpId :: {}, result code :: {}", namespace, itemId, tpId, result.getCode()); return NULL; } @@ -210,7 +211,7 @@ public class ClientWorker { try { response = URLDecoder.decode(response, "UTF-8"); } catch (Exception e) { - log.error("[Polling resp] decode modifiedDataIdsString error", e); + log.error("Polling resp decode modifiedDataIdsString error.", e); } @@ -220,18 +221,16 @@ public class ClientWorker { String[] keyArr = dataIdAndGroup.split(WORD_SEPARATOR); String dataId = keyArr[0]; String group = keyArr[1]; - if (keyArr.length == 2) { - updateList.add(GroupKey.getKey(dataId, group)); - log.info("[{}] [Polling resp] config changed. dataId={}, group={}", dataId, group); - } else if (keyArr.length == 3) { + if (keyArr.length == 3) { String tenant = keyArr[2]; updateList.add(GroupKey.getKeyTenant(dataId, group, tenant)); - log.info("[Polling resp] config changed. dataId={}, group={}, tenant={}", dataId, group, tenant); + log.info("Refresh thread pool changed. [{}]", dataId); } else { - log.error("[{}] [Polling resp] invalid dataIdAndGroup error {}", dataIdAndGroup); + log.error("[{}] Polling resp invalid dataIdAndGroup error.", dataIdAndGroup); } } } + return updateList; } @@ -251,13 +250,13 @@ public class ClientWorker { cacheData = new CacheData(namespace, itemId, tpId); CacheData lastCacheData = cacheMap.putIfAbsent(tpId, cacheData); if (lastCacheData == null) { - String serverConfig = null; + String serverConfig; try { serverConfig = getServerConfig(namespace, itemId, tpId, 3000L); - PoolParameterInfo poolInfo = JSON.parseObject(serverConfig, PoolParameterInfo.class); + PoolParameterInfo poolInfo = JSONUtil.parseObject(serverConfig, PoolParameterInfo.class); cacheData.setContent(ContentUtil.getPoolContent(poolInfo)); } catch (Exception ex) { - log.error("[Cache Data] Error. Service Unavailable :: {}", ex.getMessage()); + log.error("Cache Data Error. Service Unavailable :: {}", ex.getMessage()); } int taskId = cacheMap.size() / CONFIG_LONG_POLL_TIMEOUT; @@ -269,12 +268,12 @@ public class ClientWorker { return lastCacheData; } - public boolean isHealthServer() { - return this.isHealthServer.get(); + private void setHealthServer(boolean isHealthServer) { + this.serverHealthCheck.setHealthStatus(isHealthServer); } - private void setHealthServer(boolean isHealthServer) { - this.isHealthServer.set(isHealthServer); + protected void notifyApplicationComplete() { + awaitApplicationComplete.countDown(); } } diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ConfigEmptyAnalyzer.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ConfigEmptyAnalyzer.java new file mode 100644 index 00000000..55b9c47b --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ConfigEmptyAnalyzer.java @@ -0,0 +1,20 @@ +package cn.hippo4j.starter.core; + +import cn.hippo4j.core.config.ConfigEmptyException; +import org.springframework.boot.diagnostics.AbstractFailureAnalyzer; +import org.springframework.boot.diagnostics.FailureAnalysis; + +/** + * Config empty analyzer. + * + * @author chen.ma + * @date 2021/11/28 21:59 + */ +public class ConfigEmptyAnalyzer extends AbstractFailureAnalyzer { + + @Override + protected FailureAnalysis analyze(Throwable rootFailure, ConfigEmptyException cause) { + return new FailureAnalysis(cause.getDescription(), cause.getAction(), cause); + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ConfigService.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ConfigService.java similarity index 89% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ConfigService.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ConfigService.java index 82d6b75c..b1bc1d07 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ConfigService.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ConfigService.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.core; +package cn.hippo4j.starter.core; /** * Config service. diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DiscoveryClient.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DiscoveryClient.java similarity index 50% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DiscoveryClient.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DiscoveryClient.java index 77f46683..ed8e965f 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/DiscoveryClient.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DiscoveryClient.java @@ -1,16 +1,23 @@ -package com.github.dynamic.threadpool.starter.core; - -import com.github.dynamic.threadpool.common.constant.Constants; -import com.github.dynamic.threadpool.common.model.InstanceInfo; -import com.github.dynamic.threadpool.common.web.base.Result; -import com.github.dynamic.threadpool.common.web.base.Results; -import com.github.dynamic.threadpool.common.web.exception.ErrorCodeEnum; -import com.github.dynamic.threadpool.starter.remote.HttpAgent; -import com.github.dynamic.threadpool.starter.toolkit.thread.ThreadFactoryBuilder; -import com.github.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; +package cn.hippo4j.starter.core; + +import cn.hippo4j.common.api.ClientCloseHookExecute; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.model.InstanceInfo; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.common.web.base.Results; +import cn.hippo4j.common.web.exception.ErrorCodeEnum; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import cn.hutool.core.text.StrBuilder; +import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.DisposableBean; -import java.util.concurrent.*; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import static cn.hippo4j.common.constant.Constants.BASE_PATH; /** * Discovery client. @@ -19,9 +26,7 @@ import java.util.concurrent.*; * @date 2021/7/13 21:51 */ @Slf4j -public class DiscoveryClient { - - private final ThreadPoolExecutor heartbeatExecutor; +public class DiscoveryClient implements DisposableBean { private final ScheduledExecutorService scheduler; @@ -39,18 +44,10 @@ public class DiscoveryClient { this.httpAgent = httpAgent; this.instanceInfo = instanceInfo; this.appPathIdentifier = instanceInfo.getAppName().toUpperCase() + "/" + instanceInfo.getInstanceId(); - this.heartbeatExecutor = ThreadPoolBuilder.builder() - .poolThreadSize(1, 5) - .keepAliveTime(0, TimeUnit.SECONDS) - .workQueue(new SynchronousQueue()) - .threadFactory("DiscoveryClient-HeartbeatExecutor", true) - .build(); - - this.scheduler = Executors.newScheduledThreadPool(2, - ThreadFactoryBuilder.builder() - .daemon(true) - .prefix("DiscoveryClient-Scheduler") - .build() + + this.scheduler = new ScheduledThreadPoolExecutor( + new Integer(1), + ThreadFactoryBuilder.builder().daemon(true).prefix("client.discovery.scheduler").build() ); register(); @@ -66,13 +63,13 @@ public class DiscoveryClient { boolean register() { log.info("{}{} - registering service...", PREFIX, appPathIdentifier); - String urlPath = Constants.BASE_PATH + "/apps/register/"; - Result registerResult = null; + String urlPath = BASE_PATH + "/apps/register/"; + Result registerResult; try { registerResult = httpAgent.httpPostByDiscovery(urlPath, instanceInfo); } catch (Exception ex) { registerResult = Results.failure(ErrorCodeEnum.SERVICE_ERROR); - log.error("{}{} - registration failed :: {}", PREFIX, appPathIdentifier, ex.getMessage(), ex); + log.error("{}{} - registration failed :: {}", PREFIX, appPathIdentifier, ex.getMessage()); } if (log.isInfoEnabled()) { @@ -82,6 +79,36 @@ public class DiscoveryClient { return registerResult.isSuccess(); } + @Override + public void destroy() throws Exception { + log.info("{}{} - destroy service...", PREFIX, appPathIdentifier); + String clientCloseUrlPath = Constants.BASE_PATH + "/client/close"; + Result clientCloseResult; + try { + String groupKeyIp = StrBuilder.create() + .append(instanceInfo.getGroupKey()) + .append(Constants.GROUP_KEY_DELIMITER) + .append(instanceInfo.getIdentify()) + .toString(); + + ClientCloseHookExecute.ClientCloseHookReq clientCloseHookReq = new ClientCloseHookExecute.ClientCloseHookReq(); + clientCloseHookReq.setAppName(instanceInfo.getAppName()) + .setInstanceId(instanceInfo.getInstanceId()) + .setGroupKey(groupKeyIp); + + clientCloseResult = httpAgent.httpPostByDiscovery(clientCloseUrlPath, clientCloseHookReq); + if (clientCloseResult.isSuccess()) { + log.info("{}{} -client close hook success.", PREFIX, appPathIdentifier); + } + } catch (Throwable ex) { + if (ex instanceof ShutdownExecuteException) { + return; + } + + log.error("{}{} - client close hook fail.", PREFIX, appPathIdentifier, ex); + } + } + public class HeartbeatThread implements Runnable { @Override @@ -93,7 +120,7 @@ public class DiscoveryClient { } boolean renew() { - Result renewResult = null; + Result renewResult; try { InstanceInfo.InstanceRenew instanceRenew = new InstanceInfo.InstanceRenew() .setAppName(instanceInfo.getAppName()) @@ -101,9 +128,8 @@ public class DiscoveryClient { .setLastDirtyTimestamp(instanceInfo.getLastDirtyTimestamp().toString()) .setStatus(instanceInfo.getStatus().toString()); - renewResult = httpAgent.httpPostByDiscovery(Constants.BASE_PATH + "/apps/renew", instanceRenew); - - if (renewResult.getCode() == ErrorCodeEnum.NOT_FOUND.getCode()) { + renewResult = httpAgent.httpPostByDiscovery(BASE_PATH + "/apps/renew", instanceRenew); + if (StrUtil.equals(ErrorCodeEnum.NOT_FOUND.getCode(), renewResult.getCode())) { long timestamp = instanceInfo.setIsDirtyWithTime(); boolean success = register(); if (success) { @@ -111,6 +137,7 @@ public class DiscoveryClient { } return success; } + return renewResult.isSuccess(); } catch (Exception ex) { log.error(PREFIX + "{} - was unable to send heartbeat!", appPathIdentifier, ex); diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java new file mode 100644 index 00000000..62a71f16 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java @@ -0,0 +1,204 @@ +package cn.hippo4j.starter.core; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.enums.EnableEnum; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.core.executor.DynamicThreadPool; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import cn.hippo4j.core.executor.manage.GlobalNotifyAlarmManage; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.support.*; +import cn.hippo4j.core.toolkit.inet.DynamicThreadPoolAnnotationUtil; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hutool.core.util.BooleanUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.core.task.TaskDecorator; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import static cn.hippo4j.common.constant.Constants.*; + +/** + * Dynamic threadPool post processor. + * + * @author chen.ma + * @date 2021/8/2 20:40 + */ +@Slf4j +@AllArgsConstructor +public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { + + private final BootstrapProperties properties; + + private final HttpAgent httpAgent; + + private final ThreadPoolOperation threadPoolOperation; + + private final ServerThreadPoolDynamicRefresh threadPoolDynamicRefresh; + + private final ExecutorService executorService = ThreadPoolBuilder.builder() + .corePoolSize(2) + .maxPoolNum(4) + .keepAliveTime(2000) + .timeUnit(TimeUnit.MILLISECONDS) + .workQueue(QueueTypeEnum.ARRAY_BLOCKING_QUEUE) + .capacity(1024) + .allowCoreThreadTimeOut(true) + .threadFactory("client.dynamic.threadPool.change.config") + .rejected(new ThreadPoolExecutor.AbortPolicy()) + .build(); + + @Override + public Object postProcessBeforeInitialization(Object bean, String beanName) { + return bean; + } + + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { + if (bean instanceof DynamicThreadPoolExecutor) { + DynamicThreadPool dynamicThreadPool; + try { + dynamicThreadPool = ApplicationContextHolder.findAnnotationOnBean(beanName, DynamicThreadPool.class); + if (Objects.isNull(dynamicThreadPool)) { + // 适配低版本 SpringBoot + dynamicThreadPool = DynamicThreadPoolAnnotationUtil.findAnnotationOnBean(beanName, DynamicThreadPool.class); + if (Objects.isNull(dynamicThreadPool)) { + return bean; + } + } + } catch (Exception ex) { + log.error("Failed to create dynamic thread pool in annotation mode.", ex); + return bean; + } + + DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) bean; + DynamicThreadPoolWrapper wrap = new DynamicThreadPoolWrapper(dynamicExecutor.getThreadPoolId(), dynamicExecutor); + ThreadPoolExecutor remoteExecutor = fillPoolAndRegister(wrap); + subscribeConfig(wrap); + + return remoteExecutor; + } + + if (bean instanceof DynamicThreadPoolWrapper) { + DynamicThreadPoolWrapper wrap = (DynamicThreadPoolWrapper) bean; + registerAndSubscribe(wrap); + } + + return bean; + } + + /** + * Register and subscribe. + * + * @param dynamicThreadPoolWrap + */ + protected void registerAndSubscribe(DynamicThreadPoolWrapper dynamicThreadPoolWrap) { + fillPoolAndRegister(dynamicThreadPoolWrap); + subscribeConfig(dynamicThreadPoolWrap); + } + + /** + * Fill the thread pool and register. + * + * @param dynamicThreadPoolWrap + */ + protected ThreadPoolExecutor fillPoolAndRegister(DynamicThreadPoolWrapper dynamicThreadPoolWrap) { + String tpId = dynamicThreadPoolWrap.getTpId(); + Map queryStrMap = new HashMap(3); + queryStrMap.put(TP_ID, tpId); + queryStrMap.put(ITEM_ID, properties.getItemId()); + queryStrMap.put(NAMESPACE, properties.getNamespace()); + + Result result; + boolean isSubscribe = false; + ThreadPoolExecutor newDynamicPoolExecutor = null; + PoolParameterInfo ppi = new PoolParameterInfo(); + + try { + result = httpAgent.httpGetByConfig(Constants.CONFIG_CONTROLLER_PATH, null, queryStrMap, 5000L); + if (result.isSuccess() && result.getData() != null) { + String resultJsonStr = JSONUtil.toJSONString(result.getData()); + if ((ppi = JSONUtil.parseObject(resultJsonStr, PoolParameterInfo.class)) != null) { + // 使用相关参数创建线程池 + BlockingQueue workQueue = QueueTypeEnum.createBlockingQueue(ppi.getQueueType(), ppi.getCapacity()); + newDynamicPoolExecutor = ThreadPoolBuilder.builder() + .dynamicPool() + .workQueue(workQueue) + .threadFactory(tpId) + .poolThreadSize(ppi.getCoreSize(), ppi.getMaxSize()) + .keepAliveTime(ppi.getKeepAliveTime(), TimeUnit.SECONDS) + .rejected(RejectedTypeEnum.createPolicy(ppi.getRejectedType())) + .allowCoreThreadTimeOut(EnableEnum.getBool(ppi.getAllowCoreThreadTimeOut())) + .build(); + + // 设置动态线程池增强参数 + if (dynamicThreadPoolWrap.getExecutor() instanceof AbstractDynamicExecutorSupport) { + ThreadPoolNotifyAlarm threadPoolNotifyAlarm = new ThreadPoolNotifyAlarm( + BooleanUtil.toBoolean(ppi.getIsAlarm().toString()), + ppi.getCapacityAlarm(), + ppi.getLivenessAlarm() + ); + GlobalNotifyAlarmManage.put(tpId, threadPoolNotifyAlarm); + + TaskDecorator taskDecorator = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).getTaskDecorator(); + ((DynamicThreadPoolExecutor) newDynamicPoolExecutor).setTaskDecorator(taskDecorator); + + long awaitTerminationMillis = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).awaitTerminationMillis; + boolean waitForTasksToCompleteOnShutdown = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).waitForTasksToCompleteOnShutdown; + ((DynamicThreadPoolExecutor) newDynamicPoolExecutor).setSupportParam(awaitTerminationMillis, waitForTasksToCompleteOnShutdown); + + long executeTimeOut = ((DynamicThreadPoolExecutor) dynamicThreadPoolWrap.getExecutor()).getExecuteTimeOut(); + ((DynamicThreadPoolExecutor) newDynamicPoolExecutor).setExecuteTimeOut(executeTimeOut); + } + + dynamicThreadPoolWrap.setExecutor(newDynamicPoolExecutor); + isSubscribe = true; + + + } + } + } catch (Exception ex) { + newDynamicPoolExecutor = dynamicThreadPoolWrap.getExecutor() != null ? dynamicThreadPoolWrap.getExecutor() : CommonDynamicThreadPool.getInstance(tpId); + dynamicThreadPoolWrap.setExecutor(newDynamicPoolExecutor); + + log.error("Failed to initialize thread pool configuration. error message :: {}", ex.getMessage()); + } finally { + if (Objects.isNull(dynamicThreadPoolWrap.getExecutor())) { + dynamicThreadPoolWrap.setExecutor(CommonDynamicThreadPool.getInstance(tpId)); + } + + // 设置是否订阅远端线程池配置 + dynamicThreadPoolWrap.setSubscribeFlag(isSubscribe); + } + + GlobalThreadPoolManage.register(dynamicThreadPoolWrap.getTpId(), ppi, dynamicThreadPoolWrap); + return newDynamicPoolExecutor; + } + + /** + * Client dynamic thread pool subscription server configuration. + * + * @param dynamicThreadPoolWrap + */ + protected void subscribeConfig(DynamicThreadPoolWrapper dynamicThreadPoolWrap) { + if (dynamicThreadPoolWrap.isSubscribeFlag()) { + threadPoolOperation.subscribeConfig(dynamicThreadPoolWrap.getTpId(), executorService, config -> threadPoolDynamicRefresh.dynamicRefresh(config)); + } + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/Listener.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/Listener.java similarity index 87% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/Listener.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/Listener.java index 28c6c759..043703b2 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/Listener.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/Listener.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.core; +package cn.hippo4j.starter.core; import java.util.concurrent.Executor; diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java new file mode 100644 index 00000000..c756bd42 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java @@ -0,0 +1,165 @@ +package cn.hippo4j.starter.core; + +import cn.hippo4j.common.enums.EnableEnum; +import cn.hippo4j.common.model.PoolParameter; +import cn.hippo4j.common.model.PoolParameterInfo; +import cn.hippo4j.common.notify.request.ChangeParameterNotifyRequest; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.support.AbstractDynamicExecutorSupport; +import cn.hippo4j.core.executor.support.QueueTypeEnum; +import cn.hippo4j.core.executor.support.RejectedTypeEnum; +import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue; +import cn.hippo4j.core.proxy.RejectedProxyUtil; +import cn.hippo4j.common.api.ThreadPoolDynamicRefresh; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.Objects; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Thread pool dynamic refresh. + * + * @author chen.ma + * @date 2021/6/20 15:51 + */ +@Slf4j +@AllArgsConstructor +public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh { + + private final ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler; + + @Override + public void dynamicRefresh(String content) { + PoolParameterInfo parameter = JSONUtil.parseObject(content, PoolParameterInfo.class); + + String threadPoolId = parameter.getTpId(); + ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); + + refreshDynamicPool(parameter, executor); + } + + /** + * Refresh dynamic pool. + * + * @param parameter + * @param executor + */ + public void refreshDynamicPool(PoolParameter parameter, ThreadPoolExecutor executor) { + String threadPoolId = parameter.getTpId(); + int originalCoreSize = executor.getCorePoolSize(); + int originalMaximumPoolSize = executor.getMaximumPoolSize(); + String originalQuery = executor.getQueue().getClass().getSimpleName(); + int originalCapacity = executor.getQueue().remainingCapacity() + executor.getQueue().size(); + long originalKeepAliveTime = executor.getKeepAliveTime(TimeUnit.SECONDS); + boolean originalAllowCoreThreadTimeOut = executor.allowsCoreThreadTimeOut(); + + Long originalExecuteTimeOut = null; + RejectedExecutionHandler rejectedExecutionHandler = executor.getRejectedExecutionHandler(); + if (executor instanceof AbstractDynamicExecutorSupport) { + DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) executor; + rejectedExecutionHandler = dynamicExecutor.getRedundancyHandler(); + originalExecuteTimeOut = dynamicExecutor.getExecuteTimeOut(); + } + String originalRejected = rejectedExecutionHandler.getClass().getSimpleName(); + + // Send change message. + ChangeParameterNotifyRequest request = new ChangeParameterNotifyRequest(); + request.setBeforeCorePoolSize(originalCoreSize); + request.setBeforeMaximumPoolSize(originalMaximumPoolSize); + request.setBeforeAllowsCoreThreadTimeOut(originalAllowCoreThreadTimeOut); + request.setBeforeKeepAliveTime(originalKeepAliveTime); + request.setBlockingQueueName(originalQuery); + request.setBeforeQueueCapacity(originalCapacity); + request.setBeforeRejectedName(originalRejected); + request.setBeforeExecuteTimeOut(originalExecuteTimeOut); + request.setThreadPoolId(threadPoolId); + + changePoolInfo(executor, parameter); + ThreadPoolExecutor afterExecutor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); + + request.setNowCorePoolSize(afterExecutor.getCorePoolSize()); + request.setNowMaximumPoolSize(afterExecutor.getMaximumPoolSize()); + request.setNowAllowsCoreThreadTimeOut(EnableEnum.getBool(parameter.getAllowCoreThreadTimeOut())); + request.setNowKeepAliveTime(afterExecutor.getKeepAliveTime(TimeUnit.SECONDS)); + request.setNowQueueCapacity((afterExecutor.getQueue().remainingCapacity() + afterExecutor.getQueue().size())); + request.setNowRejectedName(RejectedTypeEnum.getRejectedNameByType(parameter.getRejectedType())); + request.setNowExecuteTimeOut(originalExecuteTimeOut); + threadPoolNotifyAlarmHandler.sendPoolConfigChange(request); + + log.info( + "[{}] Changed thread pool. " + + "\n coreSize :: [{}]" + + "\n maxSize :: [{}]" + + "\n queueType :: [{}]" + + "\n capacity :: [{}]" + + "\n keepAliveTime :: [{}]" + + "\n executeTimeOut :: [{}]" + + "\n rejectedType :: [{}]" + + "\n allowCoreThreadTimeOut :: [{}]", + threadPoolId.toUpperCase(), + String.format("%s => %s", originalCoreSize, afterExecutor.getCorePoolSize()), + String.format("%s => %s", originalMaximumPoolSize, afterExecutor.getMaximumPoolSize()), + String.format("%s => %s", originalQuery, QueueTypeEnum.getBlockingQueueNameByType(parameter.getQueueType())), + String.format("%s => %s", originalCapacity, + (afterExecutor.getQueue().remainingCapacity() + afterExecutor.getQueue().size())), + String.format("%s => %s", originalKeepAliveTime, afterExecutor.getKeepAliveTime(TimeUnit.SECONDS)), + String.format("%s => %s", originalExecuteTimeOut, originalExecuteTimeOut), + String.format("%s => %s", originalRejected, RejectedTypeEnum.getRejectedNameByType(parameter.getRejectedType())), + String.format("%s => %s", originalAllowCoreThreadTimeOut, EnableEnum.getBool(parameter.getAllowCoreThreadTimeOut())) + ); + } + + /** + * Change pool info. + * + * @param executor + * @param parameter + */ + public void changePoolInfo(ThreadPoolExecutor executor, PoolParameter parameter) { + if (parameter.getCoreSize() != null) { + executor.setCorePoolSize(parameter.getCoreSize()); + } + + if (parameter.getMaxSize() != null) { + executor.setMaximumPoolSize(parameter.getMaxSize()); + } + + if (parameter.getCapacity() != null + && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.type, parameter.getQueueType())) { + if (executor.getQueue() instanceof ResizableCapacityLinkedBlockIngQueue) { + ResizableCapacityLinkedBlockIngQueue queue = (ResizableCapacityLinkedBlockIngQueue) executor.getQueue(); + queue.setCapacity(parameter.getCapacity()); + } else { + log.warn("The queue length cannot be modified. Queue type mismatch. Current queue type :: {}", executor.getQueue().getClass().getSimpleName()); + } + } + + if (parameter.getKeepAliveTime() != null) { + executor.setKeepAliveTime(parameter.getKeepAliveTime(), TimeUnit.SECONDS); + } + + if (parameter.getRejectedType() != null) { + RejectedExecutionHandler rejectedExecutionHandler = RejectedTypeEnum.createPolicy(parameter.getRejectedType()); + if (executor instanceof AbstractDynamicExecutorSupport) { + DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) executor; + dynamicExecutor.setRedundancyHandler(rejectedExecutionHandler); + AtomicLong rejectCount = dynamicExecutor.getRejectCount(); + rejectedExecutionHandler = RejectedProxyUtil.createProxy(rejectedExecutionHandler, parameter.getTpId(), rejectCount); + } + + executor.setRejectedExecutionHandler(rejectedExecutionHandler); + } + + if (parameter.getAllowCoreThreadTimeOut() != null) { + executor.allowCoreThreadTimeOut(EnableEnum.getBool(parameter.getAllowCoreThreadTimeOut())); + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ShutdownExecuteException.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ShutdownExecuteException.java new file mode 100644 index 00000000..bbe7232a --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ShutdownExecuteException.java @@ -0,0 +1,15 @@ +package cn.hippo4j.starter.core; + +/** + * Shutdown execute exception. + * + * @author chen.ma + * @date 2021/12/9 21:48 + */ +public class ShutdownExecuteException extends Exception { + + public ShutdownExecuteException() { + super("Execute task when stopped."); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolConfigService.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolConfigService.java new file mode 100644 index 00000000..82d07f63 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolConfigService.java @@ -0,0 +1,46 @@ +package cn.hippo4j.starter.core; + +import cn.hippo4j.starter.event.ApplicationCompleteEvent; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hippo4j.starter.remote.ServerHealthCheck; +import org.springframework.context.ApplicationListener; + +import java.util.Arrays; + +/** + * ThreadPool config service. + * + * @author chen.ma + * @date 2021/6/21 21:50 + */ +public class ThreadPoolConfigService implements ConfigService, ApplicationListener { + + private final ClientWorker clientWorker; + + private final ServerHealthCheck serverHealthCheck; + + public ThreadPoolConfigService(HttpAgent httpAgent, String identification, ServerHealthCheck serverHealthCheck) { + this.serverHealthCheck = serverHealthCheck; + this.clientWorker = new ClientWorker(httpAgent, identification, serverHealthCheck); + } + + @Override + public void addListener(String tenantId, String itemId, String tpId, Listener listener) { + clientWorker.addTenantListeners(tenantId, itemId, tpId, Arrays.asList(listener)); + } + + @Override + public String getServerStatus() { + if (serverHealthCheck.isHealthStatus()) { + return "UP"; + } else { + return "DOWN"; + } + } + + @Override + public void onApplicationEvent(ApplicationCompleteEvent event) { + clientWorker.notifyApplicationComplete(); + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolOperation.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolOperation.java similarity index 89% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolOperation.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolOperation.java index 7a98f10b..c6f771d5 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolOperation.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolOperation.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.starter.core; +package cn.hippo4j.starter.core; -import com.github.dynamic.threadpool.starter.config.BootstrapProperties; +import cn.hippo4j.starter.config.BootstrapProperties; import java.util.concurrent.Executor; diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolSubscribeCallback.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolSubscribeCallback.java similarity index 81% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolSubscribeCallback.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolSubscribeCallback.java index 1132040d..d6b08e4c 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/core/ThreadPoolSubscribeCallback.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ThreadPoolSubscribeCallback.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.starter.core; +package cn.hippo4j.starter.core; /** * ThreadPool subscribe callback. diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/ApplicationCompleteEvent.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/ApplicationCompleteEvent.java new file mode 100644 index 00000000..d3ae2b65 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/ApplicationCompleteEvent.java @@ -0,0 +1,23 @@ +package cn.hippo4j.starter.event; + +import org.springframework.context.ApplicationEvent; + +/** + * Execute after the spring application context is successfully started. + * + * @author chen.ma + * @date 2021/12/25 21:19 + */ +public class ApplicationCompleteEvent extends ApplicationEvent { + + /** + * Create a new {@code ApplicationEvent}. + * + * @param source the object on which the event initially occurred or with + * which the event is associated (never {@code null}) + */ + public ApplicationCompleteEvent(Object source) { + super(source); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/ApplicationContentPostProcessor.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/ApplicationContentPostProcessor.java new file mode 100644 index 00000000..f766e45e --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/ApplicationContentPostProcessor.java @@ -0,0 +1,32 @@ +package cn.hippo4j.starter.event; + +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationListener; + +import javax.annotation.Resource; + +/** + * Application content post processor. + * + * @author chen.ma + * @date 2021/12/25 20:21 + */ +public class ApplicationContentPostProcessor implements ApplicationListener { + + @Resource + private ApplicationContext applicationContext; + + private boolean executeOnlyOnce = true; + + @Override + public void onApplicationEvent(ApplicationReadyEvent event) { + synchronized (ApplicationContentPostProcessor.class) { + if (executeOnlyOnce) { + applicationContext.publishEvent(new ApplicationCompleteEvent(this)); + executeOnlyOnce = false; + } + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/MonitorEventExecutor.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/MonitorEventExecutor.java new file mode 100644 index 00000000..2648cec4 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/event/MonitorEventExecutor.java @@ -0,0 +1,45 @@ +package cn.hippo4j.starter.event; + +import cn.hippo4j.common.function.NoArgsConsumer; +import cn.hippo4j.core.executor.support.QueueTypeEnum; +import cn.hippo4j.core.executor.support.ThreadPoolBuilder; +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.ThreadPoolExecutor; + +import static cn.hippo4j.common.constant.Constants.AVAILABLE_PROCESSORS; + +/** + * 动态线程池监控事件执行器. + * + * @author chen.ma + * @date 2021/11/8 23:44 + */ +@Slf4j +public class MonitorEventExecutor { + + private static final ExecutorService EVENT_EXECUTOR = ThreadPoolBuilder.builder() + .threadFactory("client.monitor.event.executor") + .corePoolSize(AVAILABLE_PROCESSORS) + .maxPoolNum(AVAILABLE_PROCESSORS) + .workQueue(QueueTypeEnum.LINKED_BLOCKING_QUEUE) + .capacity(4096) + .rejected(new ThreadPoolExecutor.AbortPolicy()) + .build(); + + /** + * 发布事件. + * + * @param consumer + */ + public static void publishEvent(NoArgsConsumer consumer) { + try { + EVENT_EXECUTOR.execute(consumer::accept); + } catch (RejectedExecutionException ex) { + log.error("Monitoring thread pool run events exceeded load."); + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/ReportingEventExecutor.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/ReportingEventExecutor.java new file mode 100644 index 00000000..cb2e4564 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/ReportingEventExecutor.java @@ -0,0 +1,131 @@ +package cn.hippo4j.starter.monitor; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hippo4j.starter.monitor.collect.Collector; +import cn.hippo4j.starter.monitor.send.MessageSender; +import cn.hippo4j.starter.remote.ServerHealthCheck; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import cn.hippo4j.common.toolkit.ThreadUtil; +import cn.hutool.core.collection.CollUtil; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.boot.CommandLineRunner; + +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import static cn.hippo4j.core.executor.manage.GlobalThreadPoolManage.getThreadPoolNum; + +/** + * 动态线程池采集上报事件执行器. + *

+ * {@link BlockingQueue} 充当缓冲容器, 实现生产-消费模型. + * + * @author chen.ma + * @date 2021/12/6 20:23 + */ +@Slf4j +@RequiredArgsConstructor +public class ReportingEventExecutor implements Runnable, CommandLineRunner, DisposableBean { + + @NonNull + private final BootstrapProperties properties; + + @NonNull + private final MessageSender messageSender; + + @NonNull + private final ServerHealthCheck serverHealthCheck; + + /** + * 数据采集组件集合 + */ + private Map collectors; + + /** + * 数据采集的缓冲容器, 等待 ReportingEventExecutor 上报服务端 + */ + private BlockingQueue messageCollectVessel; + + /** + * 数据采集定时执行器, Spring 启动后延时一段时间进行采集动态线程池的运行数据 + */ + private ScheduledThreadPoolExecutor collectVesselExecutor; + + @SneakyThrows + @Override + public void run() { + while (true) { + try { + Message message = messageCollectVessel.take(); + messageSender.send(message); + } catch (Throwable ex) { + log.error("Consumption buffer container task failed. Number of buffer container tasks :: {}", messageCollectVessel.size(), ex); + } + } + } + + @Override + public void run(String... args) { + if (properties.getCollect()) { + Integer bufferSize = properties.getTaskBufferSize(); + messageCollectVessel = new ArrayBlockingQueue(bufferSize); + + String collectVesselTaskName = "client.scheduled.collect.data"; + collectVesselExecutor = new ScheduledThreadPoolExecutor( + new Integer(1), + ThreadFactoryBuilder.builder().daemon(true).prefix(collectVesselTaskName).build() + ); + + // 延迟 initialDelay 后循环调用. scheduleWithFixedDelay 每次执行时间为上一次任务结束时, 向后推一个时间间隔 + collectVesselExecutor.scheduleWithFixedDelay( + () -> runTimeGatherTask(), + properties.getInitialDelay(), + properties.getCollectInterval(), + TimeUnit.MILLISECONDS + ); + + // 启动上报监控数据线程 + String reportingTaskName = "client.thread.reporting.task"; + ThreadUtil.newThread(this, reportingTaskName, Boolean.TRUE).start(); + + // 获取所有数据采集组件, 目前仅有历史运行数据采集 + collectors = ApplicationContextHolder.getBeansOfType(Collector.class); + } + + log.info("Dynamic thread pool :: [{}]. The dynamic thread pool starts data collection and reporting. ", getThreadPoolNum()); + } + + @Override + public void destroy() { + Optional.ofNullable(collectVesselExecutor).ifPresent((each) -> each.shutdown()); + } + + /** + * 采集动态线程池数据, 并添加缓冲队列. + */ + private void runTimeGatherTask() { + boolean healthStatus = serverHealthCheck.isHealthStatus(); + if (!healthStatus || CollUtil.isEmpty(collectors)) { + return; + } + + collectors.forEach((beanName, collector) -> { + Message message = collector.collectMessage(); + boolean offer = messageCollectVessel.offer(message); + if (!offer) { + log.warn("Buffer data starts stacking data..."); + } + }); + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/collect/Collector.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/collect/Collector.java new file mode 100644 index 00000000..eba657e0 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/collect/Collector.java @@ -0,0 +1,20 @@ +package cn.hippo4j.starter.monitor.collect; + +import cn.hippo4j.common.monitor.Message; + +/** + * Collect dynamic thread pool data. + * + * @author chen.ma + * @date 2021/12/7 20:11 + */ +public interface Collector { + + /** + * Collect message. + * + * @return + */ + Message collectMessage(); + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/collect/RunTimeInfoCollector.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/collect/RunTimeInfoCollector.java new file mode 100644 index 00000000..9562e64b --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/collect/RunTimeInfoCollector.java @@ -0,0 +1,54 @@ +package cn.hippo4j.starter.monitor.collect; + +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.monitor.AbstractMessage; +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.MessageTypeEnum; +import cn.hippo4j.common.monitor.RuntimeMessage; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.core.executor.state.AbstractThreadPoolRuntime; +import cn.hutool.core.bean.BeanUtil; +import com.google.common.collect.Lists; +import lombok.AllArgsConstructor; + +import java.util.List; + +import static cn.hippo4j.core.toolkit.IdentifyUtil.getThreadPoolIdentify; + +/** + * Thread pool runtime data collection. + * + * @author chen.ma + * @date 2021/12/16 19:46 + */ +@AllArgsConstructor +public class RunTimeInfoCollector extends AbstractThreadPoolRuntime implements Collector { + + private final BootstrapProperties properties; + + @Override + public Message collectMessage() { + AbstractMessage message = new RuntimeMessage(); + + List runtimeMessages = Lists.newArrayList(); + List listThreadPoolId = GlobalThreadPoolManage.listThreadPoolId(); + for (String each : listThreadPoolId) { + PoolRunStateInfo poolRunState = getPoolRunState(each); + RuntimeMessage runtimeMessage = BeanUtil.toBean(poolRunState, RuntimeMessage.class); + runtimeMessage.setGroupKey(getThreadPoolIdentify(each, properties.getItemId(), properties.getNamespace())); + runtimeMessages.add(runtimeMessage); + } + + message.setMessageType(MessageTypeEnum.RUNTIME); + message.setMessages(runtimeMessages); + + return message; + } + + @Override + protected PoolRunStateInfo supplement(PoolRunStateInfo basePoolRunStateInfo) { + return basePoolRunStateInfo; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/send/HttpConnectSender.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/send/HttpConnectSender.java new file mode 100644 index 00000000..a2a5064e --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/send/HttpConnectSender.java @@ -0,0 +1,34 @@ +package cn.hippo4j.starter.monitor.send; + +import cn.hippo4j.common.monitor.Message; +import cn.hippo4j.common.monitor.MessageWrapper; +import cn.hippo4j.common.toolkit.MessageConvert; +import cn.hippo4j.starter.remote.HttpAgent; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import static cn.hippo4j.common.constant.Constants.MONITOR_PATH; + +/** + * Http mvc sender. + * + * @author chen.ma + * @date 2021/12/7 20:53 + */ +@Slf4j +@AllArgsConstructor +public class HttpConnectSender implements MessageSender { + + private final HttpAgent httpAgent; + + @Override + public void send(Message message) { + try { + MessageWrapper messageWrapper = MessageConvert.convert(message); + httpAgent.httpPost(MONITOR_PATH, messageWrapper); + } catch (Throwable ex) { + log.error("Failed to push dynamic thread pool runtime data.", ex); + } + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/send/MessageSender.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/send/MessageSender.java new file mode 100644 index 00000000..03cce85d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/monitor/send/MessageSender.java @@ -0,0 +1,20 @@ +package cn.hippo4j.starter.monitor.send; + +import cn.hippo4j.common.monitor.Message; + +/** + * Message sender. + * + * @author chen.ma + * @date 2021/12/7 20:49 + */ +public interface MessageSender { + + /** + * Send. + * + * @param message + */ + void send(Message message); + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/notify/ServerNotifyConfigBuilder.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/notify/ServerNotifyConfigBuilder.java new file mode 100644 index 00000000..aa89727d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/notify/ServerNotifyConfigBuilder.java @@ -0,0 +1,78 @@ +package cn.hippo4j.starter.notify; + +import cn.hippo4j.common.notify.AlarmControlHandler; +import cn.hippo4j.common.api.NotifyConfigBuilder; +import cn.hippo4j.common.notify.NotifyConfigDTO; +import cn.hippo4j.common.notify.ThreadPoolNotifyDTO; +import cn.hippo4j.common.notify.request.ThreadPoolNotifyRequest; +import cn.hippo4j.common.toolkit.GroupKey; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hippo4j.starter.remote.HttpAgent; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; +import java.util.Map; + +import static cn.hippo4j.common.constant.Constants.BASE_PATH; + +/** + * Server notify config builder. + * + * @author chen.ma + * @date 2022/2/24 19:57 + */ +@Slf4j +@AllArgsConstructor +public class ServerNotifyConfigBuilder implements NotifyConfigBuilder { + + private final HttpAgent httpAgent; + + private final BootstrapProperties properties; + + private final AlarmControlHandler alarmControlHandler; + + @Override + public Map> buildNotify() { + Map> resultMap = Maps.newHashMap(); + List threadPoolIds = GlobalThreadPoolManage.listThreadPoolId(); + if (CollUtil.isEmpty(threadPoolIds)) { + log.warn("The client does not have a dynamic thread pool instance configured."); + return resultMap; + } + + List groupKeys = Lists.newArrayList(); + threadPoolIds.forEach(each -> { + String groupKey = GroupKey.getKeyTenant(each, properties.getItemId(), properties.getNamespace()); + groupKeys.add(groupKey); + }); + + Result result = null; + try { + result = httpAgent.httpPostByDiscovery(BASE_PATH + "/notify/list/config", new ThreadPoolNotifyRequest(groupKeys)); + } catch (Throwable ex) { + log.error("Get dynamic thread pool notify configuration error. message :: {}", ex.getMessage()); + } + + if (result != null && result.isSuccess() && result.getData() != null) { + String resultDataStr = JSONUtil.toJSONString(result.getData()); + List resultData = JSONUtil.parseArray(resultDataStr, ThreadPoolNotifyDTO.class); + resultData.forEach(each -> resultMap.put(each.getNotifyKey(), each.getNotifyList())); + + resultMap.forEach((key, val) -> + val.stream().filter(each -> StrUtil.equals("ALARM", each.getType())) + .forEach(each -> alarmControlHandler.initCacheAndLock(each.getTpId(), each.getPlatform(), each.getInterval())) + ); + } + + return resultMap; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/AbstractHealthCheck.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/AbstractHealthCheck.java new file mode 100644 index 00000000..e218dd72 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/AbstractHealthCheck.java @@ -0,0 +1,143 @@ +package cn.hippo4j.starter.remote; + +import cn.hippo4j.starter.core.ShutdownExecuteException; +import cn.hippo4j.starter.event.ApplicationCompleteEvent; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationListener; + +import java.util.Objects; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; + +import static cn.hippo4j.common.constant.Constants.HEALTH_CHECK_INTERVAL; + +/** + * Abstract health check. + * + * @author chen.ma + * @date 2021/12/8 20:19 + */ +@Slf4j +public abstract class AbstractHealthCheck implements ServerHealthCheck, InitializingBean, ApplicationListener { + + /** + * Health status + */ + private volatile boolean healthStatus = true; + + /** + * Client shutdown hook + */ + private volatile boolean clientShutdownHook = false; + + /** + * Spring context init complete. TODO: Why this + */ + private boolean contextInitComplete = false; + + /** + * Health main lock + */ + private final ReentrantLock healthMainLock = new ReentrantLock(); + + /** + * Health condition + */ + private final Condition healthCondition = healthMainLock.newCondition(); + + /** + * Health check executor + */ + private final ScheduledThreadPoolExecutor healthCheckExecutor = new ScheduledThreadPoolExecutor( + new Integer(1), + ThreadFactoryBuilder.builder().daemon(true).prefix("client.scheduled.health.check").build() + ); + + /** + * Send health check. + * + * @return + */ + protected abstract boolean sendHealthCheck(); + + /** + * Health check. + */ + public void healthCheck() { + boolean healthCheckStatus = sendHealthCheck(); + if (healthCheckStatus) { + if (Objects.equals(healthStatus, false)) { + healthStatus = true; + log.info("The client reconnects to the server successfully."); + signalAllBizThread(); + } + } else { + healthStatus = false; + } + } + + @Override + @SneakyThrows + public boolean isHealthStatus() { + while (contextInitComplete + && !healthStatus && !clientShutdownHook) { + healthMainLock.lock(); + try { + healthCondition.await(); + } finally { + healthMainLock.unlock(); + } + } + + if (!healthStatus) { + throw new ShutdownExecuteException(); + } + + return healthStatus; + } + + @Override + public void setHealthStatus(boolean healthStatus) { + healthMainLock.lock(); + try { + this.healthStatus = healthStatus; + log.warn("The server health status setting is unavailable."); + } finally { + healthMainLock.unlock(); + } + } + + /** + * Signal all biz thread. + */ + private void signalAllBizThread() { + healthMainLock.lock(); + try { + healthCondition.signalAll(); + } finally { + healthMainLock.unlock(); + } + } + + @Override + public void afterPropertiesSet() throws Exception { + // 添加钩子函数, Client 端停止时, 如果 Server 端是非健康状态, Client 销毁函数会暂停运行 + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + clientShutdownHook = true; + signalAllBizThread(); + })); + + healthCheckExecutor.scheduleWithFixedDelay(() -> healthCheck(), 0, HEALTH_CHECK_INTERVAL, TimeUnit.SECONDS); + } + + @Override + public void onApplicationEvent(ApplicationCompleteEvent event) { + contextInitComplete = true; + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/HttpAgent.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java similarity index 81% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/HttpAgent.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java index e9470ab4..11c9156f 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/HttpAgent.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpAgent.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.starter.remote; +package cn.hippo4j.starter.remote; -import com.github.dynamic.threadpool.common.web.base.Result; +import cn.hippo4j.common.web.base.Result; import java.util.Map; @@ -31,6 +31,23 @@ public interface HttpAgent { */ String getEncode(); + /** + * Http get simple. + * + * @param path + * @return + */ + Result httpGetSimple(String path); + + /** + * Http post. + * + * @param path + * @param body + * @return + */ + Result httpPost(String path, Object body); + /** * Send HTTP post request by discovery. * diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpScheduledHealthCheck.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpScheduledHealthCheck.java new file mode 100644 index 00000000..0d59b3d4 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/HttpScheduledHealthCheck.java @@ -0,0 +1,39 @@ +package cn.hippo4j.starter.remote; + +import cn.hippo4j.common.web.base.Result; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.Objects; + +import static cn.hippo4j.common.constant.Constants.HEALTH_CHECK_PATH; +import static cn.hippo4j.common.constant.Constants.UP; + +/** + * Server health check. + * + * @author chen.ma + * @date 2021/12/8 20:16 + */ +@Slf4j +@AllArgsConstructor +public class HttpScheduledHealthCheck extends AbstractHealthCheck { + + private final HttpAgent httpAgent; + + @Override + protected boolean sendHealthCheck() { + boolean healthStatus = false; + try { + Result healthResult = httpAgent.httpGetSimple(HEALTH_CHECK_PATH); + if (healthResult != null && Objects.equals(healthResult.getData(), UP)) { + healthStatus = true; + } + } catch (Throwable ex) { + log.error("Failed to periodically check the health status of the server.", ex.getMessage()); + } + + return healthStatus; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHealthCheck.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHealthCheck.java new file mode 100644 index 00000000..d6be233d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHealthCheck.java @@ -0,0 +1,25 @@ +package cn.hippo4j.starter.remote; + +/** + * Server health check. + * + * @author chen.ma + * @date 2021/12/8 20:08 + */ +public interface ServerHealthCheck { + + /** + * Is health status. + * + * @return + */ + boolean isHealthStatus(); + + /** + * Set health status. + * + * @param healthStatus + */ + void setHealthStatus(boolean healthStatus); + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java new file mode 100644 index 00000000..fa83be85 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerHttpAgent.java @@ -0,0 +1,140 @@ +package cn.hippo4j.starter.remote; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hippo4j.starter.security.SecurityProxy; +import cn.hippo4j.starter.toolkit.HttpClientUtil; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import cn.hutool.core.util.StrUtil; +import com.google.common.collect.Maps; + +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * Server http agent. + * + * @author chen.ma + * @date 2021/6/23 20:50 + */ +public class ServerHttpAgent implements HttpAgent { + + private final BootstrapProperties dynamicThreadPoolProperties; + + private final ServerListManager serverListManager; + + private final HttpClientUtil httpClientUtil; + + private SecurityProxy securityProxy; + + private ServerHealthCheck serverHealthCheck; + + private ScheduledExecutorService executorService; + + private final long securityInfoRefreshIntervalMills = TimeUnit.SECONDS.toMillis(5); + + public ServerHttpAgent(BootstrapProperties properties, HttpClientUtil httpClientUtil) { + this.dynamicThreadPoolProperties = properties; + this.httpClientUtil = httpClientUtil; + this.serverListManager = new ServerListManager(dynamicThreadPoolProperties); + this.securityProxy = new SecurityProxy(httpClientUtil, properties); + + this.securityProxy.applyToken(this.serverListManager.getServerUrls()); + this.executorService = new ScheduledThreadPoolExecutor( + new Integer(1), + ThreadFactoryBuilder.builder().daemon(true).prefix("client.scheduled.token.security.updater").build() + ); + + this.executorService.scheduleWithFixedDelay( + () -> securityProxy.applyToken(serverListManager.getServerUrls()), + 0, + securityInfoRefreshIntervalMills, + TimeUnit.MILLISECONDS + ); + } + + @Override + public void start() { + + } + + @Override + public String getTenantId() { + return dynamicThreadPoolProperties.getNamespace(); + } + + @Override + public String getEncode() { + return null; + } + + @Override + public Result httpGetSimple(String path) { + path = injectSecurityInfoByPath(path); + return httpClientUtil.restApiGetHealth(buildUrl(path), Result.class); + } + + @Override + public Result httpPost(String path, Object body) { + isHealthStatus(); + path = injectSecurityInfoByPath(path); + return httpClientUtil.restApiPost(buildUrl(path), body, Result.class); + } + + @Override + public Result httpPostByDiscovery(String path, Object body) { + isHealthStatus(); + path = injectSecurityInfoByPath(path); + return httpClientUtil.restApiPost(buildUrl(path), body, Result.class); + } + + @Override + public Result httpGetByConfig(String path, Map headers, Map paramValues, long readTimeoutMs) { + isHealthStatus(); + injectSecurityInfo(paramValues); + return httpClientUtil.restApiGetByThreadPool(buildUrl(path), headers, paramValues, readTimeoutMs, Result.class); + } + + @Override + public Result httpPostByConfig(String path, Map headers, Map paramValues, long readTimeoutMs) { + isHealthStatus(); + injectSecurityInfo(paramValues); + return httpClientUtil.restApiPostByThreadPool(buildUrl(path), headers, paramValues, readTimeoutMs, Result.class); + } + + @Override + public Result httpDeleteByConfig(String path, Map headers, Map paramValues, long readTimeoutMs) { + return null; + } + + private String buildUrl(String path) { + return serverListManager.getCurrentServerAddr() + path; + } + + private void isHealthStatus() { + if (serverHealthCheck == null) { + serverHealthCheck = ApplicationContextHolder.getBean(ServerHealthCheck.class); + } + + serverHealthCheck.isHealthStatus(); + } + + private Map injectSecurityInfo(Map params) { + if (StrUtil.isNotBlank(securityProxy.getAccessToken())) { + params.put(Constants.ACCESS_TOKEN, securityProxy.getAccessToken()); + } + + return params; + } + + @Deprecated + private String injectSecurityInfoByPath(String path) { + String resultPath = httpClientUtil.buildUrl(path, injectSecurityInfo(Maps.newHashMap())); + return resultPath; + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/ServerListManager.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerListManager.java similarity index 79% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/ServerListManager.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerListManager.java index d8ccecd9..60f8edb4 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/remote/ServerListManager.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/remote/ServerListManager.java @@ -1,6 +1,8 @@ -package com.github.dynamic.threadpool.starter.remote; +package cn.hippo4j.starter.remote; -import com.github.dynamic.threadpool.starter.config.BootstrapProperties; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hutool.core.util.StrUtil; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.util.StringUtils; @@ -21,6 +23,7 @@ public class ServerListManager { private String serverAddrsStr; + @Getter volatile List serverUrls = new ArrayList(); private volatile String currentServerAddr; @@ -34,18 +37,21 @@ public class ServerListManager { serverAddrsStr = properties.getServerAddr(); if (!StringUtils.isEmpty(serverAddrsStr)) { - List serverAddrs = new ArrayList(); - String[] serverAddrsArr = this.serverAddrsStr.split(","); - - for (String serverAddr : serverAddrsArr) { - if (serverAddr.startsWith(HTTPS) || serverAddr.startsWith(HTTP)) { - // TODO Temporarily fixed write, later optimized - currentServerAddr = serverAddr; - serverAddrs.add(serverAddr); + List serverAddrList = new ArrayList(); + String[] serverAddrListArr = this.serverAddrsStr.split(","); + + for (String serverAddr : serverAddrListArr) { + boolean whetherJoint = StrUtil.isNotBlank(serverAddr) + && !serverAddr.startsWith(HTTPS) && !serverAddr.startsWith(HTTP); + if (whetherJoint) { + serverAddr = HTTP + serverAddr; } + + currentServerAddr = serverAddr; + serverAddrList.add(serverAddr); } - this.serverUrls = serverAddrs; + this.serverUrls = serverAddrList; } } @@ -58,9 +64,6 @@ public class ServerListManager { } Iterator iterator() { - if (serverUrls.isEmpty()) { - log.error("[iterator-serverlist] No server address defined!"); - } return new ServerAddressIterator(serverUrls); } diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/security/SecurityProxy.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/security/SecurityProxy.java new file mode 100644 index 00000000..f0ec7fef --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/security/SecurityProxy.java @@ -0,0 +1,102 @@ +package cn.hippo4j.starter.security; + +import cn.hippo4j.common.constant.Constants; +import cn.hippo4j.common.model.TokenInfo; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.common.web.base.Result; +import cn.hippo4j.starter.config.BootstrapProperties; +import cn.hippo4j.starter.toolkit.HttpClientUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * Security proxy. + * + * @author chen.ma + * @date 2021/12/20 20:19 + */ +@Slf4j +public class SecurityProxy { + + private static final String APPLY_TOKEN_URL = Constants.BASE_PATH + "/auth/users/apply/token"; + + private final HttpClientUtil httpClientUtil; + + private final String username; + + private final String password; + + private String accessToken; + + private long tokenTtl; + + private long lastRefreshTime; + + private long tokenRefreshWindow; + + public SecurityProxy(HttpClientUtil httpClientUtil, BootstrapProperties properties) { + username = properties.getUsername(); + password = properties.getPassword(); + this.httpClientUtil = httpClientUtil; + } + + public boolean applyToken(List servers) { + try { + if ((System.currentTimeMillis() - lastRefreshTime) < TimeUnit.SECONDS + .toMillis(tokenTtl - tokenRefreshWindow)) { + return true; + } + + for (String server : servers) { + if (applyToken(server)) { + lastRefreshTime = System.currentTimeMillis(); + return true; + } + } + } catch (Throwable ignore) { + // ignore + } + + return false; + } + + public boolean applyToken(String server) { + if (StringUtil.isAllNotEmpty(username, password)) { + String url = server + APPLY_TOKEN_URL; + + Map bodyMap = new HashMap(2); + bodyMap.put("userName", username); + bodyMap.put("password", password); + + try { + Result result = httpClientUtil.restApiPost(url, bodyMap, Result.class); + if (!result.isSuccess()) { + log.error("Error getting access token. message :: {}", result.getMessage()); + return false; + } + + String tokenJsonStr = JSONUtil.toJSONString(result.getData()); + TokenInfo tokenInfo = JSONUtil.parseObject(tokenJsonStr, TokenInfo.class); + + accessToken = tokenInfo.getAccessToken(); + tokenTtl = tokenInfo.getTokenTtl(); + tokenRefreshWindow = tokenTtl / 10; + } catch (Throwable ex) { + log.error("Failed to apply for token. message :: {}", ex.getMessage()); + return false; + } + } + + return true; + } + + public String getAccessToken() { + return accessToken; + } + +} diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/CloudCommonIdUtil.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/CloudCommonIdUtil.java similarity index 80% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/CloudCommonIdUtil.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/CloudCommonIdUtil.java index 23e42d9a..bbe1f515 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/CloudCommonIdUtil.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/CloudCommonIdUtil.java @@ -1,10 +1,9 @@ -package com.github.dynamic.threadpool.starter.toolkit; +package cn.hippo4j.starter.toolkit; +import cn.hippo4j.core.toolkit.inet.InetUtils; import lombok.SneakyThrows; import org.springframework.core.env.PropertyResolver; -import java.net.InetAddress; - /** * Cloud common id util. * @@ -16,16 +15,15 @@ public class CloudCommonIdUtil { private static final String SEPARATOR = ":"; @SneakyThrows - public static String getDefaultInstanceId(PropertyResolver resolver) { - String namePart = getIpApplicationName(resolver); + public static String getDefaultInstanceId(PropertyResolver resolver, InetUtils inetUtils) { + String namePart = getIpApplicationName(resolver, inetUtils); String indexPart = resolver.getProperty("spring.application.instance_id", resolver.getProperty("server.port")); return combineParts(namePart, SEPARATOR, indexPart); } @SneakyThrows - public static String getIpApplicationName(PropertyResolver resolver) { - InetAddress host = InetAddress.getLocalHost(); - String hostname = host.getHostAddress(); + public static String getIpApplicationName(PropertyResolver resolver, InetUtils inetUtils) { + String hostname = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); String appName = resolver.getProperty("spring.application.name"); return combineParts(hostname, SEPARATOR, appName); } diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/HttpClientUtil.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/HttpClientUtil.java similarity index 58% rename from dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/HttpClientUtil.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/HttpClientUtil.java index def09a01..f156a6a7 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/com/github/dynamic/threadpool/starter/toolkit/HttpClientUtil.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/toolkit/HttpClientUtil.java @@ -1,12 +1,13 @@ -package com.github.dynamic.threadpool.starter.toolkit; +package cn.hippo4j.starter.toolkit; -import com.alibaba.fastjson.JSON; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.common.web.exception.ServiceException; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import okhttp3.*; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -19,15 +20,15 @@ import java.util.concurrent.TimeUnit; @Slf4j public class HttpClientUtil { - @Autowired - private OkHttpClient okHttpClient; + @Resource + private OkHttpClient hippo4JOkHttpClient; private MediaType jsonMediaType = MediaType.parse("application/json; charset=utf-8"); private static int HTTP_OK_CODE = 200; /** - * Get 请求 + * Get 请求. * * @param url * @return @@ -43,7 +44,7 @@ public class HttpClientUtil { } /** - * Get 请求, 支持添加查询字符串 + * Get 请求, 支持添加查询字符串. * * @param url * @param queryString 查询字符串 @@ -55,7 +56,7 @@ public class HttpClientUtil { } /** - * 获取 Json 后直接反序列化 + * 获取 Json 后直接反序列化. * * @param url * @param clazz @@ -63,11 +64,25 @@ public class HttpClientUtil { */ public T restApiGet(String url, Class clazz) { String resp = get(url); - return JSON.parseObject(resp, clazz); + return JSONUtil.parseObject(resp, clazz); } /** - * Get 请求, 支持查询字符串 + * 调用健康检查. + * + * @param url + * @param clazz + * @param + * @return + */ + @SneakyThrows + public T restApiGetHealth(String url, Class clazz) { + String resp = new String(doGet(url), "utf-8"); + return JSONUtil.parseObject(resp, clazz); + } + + /** + * Get 请求, 支持查询字符串. * * @param url * @param queryString @@ -78,11 +93,11 @@ public class HttpClientUtil { public T restApiGet(String url, Map queryString, Class clazz) { String fullUrl = buildUrl(url, queryString); String resp = get(fullUrl); - return JSON.parseObject(resp, clazz); + return JSONUtil.parseObject(resp, clazz); } /** - * Rest 接口 Post 调用 + * Rest 接口 Post 调用. * * @param url * @param body @@ -92,14 +107,14 @@ public class HttpClientUtil { try { return doPost(url, body); } catch (Exception e) { - log.error("httpPost 调用失败. {}", url, e); + log.error("httpPost 调用失败. {} message :: {}", url, e.getMessage()); throw e; } } /** - * Rest 接口 Post 调用 - * 对返回值直接反序列化 + * Rest 接口 Post 调用. + * 对返回值直接反序列化. * * @param url * @param body @@ -107,11 +122,11 @@ public class HttpClientUtil { */ public T restApiPost(String url, Object body, Class clazz) { String resp = restApiPost(url, body); - return JSON.parseObject(resp, clazz); + return JSONUtil.parseObject(resp, clazz); } /** - * 根据查询字符串构造完整的 Url + * 根据查询字符串构造完整的 Url. * * @param url * @param queryString @@ -145,29 +160,36 @@ public class HttpClientUtil { @SneakyThrows private String doPost(String url, Object body) { - String jsonBody = JSON.toJSONString(body); + String jsonBody = JSONUtil.toJSONString(body); RequestBody requestBody = RequestBody.create(jsonMediaType, jsonBody); Request request = new Request.Builder() .url(url) .post(requestBody) .build(); - Response resp = okHttpClient.newCall(request).execute(); - if (resp.code() != HTTP_OK_CODE) { - String msg = String.format("HttpPost 响应 code 异常. [code] %s [url] %s [body] %s", resp.code(), url, jsonBody); - throw new RuntimeException(msg); + try (Response resp = hippo4JOkHttpClient.newCall(request).execute()) { + try (ResponseBody responseBody = resp.body()) { + if (resp.code() != HTTP_OK_CODE) { + String msg = String.format("HttpPost 响应 code 异常. [code] %s [url] %s [body] %s", resp.code(), url, jsonBody); + throw new ServiceException(msg); + } + + return responseBody.string(); + } } - return resp.body().string(); } @SneakyThrows private byte[] doGet(String url) { Request request = new Request.Builder().get().url(url).build(); - Response resp = okHttpClient.newCall(request).execute(); - if (resp.code() != HTTP_OK_CODE) { - String msg = String.format("HttpGet 响应 code 异常. [code] %s [url] %s", resp.code(), url); - throw new RuntimeException(msg); + try (Response resp = hippo4JOkHttpClient.newCall(request).execute()) { + try (ResponseBody responseBody = resp.body()) { + if (resp.code() != HTTP_OK_CODE) { + String msg = String.format("HttpGet 响应 code 异常. [code] %s [url] %s", resp.code(), url); + throw new ServiceException(msg); + } + return responseBody.bytes(); + } } - return resp.body().bytes(); } @SneakyThrows @@ -181,17 +203,20 @@ public class HttpClientUtil { Request request = builder.url(buildUrl).build(); - Call call = okHttpClient.newCall(request); + Call call = hippo4JOkHttpClient.newCall(request); call.timeout().timeout(readTimeoutMs, TimeUnit.MILLISECONDS); - Response resp = call.execute(); - if (resp.code() != HTTP_OK_CODE) { - String msg = String.format("HttpGet 响应 code 异常. [code] %s [url] %s", resp.code(), url); - log.error(msg); - throw new RuntimeException(msg); - } + try (Response resp = call.execute()) { + try (ResponseBody responseBody = resp.body()) { + if (resp.code() != HTTP_OK_CODE) { + String msg = String.format("HttpGet 响应 code 异常. [code] %s [url] %s", resp.code(), url); + log.error(msg); + throw new ServiceException(msg); + } - return JSON.parseObject(resp.body().string(), clazz); + return JSONUtil.parseObject(responseBody.string(), clazz); + } + } } @SneakyThrows @@ -204,16 +229,20 @@ public class HttpClientUtil { .post(RequestBody.create(jsonMediaType, "")) .build(); - Call call = okHttpClient.newCall(request); + Call call = hippo4JOkHttpClient.newCall(request); call.timeout().timeout(readTimeoutMs, TimeUnit.MILLISECONDS); - Response resp = call.execute(); - if (resp.code() != HTTP_OK_CODE) { - String msg = String.format("HttpPost 响应 code 异常. [code] %s [url] %s.", resp.code(), url); - log.error(msg); - throw new RuntimeException(msg); + try (Response resp = call.execute()) { + try (ResponseBody responseBody = resp.body()) { + if (resp.code() != HTTP_OK_CODE) { + String msg = String.format("HttpPost 响应 code 异常. [code] %s [url] %s.", resp.code(), url); + log.error(msg); + throw new ServiceException(msg); + } + + return JSONUtil.parseObject(responseBody.string(), clazz); + } } - return JSON.parseObject(resp.body().string(), clazz); } } diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/wrapper/ManagerListenerWrapper.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/wrapper/ManagerListenerWrapper.java new file mode 100644 index 00000000..6ec9b9d8 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/wrapper/ManagerListenerWrapper.java @@ -0,0 +1,31 @@ +package cn.hippo4j.starter.wrapper; + +import cn.hippo4j.starter.core.Listener; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** + * Manager listener wrapper. + * + * @author chen.ma + * @date 2021/6/22 17:47 + */ +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class ManagerListenerWrapper { + + /** + * Last call md5 + */ + private String lastCallMd5; + + /** + * Listener + */ + private Listener listener; + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/LICENSE b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/LICENSE new file mode 100644 index 00000000..ff773796 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + https://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. diff --git a/dynamic-threadpool-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json similarity index 100% rename from dynamic-threadpool-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/spring.factories b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..dcfef765 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.starter.config.DynamicThreadPoolAutoConfiguration +org.springframework.boot.diagnostics.FailureAnalyzer=cn.hippo4j.starter.core.ConfigEmptyAnalyzer diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java new file mode 100644 index 00000000..a4b18134 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/MonitorPerformanceTest.java @@ -0,0 +1,107 @@ +package cn.hippo4j.starter.test; + +import cn.hippo4j.common.model.PoolRunStateInfo; +import cn.hippo4j.common.toolkit.JSONUtil; +import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; +import cn.hippo4j.starter.monitor.collect.RunTimeInfoCollector; +import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue; +import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; +import cn.hippo4j.core.executor.support.ThreadPoolBuilder; +import cn.hippo4j.common.toolkit.ThreadUtil; +import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * 监控性能测试. + * + * @author chen.ma + * @date 2022/1/12 08:17 + */ +@Slf4j +public class MonitorPerformanceTest { + + private static final int MAX_EXECUTE = 20000; + + private static final String TEST_FLAG = "test.monitor.performance"; + + private static final RunTimeInfoCollector COLLECTOR = new RunTimeInfoCollector(null); + + private static final ThreadPoolExecutor DYNAMIC_EXECUTOR = ThreadPoolBuilder.builder() + .dynamicPool() + .threadFactory(TEST_FLAG) + .poolThreadSize(5, 10) + .workQueue(new ResizableCapacityLinkedBlockIngQueue(1024)) + .rejected(new ThreadPoolExecutor.AbortPolicy()) + .build(); + + private static final ThreadPoolExecutor MONITOR_DYNAMIC_EXECUTOR = ThreadPoolBuilder.builder() + .dynamicPool() + .threadFactory("dynamic.thread.pool") + .poolThreadSize(5, 10) + .workQueue(new ResizableCapacityLinkedBlockIngQueue(1024)) + .rejected(new ThreadPoolExecutor.AbortPolicy()) + .build(); + + private static final ScheduledThreadPoolExecutor COLLECT_VESSEL_EXECUTOR = new ScheduledThreadPoolExecutor( + new Integer(1), + ThreadFactoryBuilder.builder().daemon(true).prefix("client.scheduled.collect.dat").build() + ); + + static { + DynamicThreadPoolWrapper wrapper = new DynamicThreadPoolWrapper(TEST_FLAG, DYNAMIC_EXECUTOR); + GlobalThreadPoolManage.registerPool(TEST_FLAG, wrapper); + } + + public static void main(String[] args) { + log.info("测试线程池, 执行时长 :: {}", testExecutorTime(DYNAMIC_EXECUTOR)); + + log.info("开始执行 DYNAMIC_EXECUTOR 线程池销毁..."); + while (!DYNAMIC_EXECUTOR.isTerminated()) { + ThreadUtil.sleep(500); + } + + COLLECT_VESSEL_EXECUTOR.scheduleWithFixedDelay( + () -> { + PoolRunStateInfo poolRunState = COLLECTOR.getPoolRunState(TEST_FLAG); + log.info("采集数据 :: {}", JSONUtil.toJSONString(poolRunState)); + }, + 1000, + 1000, + TimeUnit.MILLISECONDS + ); + + log.info("测试带有监控线程池, 执行时长 :: {}", testExecutorTime(MONITOR_DYNAMIC_EXECUTOR)); + + log.info("开始执行 MONITOR_DYNAMIC_EXECUTOR 线程池销毁..."); + while (!MONITOR_DYNAMIC_EXECUTOR.isTerminated()) { + ThreadUtil.sleep(500); + } + + COLLECT_VESSEL_EXECUTOR.shutdownNow(); + } + + private static Long testExecutorTime(ThreadPoolExecutor executor) { + long startTime = System.currentTimeMillis(); + for (int i = 0; i < MAX_EXECUTE; i++) { + try { + ThreadUtil.sleep(1); + executor.execute(() -> { + ThreadUtil.sleep(5); + }); + } catch (Exception ex) { + // ignore + log.error("拒绝策略执行."); + } + } + + long endTime = System.currentTimeMillis(); + + executor.shutdown(); + return endTime - startTime; + } + +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/RejectedExecutionHandlerProxyTest.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/RejectedExecutionHandlerProxyTest.java new file mode 100644 index 00000000..ce54ece6 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/RejectedExecutionHandlerProxyTest.java @@ -0,0 +1,50 @@ +package cn.hippo4j.starter.test; + +import cn.hippo4j.core.executor.DynamicThreadPoolExecutor; +import cn.hippo4j.core.executor.support.ThreadPoolBuilder; +import cn.hippo4j.common.toolkit.ThreadUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * Rejected execution handler proxy test. + * + * @author chen.ma + * @date 2022/2/17 19:52 + */ +@Slf4j +public class RejectedExecutionHandlerProxyTest { + + public static void main(String[] args) { + for (int i = 0; i < 2; i++) { + test(i + ""); + } + } + + private static void test(String threadPoolId) { + ThreadPoolExecutor executor = ThreadPoolBuilder.builder() + .threadPoolId(threadPoolId) + .threadFactory(threadPoolId) + .poolThreadSize(1, 1) + .workQueue(new LinkedBlockingQueue(1)) + .dynamicPool() + .build(); + + + for (int i = 0; i < 300; i++) { + try { + executor.execute(() -> ThreadUtil.sleep(Integer.MAX_VALUE)); + } catch (Exception ex) { + log.error("ThreadPool name :: {}, Exception :: ", Thread.currentThread().getName(), ex); + } + } + + ThreadUtil.sleep(1000); + + DynamicThreadPoolExecutor dynamicThreadPoolExecutor = (DynamicThreadPoolExecutor) executor; + long rejectCount = dynamicThreadPoolExecutor.getRejectCountNum(); + log.info("ThreadPool name :: {}, Reject count :: {}", Thread.currentThread().getName(), rejectCount); + } +} diff --git a/dynamic-threadpool-spring-boot-starter/src/test/java/com/github/dynamic/threadpool/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java similarity index 94% rename from dynamic-threadpool-spring-boot-starter/src/test/java/com/github/dynamic/threadpool/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java rename to hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java index 08b84a1a..466c2259 100644 --- a/dynamic-threadpool-spring-boot-starter/src/test/java/com/github/dynamic/threadpool/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/test/java/cn/hippo4j/starter/test/ResizableCapacityLinkedBlockIngQueueTest.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.starter.test; +package cn.hippo4j.starter.test; -import com.github.dynamic.threadpool.starter.toolkit.thread.ResizableCapacityLinkedBlockIngQueue; +import cn.hippo4j.core.executor.support.ResizableCapacityLinkedBlockIngQueue; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.LinkedBlockingQueue; diff --git a/hippo4j-spring-boot/pom.xml b/hippo4j-spring-boot/pom.xml new file mode 100644 index 00000000..ed7f0b63 --- /dev/null +++ b/hippo4j-spring-boot/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-all + ${revision} + + + hippo4j-spring-boot + ${project.artifactId} + + pom + Hippo4J Starter List + + + hippo4j-core-spring-boot-starter + hippo4j-spring-boot-starter + + + diff --git a/hippo4j-tools/.gitignore b/hippo4j-tools/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-tools/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/hippo4j-tools/log-record-tool/.gitignore b/hippo4j-tools/log-record-tool/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-tools/log-record-tool/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/tools/log-record-tool/pom.xml b/hippo4j-tools/log-record-tool/pom.xml similarity index 84% rename from tools/log-record-tool/pom.xml rename to hippo4j-tools/log-record-tool/pom.xml index b8ce38db..a68c1d67 100644 --- a/tools/log-record-tool/pom.xml +++ b/hippo4j-tools/log-record-tool/pom.xml @@ -4,8 +4,8 @@ 4.0.0 - com.github.dynamic-threadpool - tools + cn.hippo4j + hippo4j-tools ${revision} @@ -13,11 +13,11 @@ jar ${project.artifactId} - - 操作日志记录工具类, 借鉴以下开源项目 - - https://github.com/mouzt/mzt-biz-log - - https://github.com/dadiyang/equator - + 操作日志记录工具类. + + + true + diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/annotation/LogField.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/annotation/LogField.java similarity index 78% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/annotation/LogField.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/annotation/LogField.java index f6dadfa8..9953bf43 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/annotation/LogField.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/annotation/LogField.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.annotation; +package cn.hippo4j.tools.logrecord.annotation; /** * 日志字段, 用于标记需要比较的实体属性. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/annotation/LogRecord.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/annotation/LogRecord.java similarity index 87% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/annotation/LogRecord.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/annotation/LogRecord.java index c1c2f767..489e1af7 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/annotation/LogRecord.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/annotation/LogRecord.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.annotation; +package cn.hippo4j.tools.logrecord.annotation; -import com.github.dynamic.threadpool.logrecord.enums.LogRecordTypeEnum; +import cn.hippo4j.tools.logrecord.enums.LogRecordTypeEnum; import java.lang.annotation.*; @@ -20,7 +20,7 @@ public @interface LogRecord { * * @return */ - String prefix(); + String prefix() default ""; /** * 操作日志文本模版 diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/aop/LogRecordAspect.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/aop/LogRecordAspect.java similarity index 90% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/aop/LogRecordAspect.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/aop/LogRecordAspect.java index 5ff0fb73..8f7d4feb 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/aop/LogRecordAspect.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/aop/LogRecordAspect.java @@ -1,14 +1,14 @@ -package com.github.dynamic.threadpool.logrecord.aop; - -import com.github.dynamic.threadpool.logrecord.annotation.LogRecord; -import com.github.dynamic.threadpool.logrecord.context.LogRecordContext; -import com.github.dynamic.threadpool.logrecord.model.LogRecordInfo; -import com.github.dynamic.threadpool.logrecord.model.LogRecordOps; -import com.github.dynamic.threadpool.logrecord.model.MethodExecuteResult; -import com.github.dynamic.threadpool.logrecord.parse.LogRecordOperationSource; -import com.github.dynamic.threadpool.logrecord.parse.LogRecordValueParser; -import com.github.dynamic.threadpool.logrecord.service.LogRecordService; -import com.github.dynamic.threadpool.logrecord.service.OperatorGetService; +package cn.hippo4j.tools.logrecord.aop; + +import cn.hippo4j.tools.logrecord.annotation.LogRecord; +import cn.hippo4j.tools.logrecord.context.LogRecordContext; +import cn.hippo4j.tools.logrecord.model.LogRecordInfo; +import cn.hippo4j.tools.logrecord.model.LogRecordOps; +import cn.hippo4j.tools.logrecord.model.MethodExecuteResult; +import cn.hippo4j.tools.logrecord.parse.LogRecordOperationSource; +import cn.hippo4j.tools.logrecord.parse.LogRecordValueParser; +import cn.hippo4j.tools.logrecord.service.LogRecordService; +import cn.hippo4j.tools.logrecord.service.OperatorGetService; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -148,8 +148,9 @@ public class LogRecordAspect { Map expressionValues = logRecordValueParser.processTemplate(spElTemplates, ret, targetClass, method, args, errorMsg, functionNameAndReturnMap); if (logConditionPassed(operation.getCondition(), expressionValues)) { + String tenant = environment.getProperty("tenant"); LogRecordInfo logRecordInfo = LogRecordInfo.builder() - .tenant(environment.getProperty("tenant")) + .tenant(StringUtils.isEmpty(tenant) ? "hippo4j" : tenant) .bizKey(expressionValues.get(operation.getBizKey())) .bizNo(expressionValues.get(operation.getBizNo())) .operator(getRealOperatorId(operation, operatorIdFromService, expressionValues)) diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/AbstractEquator.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/AbstractEquator.java similarity index 99% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/AbstractEquator.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/AbstractEquator.java index 484f6cc5..727a5890 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/AbstractEquator.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/AbstractEquator.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.compare; +package cn.hippo4j.tools.logrecord.compare; import java.util.*; import java.util.stream.Collectors; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/Equator.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/Equator.java similarity index 89% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/Equator.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/Equator.java index 6f487a39..9b5a627a 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/Equator.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/Equator.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.compare; +package cn.hippo4j.tools.logrecord.compare; import java.util.List; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/FieldInfo.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/FieldInfo.java similarity index 97% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/FieldInfo.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/FieldInfo.java index c928ae44..e7cafca4 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/FieldInfo.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/FieldInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.compare; +package cn.hippo4j.tools.logrecord.compare; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/GetterBaseEquator.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/GetterBaseEquator.java similarity index 99% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/GetterBaseEquator.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/GetterBaseEquator.java index 45270b93..ee82f600 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/compare/GetterBaseEquator.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/compare/GetterBaseEquator.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.compare; +package cn.hippo4j.tools.logrecord.compare; import lombok.NoArgsConstructor; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/config/LogRecordConfig.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/config/LogRecordConfig.java similarity index 75% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/config/LogRecordConfig.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/config/LogRecordConfig.java index 69223eed..c20f6f3a 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/config/LogRecordConfig.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/config/LogRecordConfig.java @@ -1,12 +1,12 @@ -package com.github.dynamic.threadpool.logrecord.config; +package cn.hippo4j.tools.logrecord.config; -import com.github.dynamic.threadpool.logrecord.parse.LogRecordOperationSource; -import com.github.dynamic.threadpool.logrecord.service.FunctionService; -import com.github.dynamic.threadpool.logrecord.service.LogRecordService; -import com.github.dynamic.threadpool.logrecord.service.OperatorGetService; -import com.github.dynamic.threadpool.logrecord.service.ParseFunction; -import com.github.dynamic.threadpool.logrecord.parse.LogRecordValueParser; -import com.github.dynamic.threadpool.logrecord.service.impl.*; +import cn.hippo4j.tools.logrecord.parse.LogRecordOperationSource; +import cn.hippo4j.tools.logrecord.parse.LogRecordValueParser; +import cn.hippo4j.tools.logrecord.service.FunctionService; +import cn.hippo4j.tools.logrecord.service.LogRecordService; +import cn.hippo4j.tools.logrecord.service.OperatorGetService; +import cn.hippo4j.tools.logrecord.service.ParseFunction; +import cn.hippo4j.tools.logrecord.service.impl.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/context/LogRecordContext.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/context/LogRecordContext.java similarity index 94% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/context/LogRecordContext.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/context/LogRecordContext.java index ca908043..4f6e1356 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/context/LogRecordContext.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/context/LogRecordContext.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.context; +package cn.hippo4j.tools.logrecord.context; import com.alibaba.ttl.TransmittableThreadLocal; import com.google.common.collect.Maps; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/enums/LogRecordTypeEnum.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/enums/LogRecordTypeEnum.java similarity index 81% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/enums/LogRecordTypeEnum.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/enums/LogRecordTypeEnum.java index 758b0da4..8a9525dc 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/enums/LogRecordTypeEnum.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/enums/LogRecordTypeEnum.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.enums; +package cn.hippo4j.tools.logrecord.enums; /** * 日志记录类型. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/LogRecordInfo.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/LogRecordInfo.java similarity index 95% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/LogRecordInfo.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/LogRecordInfo.java index 3d4491af..a89c93e3 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/LogRecordInfo.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/LogRecordInfo.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.model; +package cn.hippo4j.tools.logrecord.model; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/LogRecordOps.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/LogRecordOps.java similarity index 88% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/LogRecordOps.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/LogRecordOps.java index e420b1fc..b6d13bbb 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/LogRecordOps.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/LogRecordOps.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.model; +package cn.hippo4j.tools.logrecord.model; import lombok.Builder; import lombok.Data; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/MethodExecuteResult.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/MethodExecuteResult.java similarity index 88% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/MethodExecuteResult.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/MethodExecuteResult.java index f4f5c7b2..0cfdb60b 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/MethodExecuteResult.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/MethodExecuteResult.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.model; +package cn.hippo4j.tools.logrecord.model; import lombok.*; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/Operator.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/Operator.java similarity index 84% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/Operator.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/Operator.java index f4c26dc1..aeb8d3e5 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/model/Operator.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/model/Operator.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.model; +package cn.hippo4j.tools.logrecord.model; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordEvaluationContext.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordEvaluationContext.java similarity index 88% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordEvaluationContext.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordEvaluationContext.java index 5f29404a..da09b7d5 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordEvaluationContext.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordEvaluationContext.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.parse; +package cn.hippo4j.tools.logrecord.parse; -import com.github.dynamic.threadpool.logrecord.context.LogRecordContext; +import cn.hippo4j.tools.logrecord.context.LogRecordContext; import org.springframework.context.expression.MethodBasedEvaluationContext; import org.springframework.core.ParameterNameDiscoverer; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordExpressionEvaluator.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordExpressionEvaluator.java similarity index 97% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordExpressionEvaluator.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordExpressionEvaluator.java index 40060b4d..0815e0f7 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordExpressionEvaluator.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordExpressionEvaluator.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.parse; +package cn.hippo4j.tools.logrecord.parse; import com.google.common.collect.Maps; import org.springframework.aop.support.AopUtils; diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordOperationSource.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordOperationSource.java similarity index 90% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordOperationSource.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordOperationSource.java index 9607debc..7af1b981 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordOperationSource.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordOperationSource.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.logrecord.parse; +package cn.hippo4j.tools.logrecord.parse; -import com.github.dynamic.threadpool.logrecord.annotation.LogRecord; -import com.github.dynamic.threadpool.logrecord.model.LogRecordOps; +import cn.hippo4j.tools.logrecord.annotation.LogRecord; +import cn.hippo4j.tools.logrecord.model.LogRecordOps; import org.springframework.core.BridgeMethodResolver; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.util.ClassUtils; @@ -49,7 +49,7 @@ public class LogRecordOperationSource { LogRecordOps recordOps = LogRecordOps.builder() .successLogTemplate(logRecord.success()) .failLogTemplate(logRecord.fail()) - .bizKey(logRecord.prefix().concat("_").concat(logRecord.bizNo())) + .bizKey(logRecord.prefix().concat(logRecord.bizNo())) .bizNo(logRecord.bizNo()) .operatorId(logRecord.operator()) .category(StringUtils.isEmpty(logRecord.category()) ? logRecord.prefix() : logRecord.category()) diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordValueParser.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordValueParser.java similarity index 93% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordValueParser.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordValueParser.java index bc26e584..aeaf8ce4 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/parse/LogRecordValueParser.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/parse/LogRecordValueParser.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.parse; +package cn.hippo4j.tools.logrecord.parse; -import com.github.dynamic.threadpool.logrecord.service.FunctionService; +import cn.hippo4j.tools.logrecord.service.FunctionService; import com.google.common.base.Strings; import com.google.common.collect.Maps; import org.springframework.beans.BeansException; @@ -33,7 +33,7 @@ public class LogRecordValueParser implements BeanFactoryAware { private final LogRecordExpressionEvaluator expressionEvaluator = new LogRecordExpressionEvaluator(); - private static final Pattern pattern = Pattern.compile("\\{\\s*(\\w*)\\s*\\{(.*?)}}"); + private static final Pattern PATTERN = Pattern.compile("\\{\\s*(\\w*)\\s*\\{(.*?)}}"); public Map processTemplate(Collection templates, Object ret, Class targetClass, Method method, Object[] args, String errorMsg, @@ -43,7 +43,7 @@ public class LogRecordValueParser implements BeanFactoryAware { for (String expressionTemplate : templates) { if (expressionTemplate.contains("{")) { - Matcher matcher = pattern.matcher(expressionTemplate); + Matcher matcher = PATTERN.matcher(expressionTemplate); StringBuffer parsedStr = new StringBuffer(); while (matcher.find()) { String expression = matcher.group(2); @@ -63,12 +63,12 @@ public class LogRecordValueParser implements BeanFactoryAware { } public Map processBeforeExecuteFunctionTemplate(Collection templates, Class targetClass, Method method, Object[] args) { - Map functionNameAndReturnValueMap = new HashMap<>(); + Map functionNameAndReturnValueMap = new HashMap(16); EvaluationContext evaluationContext = expressionEvaluator.createEvaluationContext(method, args, targetClass, null, null, beanFactory); for (String expressionTemplate : templates) { if (expressionTemplate.contains("{")) { - Matcher matcher = pattern.matcher(expressionTemplate); + Matcher matcher = PATTERN.matcher(expressionTemplate); while (matcher.find()) { String expression = matcher.group(2); if (expression.contains("#_ret") || expression.contains("#_errorMsg")) { diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/FunctionService.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/FunctionService.java similarity index 87% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/FunctionService.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/FunctionService.java index 278284b1..fe7e689f 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/FunctionService.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/FunctionService.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.service; +package cn.hippo4j.tools.logrecord.service; /** * 函数服务. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/LogRecordService.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/LogRecordService.java similarity index 65% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/LogRecordService.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/LogRecordService.java index 5f5461e9..09f1c833 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/LogRecordService.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/LogRecordService.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.service; +package cn.hippo4j.tools.logrecord.service; -import com.github.dynamic.threadpool.logrecord.model.LogRecordInfo; +import cn.hippo4j.tools.logrecord.model.LogRecordInfo; /** * 日志记录. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/OperatorGetService.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/OperatorGetService.java similarity index 63% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/OperatorGetService.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/OperatorGetService.java index cb1d297d..eac2ba57 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/OperatorGetService.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/OperatorGetService.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.service; +package cn.hippo4j.tools.logrecord.service; -import com.github.dynamic.threadpool.logrecord.model.Operator; +import cn.hippo4j.tools.logrecord.model.Operator; /** * 获取操作人. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/ParseFunction.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/ParseFunction.java similarity index 88% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/ParseFunction.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/ParseFunction.java index 46d8c4e3..ffa09675 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/ParseFunction.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/ParseFunction.java @@ -1,4 +1,4 @@ -package com.github.dynamic.threadpool.logrecord.service; +package cn.hippo4j.tools.logrecord.service; /** * 函数解析. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultFunctionServiceImpl.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultFunctionServiceImpl.java similarity index 77% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultFunctionServiceImpl.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultFunctionServiceImpl.java index 181c8d72..79b03935 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultFunctionServiceImpl.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultFunctionServiceImpl.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.logrecord.service.impl; +package cn.hippo4j.tools.logrecord.service.impl; -import com.github.dynamic.threadpool.logrecord.service.FunctionService; -import com.github.dynamic.threadpool.logrecord.service.ParseFunction; +import cn.hippo4j.tools.logrecord.service.FunctionService; +import cn.hippo4j.tools.logrecord.service.ParseFunction; import lombok.AllArgsConstructor; /** diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultLogRecordServiceImpl.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultLogRecordServiceImpl.java similarity index 61% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultLogRecordServiceImpl.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultLogRecordServiceImpl.java index 174ec3ba..a0e77bcb 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultLogRecordServiceImpl.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultLogRecordServiceImpl.java @@ -1,7 +1,7 @@ -package com.github.dynamic.threadpool.logrecord.service.impl; +package cn.hippo4j.tools.logrecord.service.impl; -import com.github.dynamic.threadpool.logrecord.model.LogRecordInfo; -import com.github.dynamic.threadpool.logrecord.service.LogRecordService; +import cn.hippo4j.tools.logrecord.model.LogRecordInfo; +import cn.hippo4j.tools.logrecord.service.LogRecordService; import lombok.extern.slf4j.Slf4j; /** diff --git a/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultOperatorGetServiceImpl.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultOperatorGetServiceImpl.java new file mode 100644 index 00000000..866a0686 --- /dev/null +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultOperatorGetServiceImpl.java @@ -0,0 +1,19 @@ +package cn.hippo4j.tools.logrecord.service.impl; + +import cn.hippo4j.tools.logrecord.model.Operator; +import cn.hippo4j.tools.logrecord.service.OperatorGetService; + +/** + * 默认实现. + * + * @author chen.ma + * @date 2021/10/24 17:58 + */ +public class DefaultOperatorGetServiceImpl implements OperatorGetService { + + @Override + public Operator getUser() { + return new Operator("-"); + } + +} diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultParseFunction.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultParseFunction.java similarity index 74% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultParseFunction.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultParseFunction.java index 3f0236fd..b6fb80a3 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultParseFunction.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/DefaultParseFunction.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.service.impl; +package cn.hippo4j.tools.logrecord.service.impl; -import com.github.dynamic.threadpool.logrecord.service.ParseFunction; +import cn.hippo4j.tools.logrecord.service.ParseFunction; /** * 默认实现. diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/ParseFunctionFactory.java b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/ParseFunctionFactory.java similarity index 90% rename from tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/ParseFunctionFactory.java rename to hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/ParseFunctionFactory.java index 5b04405c..0ea4dfd7 100644 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/ParseFunctionFactory.java +++ b/hippo4j-tools/log-record-tool/src/main/java/cn/hippo4j/tools/logrecord/service/impl/ParseFunctionFactory.java @@ -1,6 +1,6 @@ -package com.github.dynamic.threadpool.logrecord.service.impl; +package cn.hippo4j.tools.logrecord.service.impl; -import com.github.dynamic.threadpool.logrecord.service.ParseFunction; +import cn.hippo4j.tools.logrecord.service.ParseFunction; import com.google.common.collect.Maps; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; diff --git a/tools/pom.xml b/hippo4j-tools/pom.xml similarity index 73% rename from tools/pom.xml rename to hippo4j-tools/pom.xml index 147f5295..d1fb094d 100644 --- a/tools/pom.xml +++ b/hippo4j-tools/pom.xml @@ -4,23 +4,24 @@ 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} - tools + hippo4j-tools pom tools 动态线程池工具类模块 + + true + + log-record-tool - - - open-change-tool diff --git a/pom.xml b/pom.xml index 7ed05b0a..1246aade 100644 --- a/pom.xml +++ b/pom.xml @@ -3,46 +3,54 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.github.dynamic-threadpool - parent + cn.hippo4j + hippo4j-all ${revision} pom ${project.artifactId} https://github.com/acmenlt/dynamic-threadpool - 🔥 强大的动态线程池,附带监控报警功能(没有依赖任何中间件) + 动态可观测线程池框架, 为业务系统提高线上运行保障能力. - auth - common - console - server - config - discovery - example - tools - dynamic-threadpool-spring-boot-starter + hippo4j-auth + hippo4j-common + hippo4j-config + hippo4j-console + hippo4j-core + hippo4j-discovery + hippo4j-example + hippo4j-server + hippo4j-spring-boot + hippo4j-tools + 1.2.0 1.8 - 1.0.0-SNAPSHOT 6.5.0 29.0-jre - 3.8.1 - 5.4.7 + 3.12.0 + 5.4.7 1.2.75 3.12.0 6.1.5.Final 2.12.1 1.5.11 + 0.9.0 + 2.11.1 1.0.1 + 1.7.7 + 1.2.3 3.4.2 2.3.2.RELEASE + 1.9.1 + false + UTF-8 UTF-8 UTF-8 @@ -66,9 +74,8 @@ com.squareup.okhttp3 - logging-interceptor + okhttp ${okhttp3.version} - true @@ -80,7 +87,7 @@ cn.hutool hutool-all - ${hutool-core.version} + ${hutool-all.version} @@ -90,43 +97,49 @@ - com.github.dynamic-threadpool - common + cn.hippo4j + hippo4j-common ${revision} - com.github.dynamic-threadpool - config + cn.hippo4j + hippo4j-config ${revision} - com.github.dynamic-threadpool - console + cn.hippo4j + hippo4j-console ${revision} - com.github.dynamic-threadpool - discovery + cn.hippo4j + hippo4j-discovery ${revision} - com.github.dynamic-threadpool + cn.hippo4j log-record-tool ${revision} - com.github.dynamic-threadpool - auth + cn.hippo4j + hippo4j-auth ${revision} - com.github.dynamic-threadpool + cn.hippo4j + hippo4j-core + ${revision} + + + + cn.hippo4j open-change-tool ${revision} @@ -172,6 +185,31 @@ forest-spring-boot-starter ${forest.version} + + + org.slf4j + slf4j-api + ${slf4j-api.version} + + + + ch.qos.logback + logback-core + ${logback.version} + + + + ch.qos.logback + logback-classic + ${logback.version} + + + + org.springframework.boot + spring-boot-starter-json + ${spring-boot.version} + compile + @@ -185,27 +223,21 @@ + acmenlt chen.ma + m7798432@163.com https://github.com/acmenlt + + Github Issue + https://github.com/acmenlt/dynamic-threadpool/issues + + ${project.artifactId} - - - src/main/resources - - ** - - - rebel.xml - - true - - - org.apache.maven.plugins @@ -219,29 +251,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven.javadoc.plugin.version} - - - - org.apache.maven.plugins - maven-source-plugin - ${maven.source.plugin.version} - - true - - - - compile - - jar - - - - - maven-jar-plugin ${maven.jar.plugin.version} @@ -285,7 +294,77 @@ spring-boot-maven-plugin ${spring-boot.version} + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + verify + + sign + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.0-M1 + + ${javadoc.opts} + + + + + org.apache.maven.plugins + maven-source-plugin + 2.4 + + true + + + + package + + jar-no-fork + + + + + + + + disable-javadoc-doclint + + [1.8,) + + + -Xdoclint:none + + + + + + scm:git@github.com:acmenlt/dynamic-threadpool + scm:git@github.com:acmenlt/dynamic-threadpool.git + git@github.com:acmenlt/dynamic-threadpool.git + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + diff --git a/server/src/main/java/com/github/dynamic/threadpool/server/ServerApplication.java b/server/src/main/java/com/github/dynamic/threadpool/server/ServerApplication.java deleted file mode 100644 index 1fe66839..00000000 --- a/server/src/main/java/com/github/dynamic/threadpool/server/ServerApplication.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.dynamic.threadpool.server; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@MapperScan(basePackages = - { - "com.github.dynamic.threadpool.config.mapper", - "com.github.dynamic.threadpool.auth.mapper" - }) -@SpringBootApplication(scanBasePackages = - { - "com.github.dynamic.threadpool" - }) -public class ServerApplication { - - public static void main(String[] args) { - SpringApplication.run(ServerApplication.class, args); - } - -} diff --git a/server/src/main/resources/application.yaml b/server/src/main/resources/application.yaml deleted file mode 100644 index 469fa954..00000000 --- a/server/src/main/resources/application.yaml +++ /dev/null @@ -1,28 +0,0 @@ -server: - port: 6691 - -tenant: hippo - -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/hippo_manager?characterEncoding=UTF-8 - username: root - password: root - hikari: - connectionTimeout: 60000 - idleTimeout: 60000 - validationTimeout: 3000 - maxLifetime: 60000 - loginTimeout: 5 - maximumPoolSize: 60 - minimumIdle: 10 - -mybatis-plus: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - global-config: - db-config: - logic-delete-field: delFlag - logic-delete-value: 1 - logic-not-delete-value: 0 diff --git a/server/src/main/resources/hippo_manager.sql b/server/src/main/resources/hippo_manager.sql deleted file mode 100644 index d52b04f7..00000000 --- a/server/src/main/resources/hippo_manager.sql +++ /dev/null @@ -1,147 +0,0 @@ -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hippo_manager` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; - -USE `hippo_manager`; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = tenant */ -/******************************************/ -DROP TABLE IF EXISTS `tenant`, `tenant_info`; -CREATE TABLE `tenant` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `tenant_name` varchar(128) DEFAULT NULL COMMENT '租户名称', - `tenant_desc` varchar(256) DEFAULT NULL COMMENT '租户介绍', - `owner` varchar(32) DEFAULT '-' COMMENT '负责人', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', - `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - KEY `uk_tenantinfo_tenantid` (`tenant_id`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='租户表'; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = item */ -/******************************************/ -DROP TABLE IF EXISTS `item`, `item_info`; -CREATE TABLE `item` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `item_id` varchar(128) DEFAULT NULL COMMENT '项目ID', - `item_name` varchar(128) DEFAULT NULL COMMENT '项目名称', - `item_desc` varchar(256) DEFAULT NULL COMMENT '项目介绍', - `owner` varchar(32) DEFAULT NULL COMMENT '负责人', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', - `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - UNIQUE KEY `uk_iteminfo_tenantitem` (`tenant_id`,`item_id`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='项目表'; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = config */ -/******************************************/ -DROP TABLE IF EXISTS `config`, `config_info`; -CREATE TABLE `config` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', - `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', - `tp_name` varchar(56) DEFAULT NULL COMMENT '线程池名称', - `core_size` int(11) DEFAULT NULL COMMENT '核心线程数', - `max_size` int(11) DEFAULT NULL COMMENT '最大线程数', - `queue_type` int(11) DEFAULT NULL COMMENT '队列类型...', - `capacity` int(11) DEFAULT NULL COMMENT '队列大小', - `rejected_type` int(11) DEFAULT NULL COMMENT '拒绝策略', - `keep_alive_time` int(11) DEFAULT NULL COMMENT '线程存活时间', - `content` longtext COMMENT '线程池内容', - `md5` varchar(32) NOT NULL COMMENT 'MD5', - `is_alarm` tinyint(1) DEFAULT NULL COMMENT '是否报警 0:报警 1:不报警', - `capacity_alarm` int(11) DEFAULT NULL COMMENT '容量报警', - `liveness_alarm` int(11) DEFAULT NULL COMMENT '活跃度报警', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - UNIQUE KEY `uk_configinfo_datagrouptenant` (`tenant_id`,`item_id`,`tp_id`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置表'; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = log_record_info */ -/******************************************/ -DROP TABLE IF EXISTS `log_record_info`; -CREATE TABLE `log_record_info` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `tenant` varchar(128) NOT NULL DEFAULT '' COMMENT '租户标识', - `biz_key` varchar(128) NOT NULL DEFAULT '' COMMENT '日志业务标识', - `biz_no` varchar(128) NOT NULL DEFAULT '' COMMENT '业务码标识', - `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人', - `action` varchar(128) NOT NULL DEFAULT '' COMMENT '动作', - `category` varchar(128) NOT NULL DEFAULT '' COMMENT '种类', - `detail` varchar(2048) NOT NULL DEFAULT '' COMMENT '修改的详细信息,可以为json', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`), - KEY `idx_biz_key` (`biz_key`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='操作日志表'; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = user */ -/******************************************/ -DROP TABLE IF EXISTS `user`; -CREATE TABLE `user` ( - `id` bigint(20) NOT NULL COMMENT 'ID', - `user_name` varchar(64) NOT NULL COMMENT '用户名', - `password` varchar(512) NOT NULL COMMENT '用户密码', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = role */ -/******************************************/ -DROP TABLE IF EXISTS `role`; -CREATE TABLE `role` ( - `id` bigint(20) NOT NULL COMMENT 'ID', - `role` varchar(64) NOT NULL COMMENT '角色', - `user_name` varchar(64) NOT NULL COMMENT '用户名', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; - -/******************************************/ -/* 数据库全名 = hippo_manager */ -/* 表名称 = permission */ -/******************************************/ -DROP TABLE IF EXISTS `permission`; -CREATE TABLE `permission` ( - `id` bigint(20) NOT NULL COMMENT 'ID', - `role` varchar(512) NOT NULL COMMENT '角色', - `resource` varchar(512) NOT NULL COMMENT '资源', - `action` varchar(8) NOT NULL COMMENT '读写权限', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限表'; - -/* 租户 */ -INSERT INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'framework', '架构组', '架构组:负责集团项目的规范标准定义以及执行', '某某', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); - -/* 项目 */ -INSERT INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); - -/* 线程池 */ -INSERT INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '1', '5', '9', '1024', '2', '90', '{\"capacity\":1024,\"capacityAlarm\":80,\"coreSize\":1,\"isAlarm\":0,\"itemId\":\"dynamic-threadpool-example\",\"keepAliveTime\":90,\"livenessAlarm\":80,\"maxSize\":5,\"queueType\":9,\"tenantId\":\"prescription\",\"tpId\":\"message-consume\"}', '548564177fd601015e19ef6df42000d1', '0', '80', '80', '2021-10-24 16:12:16', '2021-10-24 16:12:16', '0'), -('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '1', '5', '9', '100', '7', '10', '{\"capacity\":100,\"capacityAlarm\":30,\"coreSize\":10,\"isAlarm\":0,\"itemId\":\"dynamic-threadpool-example\",\"keepAliveTime\":10,\"livenessAlarm\":30,\"maxSize\":15,\"queueType\":9,\"rejectedType\":7,\"tenantId\":\"prescription\",\"tpId\":\"message-produce\"}', 'edd6677f6ca35ce2c2e06db5749572c8', '0', '30', '30', '2021-10-24 16:12:56', '2021-10-28 09:49:27', '0'); diff --git a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultOperatorGetServiceImpl.java b/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultOperatorGetServiceImpl.java deleted file mode 100644 index 84a0a830..00000000 --- a/tools/log-record-tool/src/main/java/com/github/dynamic/threadpool/logrecord/service/impl/DefaultOperatorGetServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.github.dynamic.threadpool.logrecord.service.impl; - -import com.github.dynamic.threadpool.logrecord.model.Operator; -import com.github.dynamic.threadpool.logrecord.service.OperatorGetService; - -/** - * 默认实现. - * - * @author chen.ma - * @date 2021/10/24 17:58 - */ -public class DefaultOperatorGetServiceImpl implements OperatorGetService { - - @Override - public Operator getUser() { - return new Operator("994924"); - } - -} diff --git a/tools/log-record-tool/src/test/java/com/github/dynamic/threadpool/logrecord/LogRecordToolApplicationTests.java b/tools/log-record-tool/src/test/java/com/github/dynamic/threadpool/logrecord/LogRecordToolApplicationTests.java deleted file mode 100644 index 58abdd12..00000000 --- a/tools/log-record-tool/src/test/java/com/github/dynamic/threadpool/logrecord/LogRecordToolApplicationTests.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.dynamic.threadpool.logrecord; - -import org.junit.jupiter.api.Test; - -class LogRecordToolApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/tools/open-change-tool/pom.xml b/tools/open-change-tool/pom.xml deleted file mode 100644 index 4f8c187e..00000000 --- a/tools/open-change-tool/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - - com.github.dynamic-threadpool - tools - ${revision} - - - open-change-tool - jar - - ${project.artifactId} - Demo project for Spring Boot - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.projectlombok - lombok - - - - com.aliyun - alibaba-dingtalk-service-sdk - - - - com.dtflys.forest - forest-spring-boot-starter - - - - cn.hutool - hutool-all - - - - diff --git a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/EnableOpenChangeNotify.java b/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/EnableOpenChangeNotify.java deleted file mode 100644 index f548753f..00000000 --- a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/EnableOpenChangeNotify.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.dynamic.threadpool.openchange; - -import org.springframework.context.annotation.Import; - -import java.lang.annotation.*; - -/** - * Change timed task. - * - * @author chen.ma - * @date 2021/10/31 13:39 - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Import(OpenChangeNotifyConfig.class) -@Documented -public @interface EnableOpenChangeNotify { -} diff --git a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/GitHubRemote.java b/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/GitHubRemote.java deleted file mode 100644 index 8f647f0a..00000000 --- a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/GitHubRemote.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.dynamic.threadpool.openchange; - -import com.dtflys.forest.annotation.Get; - -/** - * GitHub remote. - * - * @author chen.ma - * @date 2021/10/31 10:45 - */ -public interface GitHubRemote { - - /** - * 获取 GitHub 仓库详细信息. - * - * @return - */ - @Get("https://api.github.com/repos/acmenlt/dynamic-threadpool") - OpenChangeInfo getGitHubItemInfo(); - -} diff --git a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeInfo.java b/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeInfo.java deleted file mode 100644 index a7ce44b2..00000000 --- a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeInfo.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.github.dynamic.threadpool.openchange; - -import lombok.Data; - -/** - * Open change info. - * - * @author chen.ma - * @date 2021/10/31 10:33 - */ -@Data -public class OpenChangeInfo { - - /** - * name - */ - private String name; - - /** - * stars - */ - private Long stargazers_count; - - /** - * forks - */ - private Long forks_count; - - /** - * open issues - */ - private Long open_issues_count; - - /** - * url - */ - private String html_url; - - /** - * subscribers - */ - private Long subscribers_count; - - /** - * default branch - */ - private String default_branch; - - /** - * star_add - */ - private Long star_add; - - /** - * fork_add - */ - - private Long fork_add; - -} diff --git a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeNotifyBootstrapProperties.java b/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeNotifyBootstrapProperties.java deleted file mode 100644 index 6ce4e32d..00000000 --- a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeNotifyBootstrapProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.github.dynamic.threadpool.openchange; - -import lombok.Data; -import lombok.Getter; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -import java.util.List; - -/** - * Bootstrap properties. - * - * @author chen.ma - * @date 2021/6/22 09:14 - */ -@Slf4j -@Getter -@Setter -@Configuration -@ConfigurationProperties(prefix = OpenChangeNotifyBootstrapProperties.PREFIX) -public class OpenChangeNotifyBootstrapProperties { - - public static final String PREFIX = "spring.dynamic.thread-pool"; - - /** - * notifyInterval - */ - private Long notifyInterval; - - /** - * notifys - */ - private List notifys; - - @Data - public static class NotifyConfig { - - /** - * type - */ - private String type; - - /** - * url - */ - private String url; - - /** - * token - */ - private String token; - - } - -} diff --git a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeNotifyConfig.java b/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeNotifyConfig.java deleted file mode 100644 index 90894986..00000000 --- a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeNotifyConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.github.dynamic.threadpool.openchange; - -import com.dtflys.forest.springboot.annotation.ForestScan; -import lombok.AllArgsConstructor; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.scheduling.annotation.EnableScheduling; - -/** - * 项目变更通知配置. - * - * @author chen.ma - * @date 2021/10/31 10:23 - */ -@EnableScheduling -@AllArgsConstructor -@ImportAutoConfiguration(OpenChangeNotifyBootstrapProperties.class) -@ForestScan(basePackages = "com.github.dynamic.threadpool.openchange") -public class OpenChangeNotifyConfig { - - private final GitHubRemote gitHubRemote; - - private final OpenChangeNotifyBootstrapProperties bootstrapProperties; - - @Bean - public OpenChangeTimedTask changeTimedTask() { - return new OpenChangeTimedTask(gitHubRemote, bootstrapProperties); - } - -} diff --git a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeTimedTask.java b/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeTimedTask.java deleted file mode 100644 index 30272044..00000000 --- a/tools/open-change-tool/src/main/java/com/github/dynamic/threadpool/openchange/OpenChangeTimedTask.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.github.dynamic.threadpool.openchange; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.thread.ThreadUtil; -import cn.hutool.json.JSONUtil; -import com.dingtalk.api.DefaultDingTalkClient; -import com.dingtalk.api.DingTalkClient; -import com.dingtalk.api.request.OapiRobotSendRequest; -import com.taobao.api.ApiException; -import lombok.NonNull; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.scheduling.annotation.Scheduled; - -import java.util.concurrent.TimeUnit; - -/** - * Change timed task. - * - * @author chen.ma - * @date 2021/10/31 10:39 - */ -@Slf4j -@RequiredArgsConstructor -public class OpenChangeTimedTask implements InitializingBean { - - @NonNull - private final GitHubRemote gitHubRemote; - - @NonNull - private final OpenChangeNotifyBootstrapProperties bootstrapProperties; - - private OpenChangeInfo lastChangeInfo; - - @Scheduled(cron = "0 0/5 * * * ?") - public void execute() { - OpenChangeInfo itemInfo = null; - try { - itemInfo = gitHubRemote.getGitHubItemInfo(); - // 防止初始化调用 GitHub 403 - if (lastChangeInfo == null) { - lastChangeInfo = itemInfo; - log.info("Init... GitHub Item Info :: {}", JSONUtil.toJsonStr(lastChangeInfo)); - return; - } - } catch (Throwable ex) { - log.error("Failed to call GitHub API interface.", ex); - - // 担心 GitHub 限制访问 403, 如异常则睡眠 5 分钟 - ThreadUtil.sleep(5, TimeUnit.MINUTES); - return; - } - - long addStarNum, addForkChange; - boolean starChange = (addStarNum = (itemInfo.getStargazers_count() - lastChangeInfo.getStargazers_count())) > 0; - if (starChange) { - itemInfo.setStar_add(addStarNum); - } - - boolean forkChange = (addForkChange = (itemInfo.getForks_count() - lastChangeInfo.getForks_count())) > 0; - if (forkChange) { - itemInfo.setFork_add(addForkChange); - } - - if (starChange == false && forkChange == false) { - log.info("Star and fork are unchanged."); - return; - } - - sendDingMessage(itemInfo); - lastChangeInfo = itemInfo; - } - - public void sendDingMessage(OpenChangeInfo itemInfo) { - String gitHubItemUrl = itemInfo.getHtml_url(); - String markdownText = String.format( - "[通知] GitHub Star Fork 变更通知 \n\n" + - " --- \n\n " + - "项目名称:HIPPO-JAVA \n\n" + - "项目地址:[%s](%s) \n\n" + - " --- \n\n " + - "Hippo Stars Add:%s \n\n " + - "Hippo Forks Add:%s \n\n " + - " --- \n\n " + - "Hippo Now Star:[%d](" + gitHubItemUrl + "/stargazers) \n\n" + - "Hippo Now Fork:[%d](" + gitHubItemUrl + "/members) \n\n" + - "Hippo Open Issue:[%d](" + gitHubItemUrl + "/issues) \n\n" + - "Hippo Subscribers Count:[%d](" + gitHubItemUrl + "/watchers) \n\n" + - " --- \n\n " + - "友情提示:5 分钟内 Star Fork 有变更则通知(可配置) \n\n" + - "OWNER:Long-Tai \n\n" + - " --- \n\n " + - "**播报时间:%s**", - - itemInfo.getName().toUpperCase(), - gitHubItemUrl, - - itemInfo.getStar_add() == null ? "-" : itemInfo.getStar_add().toString() + "+", - itemInfo.getFork_add() == null ? "-" : itemInfo.getFork_add().toString() + "+", - - itemInfo.getStargazers_count(), - itemInfo.getForks_count(), - itemInfo.getOpen_issues_count(), - itemInfo.getSubscribers_count(), - - DateUtil.now() - ); - - OpenChangeNotifyBootstrapProperties.NotifyConfig notifyConfig = bootstrapProperties.getNotifys().get(0); - String serverUrl = notifyConfig.getUrl() + notifyConfig.getToken(); - DingTalkClient dingTalkClient = new DefaultDingTalkClient(serverUrl); - OapiRobotSendRequest request = new OapiRobotSendRequest(); - request.setMsgtype("markdown"); - - OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); - markdown.setTitle("GitHub Star Fork 变更通知"); - markdown.setText(markdownText); - request.setMarkdown(markdown); - - try { - dingTalkClient.execute(request); - } catch (ApiException ex) { - log.error("Ding failed to send message.", ex.getMessage()); - } - } - - @Override - public void afterPropertiesSet() throws Exception { - try { - lastChangeInfo = gitHubRemote.getGitHubItemInfo(); - } catch (Throwable ex) { - log.error("Init error..."); - } - - log.info("Init success... GitHub Item Info :: {}", JSONUtil.toJsonStr(lastChangeInfo)); - } - -}