1 文件已重命名
18个文件已添加
3个文件已修改
| File was renamed from zy-asrs-framework/src/main/java/com/zy/asrs/framework/config/CoolBaseConfig.java |
| | |
| | | package com.zy.asrs.framework.config; |
| | | package com.zy.asrs.common.config; |
| | | |
| | | //import com.baomidou.mybatisplus.plugins.PaginationInterceptor; |
| | | |
| | | import com.zy.asrs.framework.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-10 |
| | | */ |
| | | @Configuration |
| | | public class CoolBaseConfig { |
| | | |
| | | // @Bean |
| | |
| | | package com.zy.asrs.framework.generators.utils; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | |
| | | package com.zy.asrs.framework.utils; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.core.config.CoolBaseConfig |
| | | #org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.core.config.CoolBaseConfig |
| New file |
| | |
| | | package com.zy.asrs.wms.controller; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-07-30 |
| | | */ |
| | | @Controller |
| | | public class RouterController { |
| | | |
| | | @Value("${server.servlet.context-path}") |
| | | private String contextPath; |
| | | |
| | | @RequestMapping("/") |
| | | public void index(HttpServletResponse response) { |
| | | try{ |
| | | response.sendRedirect(contextPath+"/views/index.html"); |
| | | } catch (Exception ex){ |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/login") |
| | | public void login(HttpServletResponse response) { |
| | | try{ |
| | | response.sendRedirect(contextPath+"/views/login.html"); |
| | | } catch (Exception ex){ |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/pda") |
| | | public void pda(HttpServletResponse response) { |
| | | try{ |
| | | response.sendRedirect(contextPath+"/views/pda/login.html"); |
| | | } catch (Exception ex){ |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/pda/ce") |
| | | public void pdaCe(HttpServletResponse response) { |
| | | try{ |
| | | response.sendRedirect(contextPath+"/views/pdaCe/login.html"); |
| | | } catch (Exception ex){ |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#api', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/api/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'namespace', align: 'center',title: '命名空间'} |
| | | ,{field: 'oauth$', align: 'center',title: '授权'} |
| | | ,{field: 'request', align: 'center',title: '请求结构'} |
| | | ,{field: 'response', align: 'center',title: '响应结构'} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(api)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(api)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'api_detail.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | var ids=[]; |
| | | data.map(function (track) { |
| | | ids.push(track.id); |
| | | }); |
| | | if (ids.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/api/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'api': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/api/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(api)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'api_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'api_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | id: $('#id').val(), |
| | | namespace: $('#namespace').val(), |
| | | oauth: $('#oauth').val(), |
| | | request: $('#request').val(), |
| | | response: $('#response').val(), |
| | | createTime: top.strToDate($('#createTime\\$').val()), |
| | | updateTime: top.strToDate($('#updateTime\\$').val()), |
| | | status: $('#status').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/api/edit/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | tableReload(true); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | } |
| | | layer.style(index, { |
| | | top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | $(".layui-layer-shade").remove(); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| New file |
| | |
| | | var baseUrl = "/jkwms"; |
| | | |
| | | // 详情窗口-高度 |
| | | var detailHeight = '80%'; |
| | | // 详情窗口-宽度 |
| | | var detailWidth = '90%'; |
| | | |
| | | // 非空判断 |
| | | function isEmpty(obj){ |
| | | return typeof obj == "undefined" || obj == null || obj === ""; |
| | | } |
| | | |
| | | // let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | // layer.close(loadIndex); |
| | | |
| | | // 时间 ==>> 字符串 |
| | | function dateToStr(date, millisecond) { |
| | | var time = new Date(date); |
| | | var y = time.getFullYear(); |
| | | var M = time.getMonth() + 1; |
| | | M = M < 10 ? ("0" + M) : M; |
| | | var d = time.getDate(); |
| | | d = d < 10 ? ("0" + d) : d; |
| | | var h = time.getHours(); |
| | | h = h < 10 ? ("0" + h) : h; |
| | | var m = time.getMinutes(); |
| | | m = m < 10 ? ("0" + m) : m; |
| | | var s = time.getSeconds(); |
| | | s = s < 10 ? ("0" + s) : s; |
| | | if (!millisecond) { |
| | | return y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s; |
| | | } else { |
| | | var p = time.getMilliseconds(); |
| | | if (p < 10) { |
| | | p = "00" + p; |
| | | } |
| | | if (p < 100) { |
| | | p = "0" + p; |
| | | } |
| | | return y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s + "," + p; |
| | | } |
| | | } |
| | | |
| | | // 字符串 ===>> 时间 |
| | | function strToDate(str) { |
| | | var t = Date.parse(str); |
| | | if (!isNaN(t)) { |
| | | return new Date(Date.parse(str.replace(/-/g, "/"))); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | // 清理对象null值 |
| | | function reObject(data) { |
| | | for (var obj in data) { |
| | | if (data[obj]===null){ |
| | | delete data[obj]; |
| | | } |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | /** |
| | | * disabled 属性转换 |
| | | */ |
| | | function convertDisabled(el, param) { |
| | | el.each(function () { |
| | | $(this).attr("disabled", param); |
| | | }); |
| | | } |
| | | |
| | | // 权限 |
| | | function limit(child){ |
| | | if (child == null){ |
| | | child = false; |
| | | } |
| | | var param = (child?parent.window:window).location.href.split("?")[1]; |
| | | if (null != param) { |
| | | var resourceId = param.split("=")[1]; |
| | | $.ajax({ |
| | | url: baseUrl+"/power/menu/"+resourceId+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for(var i = 0, len = res.data.length; i < len; i++) { |
| | | (child?parent:window).$('#'+res.data[i].code).css("display", "inline-block"); |
| | | (child?parent:window).$('.'+res.data[i].code).css("display", "inline-block"); |
| | | } |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | // http请求 |
| | | !function (n) { |
| | | "use strict"; |
| | | |
| | | var http = { |
| | | toAjax: function (params) { |
| | | $.ajax(params); |
| | | }, |
| | | get: function (url, data, callback) { |
| | | http.toAjax({ |
| | | method: 'GET', |
| | | url: url, |
| | | data: data, |
| | | dataType: 'json', |
| | | header: {'token': localStorage.getItem('token')}, |
| | | timeout: 10000, |
| | | cache: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | callback(res); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | }, |
| | | error: function (res, type) { |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | // 默认表单 |
| | | post: function (url, param, callback, type) { |
| | | var headerType; |
| | | if (type === 'json') { |
| | | headerType = {'Content-Type': 'application/json'} |
| | | } else { |
| | | headerType = {'Content-Type': 'application/x-www-form-urlencoded'} |
| | | } |
| | | headerType['token'] = localStorage.getItem('token'); |
| | | http.toAjax({ |
| | | method: 'POST', |
| | | url: url, |
| | | data: param, |
| | | dataType: 'json', |
| | | headers: headerType, |
| | | timeout: 10000, |
| | | cache: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | callback(res); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | }, |
| | | error: function (res, type) { |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | }; |
| | | "function" == typeof define && define.amd ? define(function () { |
| | | return http |
| | | }) : "object" == typeof module && module.exports ? module.exports = http : n.http = http |
| | | }(this); |
| | | |
| | | /*************************************************************************************************************/ |
| | | /********************************************** 物料业务抽象 ***************************************************/ |
| | | /*************************************************************************************************************/ |
| | | |
| | | function arrRemove(arr, key, val) { |
| | | for(var i=arr.length-1; i>=0; i--){ |
| | | if(arr[i][key] === val){ |
| | | arr.splice(i,1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var matCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号', width: 180} |
| | | // {field: 'id', align: 'center',title: 'ID'} |
| | | // ,{field: 'uuid', align: 'center',title: '编号'} |
| | | // ,{field: 'tagId$', align: 'center',title: '所属归类'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | // ,{field: 'name', align: 'center',title: '别名'} |
| | | ,{field: 'specs', align: 'center',title: '配置'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: false} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | | ,{field: 'manu', align: 'center',title: '厂家', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: false} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: false} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: false} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: false} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ] |
| | | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'batch', align: 'center',title: '序列码', width: 300, sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | |
| | | ,{field: 'specs', align: 'center',title: '配置'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: false} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | | ,{field: 'manu', align: 'center',title: '厂家', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: false} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: false} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: false} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: false} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | ] |
| | | |
| New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#config', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/config/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'code', align: 'center',title: '编码'} |
| | | ,{field: 'value', align: 'center',title: '对应值'} |
| | | ,{field: 'type$', align: 'center',title: '类型'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(config)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(config)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'config_detail.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | var ids=[]; |
| | | data.map(function (track) { |
| | | ids.push(track.id); |
| | | }); |
| | | if (ids.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/config/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'config': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/config/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(config)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'config_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'config_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | id: $('#id').val(), |
| | | name: $('#name').val(), |
| | | code: $('#code').val(), |
| | | value: $('#value').val(), |
| | | type: $('#type').val(), |
| | | status: $('#status').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/config/edit/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | tableReload(true); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | } |
| | | layer.style(index, { |
| | | top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | $(".layui-layer-shade").remove(); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| New file |
| | |
| | | /** |
| | | * 搜索自动补全 -- 局外点击隐藏 |
| | | */ |
| | | $(function(){ |
| | | $(document).on("click",function(e){ |
| | | if(!$(e.target).parents(".cool-auto-complete").length){ |
| | | $(".cool-auto-complete-window").hide(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | |
| | | /** |
| | | * 搜索自动补全 -- div |
| | | */ |
| | | function autoShow(id) { |
| | | var cac = document.getElementById(id).parentNode; |
| | | var cacw = cac.getElementsByClassName("cool-auto-complete-window")[0]; |
| | | if (cacw.style.display === "none" || cacw.style.display === ""){ |
| | | cacw.style.display = "block"; |
| | | var cacwi = cacw.getElementsByClassName("cool-auto-complete-window-input")[0]; |
| | | cacwi.focus(); |
| | | autoLoad(cacwi.getAttribute('data-key')); |
| | | }else { |
| | | cacw.style.display = "none"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 搜索自动补全 -- input |
| | | */ |
| | | function autoLoad(val) { |
| | | var inputDomVal = document.querySelector("input[data-key="+val+"]").value; |
| | | var selectDom = document.querySelector("select[data-key="+val+"Select]"); |
| | | selectDom.length = 0; |
| | | var defaultOption = new Option("取消选择", ""); |
| | | defaultOption.title = ""; |
| | | selectDom.appendChild(defaultOption); |
| | | selectDom.style.display='none'; |
| | | $.ajax({ |
| | | url: baseUrl+"/"+getForeignKeyQuery(val)+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {condition: inputDomVal}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var list = res.data; |
| | | for (var i=0;i<list.length;i++){ |
| | | var option = new Option(list[i].value, i); |
| | | option.title = list[i].id; |
| | | selectDom.options[i+1] = option; |
| | | } |
| | | selectDom.style.display='block'; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 搜索自动补全 -- select |
| | | */ |
| | | function confirmed(val){ |
| | | var inputDom = $("input[data-key="+val.substring(0,val.length - 6)+"]"); |
| | | var selectDom = $("select[data-key="+val+"]"); |
| | | |
| | | selectDom.dblclick(function(){ |
| | | inputDom.focus(); |
| | | selectDom.css("display","none"); |
| | | }); |
| | | |
| | | // 修饰字段 |
| | | var cacw = inputDom.parent(); |
| | | cacw.css("display", "none"); |
| | | var cacd = cacw.parent().find(".cool-auto-complete-div"); |
| | | var realDom = cacd.prev(); |
| | | // id字段 |
| | | var selectOptionDom = selectDom.find("option:selected"); |
| | | var html = selectOptionDom.html(); |
| | | if (html === "取消选择"){ |
| | | cacd.val(""); |
| | | realDom.val(""); |
| | | } else { |
| | | cacd.val(selectOptionDom.html()); |
| | | realDom.val(selectOptionDom.attr("title")); |
| | | } |
| | | inputDom.val(""); |
| | | } |
| | | |
| | | function reviewImg(src) { |
| | | window.open().document.write("<img src="+src+" />"); |
| | | } |
| | | |
| | | /** |
| | | * 截取By之前的字符串 |
| | | */ |
| | | function getForeignKeyQuery(str) { |
| | | var index = str.indexOf('By'); |
| | | if (index !== -1){ |
| | | return str.substring(0, index); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | // 表单值清空 |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | var banMsg; |
| | | var tips; |
| | | // 主键校验 |
| | | function check(id, domain) { |
| | | var param = { |
| | | key: id, |
| | | val: $('#'+id).val() |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/"+domain+"/check/column/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.close(tips); |
| | | banMsg = null; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 407) { |
| | | banMsg = res.data + "不可用"; |
| | | tips = layer.tips( |
| | | "<span style='color:red;'>已存在</span>", |
| | | '#'+id, |
| | | { |
| | | // tipsMore: true, |
| | | tips: [2,'#fff'], |
| | | time:0 |
| | | ,area: 'auto' |
| | | ,maxWidth:500 |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| New file |
| | |
| | | |
| | | /* |
| | | * Licensed to the Apache Software Foundation (ASF) under one |
| | | * or more contributor license agreements. See the NOTICE file |
| | | * distributed with this work for additional information |
| | | * regarding copyright ownership. The ASF licenses this file |
| | | * to you 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. |
| | | */ |
| | | |
| | | |
| | | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";var e=2311,n=function(){return e++},v="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);n&&(e.ie=!0,e.version=n[1]);a&&(e.edge=!0,e.version=a[1]);o&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},l={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},u=Object.prototype.toString,i=Array.prototype,r=i.forEach,h=i.filter,a=i.slice,c=i.map,d=i.reduce,o={};function f(t,e){"createCanvas"===t&&(y=null),o[t]=e}function D(t){if(null==t||"object"!=typeof t)return t;var e=t,i=u.call(t);if("[object Array]"===i){if(!$(t)){e=[];for(var n=0,a=t.length;n<a;n++)e[n]=D(t[n])}}else if(l[i]){if(!$(t)){var o=t.constructor;if(t.constructor.from)e=o.from(t);else{e=new o(t.length);for(n=0,a=t.length;n<a;n++)e[n]=D(t[n])}}}else if(!s[i]&&!$(t)&&!G(t))for(var r in e={},t)t.hasOwnProperty(r)&&(e[r]=D(t[r]));return e}function m(t,e,i){if(!z(e)||!z(t))return i?D(e):t;for(var n in e)if(e.hasOwnProperty(n)){var a=t[n],o=e[n];!z(o)||!z(a)||k(o)||k(a)||G(o)||G(a)||B(o)||B(a)||$(o)||$(a)?!i&&n in t||(t[n]=D(e[n])):m(a,o,i)}return t}function p(t,e){for(var i=t[0],n=1,a=t.length;n<a;n++)i=m(i,t[n],e);return i}function L(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function C(t,e,i){for(var n in e)e.hasOwnProperty(n)&&(i?null!=e[n]:null==t[n])&&(t[n]=e[n]);return t}function g(){return o.createCanvas()}var y;function x(){return y=y||g().getContext("2d")}function _(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i}return-1}function w(t,e){var i=t.prototype;function n(){}for(var a in n.prototype=e.prototype,t.prototype=new n,i)i.hasOwnProperty(a)&&(t.prototype[a]=i[a]);(t.prototype.constructor=t).superClass=e}function b(t,e,i){C(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,i)}function P(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function E(t,e,i){if(t&&e)if(t.forEach&&t.forEach===r)t.forEach(e,i);else if(t.length===+t.length)for(var n=0,a=t.length;n<a;n++)e.call(i,t[n],n,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(i,t[o],o,t)}function N(t,e,i){if(t&&e){if(t.map&&t.map===c)return t.map(e,i);for(var n=[],a=0,o=t.length;a<o;a++)n.push(e.call(i,t[a],a,t));return n}}function S(t,e,i,n){if(t&&e){if(t.reduce&&t.reduce===d)return t.reduce(e,i,n);for(var a=0,o=t.length;a<o;a++)i=e.call(n,i,t[a],a,t);return i}}function M(t,e,i){if(t&&e){if(t.filter&&t.filter===h)return t.filter(e,i);for(var n=[],a=0,o=t.length;a<o;a++)e.call(i,t[a],a,t)&&n.push(t[a]);return n}}function I(t,e,i){if(t&&e)for(var n=0,a=t.length;n<a;n++)if(e.call(i,t[n],n,t))return t[n]}function T(t,e){var i=a.call(arguments,2);return function(){return t.apply(e,i.concat(a.call(arguments)))}}function A(t){var e=a.call(arguments,1);return function(){return t.apply(this,e.concat(a.call(arguments)))}}function k(t){return"[object Array]"===u.call(t)}function O(t){return"function"==typeof t}function R(t){return"[object String]"===u.call(t)}function z(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function B(t){return!!s[u.call(t)]}function V(t){return!!l[u.call(t)]}function G(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function F(t){return t!=t}function W(t){for(var e=0,i=arguments.length;e<i;e++)if(null!=arguments[e])return arguments[e]}function H(t,e){return null!=t?t:e}function Z(t,e,i){return null!=t?t:null!=e?e:i}function U(){return Function.call.apply(a,arguments)}function X(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function Y(t,e){if(!t)throw new Error(e)}function j(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}o.createCanvas=function(){return document.createElement("canvas")};var q="__ec_primitive__";function K(t){t[q]=!0}function $(t){return t[q]}function J(t){var i=k(t);this.data={};var n=this;function e(t,e){i?n.set(t,e):n.set(e,t)}t instanceof J?t.each(e):t&&E(t,e)}function Q(t){return new J(t)}function tt(t,e){for(var i=new t.constructor(t.length+e.length),n=0;n<t.length;n++)i[n]=t[n];var a=t.length;for(n=0;n<e.length;n++)i[n+a]=e[n];return i}function et(){}J.prototype={constructor:J,get:function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},set:function(t,e){return this.data[t]=e},each:function(t,e){for(var i in void 0!==e&&(t=T(t,e)),this.data)this.data.hasOwnProperty(i)&&t(this.data[i],i)},removeKey:function(t){delete this.data[t]}};var it=(Object.freeze||Object)({$override:f,clone:D,merge:m,mergeAll:p,extend:L,defaults:C,createCanvas:g,getContext:x,indexOf:_,inherits:w,mixin:b,isArrayLike:P,each:E,map:N,reduce:S,filter:M,find:I,bind:T,curry:A,isArray:k,isFunction:O,isString:R,isObject:z,isBuiltInObject:B,isTypedArray:V,isDom:G,eqNaN:F,retrieve:W,retrieve2:H,retrieve3:Z,slice:U,normalizeCssArray:X,assert:Y,trim:j,setAsPrimitive:K,isPrimitive:$,createHashMap:Q,concatArray:tt,noop:et}),nt="undefined"==typeof Float32Array?Array:Float32Array;function at(t,e){var i=new nt(2);return null==t&&(t=0),null==e&&(e=0),i[0]=t,i[1]=e,i}function ot(t,e){return t[0]=e[0],t[1]=e[1],t}function rt(t){var e=new nt(2);return e[0]=t[0],e[1]=t[1],e}function st(t,e,i){return t[0]=e,t[1]=i,t}function lt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function ut(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t}function ht(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function ct(t){return Math.sqrt(ft(t))}var dt=ct;function ft(t){return t[0]*t[0]+t[1]*t[1]}var pt=ft;function gt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function mt(t,e){var i=ct(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}function vt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var yt=vt;function xt(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var _t=xt;function wt(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}function bt(t,e,i){var n=e[0],a=e[1];return t[0]=i[0]*n+i[2]*a+i[4],t[1]=i[1]*n+i[3]*a+i[5],t}function St(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function Mt(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}var It=(Object.freeze||Object)({create:at,copy:ot,clone:rt,set:st,add:lt,scaleAndAdd:ut,sub:ht,len:ct,length:dt,lenSquare:ft,lengthSquare:pt,mul:function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},div:function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:gt,normalize:mt,distance:vt,dist:yt,distanceSquare:xt,distSquare:_t,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:wt,applyTransform:bt,min:St,max:Mt});function At(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this),this.on("globalout",this._dragEnd,this)}function Tt(t,e){return{target:t,topTarget:e&&e.topTarget}}At.prototype={constructor:At,_dragStart:function(t){var e=t.target;e&&e.draggable&&((this._draggingTarget=e).dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(Tt(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,n=t.offsetY,a=i-this._x,o=n-this._y;this._x=i,this._y=n,e.drift(a,o,t),this.dispatchToElement(Tt(e,t),"drag",t.event);var r=this.findHover(i,n,e).target,s=this._dropTarget;e!==(this._dropTarget=r)&&(s&&r!==s&&this.dispatchToElement(Tt(s,t),"dragleave",t.event),r&&r!==s&&this.dispatchToElement(Tt(r,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(Tt(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(Tt(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}};var Dt=Array.prototype.slice,Ct=function(t){this._$handlers={},this._$eventProcessor=t};function Lt(t,e,i,n,a,o){var r=t._$handlers;if("function"==typeof i&&(a=n,n=i,i=null),!n||!e)return t;i=function(t,e){var i=t._$eventProcessor;return null!=e&&i&&i.normalizeQuery&&(e=i.normalizeQuery(e)),e}(t,i),r[e]||(r[e]=[]);for(var s=0;s<r[e].length;s++)if(r[e][s].h===n)return t;var l={h:n,one:o,query:i,ctx:a||t,callAtLast:n.zrEventfulCallAtLast},u=r[e].length-1,h=r[e][u];return h&&h.callAtLast?r[e].splice(u,0,l):r[e].push(l),t}Ct.prototype={constructor:Ct,one:function(t,e,i,n){return Lt(this,t,e,i,n,!0)},on:function(t,e,i,n){return Lt(this,t,e,i,n,!1)},isSilent:function(t){var e=this._$handlers;return!e[t]||!e[t].length},off:function(t,e){var i=this._$handlers;if(!t)return this._$handlers={},this;if(e){if(i[t]){for(var n=[],a=0,o=i[t].length;a<o;a++)i[t][a].h!==e&&n.push(i[t][a]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this},trigger:function(t){var e=this._$handlers[t],i=this._$eventProcessor;if(e){var n=arguments,a=n.length;3<a&&(n=Dt.call(n,1));for(var o=e.length,r=0;r<o;){var s=e[r];if(i&&i.filter&&null!=s.query&&!i.filter(t,s.query))r++;else{switch(a){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,n[1]);break;case 3:s.h.call(s.ctx,n[1],n[2]);break;default:s.h.apply(s.ctx,n)}s.one?(e.splice(r,1),o--):r++}}}return i&&i.afterTrigger&&i.afterTrigger(t),this},triggerWithContext:function(t){var e=this._$handlers[t],i=this._$eventProcessor;if(e){var n=arguments,a=n.length;4<a&&(n=Dt.call(n,1,n.length-1));for(var o=n[n.length-1],r=e.length,s=0;s<r;){var l=e[s];if(i&&i.filter&&null!=l.query&&!i.filter(t,l.query))s++;else{switch(a){case 1:l.h.call(o);break;case 2:l.h.call(o,n[1]);break;case 3:l.h.call(o,n[1],n[2]);break;default:l.h.apply(o,n)}l.one?(e.splice(s,1),r--):s++}}}return i&&i.afterTrigger&&i.afterTrigger(t),this}};var kt=Math.log(2);function Pt(t,e,i,n,a,o){var r=n+"-"+a,s=t.length;if(o.hasOwnProperty(r))return o[r];if(1===e){var l=Math.round(Math.log((1<<s)-1&~a)/kt);return t[i][l]}for(var u=n|1<<i,h=i+1;n&1<<h;)h++;for(var c=0,d=0,f=0;d<s;d++){var p=1<<d;p&a||(c+=(f%2?-1:1)*t[i][d]*Pt(t,e-1,h,u,a|p,o),f++)}return o[r]=c}var Nt="undefined"!=typeof window&&!!window.addEventListener,Ot=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Et="___zrEVENTSAVED",Rt=[];function zt(t,e,i,n){return i=i||{},n||!v.canvasSupported?Bt(t,e,i):v.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):Bt(t,e,i),i}function Bt(t,e,i){if(t.getBoundingClientRect&&v.domSupported){var n=e.clientX,a=e.clientY;if("CANVAS"===t.nodeName.toUpperCase()){var o=t.getBoundingClientRect();return i.zrX=n-o.left,void(i.zrY=a-o.top)}var r=t[Et]||(t[Et]={}),s=function(t,e){for(var i=e.transformer,n=e.srcCoords,a=!0,o=[],r=[],s=0;s<4;s++){var l=t[s].getBoundingClientRect(),u=2*s,h=l.left,c=l.top;o.push(h,c),a&=n&&h===n[u]&&c===n[1+u],r.push(t[s].offsetLeft,t[s].offsetTop)}return a?i:(e.srcCoords=o,e.transformer=function(t,e){var i=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},a=Pt(i,8,0,0,0,n);if(0!==a){for(var o=[],r=0;r<8;r++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((r+s)%2?-1:1)*Pt(i,7,0===r?1:0,1<<r,1<<s,n)/a*e[r];return function(t,e,i){var n=e*o[6]+i*o[7]+1;t[0]=(e*o[0]+i*o[1]+o[2])/n,t[1]=(e*o[3]+i*o[4]+o[5])/n}}}(o,r))}(function(t,e){var i=e.markers;if(i)return i;i=e.markers=[];for(var n=["left","right"],a=["top","bottom"],o=0;o<4;o++){var r=document.createElement("div"),s=r.style,l=o%2,u=(o>>1)%2;s.cssText=["position:absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","width:0","height:0",n[l]+":0",a[u]+":0",n[1-l]+":auto",a[1-u]+":auto",""].join("!important;"),t.appendChild(r),i.push(r)}return i}(t,r),r);if(s)return s(Rt,n,a),i.zrX=Rt[0],void(i.zrY=Rt[1])}i.zrX=i.zrY=0}function Vt(t,e,i){if(null!=(e=e||window.event).zrX)return e;var n=e.type;if(n&&0<=n.indexOf("touch")){var a="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];a&&zt(t,a,e,i)}else zt(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var o=e.button;return null==e.which&&void 0!==o&&Ot.test(e.type)&&(e.which=1&o?1:2&o?3:4&o?2:0),e}function Gt(t,e,i){Nt?t.addEventListener(e,i):t.attachEvent("on"+e,i)}var Ft=Nt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function Wt(t){return 2===t.which||3===t.which}function Ht(){this._track=[]}function Zt(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}Ht.prototype={constructor:Ht,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:e,event:t},o=0,r=n.length;o<r;o++){var s=n[o],l=zt(i,s,{});a.points.push([l.zrX,l.zrY]),a.touches.push(s)}this._track.push(a)}},_recognize:function(t){for(var e in Ut)if(Ut.hasOwnProperty(e)){var i=Ut[e](this._track,t);if(i)return i}}};var Ut={pinch:function(t,e){var i=t.length;if(i){var n=(t[i-1]||{}).points,a=(t[i-2]||{}).points||n;if(a&&1<a.length&&n&&1<n.length){var o=Zt(n)/Zt(a);isFinite(o)||(o=1),e.pinchScale=o;var r=function(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}(n);return e.pinchX=r[0],e.pinchY=r[1],{type:"pinch",target:t[0].target,event:e}}}}},Xt="silent";function Yt(t){Ft(this.event)}function jt(){}jt.prototype.dispose=function(){};function qt(t,e,i,n){Ct.call(this),this.storage=t,this.painter=e,this.painterRoot=n,i=i||new jt,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,At.call(this),this.setHandlerProxy(i)}var Kt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"];function $t(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){for(var n,a=t;a;){if(a.clipPath&&!a.clipPath.contain(e,i))return!1;a.silent&&(n=!0),a=a.parent}return!n||Xt}return!1}qt.prototype={constructor:qt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(E(Kt,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,i=t.zrY,n=this._hovered,a=n.target;a&&!a.__zr&&(a=(n=this.findHover(n.x,n.y)).target);var o=this._hovered=this.findHover(e,i),r=o.target,s=this.proxy;s.setCursor&&s.setCursor(r?r.cursor:"default"),a&&r!==a&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(o,"mousemove",t),r&&r!==a&&this.dispatchToElement(o,"mouseover",t)},mouseout:function(t){this.dispatchToElement(this._hovered,"mouseout",t);for(var e,i=t.toElement||t.relatedTarget;(i=i&&i.parentNode)&&9!==i.nodeType&&!(e=i===this.painterRoot););e||this.trigger("globalout",{event:t})},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){var n=(t=t||{}).target;if(!n||!n.silent){for(var a="on"+e,o=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:Yt}}(e,t,i);n&&(n[a]&&(o.cancelBubble=n[a].call(n,o)),n.trigger(e,o),n=n.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[a]&&t[a].call(t,o),t.trigger&&t.trigger(e,o)}))}},findHover:function(t,e,i){for(var n=this.storage.getDisplayList(),a={x:t,y:e},o=n.length-1;0<=o;o--){var r;if(n[o]!==i&&!n[o].ignore&&(r=$t(n[o],t,e))&&(a.topTarget||(a.topTarget=n[o]),r!==Xt)){a.target=n[o];break}}return a},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new Ht);var i=this._gestureMgr;"start"===e&&i.clear();var n=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),n){var a=n.type;t.gestureEvent=a,this.dispatchToElement({target:n.target},a,n.event)}}},E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(n){qt.prototype[n]=function(t){var e=this.findHover(t.zrX,t.zrY),i=e.target;if("mousedown"===n)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===n)this._upEl=i;else if("click"===n){if(this._downEl!==this._upEl||!this._downPoint||4<yt(this._downPoint,[t.zrX,t.zrY]))return;this._downPoint=null}this.dispatchToElement(e,n,t)}}),b(qt,Ct),b(qt,At);var Jt="undefined"==typeof Float32Array?Array:Float32Array;function Qt(){var t=new Jt(6);return te(t),t}function te(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ee(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ie(t,e,i){var n=e[0]*i[0]+e[2]*i[1],a=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],s=e[0]*i[4]+e[2]*i[5]+e[4],l=e[1]*i[4]+e[3]*i[5]+e[5];return t[0]=n,t[1]=a,t[2]=o,t[3]=r,t[4]=s,t[5]=l,t}function ne(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}function ae(t,e,i){var n=e[0],a=e[2],o=e[4],r=e[1],s=e[3],l=e[5],u=Math.sin(i),h=Math.cos(i);return t[0]=n*h+r*u,t[1]=-n*u+r*h,t[2]=a*h+s*u,t[3]=-a*u+h*s,t[4]=h*o+u*l,t[5]=h*l-u*o,t}function oe(t,e,i){var n=i[0],a=i[1];return t[0]=e[0]*n,t[1]=e[1]*a,t[2]=e[2]*n,t[3]=e[3]*a,t[4]=e[4]*n,t[5]=e[5]*a,t}function re(t,e){var i=e[0],n=e[2],a=e[4],o=e[1],r=e[3],s=e[5],l=i*r-o*n;return l?(l=1/l,t[0]=r*l,t[1]=-o*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*s-r*a)*l,t[5]=(o*a-i*s)*l,t):null}function se(t){var e=Qt();return ee(e,t),e}var le=(Object.freeze||Object)({create:Qt,identity:te,copy:ee,mul:ie,translate:ne,rotate:ae,scale:oe,invert:re,clone:se}),ue=te;function he(t){return 5e-5<t||t<-5e-5}var ce=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},de=ce.prototype;de.transform=null,de.needLocalTransform=function(){return he(this.rotation)||he(this.position[0])||he(this.position[1])||he(this.scale[0]-1)||he(this.scale[1]-1)};var fe=[];de.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;if(i||e){n=n||Qt(),i?this.getLocalTransform(n):ue(n),e&&(i?ie(n,t.transform,n):ee(n,t.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(fe);var o=fe[0]<0?-1:1,r=fe[1]<0?-1:1,s=((fe[0]-o)*a+o)/fe[0]||0,l=((fe[1]-r)*a+r)/fe[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||Qt(),re(this.invTransform,n)}else n&&ue(n)},de.getLocalTransform=function(t){return ce.getLocalTransform(this,t)},de.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},de.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var pe=[],ge=Qt();de.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=this.position,a=this.scale;he(e-1)&&(e=Math.sqrt(e)),he(i-1)&&(i=Math.sqrt(i)),t[0]<0&&(e=-e),t[3]<0&&(i=-i),n[0]=t[4],n[1]=t[5],a[0]=e,a[1]=i,this.rotation=Math.atan2(-t[1]/i,t[0]/e)}},de.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(ie(pe,t.invTransform,e),e=pe);var i=this.origin;i&&(i[0]||i[1])&&(ge[4]=i[0],ge[5]=i[1],ie(pe,e,ge),pe[4]-=i[0],pe[5]-=i[1],e=pe),this.setLocalTransform(e)}},de.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[0]=1,t[1]=1),t},de.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&bt(i,i,n),i},de.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&bt(i,i,n),i},ce.getLocalTransform=function(t,e){ue(e=e||[]);var i=t.origin,n=t.scale||[1,1],a=t.rotation||0,o=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),oe(e,e,n),a&&ae(e,e,a),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=o[0],e[5]+=o[1],e};var me={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,i=.1;return 0===t?0:1===t?1:(e=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(e=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(e=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){return t*t*(2.70158*t-1.70158)},backOut:function(t){return--t*t*(2.70158*t+1.70158)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)},bounceIn:function(t){return 1-me.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*me.bounceIn(2*t):.5*me.bounceOut(2*t-1)+.5}};function ve(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,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,this._pausedTime=0,this._paused=!1}ve.prototype={constructor:ve,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,a="string"==typeof n?me[n]:n,o="function"==typeof a?a(i):i;return this.fire("frame",o),1===i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};function ye(){this.head=null,this.tail=null,this._len=0}var xe=ye.prototype;xe.insert=function(t){var e=new we(t);return this.insertEntry(e),e},xe.insertEntry=function(t){this.head?((this.tail.next=t).prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},xe.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},xe.len=function(){return this._len},xe.clear=function(){this.head=this.tail=null,this._len=0};function _e(t){this._list=new ye,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null}var we=function(t){this.value=t,this.next,this.prev},be=_e.prototype;be.put=function(t,e){var i=this._list,n=this._map,a=null;if(null==n[t]){var o=i.len(),r=this._lastRemovedEntry;if(o>=this._maxSize&&0<o){var s=i.head;i.remove(s),delete n[s.key],a=s.value,this._lastRemovedEntry=s}r?r.value=e:r=new we(e),r.key=t,i.insertEntry(r),n[t]=r}return a},be.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},be.clear=function(){this._list.clear(),this._map={}};var Se={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 Me(t){return(t=Math.round(t))<0?0:255<t?255:t}function Ie(t){return t<0?0:1<t?1:t}function Ae(t){return t.length&&"%"===t.charAt(t.length-1)?Me(parseFloat(t)/100*255):Me(parseInt(t,10))}function Te(t){return t.length&&"%"===t.charAt(t.length-1)?Ie(parseFloat(t)/100):Ie(parseFloat(t))}function De(t,e,i){return i<0?i+=1:1<i&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function Ce(t,e,i){return t+(e-t)*i}function Le(t,e,i,n,a){return t[0]=e,t[1]=i,t[2]=n,t[3]=a,t}function ke(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Pe=new _e(20),Ne=null;function Oe(t,e){Ne&&ke(Ne,e),Ne=Pe.put(t,Ne||e.slice())}function Ee(t,e){if(t){e=e||[];var i=Pe.get(t);if(i)return ke(e,i);var n,a=(t+="").replace(/ /g,"").toLowerCase();if(a in Se)return ke(e,Se[a]),Oe(t,e),e;if("#"===a.charAt(0))return 4===a.length?0<=(n=parseInt(a.substr(1),16))&&n<=4095?(Le(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),Oe(t,e),e):void Le(e,0,0,0,1):7===a.length?0<=(n=parseInt(a.substr(1),16))&&n<=16777215?(Le(e,(16711680&n)>>16,(65280&n)>>8,255&n,1),Oe(t,e),e):void Le(e,0,0,0,1):void 0;var o=a.indexOf("("),r=a.indexOf(")");if(-1!==o&&r+1===a.length){var s=a.substr(0,o),l=a.substr(o+1,r-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Le(e,0,0,0,1);u=Te(l.pop());case"rgb":return 3!==l.length?void Le(e,0,0,0,1):(Le(e,Ae(l[0]),Ae(l[1]),Ae(l[2]),u),Oe(t,e),e);case"hsla":return 4!==l.length?void Le(e,0,0,0,1):(l[3]=Te(l[3]),Re(l,e),Oe(t,e),e);case"hsl":return 3!==l.length?void Le(e,0,0,0,1):(Re(l,e),Oe(t,e),e);default:return}}Le(e,0,0,0,1)}}function Re(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Te(t[1]),a=Te(t[2]),o=a<=.5?a*(n+1):a+n-a*n,r=2*a-o;return Le(e=e||[],Me(255*De(r,o,i+1/3)),Me(255*De(r,o,i)),Me(255*De(r,o,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ze(t,e){var i=Ee(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,255<i[n]?i[n]=255:t[n]<0&&(i[n]=0);return Ue(i,4===i.length?"rgba":"rgb")}}function Be(t){var e=Ee(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Ve(t,e,i){if(e&&e.length&&0<=t&&t<=1){i=i||[];var n=t*(e.length-1),a=Math.floor(n),o=Math.ceil(n),r=e[a],s=e[o],l=n-a;return i[0]=Me(Ce(r[0],s[0],l)),i[1]=Me(Ce(r[1],s[1],l)),i[2]=Me(Ce(r[2],s[2],l)),i[3]=Ie(Ce(r[3],s[3],l)),i}}var Ge=Ve;function Fe(t,e,i){if(e&&e.length&&0<=t&&t<=1){var n=t*(e.length-1),a=Math.floor(n),o=Math.ceil(n),r=Ee(e[a]),s=Ee(e[o]),l=n-a,u=Ue([Me(Ce(r[0],s[0],l)),Me(Ce(r[1],s[1],l)),Me(Ce(r[2],s[2],l)),Ie(Ce(r[3],s[3],l))],"rgba");return i?{color:u,leftIndex:a,rightIndex:o,value:n}:u}}var We=Fe;function He(t,e,i,n){if(t=Ee(t))return t=function(t){if(t){var e,i,n=t[0]/255,a=t[1]/255,o=t[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r,u=(s+r)/2;if(0==l)i=e=0;else{i=u<.5?l/(s+r):l/(2-s-r);var h=((s-n)/6+l/2)/l,c=((s-a)/6+l/2)/l,d=((s-o)/6+l/2)/l;n===s?e=d-c:a===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),1<e&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=function(t){return(t=Math.round(t))<0?0:360<t?360:t}(e)),null!=i&&(t[1]=Te(i)),null!=n&&(t[2]=Te(n)),Ue(Re(t),"rgba")}function Ze(t,e){if((t=Ee(t))&&null!=e)return t[3]=Ie(e),Ue(t,"rgba")}function Ue(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}var Xe=(Object.freeze||Object)({parse:Ee,lift:ze,toHex:Be,fastLerp:Ve,fastMapToColor:Ge,lerp:Fe,mapToColor:We,modifyHSL:He,modifyAlpha:Ze,stringify:Ue}),Ye=Array.prototype.slice;function je(t,e){return t[e]}function qe(t,e,i){t[e]=i}function Ke(t,e,i){return(e-t)*i+t}function $e(t,e,i){return.5<i?e:t}function Je(t,e,i,n,a){var o=t.length;if(1===a)for(var r=0;r<o;r++)n[r]=Ke(t[r],e[r],i);else{var s=o&&t[0].length;for(r=0;r<o;r++)for(var l=0;l<s;l++)n[r][l]=Ke(t[r][l],e[r][l],i)}}function Qe(t,e,i){var n=t.length,a=e.length;if(n!==a)if(a<n)t.length=a;else for(var o=n;o<a;o++)t.push(1===i?e[o]:Ye.call(e[o]));var r=t[0]&&t[0].length;for(o=0;o<t.length;o++)if(1===i)isNaN(t[o])&&(t[o]=e[o]);else for(var s=0;s<r;s++)isNaN(t[o][s])&&(t[o][s]=e[o][s])}function ti(t,e,i){if(t===e)return!0;var n=t.length;if(n!==e.length)return!1;if(1===i){for(var a=0;a<n;a++)if(t[a]!==e[a])return!1}else{var o=t[0].length;for(a=0;a<n;a++)for(var r=0;r<o;r++)if(t[a][r]!==e[a][r])return!1}return!0}function ei(t,e,i,n,a,o,r,s,l){var u=t.length;if(1===l)for(var h=0;h<u;h++)s[h]=ii(t[h],e[h],i[h],n[h],a,o,r);else{var c=t[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=ii(t[h][d],e[h][d],i[h][d],n[h][d],a,o,r)}}function ii(t,e,i,n,a,o,r){var s=.5*(i-t),l=.5*(n-e);return(2*(e-i)+s+l)*r+(-3*(e-i)-2*s-l)*o+s*a+e}function ni(t){if(P(t)){var e=t.length;if(P(t[0])){for(var i=[],n=0;n<e;n++)i.push(Ye.call(t[n]));return i}return Ye.call(t)}return t}function ai(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function oi(t,e,i,n,o,a){var r=t._getter,s=t._setter,l="spline"===e,u=n.length;if(u){var h,c=P(n[0].value),d=!1,f=!1,p=c?function(t){var e=t[t.length-1].value;return P(e&&e[0])?2:1}(n):0;n.sort(function(t,e){return t.time-e.time}),h=n[u-1].time;for(var g=[],m=[],v=n[0].value,y=!0,x=0;x<u;x++){g.push(n[x].time/h);var _=n[x].value;if(c&&ti(_,v,p)||!c&&_===v||(y=!1),"string"==typeof(v=_)){var w=Ee(_);w?(_=w,d=!0):f=!0}m.push(_)}if(a||!y){var b=m[u-1];for(x=0;x<u-1;x++)c?Qe(m[x],b,p):!isNaN(m[x])||isNaN(b)||f||d||(m[x]=b);c&&Qe(r(t._target,o),b,p);var S,M,I,A,T,D=0,C=0;if(d)var L=[0,0,0,0];var k=new ve({target:t._target,life:h,loop:t._loop,delay:t._delay,onframe:function(t,e){var i;if(e<0)i=0;else if(e<C){for(i=Math.min(D+1,u-1);0<=i&&!(g[i]<=e);i--);i=Math.min(i,u-2)}else{for(i=D;i<u&&!(g[i]>e);i++);i=Math.min(i-1,u-2)}C=e;var n=g[(D=i)+1]-g[i];if(0!=n)if(S=(e-g[i])/n,l)if(I=m[i],M=m[0===i?i:i-1],A=m[u-2<i?u-1:i+1],T=m[u-3<i?u-1:i+2],c)ei(M,I,A,T,S,S*S,S*S*S,r(t,o),p);else{if(d)a=ei(M,I,A,T,S,S*S,S*S*S,L,1),a=ai(L);else{if(f)return $e(I,A,S);a=ii(M,I,A,T,S,S*S,S*S*S)}s(t,o,a)}else if(c)Je(m[i],m[i+1],S,r(t,o),p);else{var a;if(d)Je(m[i],m[i+1],S,L,1),a=ai(L);else{if(f)return $e(m[i],m[i+1],S);a=Ke(m[i],m[i+1],S)}s(t,o,a)}},ondestroy:i});return e&&"spline"!==e&&(k.easing=e),k}}}function ri(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||je,this._setter=n||qe,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]}ri.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var a=this._getter(this._target,n);if(null==a)continue;0!==t&&i[n].push({time:0,value:ni(a)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].pause();this._paused=!0},resume:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var t=this._doneList,e=t.length,i=0;i<e;i++)t[i].call(this)},start:function(t,e){function i(){--o||a._doneCallback()}var n,a=this,o=0;for(var r in this._tracks)if(this._tracks.hasOwnProperty(r)){var s=oi(this,t,i,this._tracks[r],r,e);s&&(this._clipList.push(s),o++,this.animation&&this.animation.addClip(s),n=s)}if(n){var l=n.onframe;n.onframe=function(t,e){l(t,e);for(var i=0;i<a._onframeList.length;i++)a._onframeList[i](t,e)}}return o||this._doneCallback(),this},stop:function(t){for(var e=this._clipList,i=this.animation,n=0;n<e.length;n++){var a=e[n];t&&a.onframe(this._target,1),i&&i.removeClip(a)}e.length=0},delay:function(t){return this._delay=t,this},done:function(t){return t&&this._doneList.push(t),this},getClips:function(){return this._clipList}};var si=1;"undefined"!=typeof window&&(si=Math.max(window.devicePixelRatio||1,1));var li=si,ui=function(){};function hi(){this.animators=[]}var ci=ui;function di(t,e,i,n,a,o,r,s){R(n)?(o=a,a=n,n=0):O(a)?(o=a,a="linear",n=0):O(n)?(o=n,n=0):i=O(i)?(o=i,500):i||500,t.stopAnimation(),function t(e,i,n,a,o,r,s){var l={};var u=0;for(var h in a)a.hasOwnProperty(h)&&(null!=n[h]?z(a[h])&&!P(a[h])?t(e,i?i+"."+h:h,n[h],a[h],o,r,s):(s?(l[h]=n[h],fi(e,i,h,a[h])):l[h]=a[h],u++):null==a[h]||s||fi(e,i,h,a[h]));0<u&&e.animate(i,!1).when(null==o?500:o,l).delay(r||0)}(t,"",t,e,i,n,s);var l=t.animators.slice(),u=l.length;function h(){--u||o&&o()}u||o&&o();for(var c=0;c<l.length;c++)l[c].done(h).start(a,r)}function fi(t,e,i,n){if(e){var a={};a[e]={},a[e][i]=n,t.attr(a)}else t.attr(i,n)}hi.prototype={constructor:hi,animate:function(t,e){var i,n=!1,a=this,o=this.__zr;if(t){var r=t.split("."),s=a;n="shape"===r[0];for(var l=0,u=r.length;l<u;l++)s=s&&s[r[l]];s&&(i=s)}else i=a;if(i){var h=a.animators,c=new ri(i,e);return c.during(function(t){a.dirty(n)}).done(function(){h.splice(_(h,c),1)}),h.push(c),o&&o.animation.addAnimator(c),c}ci('Property "'+t+'" is not existed in element '+a.id)},stopAnimation:function(t){for(var e=this.animators,i=e.length,n=0;n<i;n++)e[n].stop(t);return e.length=0,this},animateTo:function(t,e,i,n,a,o){di(this,t,e,i,n,a,o)},animateFrom:function(t,e,i,n,a,o){di(this,t,e,i,n,a,o,!0)}};var pi=function(t){ce.call(this,t),Ct.call(this,t),hi.call(this,t),this.id=t.id||n()};pi.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;(i=i||(this.transform=[1,0,0,1,0,0]))[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];(i=i||(this[t]=[]))[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(z(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),(this.clipPath=t).__zr=e,(t.__clipTarget=this).dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.addAnimator(e[i]);this.clipPath&&this.clipPath.addSelfToZr(t)},removeSelfFromZr:function(t){this.__zr=null;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.removeAnimator(e[i]);this.clipPath&&this.clipPath.removeSelfFromZr(t)}},b(pi,hi),b(pi,ce),b(pi,Ct);var gi,mi,vi,yi,xi=bt,_i=Math.min,wi=Math.max;function bi(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}bi.prototype={constructor:bi,union:function(t){var e=_i(t.x,this.x),i=_i(t.y,this.y);this.width=wi(t.x+t.width,this.x+this.width)-e,this.height=wi(t.y+t.height,this.y+this.height)-i,this.x=e,this.y=i},applyTransform:(gi=[],mi=[],vi=[],yi=[],function(t){if(t){gi[0]=vi[0]=this.x,gi[1]=yi[1]=this.y,mi[0]=yi[0]=this.x+this.width,mi[1]=vi[1]=this.y+this.height,xi(gi,gi,t),xi(mi,mi,t),xi(vi,vi,t),xi(yi,yi,t),this.x=_i(gi[0],mi[0],vi[0],yi[0]),this.y=_i(gi[1],mi[1],vi[1],yi[1]);var e=wi(gi[0],mi[0],vi[0],yi[0]),i=wi(gi[1],mi[1],vi[1],yi[1]);this.width=e-this.x,this.height=i-this.y}}),calculateTransform:function(t){var e=t.width/this.width,i=t.height/this.height,n=Qt();return ne(n,n,[-this.x,-this.y]),oe(n,n,[e,i]),ne(n,n,[t.x,t.y]),n},intersect:function(t){if(!t)return!1;t instanceof bi||(t=bi.create(t));var e=this,i=e.x,n=e.x+e.width,a=e.y,o=e.y+e.height,r=t.x,s=t.x+t.width,l=t.y,u=t.y+t.height;return!(n<r||s<i||o<l||u<a)},contain:function(t,e){var i=this;return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new bi(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},bi.create=function(t){return new bi(t.x,t.y,t.width,t.height)};var Si=function(t){for(var e in t=t||{},pi.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Si.prototype={constructor:Si,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i<e.length;i++)if(e[i].name===t)return e[i]},childCount:function(){return this._children.length},add:function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},addBefore:function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var i=this._children,n=i.indexOf(e);0<=n&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t);var e=(t.parent=this).__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof Si&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,n=this._children,a=_(n,t);return a<0||(n.splice(a,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof Si&&t.delChildrenFromStorage(i)),e&&e.refresh()),this},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e<i.length;e++)t=i[e],n&&(n.delFromStorage(t),t instanceof Si&&t.delChildrenFromStorage(n)),t.parent=null;return i.length=0,this},eachChild:function(t,e){for(var i=this._children,n=0;n<i.length;n++){var a=i[n];t.call(e,a,n)}return this},traverse:function(t,e){for(var i=0;i<this._children.length;i++){var n=this._children[i];t.call(e,n),"group"===n.type&&n.traverse(t,e)}return this},addChildrenToStorage:function(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToStorage(i),i instanceof Si&&i.addChildrenToStorage(t)}},delChildrenFromStorage:function(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromStorage(i),i instanceof Si&&i.delChildrenFromStorage(t)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(t){for(var e=null,i=new bi(0,0,0,0),n=t||this._children,a=[],o=0;o<n.length;o++){var r=n[o];if(!r.ignore&&!r.invisible){var s=r.getBoundingRect(),l=r.getLocalTransform(a);l?(i.copy(s),i.applyTransform(l),(e=e||i.clone()).union(i)):(e=e||s.clone()).union(s)}}return e||i}},w(Si,pi);var Mi=32,Ii=7;function Ai(t,e,i,n){var a=e+1;if(a===i)return 1;if(n(t[a++],t[e])<0){for(;a<i&&n(t[a],t[a-1])<0;)a++;!function(t,e,i){i--;for(;e<i;){var n=t[e];t[e++]=t[i],t[i--]=n}}(t,e,a)}else for(;a<i&&0<=n(t[a],t[a-1]);)a++;return a-e}function Ti(t,e,i,n,a){for(n===e&&n++;n<i;n++){for(var o,r=t[n],s=e,l=n;s<l;)a(r,t[o=s+l>>>1])<0?l=o:s=1+o;var u=n-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:for(;0<u;)t[s+u]=t[s+u-1],u--}t[s]=r}}function Di(t,e,i,n,a,o){var r=0,s=0,l=1;if(0<o(t,e[i+a])){for(s=n-a;l<s&&0<o(t,e[i+a+l]);)(l=1+((r=l)<<1))<=0&&(l=s);s<l&&(l=s),r+=a,l+=a}else{for(s=a+1;l<s&&o(t,e[i+a-l])<=0;)(l=1+((r=l)<<1))<=0&&(l=s);s<l&&(l=s);var u=r;r=a-l,l=a-u}for(r++;r<l;){var h=r+(l-r>>>1);0<o(t,e[i+h])?r=h+1:l=h}return l}function Ci(t,e,i,n,a,o){var r=0,s=0,l=1;if(o(t,e[i+a])<0){for(s=a+1;l<s&&o(t,e[i+a-l])<0;)(l=1+((r=l)<<1))<=0&&(l=s);s<l&&(l=s);var u=r;r=a-l,l=a-u}else{for(s=n-a;l<s&&0<=o(t,e[i+a+l]);)(l=1+((r=l)<<1))<=0&&(l=s);s<l&&(l=s),r+=a,l+=a}for(r++;r<l;){var h=r+(l-r>>>1);o(t,e[i+h])<0?l=h:r=h+1}return l}function Li(p,g){var r,s,m=Ii,l=0,v=[];function e(t){var e=r[t],i=s[t],n=r[t+1],a=s[t+1];s[t]=i+a,t===l-3&&(r[t+1]=r[t+2],s[t+1]=s[t+2]),l--;var o=Ci(p[n],p,e,i,0,g);e+=o,0!==(i-=o)&&0!==(a=Di(p[e+i-1],p,n,a,a-1,g))&&(i<=a?function(t,e,i,n){var a=0;for(a=0;a<e;a++)v[a]=p[t+a];var o=0,r=i,s=t;if(p[s++]=p[r++],0==--n){for(a=0;a<e;a++)p[s+a]=v[o+a];return}if(1===e){for(a=0;a<n;a++)p[s+a]=p[r+a];return p[s+n]=v[o]}var l,u,h,c=m;for(;;){u=l=0,h=!1;do{if(g(p[r],v[o])<0){if(p[s++]=p[r++],u++,(l=0)==--n){h=!0;break}}else if(p[s++]=v[o++],l++,u=0,1==--e){h=!0;break}}while((l|u)<c);if(h)break;do{if(0!==(l=Ci(p[r],v,o,e,0,g))){for(a=0;a<l;a++)p[s+a]=v[o+a];if(s+=l,o+=l,(e-=l)<=1){h=!0;break}}if(p[s++]=p[r++],0==--n){h=!0;break}if(0!==(u=Di(v[o],p,r,n,0,g))){for(a=0;a<u;a++)p[s+a]=p[r+a];if(s+=u,r+=u,0===(n-=u)){h=!0;break}}if(p[s++]=v[o++],1==--e){h=!0;break}c--}while(Ii<=l||Ii<=u);if(h)break;c<0&&(c=0),c+=2}if((m=c)<1&&(m=1),1===e){for(a=0;a<n;a++)p[s+a]=p[r+a];p[s+n]=v[o]}else{if(0===e)throw new Error;for(a=0;a<e;a++)p[s+a]=v[o+a]}}(e,i,n,a):function(t,e,i,n){var a=0;for(a=0;a<n;a++)v[a]=p[i+a];var o=t+e-1,r=n-1,s=i+n-1,l=0,u=0;if(p[s--]=p[o--],0==--e){for(l=s-(n-1),a=0;a<n;a++)p[l+a]=v[a];return}if(1===n){for(u=(s-=e)+1,l=(o-=e)+1,a=e-1;0<=a;a--)p[u+a]=p[l+a];return p[s]=v[r]}var h=m;for(;;){var c=0,d=0,f=!1;do{if(g(v[r],p[o])<0){if(p[s--]=p[o--],c++,(d=0)==--e){f=!0;break}}else if(p[s--]=v[r--],d++,c=0,1==--n){f=!0;break}}while((c|d)<h);if(f)break;do{if(0!==(c=e-Ci(v[r],p,t,e,e-1,g))){for(e-=c,u=(s-=c)+1,l=(o-=c)+1,a=c-1;0<=a;a--)p[u+a]=p[l+a];if(0===e){f=!0;break}}if(p[s--]=v[r--],1==--n){f=!0;break}if(0!==(d=n-Di(p[o],v,0,n,n-1,g))){for(n-=d,u=(s-=d)+1,l=(r-=d)+1,a=0;a<d;a++)p[u+a]=v[l+a];if(n<=1){f=!0;break}}if(p[s--]=p[o--],0==--e){f=!0;break}h--}while(Ii<=c||Ii<=d);if(f)break;h<0&&(h=0),h+=2}(m=h)<1&&(m=1);if(1===n){for(u=(s-=e)+1,l=(o-=e)+1,a=e-1;0<=a;a--)p[u+a]=p[l+a];p[s]=v[r]}else{if(0===n)throw new Error;for(l=s-(n-1),a=0;a<n;a++)p[l+a]=v[a]}}(e,i,n,a))}r=[],s=[],this.mergeRuns=function(){for(;1<l;){var t=l-2;if(1<=t&&s[t-1]<=s[t]+s[t+1]||2<=t&&s[t-2]<=s[t]+s[t-1])s[t-1]<s[t+1]&&t--;else if(s[t]>s[t+1])break;e(t)}},this.forceMergeRuns=function(){for(;1<l;){var t=l-2;0<t&&s[t-1]<s[t+1]&&t--,e(t)}},this.pushRun=function(t,e){r[l]=t,s[l]=e,l+=1}}function ki(t,e,i,n){i=i||0;var a=(n=n||t.length)-i;if(!(a<2)){var o=0;if(a<Mi)Ti(t,i,n,i+(o=Ai(t,i,n,e)),e);else{var r=new Li(t,e),s=function(t){for(var e=0;Mi<=t;)e|=1&t,t>>=1;return t+e}(a);do{if((o=Ai(t,i,n,e))<s){var l=a;s<l&&(l=s),Ti(t,i,i+l,i+o,e),o=l}r.pushRun(i,o),r.mergeRuns(),a-=o,i+=o}while(0!==a);r.forceMergeRuns()}}}function Pi(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Ni(){this._roots=[],this._displayList=[],this._displayListLen=0}Ni.prototype={constructor:Ni,traverse:function(t,e){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(t,e)},getDisplayList:function(t,e){return e=e||!1,t&&this.updateDisplayList(e),this._displayList},updateDisplayList:function(t){this._displayListLen=0;for(var e=this._roots,i=this._displayList,n=0,a=e.length;n<a;n++)this._updateAndAddDisplayable(e[n],null,t);i.length=this._displayListLen,v.canvasSupported&&ki(i,Pi)},_updateAndAddDisplayable:function(t,e,i){if(!t.ignore||i){t.beforeUpdate(),t.__dirty&&t.update(),t.afterUpdate();var n=t.clipPath;if(n){e=e?e.slice():[];for(var a=n,o=t;a;)a.parent=o,a.updateTransform(),e.push(a),a=(o=a).clipPath}if(t.isGroup){for(var r=t._children,s=0;s<r.length;s++){var l=r[s];t.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,e,i)}t.__dirty=!1}else t.__clipPaths=e,this._displayList[this._displayListLen++]=t}},addRoot:function(t){t.__storage!==this&&(t instanceof Si&&t.addChildrenToStorage(this),this.addToStorage(t),this._roots.push(t))},delRoot:function(t){if(null==t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof Si&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(t instanceof Array){e=0;for(var n=t.length;e<n;e++)this.delRoot(t[e])}else{var a=_(this._roots,t);0<=a&&(this.delFromStorage(t),this._roots.splice(a,1),t instanceof Si&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:Pi};var Oi={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},Ei=function(t,e,i){return Oi.hasOwnProperty(e)?i*t.dpr:i},Ri={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},zi=9,Bi=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],Vi=function(t){this.extendFrom(t,!1)};function Gi(t,e,i){var n=null==e.x?0:e.x,a=null==e.x2?1:e.x2,o=null==e.y?0:e.y,r=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,a=a*i.width+i.x,o=o*i.height+i.y,r=r*i.height+i.y),n=isNaN(n)?0:n,a=isNaN(a)?1:a,o=isNaN(o)?0:o,r=isNaN(r)?0:r,t.createLinearGradient(n,o,a,r)}function Fi(t,e,i){var n=i.width,a=i.height,o=Math.min(n,a),r=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(r=r*n+i.x,s=s*a+i.y,l*=o),t.createRadialGradient(r,s,0,r,s,l)}Vi.prototype={constructor:Vi,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){var n=this,a=i&&i.style,o=!a||t.__attrCachedBy!==Ri.STYLE_BIND;t.__attrCachedBy=Ri.STYLE_BIND;for(var r=0;r<Bi.length;r++){var s=Bi[r],l=s[0];!o&&n[l]===a[l]||(t[l]=Ei(t,l,n[l]||s[1]))}if(!o&&n.fill===a.fill||(t.fillStyle=n.fill),!o&&n.stroke===a.stroke||(t.strokeStyle=n.stroke),!o&&n.opacity===a.opacity||(t.globalAlpha=null==n.opacity?1:n.opacity),!o&&n.blend===a.blend||(t.globalCompositeOperation=n.blend||"source-over"),this.hasStroke()){var u=n.lineWidth;t.lineWidth=u/(this.strokeNoScale&&e&&e.getLineScale?e.getLineScale():1)}},hasFill:function(){var t=this.fill;return null!=t&&"none"!==t},hasStroke:function(){var t=this.stroke;return null!=t&&"none"!==t&&0<this.lineWidth},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var n=("radial"===e.type?Fi:Gi)(t,e,i),a=e.colorStops,o=0;o<a.length;o++)n.addColorStop(a[o].offset,a[o].color);return n}};for(var Wi=Vi.prototype,Hi=0;Hi<Bi.length;Hi++){var Zi=Bi[Hi];Zi[0]in Wi||(Wi[Zi[0]]=Zi[1])}Vi.getGradient=Wi.getGradient;function Ui(t,e){this.image=t,this.repeat=e,this.type="pattern"}function Xi(){return!1}function Yi(t,e,i){var n=g(),a=e.getWidth(),o=e.getHeight(),r=n.style;return r&&(r.position="absolute",r.left=0,r.top=0,r.width=a+"px",r.height=o+"px",n.setAttribute("data-zr-dom-id",t)),n.width=a*i,n.height=o*i,n}function ji(t,e,i){var n;i=i||li,"string"==typeof t?n=Yi(t,e,i):z(t)&&(t=(n=t).id),this.id=t;var a=(this.dom=n).style;a&&(n.onselectstart=Xi,a["-webkit-user-select"]="none",a["user-select"]="none",a["-webkit-touch-callout"]="none",a["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",a.padding=0,a.margin=0,a["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=e,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i}ji.prototype={constructor:ji,__dirty:!0,__used:!(Ui.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")}),__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var t=this.dpr;this.domBack=Yi("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},resize:function(t,e){var i=this.dpr,n=this.dom,a=n.style,o=this.domBack;a&&(a.width=t+"px",a.height=e+"px"),n.width=t*i,n.height=e*i,o&&(o.width=t*i,o.height=e*i,1!==i&&this.ctxBack.scale(i,i))},clear:function(t,e){var i,n=this.dom,a=this.ctx,o=n.width,r=n.height,s=(e=e||this.clearColor,this.motionBlur&&!t),l=this.lastFrameAlpha,u=this.dpr;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(n,0,0,o/u,r/u)),a.clearRect(0,0,o,r),e&&"transparent"!==e&&(e.colorStops?(i=e.__canvasGradient||Vi.getGradient(a,e,{x:0,y:0,width:o,height:r}),e.__canvasGradient=i):e.image&&(i=Ui.prototype.getCanvasPattern.call(e,a)),a.save(),a.fillStyle=i||e,a.fillRect(0,0,o,r),a.restore());if(s){var h=this.domBack;a.save(),a.globalAlpha=l,a.drawImage(h,0,0,o,r),a.restore()}}};var qi="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){setTimeout(t,16)},Ki=new _e(50);function $i(t){if("string"!=typeof t)return t;var e=Ki.get(t);return e&&e.image}function Ji(t,e,i,n,a){if(t){if("string"!=typeof t)return t;if(e&&e.__zrImageSrc===t||!i)return e;var o=Ki.get(t),r={hostEl:i,cb:n,cbPayload:a};return o?tn(e=o.image)||o.pending.push(r):((e=new Image).onload=e.onerror=Qi,Ki.put(t,e.__cachedImgObj={image:e,pending:[r]}),e.src=e.__zrImageSrc=t),e}return e}function Qi(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var i=t.pending[e],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}t.pending.length=0}function tn(t){return t&&t.width&&t.height}var en={},nn=0,an=5e3,on=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,rn="12px sans-serif",sn={};function ln(t,e){var i=t+":"+(e=e||rn);if(en[i])return en[i];for(var n,a,o=(t+"").split("\n"),r=0,s=0,l=o.length;s<l;s++)r=Math.max((n=o[s],a=e,sn.measureText(n,a)).width,r);return an<nn&&(nn=0,en={}),nn++,en[i]=r}function un(t,e,i,n,a,o,r,s){return r?function(t,e,i,n,a,o,r,s){var l=xn(t,{rich:r,truncate:s,font:e,textAlign:i,textPadding:a,textLineHeight:o}),u=l.outerWidth,h=l.outerHeight,c=hn(0,u,i),d=cn(0,h,n);return new bi(c,d,u,h)}(t,e,i,n,a,o,r,s):function(t,e,i,n,a,o,r){var s=yn(t,e,a,o,r),l=ln(t,e);a&&(l+=a[1]+a[3]);var u=s.outerHeight,h=hn(0,l,i),c=cn(0,u,n),d=new bi(h,c,l,u);return d.lineHeight=s.lineHeight,d}(t,e,i,n,a,o,s)}function hn(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function cn(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function dn(t,e,i){var n=e.textPosition,a=e.textDistance,o=i.x,r=i.y;a=a||0;var s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":o-=a,r+=u,h="right",c="middle";break;case"right":o+=a+l,r+=u,c="middle";break;case"top":o+=l/2,r-=a,h="center",c="bottom";break;case"bottom":o+=l/2,r+=s+a,h="center";break;case"inside":o+=l/2,r+=u,h="center",c="middle";break;case"insideLeft":o+=a,r+=u,c="middle";break;case"insideRight":o+=l-a,r+=u,h="right",c="middle";break;case"insideTop":o+=l/2,r+=a,h="center";break;case"insideBottom":o+=l/2,r+=s-a,h="center",c="bottom";break;case"insideTopLeft":o+=a,r+=a;break;case"insideTopRight":o+=l-a,r+=a,h="right";break;case"insideBottomLeft":o+=a,r+=s-a,c="bottom";break;case"insideBottomRight":o+=l-a,r+=s-a,h="right",c="bottom"}return(t=t||{}).x=o,t.y=r,t.textAlign=h,t.textVerticalAlign=c,t}function fn(t,e,i,n,a){if(!e)return"";var o=(t+"").split("\n");a=pn(e,i,n,a);for(var r=0,s=o.length;r<s;r++)o[r]=gn(o[r],a);return o.join("\n")}function pn(t,e,i,n){(n=L({},n)).font=e;i=H(i,"...");n.maxIterations=H(n.maxIterations,2);var a=n.minChar=H(n.minChar,0);n.cnCharWidth=ln("国",e);var o=n.ascCharWidth=ln("a",e);n.placeholder=H(n.placeholder,"");for(var r=t=Math.max(0,t-1),s=0;s<a&&o<=r;s++)r-=o;var l=ln(i,e);return r<l&&(i="",l=0),r=t-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=r,n.containerWidth=t,n}function gn(t,e){var i=e.containerWidth,n=e.font,a=e.contentWidth;if(!i)return"";var o=ln(t,n);if(o<=i)return t;for(var r=0;;r++){if(o<=a||r>=e.maxIterations){t+=e.ellipsis;break}var s=0===r?mn(t,a,e.ascCharWidth,e.cnCharWidth):0<o?Math.floor(t.length*a/o):0;o=ln(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function mn(t,e,i,n){for(var a=0,o=0,r=t.length;o<r&&a<e;o++){var s=t.charCodeAt(o);a+=0<=s&&s<=127?i:n}return o}function vn(t){return ln("国",t)}function yn(t,e,i,n,a){null!=t&&(t+="");var o=H(n,vn(e)),r=t?t.split("\n"):[],s=r.length*o,l=s,u=!0;if(i&&(l+=i[0]+i[2]),t&&a){u=!1;var h=a.outerHeight,c=a.outerWidth;if(null!=h&&h<l)t="",r=[];else if(null!=c)for(var d=pn(c-(i?i[1]+i[3]:0),e,a.ellipsis,{minChar:a.minChar,placeholder:a.placeholder}),f=0,p=r.length;f<p;f++)r[f]=gn(r[f],d)}return{lines:r,height:s,outerHeight:l,lineHeight:o,canCacheByTextString:u}}function xn(t,e){var i={lines:[],width:0,height:0};if(null!=t&&(t+=""),!t)return i;for(var n,a=on.lastIndex=0;null!=(n=on.exec(t));){var o=n.index;a<o&&_n(i,t.substring(a,o)),_n(i,n[2],n[1]),a=on.lastIndex}a<t.length&&_n(i,t.substring(a,t.length));var r=i.lines,s=0,l=0,u=[],h=e.textPadding,c=e.truncate,d=c&&c.outerWidth,f=c&&c.outerHeight;h&&(null!=d&&(d-=h[1]+h[3]),null!=f&&(f-=h[0]+h[2]));for(var p=0;p<r.length;p++){for(var g=r[p],m=0,v=0,y=0;y<g.tokens.length;y++){var x=(C=g.tokens[y]).styleName&&e.rich[C.styleName]||{},_=C.textPadding=x.textPadding,w=C.font=x.font||e.font,b=C.textHeight=H(x.textHeight,vn(w));if(_&&(b+=_[0]+_[2]),C.height=b,C.lineHeight=Z(x.textLineHeight,e.textLineHeight,b),C.textAlign=x&&x.textAlign||e.textAlign,C.textVerticalAlign=x&&x.textVerticalAlign||"middle",null!=f&&s+C.lineHeight>f)return{lines:[],width:0,height:0};C.textWidth=ln(C.text,w);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))C.percentWidth=S,u.push(C),S=0;else{if(M){S=C.textWidth;var I=x.textBackgroundColor,A=I&&I.image;A&&tn(A=$i(A))&&(S=Math.max(S,A.width*b/A.height))}var T=_?_[1]+_[3]:0;S+=T;var D=null!=d?d-v:null;null!=D&&D<S&&(!M||D<T?(C.text="",C.textWidth=S=0):(C.text=fn(C.text,D-T,w,c.ellipsis,{minChar:c.minChar}),C.textWidth=ln(C.text,w),S=C.textWidth+T))}v+=C.width=S,x&&(m=Math.max(m,C.lineHeight))}g.width=v,s+=g.lineHeight=m,l=Math.max(l,v)}i.outerWidth=i.width=H(e.textWidth,l),i.outerHeight=i.height=H(e.textHeight,s),h&&(i.outerWidth+=h[1]+h[3],i.outerHeight+=h[0]+h[2]);for(p=0;p<u.length;p++){var C,L=(C=u[p]).percentWidth;C.width=parseInt(L,10)/100*l}return i}function _n(t,e,i){for(var n=""===e,a=e.split("\n"),o=t.lines,r=0;r<a.length;r++){var s=a[r],l={styleName:i,text:s,isLineHolder:!s&&!n};if(r)o.push({tokens:[l]});else{var u=(o[o.length-1]||(o[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:!s&&h&&!n||u.push(l)}}}function wn(t){var e=(t.fontSize||t.fontFamily)&&[t.fontStyle,t.fontWeight,(t.fontSize||12)+"px",t.fontFamily||"sans-serif"].join(" ");return e&&j(e)||t.textFont||t.font}function bn(t,e){var i,n,a,o,r,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?i=n=a=o=c:c instanceof Array?1===c.length?i=n=a=o=c[0]:2===c.length?(i=a=c[0],n=o=c[1]):3===c.length?(i=c[0],n=o=c[1],a=c[2]):(i=c[0],n=c[1],a=c[2],o=c[3]):i=n=a=o=0,u<i+n&&(i*=u/(r=i+n),n*=u/r),u<a+o&&(a*=u/(r=a+o),o*=u/r),h<n+a&&(n*=h/(r=n+a),a*=h/r),h<i+o&&(i*=h/(r=i+o),o*=h/r),t.moveTo(s+i,l),t.lineTo(s+u-n,l),0!==n&&t.arc(s+u-n,l+n,n,-Math.PI/2,0),t.lineTo(s+u,l+h-a),0!==a&&t.arc(s+u-a,l+h-a,a,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+i),0!==i&&t.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)}sn.measureText=function(t,e){var i=x();return i.font=e||rn,i.measureText(t)};var Sn=rn,Mn={left:1,right:1,center:1},In={top:1,bottom:1,middle:1},An=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],Tn={},Dn={};function Cn(t){return Ln(t),E(t.rich,Ln),t}function Ln(t){if(t){t.font=wn(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||Mn[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||In[i]?i:"top",t.textPadding&&(t.textPadding=X(t.textPadding))}}function kn(t,e,i,n,a,o){n.rich?function(t,e,i,n,a,o){o!==zi&&(e.__attrCachedBy=Ri.NONE);var r=t.__textCotentBlock;r&&!t.__dirtyText||(r=t.__textCotentBlock=xn(i,n));!function(t,e,i,n,a){var o=i.width,r=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=zn(Dn,t,n,a),h=u.baseX,c=u.baseY,d=u.textAlign,f=u.textVerticalAlign;Pn(e,n,a,h,c);var p=hn(h,r,d),g=cn(c,s,f),m=p,v=g;l&&(m+=l[3],v+=l[0]);var y=m+o;On(n)&&En(t,e,n,p,g,r,s);for(var x=0;x<i.lines.length;x++){for(var _,w=i.lines[x],b=w.tokens,S=b.length,M=w.lineHeight,I=w.width,A=0,T=m,D=y,C=S-1;A<S&&(!(_=b[A]).textAlign||"left"===_.textAlign);)Nn(t,e,_,n,M,v,T,"left"),I-=_.width,T+=_.width,A++;for(;0<=C&&"right"===(_=b[C]).textAlign;)Nn(t,e,_,n,M,v,D,"right"),I-=_.width,D-=_.width,C--;for(T+=(o-(T-m)-(y-D)-I)/2;A<=C;)_=b[A],Nn(t,e,_,n,M,v,T+_.width/2,"center"),T+=_.width,A++;v+=M}}(t,e,r,n,a)}(t,e,i,n,a,o):function(t,e,i,n,a,o){var r,s=On(n),l=!1,u=e.__attrCachedBy===Ri.PLAIN_TEXT;o!==zi?(o&&(r=o.style,l=!s&&u&&r),e.__attrCachedBy=s?Ri.NONE:Ri.PLAIN_TEXT):u&&(e.__attrCachedBy=Ri.NONE);var h=n.font||Sn;l&&h===(r.font||Sn)||(e.font=h);var c=t.__computedFont;t.__styleFont!==h&&(t.__styleFont=h,c=t.__computedFont=e.font);var d=n.textPadding,f=n.textLineHeight,p=t.__textCotentBlock;p&&!t.__dirtyText||(p=t.__textCotentBlock=yn(i,c,d,f,n.truncate));var g=p.outerHeight,m=p.lines,v=p.lineHeight,y=zn(Dn,t,n,a),x=y.baseX,_=y.baseY,w=y.textAlign||"left",b=y.textVerticalAlign;Pn(e,n,a,x,_);var S=cn(_,g,b),M=x,I=S;if(s||d){var A=ln(i,c);d&&(A+=d[1]+d[3]);var T=hn(x,A,w);s&&En(t,e,n,T,S,A,g),d&&(M=Wn(x,w,d),I+=d[0])}e.textAlign=w,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(var D=0;D<An.length;D++){var C=An[D],L=C[0],k=C[1],P=n[L];l&&P===r[L]||(e[k]=Ei(e,k,P||C[2]))}I+=v/2;var N=n.textStrokeWidth,O=l?r.textStrokeWidth:null,E=!l||N!==O,R=!l||E||n.textStroke!==r.textStroke,z=Vn(n.textStroke,N),B=Gn(n.textFill);z&&(E&&(e.lineWidth=N),R&&(e.strokeStyle=z));B&&(l&&n.textFill===r.textFill||(e.fillStyle=B));if(1===m.length)z&&e.strokeText(m[0],M,I),B&&e.fillText(m[0],M,I);else for(D=0;D<m.length;D++)z&&e.strokeText(m[D],M,I),B&&e.fillText(m[D],M,I),I+=v}(t,e,i,n,a,o)}function Pn(t,e,i,n,a){if(i&&e.textRotation){var o=e.textOrigin;"center"===o?(n=i.width/2+i.x,a=i.height/2+i.y):o&&(n=o[0]+i.x,a=o[1]+i.y),t.translate(n,a),t.rotate(-e.textRotation),t.translate(-n,-a)}}function Nn(t,e,i,n,a,o,r,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=o+a/2;"top"===u?h=o+i.height/2:"bottom"===u&&(h=o+a-i.height/2),!i.isLineHolder&&On(l)&&En(t,e,l,"right"===s?r-i.width:"center"===s?r-i.width/2:r,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(r=Wn(r,s,c),h-=i.height/2-c[2]-i.textHeight/2),Bn(e,"shadowBlur",Z(l.textShadowBlur,n.textShadowBlur,0)),Bn(e,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),Bn(e,"shadowOffsetX",Z(l.textShadowOffsetX,n.textShadowOffsetX,0)),Bn(e,"shadowOffsetY",Z(l.textShadowOffsetY,n.textShadowOffsetY,0)),Bn(e,"textAlign",s),Bn(e,"textBaseline","middle"),Bn(e,"font",i.font||Sn);var d=Vn(l.textStroke||n.textStroke,p),f=Gn(l.textFill||n.textFill),p=H(l.textStrokeWidth,n.textStrokeWidth);d&&(Bn(e,"lineWidth",p),Bn(e,"strokeStyle",d),e.strokeText(i.text,r,h)),f&&(Bn(e,"fillStyle",f),e.fillText(i.text,r,h))}function On(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function En(t,e,i,n,a,o,r){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=R(s);if(Bn(e,"shadowBlur",i.textBoxShadowBlur||0),Bn(e,"shadowColor",i.textBoxShadowColor||"transparent"),Bn(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),Bn(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){e.beginPath();var c=i.textBorderRadius;c?bn(e,{x:n,y:a,width:o,height:r,r:c}):e.rect(n,a,o,r),e.closePath()}if(h)if(Bn(e,"fillStyle",s),null!=i.fillOpacity){var d=e.globalAlpha;e.globalAlpha=i.fillOpacity*i.opacity,e.fill(),e.globalAlpha=d}else e.fill();else if(z(s)){var f=s.image;(f=Ji(f,null,t,Rn,s))&&tn(f)&&e.drawImage(f,n,a,o,r)}if(l&&u)if(Bn(e,"lineWidth",l),Bn(e,"strokeStyle",u),null!=i.strokeOpacity){d=e.globalAlpha;e.globalAlpha=i.strokeOpacity*i.opacity,e.stroke(),e.globalAlpha=d}else e.stroke()}function Rn(t,e){e.image=t}function zn(t,e,i,n){var a=i.x||0,o=i.y||0,r=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)a=n.x+Fn(l[0],n.width),o=n.y+Fn(l[1],n.height);else{var u=e&&e.calculateTextPosition?e.calculateTextPosition(Tn,i,n):dn(Tn,i,n);a=u.x,o=u.y,r=r||u.textAlign,s=s||u.textVerticalAlign}var h=i.textOffset;h&&(a+=h[0],o+=h[1])}return(t=t||{}).baseX=a,t.baseY=o,t.textAlign=r,t.textVerticalAlign=s,t}function Bn(t,e,i){return t[e]=Ei(t,e,i),t[e]}function Vn(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Gn(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function Fn(t,e){return"string"==typeof t?0<=t.lastIndexOf("%")?parseFloat(t)/100*e:parseFloat(t):t}function Wn(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function Hn(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function Zn(){}var Un=new bi;function Xn(t){for(var e in t=t||{},pi.call(this,t),t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new Vi(t.style,this),this._rect=null,this.__clipPaths=null}function Yn(t){Xn.call(this,t)}Xn.prototype={constructor:Xn,type:"displayable",__dirty:!0,invisible:!(Zn.prototype={constructor:Zn,drawRectText:function(t,e){var i=this.style;e=i.textRect||e,this.__dirty&&Cn(i);var n=i.text;if(null!=n&&(n+=""),Hn(n,i)){t.save();var a=this.transform;i.transformText?this.setTransform(t):a&&(Un.copy(e),Un.applyTransform(a),e=Un),kn(this,t,n,i,e,zi),t.restore()}}}),z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(t){},afterBrush:function(t){},brush:function(t,e){},getBoundingRect:function(){},contain:function(t,e){return this.rectContain(t,e)},traverse:function(t,e){t.call(e,this)},rectContain:function(t,e){var i=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(t){return this.animate("style",t)},attrKV:function(t,e){"style"!==t?pi.prototype.attrKV.call(this,t,e):this.style.set(e)},setStyle:function(t,e){return this.style.set(t,e),this.dirty(!1),this},useStyle:function(t){return this.style=new Vi(t,this),this.dirty(!1),this},calculateTextPosition:null},w(Xn,pi),b(Xn,Zn),Yn.prototype={constructor:Yn,type:"image",brush:function(t,e){var i=this.style,n=i.image;i.bind(t,this,e);var a=this._image=Ji(n,this._image,this,this.onload);if(a&&tn(a)){var o=i.x||0,r=i.y||0,s=i.width,l=i.height,u=a.width/a.height;if(null==s&&null!=l?s=l*u:null==l&&null!=s?l=s/u:null==s&&null==l&&(s=a.width,l=a.height),this.setTransform(t),i.sWidth&&i.sHeight){var h=i.sx||0,c=i.sy||0;t.drawImage(a,h,c,i.sWidth,i.sHeight,o,r,s,l)}else if(i.sx&&i.sy){var d=s-(h=i.sx),f=l-(c=i.sy);t.drawImage(a,h,c,d,f,o,r,s,l)}else t.drawImage(a,o,r,s,l);null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))}},getBoundingRect:function(){var t=this.style;return this._rect||(this._rect=new bi(t.x||0,t.y||0,t.width||0,t.height||0)),this._rect}},w(Yn,Xn);var jn=314159;function qn(t){return parseInt(t,10)}var Kn=new bi(0,0,0,0),$n=new bi(0,0,0,0);function Jn(t,e,i){this.type="canvas";var n=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=i=L({},i||{}),this.dpr=i.devicePixelRatio||li,this._singleCanvas=n;var a=(this.root=t).style;a&&(a["-webkit-tap-highlight-color"]="transparent",a["-webkit-user-select"]=a["user-select"]=a["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var o=this._zlevelList=[],r=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,n){var s=t.width,l=t.height;null!=i.width&&(s=i.width),null!=i.height&&(l=i.height),this.dpr=i.devicePixelRatio||1,t.width=s*this.dpr,t.height=l*this.dpr,this._width=s,this._height=l;var u=new ji(t,this,this.dpr);u.__builtin__=!0,u.initContext(),(r[jn]=u).zlevel=jn,o.push(jn),this._domRoot=t}else{this._width=this._getSize(0),this._height=this._getSize(1);var h=this._domRoot=function(t,e){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);t.appendChild(h)}this._hoverlayer=null,this._hoverElements=[]}Jn.prototype={constructor:Jn,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(t){var e=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,t,this._redrawId);for(var n=0;n<i.length;n++){var a=i[n],o=this._layers[a];if(!o.__builtin__&&o.refresh){var r=0===n?this._backgroundColor:null;o.refresh(r)}}return this.refreshHover(),this},addHover:function(t,e){if(!t.__hoverMir){var i=new t.constructor({style:t.style,shape:t.shape,z:t.z,z2:t.z2,silent:t.silent});return(i.__from=t).__hoverMir=i,e&&i.setStyle(e),this._hoverElements.push(i),i}},removeHover:function(t){var e=t.__hoverMir,i=this._hoverElements,n=_(i,e);0<=n&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i<e.length;i++){var n=e[i].__from;n&&(n.__hoverMir=null)}e.length=0},refreshHover:function(){var t=this._hoverElements,e=t.length,i=this._hoverlayer;if(i&&i.clear(),e){ki(t,this.storage.displayableSortFunc);var n={};(i=i||(this._hoverlayer=this.getLayer(1e5))).ctx.save();for(var a=0;a<e;){var o=t[a],r=o.__from;r&&r.__zr?(a++,r.invisible||(o.transform=r.transform,o.invTransform=r.invTransform,o.__clipPaths=r.__clipPaths,this._doPaintEl(o,i,!0,n))):(t.splice(a,1),r.__hoverMir=null,e--)}i.ctx.restore()}},getHoverLayer:function(){return this.getLayer(1e5)},_paintList:function(t,e,i){if(this._redrawId===i){e=e||!1,this._updateLayerStatus(t);var n=this._doPaintList(t,e);if(this._needsManuallyCompositing&&this._compositeManually(),!n){var a=this;qi(function(){a._paintList(t,e,i)})}}},_compositeManually:function(){var e=this.getLayer(jn).ctx,i=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,i,n),this.eachBuiltinLayer(function(t){t.virtual&&e.drawImage(t.dom,0,0,i,n)})},_doPaintList:function(t,e){for(var i=[],n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];(s=this._layers[a]).__builtin__&&s!==this._hoverlayer&&(s.__dirty||e)&&i.push(s)}for(var o=!0,r=0;r<i.length;r++){var s,l=(s=i[r]).ctx,u={};l.save();var h=e?s.__startIndex:s.__drawIndex,c=!e&&s.incremental&&Date.now,d=c&&Date.now(),f=s.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,f);else if(h===s.__startIndex){var p=t[h];p.incremental&&p.notClear&&!e||s.clear(!1,f)}-1===h&&(console.error("For some unknown reason. drawIndex is -1"),h=s.__startIndex);for(var g=h;g<s.__endIndex;g++){var m=t[g];if(this._doPaintEl(m,s,e,u),m.__dirty=m.__dirtyText=!1,c)if(15<Date.now()-d)break}s.__drawIndex=g,s.__drawIndex<s.__endIndex&&(o=!1),u.prevElClipPaths&&l.restore(),l.restore()}return v.wxa&&E(this._layers,function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()}),o},_doPaintEl:function(t,e,i,n){var a=e.ctx,o=t.transform;if((e.__dirty||i)&&!t.invisible&&0!==t.style.opacity&&(!o||o[0]||o[3])&&(!t.culling||!function(t,e,i){return Kn.copy(t.getBoundingRect()),t.transform&&Kn.applyTransform(t.transform),$n.width=e,$n.height=i,!Kn.intersect($n)}(t,this._width,this._height))){var r=t.__clipPaths,s=n.prevElClipPaths;s&&!function(t,e){if(t===e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!0;return!1}(r,s)||(s&&(a.restore(),n.prevElClipPaths=null,n.prevEl=null),r&&(a.save(),function(t,e){for(var i=0;i<t.length;i++){var n=t[i];n.setTransform(e),e.beginPath(),n.buildPath(e,n.shape),e.clip(),n.restoreTransform(e)}}(r,a),n.prevElClipPaths=r)),t.beforeBrush&&t.beforeBrush(a),t.brush(a,n.prevEl||null),(n.prevEl=t).afterBrush&&t.afterBrush(a)}},getLayer:function(t,e){this._singleCanvas&&!this._needsManuallyCompositing&&(t=jn);var i=this._layers[t];return i||((i=new ji("zr_"+t,this,this.dpr)).zlevel=t,i.__builtin__=!0,this._layerConfig[t]&&m(i,this._layerConfig[t],!0),e&&(i.virtual=e),this.insertLayer(t,i),i.initContext()),i},insertLayer:function(t,e){var i=this._layers,n=this._zlevelList,a=n.length,o=null,r=-1,s=this._domRoot;if(i[t])ci("ZLevel "+t+" has been used already");else if(function(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}(e)){if(0<a&&t>n[0]){for(r=0;r<a-1&&!(n[r]<t&&n[r+1]>t);r++);o=i[n[r]]}if(n.splice(r+1,0,t),!(i[t]=e).virtual)if(o){var l=o.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else ci("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,a=this._zlevelList;for(n=0;n<a.length;n++)i=a[n],t.call(e,this._layers[i],i)},eachBuiltinLayer:function(t,e){var i,n,a,o=this._zlevelList;for(a=0;a<o.length;a++)n=o[a],(i=this._layers[n]).__builtin__&&t.call(e,i,n)},eachOtherLayer:function(t,e){var i,n,a,o=this._zlevelList;for(a=0;a<o.length;a++)n=o[a],(i=this._layers[n]).__builtin__||t.call(e,i,n)},getLayers:function(){return this._layers},_updateLayerStatus:function(t){function e(t){n&&(n.__endIndex!==t&&(n.__dirty=!0),n.__endIndex=t)}if(this.eachBuiltinLayer(function(t,e){t.__dirty=t.__used=!1}),this._singleCanvas)for(var i=1;i<t.length;i++){if((o=t[i]).zlevel!==t[i-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var n=null,a=0;for(i=0;i<t.length;i++){var o,r,s=(o=t[i]).zlevel;o.incremental?((r=this.getLayer(s+.001,this._needsManuallyCompositing)).incremental=!0,a=1):r=this.getLayer(s+(0<a?.01:0),this._needsManuallyCompositing),r.__builtin__||ci("ZLevel "+s+" has been used by unkown layer "+r.id),r!==n&&(r.__used=!0,r.__startIndex!==i&&(r.__dirty=!0),r.__startIndex=i,r.incremental?r.__drawIndex=-1:r.__drawIndex=i,e(i),n=r),o.__dirty&&(r.__dirty=!0,r.incremental&&r.__drawIndex<0&&(r.__drawIndex=i))}e(i),this.eachBuiltinLayer(function(t,e){!t.__used&&0<t.getElementCount()&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?m(i[t],e,!0):i[t]=e;for(var n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];if(a===t||a===t+.01)m(this._layers[a],i[t],!0)}}},delLayer:function(t){var e=this._layers,i=this._zlevelList,n=e[t];n&&(n.dom.parentNode.removeChild(n.dom),delete e[t],i.splice(_(i,t),1))},resize:function(e,i){if(this._domRoot.style){var t=this._domRoot;t.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=i&&(n.height=i),e=this._getSize(0),i=this._getSize(1),t.style.display="",this._width!==e||i!==this._height){for(var a in t.style.width=e+"px",t.style.height=i+"px",this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,i);E(this._progressiveLayers,function(t){t.resize(e,i)}),this.refresh(!0)}this._width=e,this._height=i}else{if(null==e||null==i)return;this._width=e,this._height=i,this.getLayer(jn).resize(e,i)}return this},clearLayer:function(t){var e=this._layers[t];e&&e.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[jn].dom;var e=new ji("image",this,t.pixelRatio||this.dpr);if(e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor),t.pixelRatio<=this.dpr){this.refresh();var i=e.dom.width,n=e.dom.height,a=e.ctx;this.eachLayer(function(t){t.__builtin__?a.drawImage(t.dom,0,0,i,n):t.renderToCanvas&&(e.ctx.save(),t.renderToCanvas(e.ctx),e.ctx.restore())})}else for(var o={},r=this.storage.getDisplayList(!0),s=0;s<r.length;s++){var l=r[s];this._doPaintEl(l,e,!0,o)}return e.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],n=["clientWidth","clientHeight"][t],a=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var r=this.root,s=document.defaultView.getComputedStyle(r);return(r[n]||qn(s[i])||qn(r.style[i]))-(qn(s[a])||0)-(qn(s[o])||0)|0},pathToImage:function(t,e){e=e||this.dpr;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t.getBoundingRect(),o=t.style,r=o.shadowBlur*e,s=o.shadowOffsetX*e,l=o.shadowOffsetY*e,u=o.hasStroke()?o.lineWidth:0,h=Math.max(u/2,r-s),c=Math.max(u/2,s+r),d=Math.max(u/2,r-l),f=Math.max(u/2,l+r),p=a.width+h+c,g=a.height+d+f;i.width=p*e,i.height=g*e,n.scale(e,e),n.clearRect(0,0,p,g),n.dpr=e;var m={position:t.position,rotation:t.rotation,scale:t.scale};t.position=[h-a.x,d-a.y],t.rotation=0,t.scale=[1,1],t.updateTransform(),t&&t.brush(n);var v=new Yn({style:{x:0,y:0,image:i}});return null!=m.position&&(v.position=t.position=m.position),null!=m.rotation&&(v.rotation=t.rotation=m.rotation),null!=m.scale&&(v.scale=t.scale=m.scale),v}};function Qn(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,Ct.call(this)}Qn.prototype={constructor:Qn,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),i=0;i<e.length;i++)this.addClip(e[i])},removeClip:function(t){var e=_(this._clips,t);0<=e&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i<e.length;i++)this.removeClip(e[i]);t.animation=null},_update:function(){for(var t=(new Date).getTime()-this._pausedTime,e=t-this._time,i=this._clips,n=i.length,a=[],o=[],r=0;r<n;r++){var s=i[r],l=s.step(t,e);l&&(a.push(l),o.push(s))}for(r=0;r<n;)i[r]._needsRemove?(i[r]=i[n-1],i.pop(),n--):r++;n=a.length;for(r=0;r<n;r++)o[r].fire(a[r]);this._time=t,this.onframe(e),this.trigger("frame",e),this.stage.update&&this.stage.update()},_startLoop:function(){var e=this;this._running=!0,qi(function t(){e._running&&(qi(t),e._paused||e._update())})},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(t,e){var i=new ri(t,(e=e||{}).loop,e.getter,e.setter);return this.addAnimator(i),i}},b(Qn,Ct);var ta=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ea=["touchstart","touchend","touchmove"],ia={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},na=N(ta,function(t){var e=t.replace("mouse","pointer");return ia[e]?e:t});function aa(t){return"mousewheel"===t&&v.browser.firefox?"DOMMouseScroll":t}function oa(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}var ra={mousemove:function(t){t=Vt(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){var e=(t=Vt(this.dom,t)).toElement||t.relatedTarget;if(e!==this.dom)for(;e&&9!==e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){(t=Vt(this.dom,t)).zrByTouch=!0,this._lastTouchMoment=new Date,this.handler.processGesture(t,"start"),ra.mousemove.call(this,t),ra.mousedown.call(this,t),oa(this)},touchmove:function(t){(t=Vt(this.dom,t)).zrByTouch=!0,this.handler.processGesture(t,"change"),ra.mousemove.call(this,t),oa(this)},touchend:function(t){(t=Vt(this.dom,t)).zrByTouch=!0,this.handler.processGesture(t,"end"),ra.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&ra.click.call(this,t),oa(this)},pointerdown:function(t){ra.mousedown.call(this,t)},pointermove:function(t){sa(t)||ra.mousemove.call(this,t)},pointerup:function(t){ra.mouseup.call(this,t)},pointerout:function(t){sa(t)||ra.mouseout.call(this,t)}};function sa(t){var e=t.pointerType;return"pen"===e||"touch"===e}function la(i){function t(t,e){E(t,function(t){Gt(i,aa(t),e._handlers[t])},e)}Ct.call(this),this.dom=i,this._touching=!1,this._touchTimer,this._handlers={},function(e){E(ea,function(t){e._handlers[t]=T(ra[t],e)}),E(na,function(t){e._handlers[t]=T(ra[t],e)}),E(ta,function(t){e._handlers[t]=function(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}(ra[t],e)})}(this),v.pointerEventsSupported?t(na,this):(v.touchEventsSupported&&t(ea,this),t(ta,this))}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){ra[e]=function(t){t=Vt(this.dom,t),this.trigger(e,t)}});var ua=la.prototype;ua.dispose=function(){for(var t,e,i,n=ta.concat(ea),a=0;a<n.length;a++){var o=n[a];t=this.dom,e=aa(o),i=this._handlers[o],Nt?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}},ua.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},b(la,Ct);var ha=!v.canvasSupported,ca={canvas:Jn},da={};function fa(t,e){var i=new ga(n(),t,e);return da[i.id]=i}function pa(t,e){ca[t]=e}var ga=function(t,e,i){i=i||{},this.dom=e,this.id=t;var n=this,a=new Ni,o=i.renderer;if(ha){if(!ca.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");o="vml"}else o&&ca[o]||(o="canvas");var r=new ca[o](e,a,i,t);this.storage=a,this.painter=r;var s=v.node||v.worker?null:new la(r.getViewportRoot());this.handler=new qt(a,r,s,r.root),this.animation=new Qn({stage:{update:T(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=a.delFromStorage,u=a.addToStorage;a.delFromStorage=function(t){l.call(a,t),t&&t.removeSelfFromZr(n)},a.addToStorage=function(t){u.call(a,t),t.addSelfToZr(n)}};ga.prototype={constructor:ga,getId:function(){return this.id},add:function(t){this.storage.addRoot(t),this._needsRefresh=!0},remove:function(t){this.storage.delRoot(t),this._needsRefresh=!0},configLayer:function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this._needsRefresh=!0},setBackgroundColor:function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var t;this._needsRefresh&&(t=!0,this.refreshImmediately()),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately()),t&&this.trigger("rendered")},addHover:function(t,e){if(this.painter.addHover){var i=this.painter.addHover(t,e);return this.refreshHover(),i}},removeHover:function(t){this.painter.removeHover&&(this.painter.removeHover(t),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(t,e){return this.painter.pathToImage(t,e)},setCursorStyle:function(t){this.handler.setCursorStyle(t)},findHover:function(t,e){return this.handler.findHover(t,e)},on:function(t,e,i){this.handler.on(t,e,i)},off:function(t,e){this.handler.off(t,e)},trigger:function(t,e){this.handler.trigger(t,e)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,function(t){delete da[t]}(this.id)}};var ma=(Object.freeze||Object)({version:"4.1.2",init:fa,dispose:function(t){if(t)t.dispose();else{for(var e in da)da.hasOwnProperty(e)&&da[e].dispose();da={}}return this},getInstance:function(t){return da[t]},registerPainter:pa}),va=E,ya=z,xa=k,_a="series\0";function wa(t){return t instanceof Array?t:null==t?[]:[t]}function ba(t,e,i){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,a=i.length;n<a;n++){var o=i[n];!t.emphasis[e].hasOwnProperty(o)&&t[e].hasOwnProperty(o)&&(t.emphasis[e][o]=t[e][o])}}}var Sa=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Ma(t){return!ya(t)||xa(t)||t instanceof Date?t:t.value}function Ia(t,a){a=(a||[]).slice();var o=N(t||[],function(t,e){return{exist:t}});return va(a,function(t,e){if(ya(t)){for(var i=0;i<o.length;i++)if(!o[i].option&&null!=t.id&&o[i].exist.id===t.id+"")return o[i].option=t,void(a[e]=null);for(i=0;i<o.length;i++){var n=o[i].exist;if(!(o[i].option||null!=n.id&&null!=t.id||null==t.name||Da(t)||Da(n)||n.name!==t.name+""))return o[i].option=t,void(a[e]=null)}}}),va(a,function(t,e){if(ya(t)){for(var i=0;i<o.length;i++){var n=o[i].exist;if(!o[i].option&&!Da(n)&&null==t.id){o[i].option=t;break}}i>=o.length&&o.push({option:t})}}),o}function Aa(t){var r=Q();va(t,function(t,e){var i=t.exist;i&&r.set(i.id,t)}),va(t,function(t,e){var i=t.option;Y(!i||null==i.id||!r.get(i.id)||r.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&null!=i.id&&r.set(i.id,t),t.keyInfo||(t.keyInfo={})}),va(t,function(t,e){var i=t.exist,n=t.option,a=t.keyInfo;if(ya(n)){if(a.name=null!=n.name?n.name+"":i?i.name:_a+e,i)a.id=i.id;else if(null!=n.id)a.id=n.id+"";else for(var o=0;a.id="\0"+a.name+"\0"+o++,r.get(a.id););r.set(a.id,t)}})}function Ta(t){var e=t.name;return!(!e||!e.indexOf(_a))}function Da(t){return ya(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Ca(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?k(t.dataIndex)?N(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?k(t.name)?N(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function La(){var e="__\0ec_inner_"+ka+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}}var ka=0;function Pa(s,l,u){if(R(l)){var t={};t[l+"Index"]=0,l=t}var e=u&&u.defaultMainType;!e||Na(l,e+"Index")||Na(l,e+"Id")||Na(l,e+"Name")||(l[e+"Index"]=0);var h={};return va(l,function(t,e){t=l[e];if("dataIndex"!==e&&"dataIndexInside"!==e){var i=e.match(/^(\w+)(Index|Id|Name)$/)||[],n=i[1],a=(i[2]||"").toLowerCase();if(!(!n||!a||null==t||"index"===a&&"none"===t||u&&u.includeMainTypes&&_(u.includeMainTypes,n)<0)){var o={mainType:n};"index"===a&&"all"===t||(o[a]=t);var r=s.queryComponents(o);h[n+"Models"]=r,h[n+"Model"]=r[0]}}else h[e]=t}),h}function Na(t,e){return t&&t.hasOwnProperty(e)}function Oa(t,e,i){t.setAttribute?t.setAttribute(e,i):t[e]=i}function Ea(t){return"auto"===t?v.domSupported?"html":"richText":t||"html"}function Ra(t,i){var n=Q(),a=[];return E(t,function(t){var e=i(t);(n.get(e)||(a.push(e),n.set(e,[]))).push(t)}),{keys:a,buckets:n}}var za=".",Ba="___EC__COMPONENT__CONTAINER___";function Va(t){var e={main:"",sub:""};return t&&(t=t.split(za),e.main=t[0]||"",e.sub=t[1]||""),e}function Ga(t){(t.$constructor=t).extend=function(t){function e(){t.$constructor?t.$constructor.apply(this,arguments):i.apply(this,arguments)}var i=this;return L(e.prototype,t),e.extend=this.extend,e.superCall=Ha,e.superApply=Za,w(e,this),e.superClass=i,e}}var Fa=0;function Wa(t){var e=["__\0is_clz",Fa++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function Ha(t,e){var i=U(arguments,2);return this.superClass.prototype[e].apply(t,i)}function Za(t,e,i){return this.superClass.prototype[e].apply(t,i)}function Ua(i,t){t=t||{};var a={};if(i.registerClass=function(t,e){if(e)if(function(t){Y(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}(e),(e=Va(e)).sub){if(e.sub!==Ba){(function(t){var e=a[t.main];e&&e[Ba]||((e=a[t.main]={})[Ba]=!0);return e})(e)[e.sub]=t}}else a[e.main]=t;return t},i.getClass=function(t,e,i){var n=a[t];if(n&&n[Ba]&&(n=e?n[e]:null),i&&!n)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return n},i.getClassesByMainType=function(t){t=Va(t);var i=[],e=a[t.main];return e&&e[Ba]?E(e,function(t,e){e!==Ba&&i.push(t)}):i.push(e),i},i.hasClass=function(t){return t=Va(t),!!a[t.main]},i.getAllClassMainTypes=function(){var i=[];return E(a,function(t,e){i.push(e)}),i},i.hasSubTypes=function(t){t=Va(t);var e=a[t.main];return e&&e[Ba]},i.parseClassType=Va,t.registerWhenExtend){var n=i.extend;n&&(i.extend=function(t){var e=n.call(this,t);return i.registerClass(e,t.type)})}return i}function Xa(s){for(var t=0;t<s.length;t++)s[t][1]||(s[t][1]=s[t][0]);return function(t,e,i){for(var n={},a=0;a<s.length;a++){var o=s[a][1];if(!(e&&0<=_(e,o)||i&&_(i,o)<0)){var r=t.getShallow(o);null!=r&&(n[s[a][0]]=r)}}return n}}var Ya=Xa([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),ja={getLineStyle:function(t){var e=Ya(this,t);return e.lineDash=this.getLineDash(e.lineWidth),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),i=Math.max(t,2),n=4*t;return"solid"!==e&&null!=e&&("dashed"===e?[n,n]:[i,i])}},qa=Xa([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Ka={getAreaStyle:function(t,e){return qa(this,t,e)}},$a=Math.pow,Ja=Math.sqrt,Qa=1e-8,to=1e-4,eo=Ja(3),io=1/3,no=at(),ao=at(),oo=at();function ro(t){return-Qa<t&&t<Qa}function so(t){return Qa<t||t<-Qa}function lo(t,e,i,n,a){var o=1-a;return o*o*(o*t+3*a*e)+a*a*(a*n+3*o*i)}function uo(t,e,i,n,a){var o=1-a;return 3*(((e-t)*o+2*(i-e)*a)*o+(n-i)*a*a)}function ho(t,e,i,n,a){var o=6*i-12*e+6*t,r=9*e+3*n-3*t-9*i,s=3*e-3*t,l=0;if(ro(r)){if(so(o))0<=(h=-s/o)&&h<=1&&(a[l++]=h)}else{var u=o*o-4*r*s;if(ro(u))a[0]=-o/(2*r);else if(0<u){var h,c=Ja(u),d=(-o-c)/(2*r);0<=(h=(-o+c)/(2*r))&&h<=1&&(a[l++]=h),0<=d&&d<=1&&(a[l++]=d)}}return l}function co(t,e,i,n,a,o){var r=(e-t)*a+t,s=(i-e)*a+e,l=(n-i)*a+i,u=(s-r)*a+r,h=(l-s)*a+s,c=(h-u)*a+u;o[0]=t,o[1]=r,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=n}function fo(t,e,i,n){var a=1-n;return a*(a*t+2*n*e)+n*n*i}function po(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}function go(t,e,i){var n=t+i-2*e;return 0==n?.5:(t-e)/n}function mo(t,e,i,n,a){var o=(e-t)*n+t,r=(i-e)*n+e,s=(r-o)*n+o;a[0]=t,a[1]=o,a[2]=s,a[3]=s,a[4]=r,a[5]=i}var vo=Math.min,yo=Math.max,xo=Math.sin,_o=Math.cos,wo=2*Math.PI,bo=at(),So=at(),Mo=at();function Io(t,e,i){if(0!==t.length){var n,a=t[0],o=a[0],r=a[0],s=a[1],l=a[1];for(n=1;n<t.length;n++)a=t[n],o=vo(o,a[0]),r=yo(r,a[0]),s=vo(s,a[1]),l=yo(l,a[1]);e[0]=o,e[1]=s,i[0]=r,i[1]=l}}function Ao(t,e,i,n,a,o){a[0]=vo(t,i),a[1]=vo(e,n),o[0]=yo(t,i),o[1]=yo(e,n)}var To=[],Do=[];function Co(t,e,i,n,a,o,r,s,l,u){var h,c=ho,d=lo,f=c(t,i,a,r,To);for(l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0,h=0;h<f;h++){var p=d(t,i,a,r,To[h]);l[0]=vo(p,l[0]),u[0]=yo(p,u[0])}for(f=c(e,n,o,s,Do),h=0;h<f;h++){var g=d(e,n,o,s,Do[h]);l[1]=vo(g,l[1]),u[1]=yo(g,u[1])}l[0]=vo(t,l[0]),u[0]=yo(t,u[0]),l[0]=vo(r,l[0]),u[0]=yo(r,u[0]),l[1]=vo(e,l[1]),u[1]=yo(e,u[1]),l[1]=vo(s,l[1]),u[1]=yo(s,u[1])}function Lo(t,e,i,n,a,o,r,s,l){var u=St,h=Mt,c=Math.abs(a-o);if(c%wo<1e-4&&1e-4<c)return s[0]=t-i,s[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(bo[0]=_o(a)*i+t,bo[1]=xo(a)*n+e,So[0]=_o(o)*i+t,So[1]=xo(o)*n+e,u(s,bo,So),h(l,bo,So),(a%=wo)<0&&(a+=wo),(o%=wo)<0&&(o+=wo),o<a&&!r?o+=wo:a<o&&r&&(a+=wo),r){var d=o;o=a,a=d}for(var f=0;f<o;f+=Math.PI/2)a<f&&(Mo[0]=_o(f)*i+t,Mo[1]=xo(f)*n+e,u(s,Mo,s),h(l,Mo,l))}var ko={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Po=[],No=[],Oo=[],Eo=[],Ro=Math.min,zo=Math.max,Bo=Math.cos,Vo=Math.sin,Go=Math.sqrt,Fo=Math.abs,Wo="undefined"!=typeof Float32Array,Ho=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};function Zo(t,e,i,n,a,o,r){if(0===a)return!1;var s=a,l=0;if(e+s<r&&n+s<r||r<e-s&&r<n-s||t+s<o&&i+s<o||o<t-s&&o<i-s)return!1;if(t===i)return Math.abs(o-t)<=s/2;var u=(l=(e-n)/(t-i))*o-r+(t*n-i*e)/(t-i);return u*u/(l*l+1)<=s/2*s/2}function Uo(t,e,i,n,a,o,r,s,l,u,h){if(0===l)return!1;var c=l;return!(e+c<h&&n+c<h&&o+c<h&&s+c<h||h<e-c&&h<n-c&&h<o-c&&h<s-c||t+c<u&&i+c<u&&a+c<u&&r+c<u||u<t-c&&u<i-c&&u<a-c&&u<r-c)&&function(t,e,i,n,a,o,r,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;no[0]=l,no[1]=u;for(var y=0;y<1;y+=.05)ao[0]=lo(t,i,a,r,y),ao[1]=lo(e,n,o,s,y),(p=_t(no,ao))<v&&(c=y,v=p);v=1/0;for(var x=0;x<32&&!(m<to);x++)d=c-m,f=c+m,ao[0]=lo(t,i,a,r,d),ao[1]=lo(e,n,o,s,d),p=_t(ao,no),0<=d&&p<v?(c=d,v=p):(oo[0]=lo(t,i,a,r,f),oo[1]=lo(e,n,o,s,f),g=_t(oo,no),f<=1&&g<v?(c=f,v=g):m*=.5);return h&&(h[0]=lo(t,i,a,r,c),h[1]=lo(e,n,o,s,c)),Ja(v)}(t,e,i,n,a,o,r,s,u,h,null)<=c/2}function Xo(t,e,i,n,a,o,r,s,l){if(0===r)return!1;var u=r;return!(e+u<l&&n+u<l&&o+u<l||l<e-u&&l<n-u&&l<o-u||t+u<s&&i+u<s&&a+u<s||s<t-u&&s<i-u&&s<a-u)&&function(t,e,i,n,a,o,r,s,l){var u,h=.005,c=1/0;no[0]=r,no[1]=s;for(var d=0;d<1;d+=.05){ao[0]=fo(t,i,a,d),ao[1]=fo(e,n,o,d),(m=_t(no,ao))<c&&(u=d,c=m)}c=1/0;for(var f=0;f<32&&!(h<to);f++){var p=u-h,g=u+h;ao[0]=fo(t,i,a,p),ao[1]=fo(e,n,o,p);var m=_t(ao,no);if(0<=p&&m<c)u=p,c=m;else{oo[0]=fo(t,i,a,g),oo[1]=fo(e,n,o,g);var v=_t(oo,no);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=fo(t,i,a,u),l[1]=fo(e,n,o,u)),Ja(c)}(t,e,i,n,a,o,s,l,null)<=u/2}Ho.prototype={constructor:Ho,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e,i){i=i||0,this._ux=Fo(i/li/t)||0,this._uy=Fo(i/li/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return(this._ctx=t)&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(ko.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=Fo(t-this._xi)>this._ux||Fo(e-this._yi)>this._uy||this._len<5;return this.addData(ko.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},bezierCurveTo:function(t,e,i,n,a,o){return this.addData(ko.C,t,e,i,n,a,o),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,a,o):this._ctx.bezierCurveTo(t,e,i,n,a,o)),this._xi=a,this._yi=o,this},quadraticCurveTo:function(t,e,i,n){return this.addData(ko.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,a,o){return this.addData(ko.A,t,e,i,i,n,a-n,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=Bo(a)*i+t,this._yi=Vo(a)*i+e,this},arcTo:function(t,e,i,n,a){return this._ctx&&this._ctx.arcTo(t,e,i,n,a),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(ko.R,t,e,i,n),this},closePath:function(){this.addData(ko.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,i=0;i<t.length;i++)e+=t[i];this._dashSum=e}return this},setLineDashOffset:function(t){return this._dashOffset=t,this},len:function(){return this._len},setData:function(t){var e=t.length;this.data&&this.data.length===e||!Wo||(this.data=new Float32Array(e));for(var i=0;i<e;i++)this.data[i]=t[i];this._len=e},appendPath:function(t){t instanceof Array||(t=[t]);for(var e=t.length,i=0,n=this._len,a=0;a<e;a++)i+=t[a].len();Wo&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(a=0;a<e;a++)for(var o=t[a].data,r=0;r<o.length;r++)this.data[n++]=o[r];this._len=n},addData:function(t){if(this._saveData){var e=this.data;this._len+arguments.length>e.length&&(this._expandData(),e=this.data);for(var i=0;i<arguments.length;i++)e[this._len++]=arguments[i];this._prevCmd=t}},_expandData:function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(t,e){var i,n,a=this._dashSum,o=this._dashOffset,r=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,h=t-l,c=e-u,d=Go(h*h+c*c),f=l,p=u,g=r.length;for(o<0&&(o=a+o),f-=(o%=a)*(h/=d),p-=o*(c/=d);0<h&&f<=t||h<0&&t<=f||0===h&&(0<c&&p<=e||c<0&&e<=p);)f+=h*(i=r[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,0<h&&f<l||h<0&&l<f||0<c&&p<u||c<0&&u<p||s[n%2?"moveTo":"lineTo"](0<=h?Ro(f,t):zo(f,t),0<=c?Ro(p,e):zo(p,e));h=f-t,c=p-e,this._dashOffset=-Go(h*h+c*c)},_dashedBezierTo:function(t,e,i,n,a,o){var r,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=lo,y=0,x=this._dashIdx,_=f.length,w=0;for(d<0&&(d=c+d),d%=c,r=0;r<1;r+=.1)s=v(g,t,i,a,r+.1)-v(g,t,i,a,r),l=v(m,e,n,o,r+.1)-v(m,e,n,o,r),y+=Go(s*s+l*l);for(;x<_&&!(d<(w+=f[x]));x++);for(r=(w-d)/y;r<=1;)u=v(g,t,i,a,r),h=v(m,e,n,o,r),x%2?p.moveTo(u,h):p.lineTo(u,h),r+=f[x]/y,x=(x+1)%_;x%2!=0&&p.lineTo(a,o),s=a-u,l=o-h,this._dashOffset=-Go(s*s+l*l)},_dashedQuadraticTo:function(t,e,i,n){var a=i,o=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,a,o)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,Wo&&(this.data=new Float32Array(t)))},getBoundingRect:function(){Po[0]=Po[1]=Oo[0]=Oo[1]=Number.MAX_VALUE,No[0]=No[1]=Eo[0]=Eo[1]=-Number.MAX_VALUE;for(var t,e,i,n,a,o,r,s,l,u,h,c,d,f,p=this.data,g=0,m=0,v=0,y=0,x=0;x<p.length;){var _=p[x++];switch(1===x&&(v=g=p[x],y=m=p[x+1]),_){case ko.M:g=v=p[x++],m=y=p[x++],Oo[0]=v,Oo[1]=y,Eo[0]=v,Eo[1]=y;break;case ko.L:Ao(g,m,p[x],p[x+1],Oo,Eo),g=p[x++],m=p[x++];break;case ko.C:Co(g,m,p[x++],p[x++],p[x++],p[x++],p[x],p[x+1],Oo,Eo),g=p[x++],m=p[x++];break;case ko.Q:t=g,e=m,i=p[x++],n=p[x++],a=p[x],o=p[x+1],r=Oo,s=Eo,u=l=void 0,u=fo,h=yo(vo((l=go)(t,i,a),1),0),c=yo(vo(l(e,n,o),1),0),d=u(t,i,a,h),f=u(e,n,o,c),r[0]=vo(t,a,d),r[1]=vo(e,o,f),s[0]=yo(t,a,d),s[1]=yo(e,o,f),g=p[x++],m=p[x++];break;case ko.A:var w=p[x++],b=p[x++],S=p[x++],M=p[x++],I=p[x++],A=p[x++]+I;x+=1;var T=1-p[x++];1===x&&(v=Bo(I)*S+w,y=Vo(I)*M+b),Lo(w,b,S,M,I,A,T,Oo,Eo),g=Bo(A)*S+w,m=Vo(A)*M+b;break;case ko.R:Ao(v=g=p[x++],y=m=p[x++],v+p[x++],y+p[x++],Oo,Eo);break;case ko.Z:g=v,m=y}St(Po,Po,Oo),Mt(No,No,Eo)}return 0===x&&(Po[0]=Po[1]=No[0]=No[1]=0),new bi(Po[0],Po[1],No[0]-Po[0],No[1]-Po[1])},rebuildPath:function(t){for(var e,i,n,a,o,r,s=this.data,l=this._ux,u=this._uy,h=this._len,c=0;c<h;){var d=s[c++];switch(1===c&&(e=n=s[c],i=a=s[c+1]),d){case ko.M:e=n=s[c++],i=a=s[c++],t.moveTo(n,a);break;case ko.L:o=s[c++],r=s[c++],(Fo(o-n)>l||Fo(r-a)>u||c===h-1)&&(t.lineTo(o,r),n=o,a=r);break;case ko.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case ko.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case ko.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],w=m<g?g:m,b=m<g?1:g/m,S=m<g?m/g:1,M=v+y;.001<Math.abs(g-m)?(t.translate(f,p),t.rotate(x),t.scale(b,S),t.arc(0,0,w,v,M,1-_),t.scale(1/b,1/S),t.rotate(-x),t.translate(-f,-p)):t.arc(f,p,w,v,M,1-_),1===c&&(e=Bo(v)*g+f,i=Vo(v)*m+p),n=Bo(M)*g+f,a=Vo(M)*m+p;break;case ko.R:e=n=s[c],i=a=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case ko.Z:t.closePath(),n=e,a=i}}}},Ho.CMD=ko;var Yo=2*Math.PI;function jo(t){return(t%=Yo)<0&&(t+=Yo),t}var qo=2*Math.PI;function Ko(t,e,i,n,a,o,r,s,l){if(0===r)return!1;var u=r;s-=t,l-=e;var h=Math.sqrt(s*s+l*l);if(i<h-u||h+u<i)return!1;if(Math.abs(n-a)%qo<1e-4)return!0;if(o){var c=n;n=jo(a),a=jo(c)}else n=jo(n),a=jo(a);a<n&&(a+=qo);var d=Math.atan2(l,s);return d<0&&(d+=qo),n<=d&&d<=a||n<=d+qo&&d+qo<=a}function $o(t,e,i,n,a,o){if(e<o&&n<o||o<e&&o<n)return 0;if(n===e)return 0;var r=n<e?1:-1,s=(o-e)/(n-e);1!=s&&0!=s||(r=n<e?.5:-.5);var l=s*(i-t)+t;return l===a?1/0:a<l?r:0}var Jo=Ho.CMD,Qo=2*Math.PI,tr=1e-4;var er=[-1,-1,-1],ir=[-1,-1];function nr(t,e,i,n,a,o,r,s,l,u){if(e<u&&n<u&&o<u&&s<u||u<e&&u<n&&u<o&&u<s)return 0;var h,c=function(t,e,i,n,a,o){var r=n+3*(e-i)-t,s=3*(i-2*e+t),l=3*(e-t),u=t-a,h=s*s-3*r*l,c=s*l-9*r*u,d=l*l-3*s*u,f=0;if(ro(h)&&ro(c)){if(ro(s))o[0]=0;else 0<=(M=-l/s)&&M<=1&&(o[f++]=M)}else{var p=c*c-4*h*d;if(ro(p)){var g=c/h,m=-g/2;0<=(M=-s/r+g)&&M<=1&&(o[f++]=M),0<=m&&m<=1&&(o[f++]=m)}else if(0<p){var v=Ja(p),y=h*s+1.5*r*(-c+v),x=h*s+1.5*r*(-c-v);0<=(M=(-s-((y=y<0?-$a(-y,io):$a(y,io))+(x=x<0?-$a(-x,io):$a(x,io))))/(3*r))&&M<=1&&(o[f++]=M)}else{var _=(2*h*s-3*r*c)/(2*Ja(h*h*h)),w=Math.acos(_)/3,b=Ja(h),S=Math.cos(w),M=(-s-2*b*S)/(3*r),I=(m=(-s+b*(S+eo*Math.sin(w)))/(3*r),(-s+b*(S-eo*Math.sin(w)))/(3*r));0<=M&&M<=1&&(o[f++]=M),0<=m&&m<=1&&(o[f++]=m),0<=I&&I<=1&&(o[f++]=I)}}return f}(e,n,o,s,u,er);if(0===c)return 0;for(var d,f,p=0,g=-1,m=0;m<c;m++){var v=er[m],y=0===v||1===v?.5:1;lo(t,i,a,r,v)<l||(g<0&&(g=ho(e,n,o,s,ir),ir[1]<ir[0]&&1<g&&(void 0,h=ir[0],ir[0]=ir[1],ir[1]=h),d=lo(e,n,o,s,ir[0]),1<g&&(f=lo(e,n,o,s,ir[1]))),2===g?v<ir[0]?p+=d<e?y:-y:v<ir[1]?p+=f<d?y:-y:p+=s<f?y:-y:v<ir[0]?p+=d<e?y:-y:p+=s<d?y:-y)}return p}function ar(t,e,i,n,a,o,r,s){if(e<s&&n<s&&o<s||s<e&&s<n&&s<o)return 0;var l=function(t,e,i,n,a){var o=t-2*e+i,r=2*(e-t),s=t-n,l=0;if(ro(o)){if(so(r))0<=(h=-s/r)&&h<=1&&(a[l++]=h)}else{var u=r*r-4*o*s;if(ro(u))0<=(h=-r/(2*o))&&h<=1&&(a[l++]=h);else if(0<u){var h,c=Ja(u),d=(-r-c)/(2*o);0<=(h=(-r+c)/(2*o))&&h<=1&&(a[l++]=h),0<=d&&d<=1&&(a[l++]=d)}}return l}(e,n,o,s,er);if(0===l)return 0;var u=go(e,n,o);if(0<=u&&u<=1){for(var h=0,c=fo(e,n,o,u),d=0;d<l;d++){var f=0===er[d]||1===er[d]?.5:1;fo(t,i,a,er[d])<r||(er[d]<u?h+=c<e?f:-f:h+=o<c?f:-f)}return h}f=0===er[0]||1===er[0]?.5:1;return fo(t,i,a,er[0])<r?0:o<e?f:-f}function or(t,e,i,n,a,o,r,s){if(i<(s-=e)||s<-i)return 0;var l=Math.sqrt(i*i-s*s);er[0]=-l,er[1]=l;var u=Math.abs(n-a);if(u<1e-4)return 0;if(u%Qo<1e-4){a=Qo;var h=o?1:-1;return r>=er[n=0]+t&&r<=er[1]+t?h:0}if(o){l=n;n=jo(a),a=jo(l)}else n=jo(n),a=jo(a);a<n&&(a+=Qo);for(var c=0,d=0;d<2;d++){var f=er[d];if(r<f+t){var p=Math.atan2(s,f);h=o?1:-1;p<0&&(p=Qo+p),(n<=p&&p<=a||n<=p+Qo&&p+Qo<=a)&&(p>Math.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function rr(t,e,i,n,a){for(var o=0,r=0,s=0,l=0,u=0,h=0;h<t.length;){var c=t[h++];switch(c===Jo.M&&1<h&&(i||(o+=$o(r,s,l,u,n,a))),1===h&&(l=r=t[h],u=s=t[h+1]),c){case Jo.M:r=l=t[h++],s=u=t[h++];break;case Jo.L:if(i){if(Zo(r,s,t[h],t[h+1],e,n,a))return!0}else o+=$o(r,s,t[h],t[h+1],n,a)||0;r=t[h++],s=t[h++];break;case Jo.C:if(i){if(Uo(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],e,n,a))return!0}else o+=nr(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],n,a)||0;r=t[h++],s=t[h++];break;case Jo.Q:if(i){if(Xo(r,s,t[h++],t[h++],t[h],t[h+1],e,n,a))return!0}else o+=ar(r,s,t[h++],t[h++],t[h],t[h+1],n,a)||0;r=t[h++],s=t[h++];break;case Jo.A:var d=t[h++],f=t[h++],p=t[h++],g=t[h++],m=t[h++],v=t[h++];h+=1;var y=1-t[h++],x=Math.cos(m)*p+d,_=Math.sin(m)*g+f;1<h?o+=$o(r,s,x,_,n,a):(l=x,u=_);var w=(n-d)*g/p+d;if(i){if(Ko(d,f,g,m,m+v,y,e,w,a))return!0}else o+=or(d,f,g,m,m+v,y,w,a);r=Math.cos(m+v)*p+d,s=Math.sin(m+v)*g+f;break;case Jo.R:l=r=t[h++],u=s=t[h++];x=l+t[h++],_=u+t[h++];if(i){if(Zo(l,u,x,u,e,n,a)||Zo(x,u,x,_,e,n,a)||Zo(x,_,l,_,e,n,a)||Zo(l,_,l,u,e,n,a))return!0}else o+=$o(x,u,x,_,n,a),o+=$o(l,_,l,u,n,a);break;case Jo.Z:if(i){if(Zo(r,s,l,u,e,n,a))return!0}else o+=$o(r,s,l,u,n,a);r=l,s=u}}return i||function(t,e){return Math.abs(t-e)<tr}(s,u)||(o+=$o(r,s,l,u,n,a)||0),0!==o}var sr=Ui.prototype.getCanvasPattern,lr=Math.abs,ur=new Ho(!0);function hr(t){Xn.call(this,t),this.path=null}hr.prototype={constructor:hr,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(t,e){var i,n=this.style,a=this.path||ur,o=n.hasStroke(),r=n.hasFill(),s=n.fill,l=n.stroke,u=r&&!!s.colorStops,h=o&&!!l.colorStops,c=r&&!!s.image,d=o&&!!l.image;n.bind(t,this,e),this.setTransform(t),this.__dirty&&(u&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(t,s,i)),h&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(t,l,i)));u?t.fillStyle=this._fillGradient:c&&(t.fillStyle=sr.call(s,t)),h?t.strokeStyle=this._strokeGradient:d&&(t.strokeStyle=sr.call(l,t));var f=n.lineDash,p=n.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();if(a.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||f&&!g&&o?(a.beginPath(t),f&&!g&&(a.setLineDash(f),a.setLineDashOffset(p)),this.buildPath(a,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),r)if(null!=n.fillOpacity){var v=t.globalAlpha;t.globalAlpha=n.fillOpacity*n.opacity,a.fill(t),t.globalAlpha=v}else a.fill(t);if(f&&g&&(t.setLineDash(f),t.lineDashOffset=p),o)if(null!=n.strokeOpacity){v=t.globalAlpha;t.globalAlpha=n.strokeOpacity*n.opacity,a.stroke(t),t.globalAlpha=v}else a.stroke(t);f&&g&&t.setLineDash([]),null!=n.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new Ho},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n=n||(this.path=new Ho),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var a=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){a.copy(t);var o=e.lineWidth,r=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(o=Math.max(o,this.strokeContainThreshold||4)),1e-10<r&&(a.width+=o/r,a.height+=o/r,a.x-=o/r/2,a.y-=o/r/2)}return a}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),a=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var o=this.path.data;if(a.hasStroke()){var r=a.lineWidth,s=a.strokeNoScale?this.getLineScale():1;if(1e-10<s&&(a.hasFill()||(r=Math.max(r,this.strokeContainThreshold)),function(t,e,i,n){return rr(t,e,!0,i,n)}(o,r/s,t,e)))return!0}if(a.hasFill())return function(t,e,i){return rr(t,0,!1,e,i)}(o,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):Xn.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(z(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&1e-10<lr(t[0]-1)&&1e-10<lr(t[3]-1)?Math.sqrt(lr(t[0]*t[3]-t[2]*t[1])):1}},hr.extend=function(a){function t(t){hr.call(this,t),a.style&&this.style.extendFrom(a.style,!1);var e=a.shape;if(e){this.shape=this.shape||{};var i=this.shape;for(var n in e)!i.hasOwnProperty(n)&&e.hasOwnProperty(n)&&(i[n]=e[n])}a.init&&a.init.call(this,t)}for(var e in w(t,hr),a)"style"!==e&&"shape"!==e&&(t.prototype[e]=a[e]);return t},w(hr,Xn);function cr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}var dr=Ho.CMD,fr=[[],[],[]],pr=Math.sqrt,gr=Math.atan2,mr=function(t,e){var i,n,a,o,r,s=t.data,l=dr.M,u=dr.C,h=dr.L,c=dr.R,d=dr.A,f=dr.Q;for(o=a=0;a<s.length;){switch(i=s[a++],o=a,n=0,i){case l:case h:n=1;break;case u:n=3;break;case f:n=2;break;case d:var p=e[4],g=e[5],m=pr(e[0]*e[0]+e[1]*e[1]),v=pr(e[2]*e[2]+e[3]*e[3]),y=gr(-e[1]/v,e[0]/m);s[a]*=m,s[a++]+=p,s[a]*=v,s[a++]+=g,s[a++]*=m,s[a++]*=v,s[a++]+=y,s[a++]+=y,o=a+=2;break;case c:x[0]=s[a++],x[1]=s[a++],bt(x,x,e),s[o++]=x[0],s[o++]=x[1],x[0]+=s[a++],x[1]+=s[a++],bt(x,x,e),s[o++]=x[0],s[o++]=x[1]}for(r=0;r<n;r++){var x;(x=fr[r])[0]=s[a++],x[1]=s[a++],bt(x,x,e),s[o++]=x[0],s[o++]=x[1]}}},vr=Math.sqrt,yr=Math.sin,xr=Math.cos,_r=Math.PI,wr=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(cr(t)*cr(e))},br=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(wr(t,e))};function Sr(t,e,i,n,a,o,r,s,l,u,h){var c=l*(_r/180),d=xr(c)*(t-i)/2+yr(c)*(e-n)/2,f=-1*yr(c)*(t-i)/2+xr(c)*(e-n)/2,p=d*d/(r*r)+f*f/(s*s);1<p&&(r*=vr(p),s*=vr(p));var g=(a===o?-1:1)*vr((r*r*(s*s)-r*r*(f*f)-s*s*(d*d))/(r*r*(f*f)+s*s*(d*d)))||0,m=g*r*f/s,v=g*-s*d/r,y=(t+i)/2+xr(c)*m-yr(c)*v,x=(e+n)/2+yr(c)*m+xr(c)*v,_=br([1,0],[(d-m)/r,(f-v)/s]),w=[(d-m)/r,(f-v)/s],b=[(-1*d-m)/r,(-1*f-v)/s],S=br(w,b);wr(w,b)<=-1&&(S=_r),1<=wr(w,b)&&(S=0),0===o&&0<S&&(S-=2*_r),1===o&&S<0&&(S+=2*_r),h.addData(u,y,x,r,s,_,S,c,o)}var Mr=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Ir=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Ar(t,e){var i=function(t){if(!t)return new Ho;for(var e,i=0,n=0,a=i,o=n,r=new Ho,s=Ho.CMD,l=t.match(Mr),u=0;u<l.length;u++){for(var h,c=l[u],d=c.charAt(0),f=c.match(Ir)||[],p=f.length,g=0;g<p;g++)f[g]=parseFloat(f[g]);for(var m=0;m<p;){var v,y,x,_,w,b,S,M=i,I=n;switch(d){case"l":i+=f[m++],n+=f[m++],h=s.L,r.addData(h,i,n);break;case"L":i=f[m++],n=f[m++],h=s.L,r.addData(h,i,n);break;case"m":i+=f[m++],n+=f[m++],h=s.M,r.addData(h,i,n),a=i,o=n,d="l";break;case"M":i=f[m++],n=f[m++],h=s.M,r.addData(h,i,n),a=i,o=n,d="L";break;case"h":i+=f[m++],h=s.L,r.addData(h,i,n);break;case"H":i=f[m++],h=s.L,r.addData(h,i,n);break;case"v":n+=f[m++],h=s.L,r.addData(h,i,n);break;case"V":n=f[m++],h=s.L,r.addData(h,i,n);break;case"C":h=s.C,r.addData(h,f[m++],f[m++],f[m++],f[m++],f[m++],f[m++]),i=f[m-2],n=f[m-1];break;case"c":h=s.C,r.addData(h,f[m++]+i,f[m++]+n,f[m++]+i,f[m++]+n,f[m++]+i,f[m++]+n),i+=f[m-2],n+=f[m-1];break;case"S":v=i,y=n;var A=r.len(),T=r.data;e===s.C&&(v+=i-T[A-4],y+=n-T[A-3]),h=s.C,M=f[m++],I=f[m++],i=f[m++],n=f[m++],r.addData(h,v,y,M,I,i,n);break;case"s":v=i,y=n;A=r.len(),T=r.data;e===s.C&&(v+=i-T[A-4],y+=n-T[A-3]),h=s.C,M=i+f[m++],I=n+f[m++],i+=f[m++],n+=f[m++],r.addData(h,v,y,M,I,i,n);break;case"Q":M=f[m++],I=f[m++],i=f[m++],n=f[m++],h=s.Q,r.addData(h,M,I,i,n);break;case"q":M=f[m++]+i,I=f[m++]+n,i+=f[m++],n+=f[m++],h=s.Q,r.addData(h,M,I,i,n);break;case"T":v=i,y=n;A=r.len(),T=r.data;e===s.Q&&(v+=i-T[A-4],y+=n-T[A-3]),i=f[m++],n=f[m++],h=s.Q,r.addData(h,v,y,i,n);break;case"t":v=i,y=n;A=r.len(),T=r.data;e===s.Q&&(v+=i-T[A-4],y+=n-T[A-3]),i+=f[m++],n+=f[m++],h=s.Q,r.addData(h,v,y,i,n);break;case"A":x=f[m++],_=f[m++],w=f[m++],b=f[m++],S=f[m++],Sr(M=i,I=n,i=f[m++],n=f[m++],b,S,x,_,w,h=s.A,r);break;case"a":x=f[m++],_=f[m++],w=f[m++],b=f[m++],S=f[m++],Sr(M=i,I=n,i+=f[m++],n+=f[m++],b,S,x,_,w,h=s.A,r)}}"z"!==d&&"Z"!==d||(h=s.Z,r.addData(h),i=a,n=o),e=h}return r.toStatic(),r}(t);return(e=e||{}).buildPath=function(t){if(t.setData){t.setData(i.data),(e=t.getContext())&&t.rebuildPath(e)}else{var e=t;i.rebuildPath(e)}},e.applyTransform=function(t){mr(i,t),this.dirty(!0)},e}function Tr(t,e){return new hr(Ar(t,e))}var Dr=function(t){Xn.call(this,t)};Dr.prototype={constructor:Dr,type:"text",brush:function(t,e){var i=this.style;this.__dirty&&Cn(i),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),Hn(n,i)?(this.setTransform(t),kn(this,t,n,i,null,e),this.restoreTransform(t)):t.__attrCachedBy=Ri.NONE},getBoundingRect:function(){var t=this.style;if(this.__dirty&&Cn(t),!this._rect){var e=t.text;null!=e?e+="":e="";var i=un(t.text+"",t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich);if(i.x+=t.x||0,i.y+=t.y||0,Vn(t.textStroke,t.textStrokeWidth)){var n=t.textStrokeWidth;i.x-=n/2,i.y-=n/2,i.width+=n,i.height+=n}this._rect=i}return this._rect}},w(Dr,Xn);function Cr(l){return v.browser.ie&&11<=v.browser.version?function(){var t,e=this.__clipPaths,i=this.style;if(e)for(var n=0;n<e.length;n++){var a=e[n],o=a&&a.shape,r=a&&a.type;if(o&&("sector"===r&&o.startAngle===o.endAngle||"rect"===r&&(!o.width||!o.height))){for(var s=0;s<kr.length;s++)kr[s][2]=i[kr[s][0]],i[kr[s][0]]=kr[s][1];t=!0;break}}if(l.apply(this,arguments),t)for(s=0;s<kr.length;s++)i[kr[s][0]]=kr[s][2]}:l}var Lr=hr.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(t,e,i){i&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI,!0)}}),kr=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]],Pr=hr.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:Cr(hr.prototype.brush),buildPath:function(t,e){var i=e.cx,n=e.cy,a=Math.max(e.r0||0,0),o=Math.max(e.r,0),r=e.startAngle,s=e.endAngle,l=e.clockwise,u=Math.cos(r),h=Math.sin(r);t.moveTo(u*a+i,h*a+n),t.lineTo(u*o+i,h*o+n),t.arc(i,n,o,r,s,!l),t.lineTo(Math.cos(s)*a+i,Math.sin(s)*a+n),0!==a&&t.arc(i,n,a,s,r,l),t.closePath()}}),Nr=hr.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(t,e){var i=e.cx,n=e.cy,a=2*Math.PI;t.moveTo(i+e.r,n),t.arc(i,n,e.r,0,a,!1),t.moveTo(i+e.r0,n),t.arc(i,n,e.r0,0,a,!0)}});function Or(t,e,i,n,a,o,r){var s=.5*(i-t),l=.5*(n-e);return(2*(e-i)+s+l)*r+(-3*(e-i)-2*s-l)*o+s*a+e}function Er(t,e,i){var n=e.points,a=e.smooth;if(n&&2<=n.length){if(a&&"spline"!==a){var o=function(t,e,i,n){var a,o,r,s,l=[],u=[],h=[],c=[];if(n){r=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;d<f;d++)St(r,r,t[d]),Mt(s,s,t[d]);St(r,r,n[0]),Mt(s,s,n[1])}for(d=0,f=t.length;d<f;d++){var p=t[d];if(i)a=t[d?d-1:f-1],o=t[(d+1)%f];else{if(0===d||d===f-1){l.push(rt(t[d]));continue}a=t[d-1],o=t[d+1]}ht(u,o,a),gt(u,u,e);var g=vt(p,a),m=vt(p,o),v=g+m;0!==v&&(g/=v,m/=v),gt(h,u,-g),gt(c,u,m);var y=lt([],p,h),x=lt([],p,c);n&&(Mt(y,y,r),St(y,y,s),Mt(x,x,r),St(x,x,s)),l.push(y),l.push(x)}return i&&l.push(l.shift()),l}(n,a,i,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var r=n.length,s=0;s<(i?r:r-1);s++){var l=o[2*s],u=o[2*s+1],h=n[(s+1)%r];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===a&&(n=function(t,e){for(var i=t.length,n=[],a=0,o=1;o<i;o++)a+=vt(t[o-1],t[o]);var r=a/2;r=r<i?i:r;for(o=0;o<r;o++){var s,l,u,h=o/(r-1)*(e?i:i-1),c=Math.floor(h),d=h-c,f=t[c%i];u=e?(s=t[(c-1+i)%i],l=t[(c+1)%i],t[(c+2)%i]):(s=t[0===c?c:c-1],l=t[i-2<c?i-1:c+1],t[i-3<c?i-1:c+2]);var p=d*d,g=d*p;n.push([Or(s[0],f[0],l[0],u[0],d,p,g),Or(s[1],f[1],l[1],u[1],d,p,g)])}return n}(n,i)),t.moveTo(n[0][0],n[0][1]);s=1;for(var c=n.length;s<c;s++)t.lineTo(n[s][0],n[s][1])}i&&t.closePath()}}var Rr=hr.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){Er(t,e,!0)}}),zr=hr.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){Er(t,e,!1)}}),Br=Math.round;function Vr(t,e,i){var n=i&&i.lineWidth;if(e&&n){var a=e.x1,o=e.x2,r=e.y1,s=e.y2;Br(2*a)===Br(2*o)?t.x1=t.x2=Fr(a,n,!0):(t.x1=a,t.x2=o),Br(2*r)===Br(2*s)?t.y1=t.y2=Fr(r,n,!0):(t.y1=r,t.y2=s)}}function Gr(t,e,i){var n=i&&i.lineWidth;if(e&&n){var a=e.x,o=e.y,r=e.width,s=e.height;t.x=Fr(a,n,!0),t.y=Fr(o,n,!0),t.width=Math.max(Fr(a+r,n,!1)-t.x,0===r?0:1),t.height=Math.max(Fr(o+s,n,!1)-t.y,0===s?0:1)}}function Fr(t,e,i){var n=Br(2*t);return(n+Br(e))%2==0?n/2:(n+(i?1:-1))/2}var Wr={},Hr=hr.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var i,n,a,o;this.subPixelOptimize?(Gr(Wr,e,this.style),i=Wr.x,n=Wr.y,a=Wr.width,o=Wr.height,Wr.r=e.r,e=Wr):(i=e.x,n=e.y,a=e.width,o=e.height),e.r?bn(t,e):t.rect(i,n,a,o),t.closePath()}}),Zr={},Ur=hr.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,n,a,o;o=this.subPixelOptimize?(Vr(Zr,e,this.style),i=Zr.x1,n=Zr.y1,a=Zr.x2,Zr.y2):(i=e.x1,n=e.y1,a=e.x2,e.y2);var r=e.percent;0!==r&&(t.moveTo(i,n),r<1&&(a=i*(1-r)+a*r,o=n*(1-r)+o*r),t.lineTo(a,o))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}}),Xr=[];function Yr(t,e,i){var n=t.cpx2,a=t.cpy2;return null===n||null===a?[(i?uo:lo)(t.x1,t.cpx1,t.cpx2,t.x2,e),(i?uo:lo)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(i?po:fo)(t.x1,t.cpx1,t.x2,e),(i?po:fo)(t.y1,t.cpy1,t.y2,e)]}function jr(t){this.colorStops=t||[]}var qr=hr.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.x1,n=e.y1,a=e.x2,o=e.y2,r=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(i,n),null==l||null==u?(h<1&&(mo(i,r,a,h,Xr),r=Xr[1],a=Xr[2],mo(n,s,o,h,Xr),s=Xr[1],o=Xr[2]),t.quadraticCurveTo(r,s,a,o)):(h<1&&(co(i,r,l,a,h,Xr),r=Xr[1],l=Xr[2],a=Xr[3],co(n,s,u,o,h,Xr),s=Xr[1],u=Xr[2],o=Xr[3]),t.bezierCurveTo(r,s,l,u,a,o)))},pointAt:function(t){return Yr(this.shape,t,!1)},tangentAt:function(t){var e=Yr(this.shape,t,!0);return mt(e,e)}}),Kr=hr.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.cx,n=e.cy,a=Math.max(e.r,0),o=e.startAngle,r=e.endAngle,s=e.clockwise,l=Math.cos(o),u=Math.sin(o);t.moveTo(l*a+i,u*a+n),t.arc(i,n,a,o,r,!s)}}),$r=hr.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,i=0;i<e.length;i++)t=t||e[i].__dirtyPath;this.__dirtyPath=t,this.__dirty=this.__dirty||t},beforeBrush:function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),i=0;i<t.length;i++)t[i].path||t[i].createPathProxy(),t[i].path.setScale(e[0],e[1],t[i].segmentIgnoreThreshold)},buildPath:function(t,e){for(var i=e.paths||[],n=0;n<i.length;n++)i[n].buildPath(t,i[n].shape,!0)},afterBrush:function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),hr.prototype.getBoundingRect.call(this)}});jr.prototype={constructor:jr,addColorStop:function(t,e){this.colorStops.push({offset:t,color:e})}};function Jr(t,e,i,n,a,o){this.x=null==t?0:t,this.y=null==e?0:e,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=o||!1,jr.call(this,a)}Jr.prototype={constructor:Jr},w(Jr,jr);function Qr(t,e,i,n,a){this.x=null==t?.5:t,this.y=null==e?.5:e,this.r=null==i?.5:i,this.type="radial",this.global=a||!1,jr.call(this,n)}function ts(t){Xn.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}Qr.prototype={constructor:Qr},w(Qr,jr),ts.prototype.incremental=!0,ts.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},ts.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},ts.prototype.addDisplayables=function(t,e){e=e||!1;for(var i=0;i<t.length;i++)this.addDisplayable(t[i],e)},ts.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},ts.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){(e=this._displayables[t]).parent=this,e.update(),e.parent=null}for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},ts.prototype.brush=function(t,e){for(var i=this._cursor;i<this._displayables.length;i++){(n=this._displayables[i]).beforeBrush&&n.beforeBrush(t),n.brush(t,i===this._cursor?null:this._displayables[i-1]),n.afterBrush&&n.afterBrush(t)}this._cursor=i;for(i=0;i<this._temporaryDisplayables.length;i++){var n;(n=this._temporaryDisplayables[i]).beforeBrush&&n.beforeBrush(t),n.brush(t,0===i?null:this._temporaryDisplayables[i-1]),n.afterBrush&&n.afterBrush(t)}this._temporaryDisplayables=[],this.notClear=!0};var es=[];ts.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new bi(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var i=this._displayables[e],n=i.getBoundingRect().clone();i.needLocalTransform()&&n.applyTransform(i.getLocalTransform(es)),t.union(n)}this._rect=t}return this._rect},ts.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(i[0],i[1]))for(var n=0;n<this._displayables.length;n++){if(this._displayables[n].contain(t,e))return!0}return!1},w(ts,Xn);var is=Math.max,ns=Math.min,as={},os=1,rs={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},ss="emphasis",ls="normal",us=1,hs={},cs={};function ds(t){return hr.extend(t)}function fs(t,e){cs[t]=e}function ps(t){if(cs.hasOwnProperty(t))return cs[t]}function gs(t,e,i,n){var a=Tr(t,e);return i&&("center"===n&&(i=vs(i,a.getBoundingRect())),xs(a,i)),a}function ms(t,i,n){var a=new Yn({style:{image:t,x:i.x,y:i.y,width:i.width,height:i.height},onload:function(t){if("center"===n){var e={width:t.width,height:t.height};a.setStyle(vs(i,e))}}});return a}function vs(t,e){var i,n=e.width/e.height,a=t.height*n;return i=a<=t.width?t.height:(a=t.width)/n,{x:t.x+t.width/2-a/2,y:t.y+t.height/2-i/2,width:a,height:i}}var ys=function(t,e){for(var i=[],n=t.length,a=0;a<n;a++){var o=t[a];o.path||o.createPathProxy(),o.__dirtyPath&&o.buildPath(o.path,o.shape,!0),i.push(o.path)}var r=new hr(e);return r.createPathProxy(),r.buildPath=function(t){t.appendPath(i);var e=t.getContext();e&&t.rebuildPath(e)},r};function xs(t,e){if(t.applyTransform){var i=t.getBoundingRect().calculateTransform(e);t.applyTransform(i)}}var _s=Fr;function ws(t){return null!=t&&"none"!==t}var bs=Q(),Ss=0;function Ms(t){var e=t.__hoverStl;if(e&&!t.__highlighted){var i=t.__zr,n=t.useHoverLayer&&i&&"canvas"===i.painter.type;if(t.__highlighted=n?"layer":"plain",!(t.isGroup||!i&&t.useHoverLayer)){var a=t,o=t.style;n&&(o=(a=i.addHover(t)).style),Us(o),n||function(t){if(t.__hoverStlDirty){t.__hoverStlDirty=!1;var e=t.__hoverStl;if(e){var i=t.__cachedNormalStl={};t.__cachedNormalZ2=t.z2;var n=t.style;for(var a in e)null!=e[a]&&(i[a]=n[a]);i.fill=n.fill,i.stroke=n.stroke}else t.__cachedNormalStl=t.__cachedNormalZ2=null}}(a),o.extendFrom(e),Is(o,e,"fill"),Is(o,e,"stroke"),Zs(o),n||(t.dirty(!1),t.z2+=os)}}}function Is(t,e,i){!ws(e[i])&&ws(t[i])&&(t[i]=function(t){if("string"!=typeof t)return t;var e=bs.get(t);return e||(e=ze(t,-.1),Ss<1e4&&(bs.set(t,e),Ss++)),e}(t[i]))}function As(t){var e=t.__highlighted;if(e&&(t.__highlighted=!1,!t.isGroup))if("layer"===e)t.__zr&&t.__zr.removeHover(t);else{var i=t.style,n=t.__cachedNormalStl;n&&(Us(i),t.setStyle(n),Zs(i));var a=t.__cachedNormalZ2;null!=a&&t.z2-a===os&&(t.z2=a)}}function Ts(t,e,i){var n,a=ls,o=ls;t.__highlighted&&(a=ss,n=!0),e(t,i),t.__highlighted&&(o=ss,n=!0),t.isGroup&&t.traverse(function(t){t.isGroup||e(t,i)}),n&&t.__highDownOnUpdate&&t.__highDownOnUpdate(a,o)}function Ds(t,e){e=t.__hoverStl=!1!==e&&(t.hoverStyle||e||{}),t.__hoverStlDirty=!0,t.__highlighted&&(t.__cachedNormalStl=null,As(t),Ms(t))}function Cs(t){Ns(this,t)||this.__highByOuter||Ts(this,Ms)}function Ls(t){Ns(this,t)||this.__highByOuter||Ts(this,As)}function ks(t){this.__highByOuter|=1<<(t||0),Ts(this,Ms)}function Ps(t){(this.__highByOuter&=~(1<<(t||0)))||Ts(this,As)}function Ns(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Os(t,e){Es(t,!0),Ts(t,Ds,e)}function Es(t,e){var i=!1===e;if(t.__highDownSilentOnTouch=t.highDownSilentOnTouch,t.__highDownOnUpdate=t.highDownOnUpdate,!i||t.__highDownDispatcher){var n=i?"off":"on";t[n]("mouseover",Cs)[n]("mouseout",Ls),t[n]("emphasis",ks)[n]("normal",Ps),t.__highByOuter=t.__highByOuter||0,t.__highDownDispatcher=!i}}function Rs(t){return!(!t||!t.__highDownDispatcher)}function zs(t){var e=hs[t];return null==e&&us<=32&&(e=hs[t]=us++),e}function Bs(t,e,i,n,a,o,r){var s,l=(a=a||as).labelFetcher,u=a.labelDataIndex,h=a.labelDimIndex,c=i.getShallow("show"),d=n.getShallow("show");(c||d)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h)),null==s&&(s=O(a.defaultText)?a.defaultText(u,a):a.defaultText));var f=c?s:null,p=d?H(l?l.getFormattedLabel(u,"emphasis",null,h):null,s):null;null==f&&null==p||(Gs(t,i,o,a),Gs(e,n,r,a,!0)),t.text=f,e.text=p}function Vs(t,e,i){var n=t.style;e&&(Us(n),t.setStyle(e),Zs(n)),n=t.__hoverStl,i&&n&&(Us(n),L(n,i),Zs(n))}function Gs(t,e,i,n,a){return Fs(t,e,n,a),i&&L(t,i),t}function Fs(t,e,i,n){if((i=i||as).isRectText){var a;i.getTextPosition?a=i.getTextPosition(e,n):"outside"===(a=e.getShallow("position")||(n?null:"inside"))&&(a="top"),t.textPosition=a,t.textOffset=e.getShallow("offset");var o=e.getShallow("rotate");null!=o&&(o*=Math.PI/180),t.textRotation=o,t.textDistance=H(e.getShallow("distance"),n?null:5)}var r,s=e.ecModel,l=s&&s.option.textStyle,u=function(t){var e;for(;t&&t!==t.ecModel;){var i=(t.option||as).rich;if(i)for(var n in e=e||{},i)i.hasOwnProperty(n)&&(e[n]=1);t=t.parentModel}return e}(e);if(u)for(var h in r={},u)if(u.hasOwnProperty(h)){var c=e.getModel(["rich",h]);Ws(r[h]={},c,l,i,n)}return t.rich=r,Ws(t,e,l,i,n,!0),i.forceRich&&!i.textStyle&&(i.textStyle={}),t}function Ws(t,e,i,n,a,o){i=!a&&i||as,t.textFill=Hs(e.getShallow("color"),n)||i.color,t.textStroke=Hs(e.getShallow("textBorderColor"),n)||i.textBorderColor,t.textStrokeWidth=H(e.getShallow("textBorderWidth"),i.textBorderWidth),a||(o&&(t.insideRollbackOpt=n,Zs(t)),null==t.textFill&&(t.textFill=n.autoColor)),t.fontStyle=e.getShallow("fontStyle")||i.fontStyle,t.fontWeight=e.getShallow("fontWeight")||i.fontWeight,t.fontSize=e.getShallow("fontSize")||i.fontSize,t.fontFamily=e.getShallow("fontFamily")||i.fontFamily,t.textAlign=e.getShallow("align"),t.textVerticalAlign=e.getShallow("verticalAlign")||e.getShallow("baseline"),t.textLineHeight=e.getShallow("lineHeight"),t.textWidth=e.getShallow("width"),t.textHeight=e.getShallow("height"),t.textTag=e.getShallow("tag"),o&&n.disableBox||(t.textBackgroundColor=Hs(e.getShallow("backgroundColor"),n),t.textPadding=e.getShallow("padding"),t.textBorderColor=Hs(e.getShallow("borderColor"),n),t.textBorderWidth=e.getShallow("borderWidth"),t.textBorderRadius=e.getShallow("borderRadius"),t.textBoxShadowColor=e.getShallow("shadowColor"),t.textBoxShadowBlur=e.getShallow("shadowBlur"),t.textBoxShadowOffsetX=e.getShallow("shadowOffsetX"),t.textBoxShadowOffsetY=e.getShallow("shadowOffsetY")),t.textShadowColor=e.getShallow("textShadowColor")||i.textShadowColor,t.textShadowBlur=e.getShallow("textShadowBlur")||i.textShadowBlur,t.textShadowOffsetX=e.getShallow("textShadowOffsetX")||i.textShadowOffsetX,t.textShadowOffsetY=e.getShallow("textShadowOffsetY")||i.textShadowOffsetY}function Hs(t,e){return"auto"!==t?t:e&&e.autoColor?e.autoColor:null}function Zs(t){var e,i=t.textPosition,n=t.insideRollbackOpt;if(n&&null==t.textFill){var a=n.autoColor,o=n.isRectText,r=n.useInsideStyle,s=!1!==r&&(!0===r||o&&i&&"string"==typeof i&&0<=i.indexOf("inside")),l=!s&&null!=a;(s||l)&&(e={textFill:t.textFill,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth}),s&&(t.textFill="#fff",null==t.textStroke&&(t.textStroke=a,null==t.textStrokeWidth&&(t.textStrokeWidth=2))),l&&(t.textFill=a)}t.insideRollback=e}function Us(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function Xs(t,e){var i=e||e.getModel("textStyle");return j([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))}function Ys(t,e,i,n,a,o){if("function"==typeof a&&(o=a,a=null),n&&n.isAnimationEnabled()){var r=t?"Update":"",s=n.getShallow("animationDuration"+r),l=n.getShallow("animationEasing"+r),u=n.getShallow("animationDelay"+r);"function"==typeof u&&(u=u(a,n.getAnimationDelayParams?n.getAnimationDelayParams(e,a):null)),"function"==typeof s&&(s=s(a)),0<s?e.animateTo(i,s,u||0,l,o,!!o):(e.stopAnimation(),e.attr(i),o&&o())}else e.stopAnimation(),e.attr(i),o&&o()}function js(t,e,i,n,a){Ys(!0,t,e,i,n,a)}function qs(t,e,i,n,a){Ys(!1,t,e,i,n,a)}function Ks(t,e){for(var i=te([]);t&&t!==e;)ie(i,t.getLocalTransform(),i),t=t.parent;return i}function $s(t,e,i){return e&&!P(e)&&(e=ce.getLocalTransform(e)),i&&(e=re([],e)),bt([],t,e)}function Js(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),a=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),o=["left"===t?-n:"right"===t?n:0,"top"===t?-a:"bottom"===t?a:0];return o=$s(o,e,i),Math.abs(o[0])>Math.abs(o[1])?0<o[0]?"right":"left":0<o[1]?"bottom":"top"}function Qs(t,e,n,i){if(t&&e){var a,o=(a={},t.traverse(function(t){!t.isGroup&&t.anid&&(a[t.anid]=t)}),a);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=o[t.anid];if(e){var i=r(t);t.attr(r(e)),js(t,i,n,t.dataIndex)}}})}function r(t){var e={position:rt(t.position),rotation:t.rotation};return t.shape&&(e.shape=L({},t.shape)),e}}function tl(t,n){return N(t,function(t){var e=t[0];e=is(e,n.x),e=ns(e,n.x+n.width);var i=t[1];return i=is(i,n.y),[e,i=ns(i,n.y+n.height)]})}function el(t,e,i){var n=(e=L({rectHover:!0},e)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(n.image=t.slice(8),C(n,i),new Yn(e)):gs(t.replace("path://",""),e,i,"center")}function il(t,e,i,n,a){for(var o=0,r=a[a.length-1];o<a.length;o++){var s=a[o];if(nl(t,e,i,n,s[0],s[1],r[0],r[1]))return!0;r=s}}function nl(t,e,i,n,a,o,r,s){var l=i-t,u=n-e,h=r-a,c=s-o,d=al(h,c,l,u);if(function(t){return t<=1e-6&&-1e-6<=t}(d))return!1;var f=t-a,p=e-o,g=al(f,p,l,u)/d;if(g<0||1<g)return!1;var m=al(f,p,h,c)/d;return!(m<0||1<m)}function al(t,e,i,n){return t*n-i*e}fs("circle",Lr),fs("sector",Pr),fs("ring",Nr),fs("polygon",Rr),fs("polyline",zr),fs("rect",Hr),fs("line",Ur),fs("bezierCurve",qr),fs("arc",Kr);var ol=(Object.freeze||Object)({Z2_EMPHASIS_LIFT:os,CACHED_LABEL_STYLE_PROPERTIES:rs,extendShape:ds,extendPath:function(t,e){return function(t,e){return hr.extend(Ar(t,e))}(t,e)},registerShape:fs,getShapeClass:ps,makePath:gs,makeImage:ms,mergePath:ys,resizePath:xs,subPixelOptimizeLine:function(t){return Vr(t.shape,t.shape,t.style),t},subPixelOptimizeRect:function(t){return Gr(t.shape,t.shape,t.style),t},subPixelOptimize:_s,setElementHoverStyle:Ds,setHoverStyle:Os,setAsHighDownDispatcher:Es,isHighDownDispatcher:Rs,getHighlightDigit:zs,setLabelStyle:Bs,modifyLabelStyle:Vs,setTextStyle:Gs,setText:function(t,e,i){var n,a={isRectText:!0};!1===i?n=!0:a.autoColor=i,Fs(t,e,a,n)},getFont:Xs,updateProps:js,initProps:qs,getTransform:Ks,applyTransform:$s,transformDirection:Js,groupTransition:Qs,clipPointsByRect:tl,clipRectByRect:function(t,e){var i=is(t.x,e.x),n=ns(t.x+t.width,e.x+e.width),a=is(t.y,e.y),o=ns(t.y+t.height,e.y+e.height);if(i<=n&&a<=o)return{x:i,y:a,width:n-i,height:o-a}},createIcon:el,linePolygonIntersect:il,lineLineIntersect:nl,Group:Si,Image:Yn,Text:Dr,Circle:Lr,Sector:Pr,Ring:Nr,Polygon:Rr,Polyline:zr,Rect:Hr,Line:Ur,BezierCurve:qr,Arc:Kr,IncrementalDisplayable:ts,CompoundPath:$r,LinearGradient:Jr,RadialGradient:Qr,BoundingRect:bi}),rl=["textStyle","color"],sl={getTextColor:function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(rl):null)},getFont:function(){return Xs({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return un(t,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},ll=Xa([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),ul={getItemStyle:function(t,e){var i=ll(this,t,e),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}},hl=b,cl=La();function dl(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function fl(t,e,i){for(var n=0;n<e.length&&(!e[n]||null!=(t=t&&"object"==typeof t?t[e[n]]:null));n++);return null==t&&i&&(t=i.get(e)),t}function pl(t,e){var i=cl(t).getParent;return i?i.call(t,e):t.parentModel}dl.prototype={constructor:dl,init:null,mergeOption:function(t){m(this.option,t,!0)},get:function(t,e){return null==t?this.option:fl(this.option,this.parsePath(t),!e&&pl(this,t))},getShallow:function(t,e){var i=this.option,n=null==i?i:i[t],a=!e&&pl(this,t);return null==n&&a&&(n=a.getShallow(t)),n},getModel:function(t,e){var i;return new dl(null==t?this.option:fl(this.option,t=this.parsePath(t)),e=e||(i=pl(this,t))&&i.getModel(t),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new this.constructor(D(this.option))},setReadOnly:function(t){},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){cl(this).getParent=t},isAnimationEnabled:function(){if(!v.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},Ga(dl),Wa(dl),hl(dl,ja),hl(dl,Ka),hl(dl,sl),hl(dl,ul);var gl=0;function ml(t){return[t||"",gl++,Math.random().toFixed(5)].join("_")}var vl=1e-4;function yl(t,e,i,n){var a=e[1]-e[0],o=i[1]-i[0];if(0==a)return 0==o?i[0]:(i[0]+i[1])/2;if(n)if(0<a){if(t<=e[0])return i[0];if(t>=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/a*o+i[0]}function xl(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?function(t){return t.replace(/^\s+|\s+$/g,"")}(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function _l(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function wl(t){return t.sort(function(t,e){return t-e}),t}function bl(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Sl(t){var e=t.toString(),i=e.indexOf("e");if(0<i){var n=+e.slice(i+1);return n<0?-n:0}var a=e.indexOf(".");return a<0?0:e.length-1-a}function Ml(t,e){var i=Math.log,n=Math.LN10,a=Math.floor(i(t[1]-t[0])/n),o=Math.round(i(Math.abs(e[1]-e[0]))/n),r=Math.min(Math.max(-a+o,0),20);return isFinite(r)?r:20}function Il(t,e,i){if(!t[e])return 0;var n=S(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return 0;for(var a=Math.pow(10,i),o=N(t,function(t){return(isNaN(t)?0:t)/n*a*100}),r=100*a,s=N(o,function(t){return Math.floor(t)}),l=S(s,function(t,e){return t+e},0),u=N(o,function(t,e){return t-s[e]});l<r;){for(var h=Number.NEGATIVE_INFINITY,c=null,d=0,f=u.length;d<f;++d)u[d]>h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/a}var Al=9007199254740991;function Tl(t){var e=2*Math.PI;return(t%e+e)%e}function Dl(t){return-vl<t&&t<vl}var Cl=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Ll(t){if(t instanceof Date)return t;if("string"!=typeof t)return null==t?new Date(NaN):new Date(Math.round(t));var e=Cl.exec(t);if(!e)return new Date(NaN);if(e[8]){var i=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(i-=e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,i,+(e[5]||0),+e[6]||0,+e[7]||0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,+e[7]||0)}function kl(t){return Math.pow(10,Pl(t))}function Pl(t){if(0===t)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return 10<=t/Math.pow(10,e)&&e++,e}function Nl(t,e){var i=Pl(t),n=Math.pow(10,i),a=t/n;return t=(e?a<1.5?1:a<2.5?2:a<4?3:a<7?5:10:a<1?1:a<2?2:a<3?3:a<5?5:10)*n,-20<=i?+t.toFixed(i<0?-i:0):t}function Ol(t){t.sort(function(t,e){return function t(e,i,n){return e.interval[n]<i.interval[n]||e.interval[n]===i.interval[n]&&(e.close[n]-i.close[n]==(n?-1:1)||!n&&t(e,i,1))}(t,e,0)?-1:1});for(var e=-1/0,i=1,n=0;n<t.length;){for(var a=t[n].interval,o=t[n].close,r=0;r<2;r++)a[r]<=e&&(a[r]=e,o[r]=r?1:1-i),e=a[r],i=o[r];a[0]===a[1]&&o[0]*o[1]!=1?t.splice(n,1):n++}return t}function El(t){return 0<=t-parseFloat(t)}var Rl=(Object.freeze||Object)({linearMap:yl,parsePercent:xl,round:_l,asc:wl,getPrecision:bl,getPrecisionSafe:Sl,getPixelPrecision:Ml,getPercentWithPrecision:Il,MAX_SAFE_INTEGER:Al,remRadian:Tl,isRadianAroundZero:Dl,parseDate:Ll,quantity:kl,quantityExponent:Pl,nice:Nl,quantile:function(t,e){var i=(t.length-1)*e+1,n=Math.floor(i),a=+t[n-1],o=i-n;return o?a+o*(t[n]-a):a},reformIntervals:Ol,isNumeric:El});function zl(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(1<t.length?"."+t[1]:"")}function Bl(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 Vl=X,Gl=/([&<>"'])/g,Fl={"&":"&","<":"<",">":">",'"':""","'":"'"};function Wl(t){return null==t?"":(t+"").replace(Gl,function(t,e){return Fl[e]})}function Hl(t,e){return"{"+t+(null==e?"":e)+"}"}var Zl=["a","b","c","d","e","f","g"];function Ul(t,e,i){k(e)||(e=[e]);var n=e.length;if(!n)return"";for(var a=e[0].$vars||[],o=0;o<a.length;o++){var r=Zl[o];t=t.replace(Hl(r),Hl(r,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var u=e[s][a[l]];t=t.replace(Hl(Zl[l],s),i?Wl(u):u)}return t}function Xl(i,t,n){return E(t,function(t,e){i=i.replace("{"+e+"}",n?Wl(t):t)}),i}function Yl(t,e){var i=(t=R(t)?{color:t,extraCssText:e}:t||{}).color,n=t.type,a=(e=t.extraCssText,t.renderMode||"html"),o=t.markerId||"X";return i?"html"===a?"subItem"===n?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Wl(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+Wl(i)+";"+(e||"")+'"></span>':{renderMode:a,content:"{marker"+o+"|} ",style:{color:i}}:""}function jl(t,e){return"0000".substr(0,e-(t+="").length)+t}function ql(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=Ll(e),a=i?"UTC":"",o=n["get"+a+"FullYear"](),r=n["get"+a+"Month"]()+1,s=n["get"+a+"Date"](),l=n["get"+a+"Hours"](),u=n["get"+a+"Minutes"](),h=n["get"+a+"Seconds"](),c=n["get"+a+"Milliseconds"]();return t=t.replace("MM",jl(r,2)).replace("M",r).replace("yyyy",o).replace("yy",o%100).replace("dd",jl(s,2)).replace("d",s).replace("hh",jl(l,2)).replace("h",l).replace("mm",jl(u,2)).replace("m",u).replace("ss",jl(h,2)).replace("s",h).replace("SSS",jl(c,3))}function Kl(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}var $l=fn;var Jl=(Object.freeze||Object)({addCommas:zl,toCamelCase:Bl,normalizeCssArray:Vl,encodeHTML:Wl,formatTpl:Ul,formatTplSimple:Xl,getTooltipMarker:Yl,formatTime:ql,capitalFirst:Kl,truncateText:$l,getTextBoundingRect:function(t){return un(t.text,t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich,t.truncate)},getTextRect:function(t,e,i,n,a,o,r,s){return un(t,e,i,n,a,s,o,r)}}),Ql=E,tu=["left","right","top","bottom","width","height"],eu=[["width","left","right"],["height","top","bottom"]];function iu(h,c,d,f,p){var g=0,m=0;null==f&&(f=1/0),null==p&&(p=1/0);var v=0;c.eachChild(function(t,e){var i,n,a=t.position,o=t.getBoundingRect(),r=c.childAt(e+1),s=r&&r.getBoundingRect();if("horizontal"===h){var l=o.width+(s?-s.x+o.x:0);v=f<(i=g+l)||t.newline?(g=0,i=l,m+=v+d,o.height):Math.max(v,o.height)}else{var u=o.height+(s?-s.y+o.y:0);v=p<(n=m+u)||t.newline?(g+=v+d,m=0,n=u,o.width):Math.max(v,o.width)}t.newline||(a[0]=g,a[1]=m,"horizontal"===h?g=i+d:m=n+d)})}var nu=iu;A(iu,"vertical"),A(iu,"horizontal");function au(t,e,i){i=Vl(i||0);var n=e.width,a=e.height,o=xl(t.left,n),r=xl(t.top,a),s=xl(t.right,n),l=xl(t.bottom,a),u=xl(t.width,n),h=xl(t.height,a),c=i[2]+i[0],d=i[1]+i[3],f=t.aspect;switch(isNaN(u)&&(u=n-s-d-o),isNaN(h)&&(h=a-l-c-r),null!=f&&(isNaN(u)&&isNaN(h)&&(n/a<f?u=.8*n:h=.8*a),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(o)&&(o=n-s-u-d),isNaN(r)&&(r=a-l-h-c),t.left||t.right){case"center":o=n/2-u/2-i[3];break;case"right":o=n-u-d}switch(t.top||t.bottom){case"middle":case"center":r=a/2-h/2-i[0];break;case"bottom":r=a-h-c}o=o||0,r=r||0,isNaN(u)&&(u=n-d-o-(s||0)),isNaN(h)&&(h=a-c-r-(l||0));var p=new bi(o+i[3],r+i[0],u,h);return p.margin=i,p}function ou(t,e,i,n,a){var o=!a||!a.hv||a.hv[0],r=!a||!a.hv||a.hv[1],s=a&&a.boundingMode||"all";if(o||r){var l;if("raw"===s)l="group"===t.type?new bi(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(l=t.getBoundingRect(),t.needLocalTransform()){var u=t.getLocalTransform();(l=l.clone()).applyTransform(u)}e=au(C({width:l.width,height:l.height},e),i,n);var h=t.position,c=o?e.x-l.x:0,d=r?e.y-l.y:0;t.attr("position","raw"===s?[c,d]:[h[0]+c,h[1]+d])}}function ru(l,u,t){z(t)||(t={});var h=t.ignoreSize;k(h)||(h=[h,h]);var e=n(eu[0],0),i=n(eu[1],1);function n(t,e){var i={},n=0,a={},o=0;if(Ql(t,function(t){a[t]=l[t]}),Ql(t,function(t){c(u,t)&&(i[t]=a[t]=u[t]),d(i,t)&&n++,d(a,t)&&o++}),h[e])return d(u,t[1])?a[t[2]]=null:d(u,t[2])&&(a[t[1]]=null),a;if(2!==o&&n){if(2<=n)return i;for(var r=0;r<t.length;r++){var s=t[r];if(!c(i,s)&&c(l,s)){i[s]=l[s];break}}return i}return a}function c(t,e){return t.hasOwnProperty(e)}function d(t,e){return null!=t[e]&&"auto"!==t[e]}function a(t,e,i){Ql(t,function(t){e[t]=i[t]})}a(eu[0],l,e),a(eu[1],l,i)}function su(t){return lu({},t)}function lu(e,i){return i&&e&&Ql(tu,function(t){i.hasOwnProperty(t)&&(e[t]=i[t])}),e}var uu,hu,cu,du=La(),fu=dl.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,i,n){dl.call(this,t,e,i,n),this.uid=ml("ec_cpt_model")},init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?su(t):{};m(t,e.getTheme().get(this.mainType)),m(t,this.getDefaultOption()),i&&ru(t,n,i)},mergeOption:function(t,e){m(this.option,t,!0);var i=this.layoutMode;i&&ru(this.option,t,i)},optionUpdated:function(t,e){},getDefaultOption:function(){var t=du(this);if(!t.defaultOption){for(var e=[],i=this.constructor;i;){var n=i.prototype.defaultOption;n&&e.push(n),i=i.superClass}for(var a={},o=e.length-1;0<=o;o--)a=m(a,e[o],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});function pu(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}Ua(fu,{registerWhenExtend:!0}),hu={},(uu=fu).registerSubTypeDefaulter=function(t,e){t=Va(t),hu[t.main]=e},uu.determineSubType=function(t,e){var i=e.type;if(!i){var n=Va(t).main;uu.hasSubTypes(t)&&hu[n]&&(i=hu[n](e))}return i},cu=function(t){var e=[];E(fu.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=N(e,function(t){return Va(t).main}),"dataset"!==t&&_(e,"dataset")<=0&&e.unshift("dataset");return e},fu.topologicalTravel=function(t,e,i,n){if(t.length){var a=function(e){var a={},o=[];return E(e,function(i){var n=pu(a,i),t=function(t,e){var i=[];return E(t,function(t){0<=_(e,t)&&i.push(t)}),i}(n.originalDeps=cu(i),e);n.entryCount=t.length,0===n.entryCount&&o.push(i),E(t,function(t){_(n.predecessor,t)<0&&n.predecessor.push(t);var e=pu(a,t);_(e.successor,t)<0&&e.successor.push(i)})}),{graph:a,noEntryList:o}}(e),o=a.graph,r=a.noEntryList,s={};for(E(t,function(t){s[t]=!0});r.length;){var l=r.pop(),u=o[l],h=!!s[l];h&&(i.call(n,l,u.originalDeps.slice()),delete s[l]),E(u.successor,h?d:c)}E(s,function(){throw new Error("Circle dependency may exists")})}function c(t){o[t].entryCount--,0===o[t].entryCount&&r.push(t)}function d(t){s[t]=!0,c(t)}},b(fu,{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}});var gu="";"undefined"!=typeof navigator&&(gu=navigator.platform||"");var mu={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:gu.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},vu=La();var yu={clearColorPalette:function(){vu(this).colorIdx=0,vu(this).colorNameMap={}},getColorFromPalette:function(t,e,i){var n=vu(e=e||this),a=n.colorIdx||0,o=n.colorNameMap=n.colorNameMap||{};if(o.hasOwnProperty(t))return o[t];var r=wa(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?function(t,e){for(var i=t.length,n=0;n<i;n++)if(t[n].length>e)return t[n];return t[i-1]}(s,i):r;if((l=l||r)&&l.length){var u=l[a];return t&&(o[t]=u),n.colorIdx=(a+1)%l.length,u}}};function xu(t){var e=t.get("coordinateSystem"),i={coordSysName:e,coordSysDims:[],axisMap:Q(),categoryAxisMap:Q()},n=_u[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}var _u={cartesian2d:function(t,e,i,n){var a=t.getReferringComponents("xAxis")[0],o=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],i.set("x",a),i.set("y",o),wu(a)&&(n.set("x",a),e.firstCategoryDimIndex=0),wu(o)&&(n.set("y",o),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,i,n){var a=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],i.set("single",a),wu(a)&&(n.set("single",a),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var a=t.getReferringComponents("polar")[0],o=a.findAxisModel("radiusAxis"),r=a.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",o),i.set("angle",r),wu(o)&&(n.set("radius",o),e.firstCategoryDimIndex=0),wu(r)&&(n.set("angle",r),e.firstCategoryDimIndex=1)},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,a,o,r){var s=t.ecModel,e=s.getComponent("parallel",t.get("parallelIndex")),l=a.coordSysDims=e.dimensions.slice();E(e.parallelAxisIndex,function(t,e){var i=s.getComponent("parallelAxis",t),n=l[e];o.set(n,i),wu(i)&&null==a.firstCategoryDimIndex&&(r.set(n,i),a.firstCategoryDimIndex=e)})}};function wu(t){return"category"===t.get("type")}var bu="original",Su="arrayRows",Mu="objectRows",Iu="keyedColumns",Au="unknown",Tu="typedArray",Du="column",Cu="row";function Lu(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===Iu?{}:[]),this.sourceFormat=t.sourceFormat||Au,this.seriesLayoutBy=t.seriesLayoutBy||Du,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&Q(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}Lu.seriesDataToSource=function(t){return new Lu({data:t,sourceFormat:V(t)?Tu:bu,fromDataset:!1})},Wa(Lu);var ku=La();function Pu(t){var e=t.option,i=e.data,n=V(i)?Tu:bu,a=!1,o=e.seriesLayoutBy,r=e.sourceHeader,s=e.dimensions,l=function(t){var e=t.option;if(!e.data)return t.ecModel.getComponent("dataset",e.datasetIndex||0)}(t);if(l){var u=l.option;i=u.source,n=ku(l).sourceFormat,a=!0,o=o||u.seriesLayoutBy,null==r&&(r=u.sourceHeader),s=s||u.dimensions}var h=function(t,e,i,n,a){if(!t)return{dimensionsDefine:Nu(a)};var o,r,s,l;if(e===Su)"auto"===n||null==n?Ou(function(t){null!=t&&"-"!==t&&(R(t)?null==r&&(r=1):r=0)},i,t,10):r=n?1:0,a||1!==r||(a=[],Ou(function(t,e){a[e]=null!=t?t:""},i,t)),o=a?a.length:i===Cu?t.length:t[0]?t[0].length:null;else if(e===Mu)a||(a=function(t){var e,i=0;for(;i<t.length&&!(e=t[i++]););if(e){var n=[];return E(e,function(t,e){n.push(e)}),n}}(t),s=!0);else if(e===Iu)a||(a=[],s=!0,E(t,function(t,e){a.push(e)}));else if(e===bu){var u=Ma(t[0]);o=k(u)&&u.length||1}s&&E(a,function(t,e){"name"===(z(t)?t.name:t)&&(l=e)});return{startIndex:r,dimensionsDefine:Nu(a),dimensionsDetectCount:o,potentialNameDimIndex:l}}(i,n,o,r,s),c=e.encode;!c&&l&&(c=function(t,e,i,n,a,o){var r=xu(t),s={},l=[],u=[],h=t.subType,c=Q(["pie","map","funnel"]),d=Q(["line","bar","pictorialBar","scatter","effectScatter","candlestick","boxplot"]);if(r&&null!=d.get(h)){var f=t.ecModel,p=ku(f).datasetMap,g=e.uid+"_"+a,m=p.get(g)||p.set(g,{categoryWayDim:1,valueWayDim:0});E(r.coordSysDims,function(t){if(null==r.firstCategoryDimIndex){var e=m.valueWayDim++;s[t]=e,u.push(e)}else if(r.categoryAxisMap.get(t))s[t]=0,l.push(0);else{e=m.categoryWayDim++;s[t]=e,u.push(e)}})}else if(null!=c.get(h)){for(var v,y=0;y<5&&null==v;y++)Eu(i,n,a,o.dimensionsDefine,o.startIndex,y)||(v=y);if(null!=v){s.value=v;var x=o.potentialNameDimIndex||Math.max(v-1,0);u.push(x),l.push(x)}}return l.length&&(s.itemName=l),u.length&&(s.seriesName=u),s}(t,l,i,n,o,h)),ku(t).source=new Lu({data:i,fromDataset:a,seriesLayoutBy:o,sourceFormat:n,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:c})}function Nu(t){if(t){var n=Q();return N(t,function(t,e){if(null==(t=L({},z(t)?t:{name:t})).name)return t;t.name+="",null==t.displayName&&(t.displayName=t.name);var i=n.get(t.name);return i?t.name+="-"+i.count++:n.set(t.name,{count:1}),t})}}function Ou(t,e,i,n){if(null==n&&(n=1/0),e===Cu)for(var a=0;a<i.length&&a<n;a++)t(i[a]?i[a][0]:null,a);else{var o=i[0]||[];for(a=0;a<o.length&&a<n;a++)t(o[a],a)}}function Eu(t,e,i,n,a,o){var r,s;if(V(t))return!1;if(n&&(s=z(s=n[o])?s.name:s),e===Su)if(i===Cu){for(var l=t[o],u=0;u<(l||[]).length&&u<5;u++)if(null!=(r=f(l[a+u])))return r}else for(u=0;u<t.length&&u<5;u++){var h=t[a+u];if(h&&null!=(r=f(h[o])))return r}else if(e===Mu){if(!s)return;for(u=0;u<t.length&&u<5;u++){if((c=t[u])&&null!=(r=f(c[s])))return r}}else if(e===Iu){if(!s)return;if(!(l=t[s])||V(l))return!1;for(u=0;u<l.length&&u<5;u++)if(null!=(r=f(l[u])))return r}else if(e===bu)for(u=0;u<t.length&&u<5;u++){var c,d=Ma(c=t[u]);if(!k(d))return!1;if(null!=(r=f(d[o])))return r}function f(t){return(null==t||!isFinite(t)||""===t)&&(!(!R(t)||"-"===t)||void 0)}return!1}var Ru="\0_ec_inner",zu=dl.extend({init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new dl(i),this._optionManager=n},setOption:function(t,e){Y(!(Ru in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):function(t){t=t,this.option={},this.option[Ru]=1,this._componentsMap=Q({series:[]}),this._seriesIndices,this._seriesIndicesMap,function(i,t){var n=i.color&&!i.colorLayer;E(t,function(t,e){"colorLayer"===e&&n||fu.hasClass(e)||("object"==typeof t?i[e]=i[e]?m(i[e],t,!1):D(t):null==i[e]&&(i[e]=t))})}(t,this._theme.option),m(t,mu,!1),this.mergeOption(t)}.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var a=i.getTimelineOption(this);a&&(this.mergeOption(a),e=!0)}if(!t||"recreate"===t||"media"===t){var o=i.getMediaOption(this,this._api);o.length&&E(o,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(n){var l=this.option,u=this._componentsMap,i=[];!function(t){ku(t).datasetMap=Q()}(this),E(n,function(t,e){null!=t&&(fu.hasClass(e)?e&&i.push(e):l[e]=null==l[e]?D(t):m(l[e],t,!0))}),fu.topologicalTravel(i,fu.getAllClassMainTypes(),function(r,t){var e=wa(n[r]),i=Ia(u.get(r),e);Aa(i),E(i,function(t,e){var i=t.option;z(i)&&(t.keyInfo.mainType=r,t.keyInfo.subType=function(t,e,i){return e.type?e.type:i?i.subType:fu.determineSubType(t,e)}(r,i,t.exist))});var s=function(e,t){k(t)||(t=t?[t]:[]);var i={};return E(t,function(t){i[t]=(e.get(t)||[]).slice()}),i}(u,t);l[r]=[],u.set(r,[]),E(i,function(t,e){var i=t.exist,n=t.option;if(Y(z(n)||i,"Empty component definition"),n){var a=fu.getClass(r,t.keyInfo.subType,!0);if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(n,this),i.optionUpdated(n,!1);else{var o=L({dependentModels:s,componentIndex:e},t.keyInfo);L(i=new a(n,this,this,o),o),i.init(n,this,this,o),i.optionUpdated(null,!0)}}else i.mergeOption({},this),i.optionUpdated({},!1);u.get(r)[e]=i,l[r][e]=i.option},this),"series"===r&&Bu(this,u.get("series"))},this),this._seriesIndicesMap=Q(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var n=D(this.option);return E(n,function(t,e){if(fu.hasClass(e)){for(var i=(t=wa(t)).length-1;0<=i;i--)Da(t[i])&&t.splice(i,1);n[e]=t}}),delete n[Ru],n},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i,n=t.index,a=t.id,o=t.name,r=this._componentsMap.get(e);if(!r||!r.length)return[];if(null!=n)k(n)||(n=[n]),i=M(N(n,function(t){return r[t]}),function(t){return!!t});else if(null!=a){var s=k(a);i=M(r,function(t){return s&&0<=_(a,t.id)||!s&&t.id===a})}else if(null!=o){var l=k(o);i=M(r,function(t){return l&&0<=_(o,t.name)||!l&&t.name===o})}else i=r.slice();return Vu(i,t)},findComponents:function(t){var e,i,n,a,o,r=t.query,s=t.mainType,l=(i=s+"Index",n=s+"Id",a=s+"Name",!(e=r)||null==e[i]&&null==e[n]&&null==e[a]?null:{mainType:s,index:e[i],id:e[n],name:e[a]}),u=l?this.queryComponents(l):this._componentsMap.get(s);return o=Vu(u,t),t.filter?M(o,t.filter):o},eachComponent:function(t,n,a){var e=this._componentsMap;if("function"==typeof t)a=n,n=t,e.each(function(t,i){E(t,function(t,e){n.call(a,i,t,e)})});else if(R(t))E(e.get(t),n,a);else if(z(t)){E(this.findComponents(t),n,a)}},getSeriesByName:function(e){return M(this._componentsMap.get("series"),function(t){return t.name===e})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(e){return M(this._componentsMap.get("series"),function(t){return t.subType===e})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(i,n){E(this._seriesIndices,function(t){var e=this._componentsMap.get("series")[t];i.call(n,e,t)},this)},eachRawSeries:function(t,e){E(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(i,n,a){E(this._seriesIndices,function(t){var e=this._componentsMap.get("series")[t];e.subType===i&&n.call(a,e,t)},this)},eachRawSeriesByType:function(t,e,i){return E(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){var i=M(this._componentsMap.get("series"),t,e);Bu(this,i)},restoreData:function(i){var n=this._componentsMap;Bu(this,n.get("series"));var a=[];n.each(function(t,e){a.push(e)}),fu.topologicalTravel(a,fu.getAllClassMainTypes(),function(e,t){E(n.get(e),function(t){"series"===e&&function(t,e){if(e){var i=e.seiresIndex,n=e.seriesId,a=e.seriesName;return null!=i&&t.componentIndex!==i||null!=n&&t.id!==n||null!=a&&t.name!==a}}(t,i)||t.restoreData()})})}});function Bu(t,e){t._seriesIndicesMap=Q(t._seriesIndices=N(e,function(t){return t.componentIndex})||[])}function Vu(t,e){return e.hasOwnProperty("subType")?M(t,function(t){return t.subType===e.subType}):t}b(zu,yu);var Gu=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];function Fu(e){E(Gu,function(t){this[t]=T(e[t],e)},this)}var Wu={};function Hu(){this._coordinateSystems=[]}Hu.prototype={constructor:Hu,create:function(n,a){var o=[];E(Wu,function(t,e){var i=t.create(n,a);o=o.concat(i||[])}),this._coordinateSystems=o},update:function(e,i){E(this._coordinateSystems,function(t){t.update&&t.update(e,i)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Hu.register=function(t,e){Wu[t]=e},Hu.get=function(t){return Wu[t]};var Zu=E,Uu=D,Xu=N,Yu=m,ju=/^(min|max)?(.+)$/;function qu(t){this._api=t,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function Ku(t,e,i){var o={width:e,height:i,aspectratio:e/i},r=!0;return E(t,function(t,e){var i=e.match(ju);if(i&&i[1]&&i[2]){var n=i[1],a=i[2].toLowerCase();!function(t,e,i){return"min"===i?e<=t:"max"===i?t<=e:t===e}(o[a],t,n)&&(r=!1)}}),r}qu.prototype={constructor:qu,setOption:function(t,e){t&&E(wa(t.series),function(t){t&&t.data&&V(t.data)&&K(t.data)}),t=Uu(t);var i=this._optionBackup,n=function(t,i,n){var e,a,o=[],r=[],s=t.timeline;t.baseOption&&(a=t.baseOption);(s||t.options)&&(a=a||{},o=(t.options||[]).slice());if(t.media){a=a||{};var l=t.media;Zu(l,function(t){t&&t.option&&(t.query?r.push(t):e=e||t)})}a=a||t;a.timeline||(a.timeline=s);return Zu([a].concat(o).concat(N(r,function(t){return t.option})),function(e){Zu(i,function(t){t(e,n)})}),{baseOption:a,timelineOptions:o,mediaDefault:e,mediaList:r}}.call(this,t,e,!i);this._newBaseOption=n.baseOption,i?(function(a,t){Zu(t=t||{},function(t,e){if(null!=t){var i=a[e];if(fu.hasClass(e)){t=wa(t);var n=Ia(i=wa(i),t);a[e]=Xu(n,function(t){return t.option&&t.exist?Yu(t.exist,t.option,!0):t.exist||t.option})}else a[e]=Yu(i,t,!0)}})}(i.baseOption,n.baseOption),n.timelineOptions.length&&(i.timelineOptions=n.timelineOptions),n.mediaList.length&&(i.mediaList=n.mediaList),n.mediaDefault&&(i.mediaDefault=n.mediaDefault)):this._optionBackup=n},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=Xu(e.timelineOptions,Uu),this._mediaList=Xu(e.mediaList,Uu),this._mediaDefault=Uu(e.mediaDefault),this._currentMediaIndices=[],Uu(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=Uu(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,a=this._mediaDefault,o=[],r=[];if(!n.length&&!a)return r;for(var s=0,l=n.length;s<l;s++)Ku(n[s].query,e,i)&&o.push(s);return!o.length&&a&&(o=[-1]),o.length&&!function(t,e){return t.join(",")===e.join(",")}(o,this._currentMediaIndices)&&(r=Xu(o,function(t){return Uu(-1===t?a.option:n[t].option)})),this._currentMediaIndices=o,r}};var $u=E,Ju=z,Qu=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function th(t){var e=t&&t.itemStyle;if(e)for(var i=0,n=Qu.length;i<n;i++){var a=Qu[i],o=e.normal,r=e.emphasis;o&&o[a]&&(t[a]=t[a]||{},t[a].normal?m(t[a].normal,o[a]):t[a].normal=o[a],o[a]=null),r&&r[a]&&(t[a]=t[a]||{},t[a].emphasis?m(t[a].emphasis,r[a]):t[a].emphasis=r[a],r[a]=null)}}function eh(t,e,i){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,a=t[e].emphasis;n&&(i?(t[e].normal=t[e].emphasis=null,C(t[e],n)):t[e]=n),a&&(t.emphasis=t.emphasis||{},t.emphasis[e]=a)}}function ih(t){eh(t,"itemStyle"),eh(t,"lineStyle"),eh(t,"areaStyle"),eh(t,"label"),eh(t,"labelLine"),eh(t,"upperLabel"),eh(t,"edgeLabel")}function nh(t,e){var i=Ju(t)&&t[e],n=Ju(i)&&i.textStyle;if(n)for(var a=0,o=Sa.length;a<o;a++){e=Sa[a];n.hasOwnProperty(e)&&(i[e]=n[e])}}function ah(t){t&&(ih(t),nh(t,"label"),t.emphasis&&nh(t.emphasis,"label"))}function oh(t){return k(t)?t:t?[t]:[]}function rh(t){return(k(t)?t[0]:t)||{}}function sh(e,t){$u(oh(e.series),function(t){Ju(t)&&function(t){if(Ju(t)){th(t),ih(t),nh(t,"label"),nh(t,"upperLabel"),nh(t,"edgeLabel"),t.emphasis&&(nh(t.emphasis,"label"),nh(t.emphasis,"upperLabel"),nh(t.emphasis,"edgeLabel")),(i=t.markPoint)&&(th(i),ah(i)),(n=t.markLine)&&(th(n),ah(n));var e=t.markArea;e&&ah(e);var i,n,a=t.data;if("graph"===t.type){a=a||t.nodes;var o=t.links||t.edges;if(o&&!V(o))for(var r=0;r<o.length;r++)ah(o[r]);E(t.categories,function(t){ih(t)})}if(a&&!V(a))for(r=0;r<a.length;r++)ah(a[r]);if((i=t.markPoint)&&i.data){var s=i.data;for(r=0;r<s.length;r++)ah(s[r])}if((n=t.markLine)&&n.data){var l=n.data;for(r=0;r<l.length;r++)k(l[r])?(ah(l[r][0]),ah(l[r][1])):ah(l[r])}"gauge"===t.type?(nh(t,"axisLabel"),nh(t,"title"),nh(t,"detail")):"treemap"===t.type?(eh(t.breadcrumb,"itemStyle"),E(t.levels,function(t){ih(t)})):"tree"===t.type&&ih(t.leaves)}}(t)});var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),$u(i,function(t){$u(oh(e[t]),function(t){t&&(nh(t,"axisLabel"),nh(t.axisPointer,"label"))})}),$u(oh(e.parallel),function(t){var e=t&&t.parallelAxisDefault;nh(e,"axisLabel"),nh(e&&e.axisPointer,"label")}),$u(oh(e.calendar),function(t){eh(t,"itemStyle"),nh(t,"dayLabel"),nh(t,"monthLabel"),nh(t,"yearLabel")}),$u(oh(e.radar),function(t){nh(t,"name")}),$u(oh(e.geo),function(t){Ju(t)&&(ah(t),$u(oh(t.regions),function(t){ah(t)}))}),$u(oh(e.timeline),function(t){ah(t),eh(t,"label"),eh(t,"itemStyle"),eh(t,"controlStyle",!0);var e=t.data;k(e)&&E(e,function(t){z(t)&&(eh(t,"label"),eh(t,"itemStyle"))})}),$u(oh(e.toolbox),function(t){eh(t,"iconStyle"),$u(t.feature,function(t){eh(t,"iconStyle")})}),nh(rh(e.axisPointer),"label"),nh(rh(e.tooltip).axisPointer,"label")}function lh(e){E(uh,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}var uh=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],hh=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],ch=function(i,t){sh(i,t),i.series=wa(i.series),E(i.series,function(t){if(z(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow);else if("pie"===e||"gauge"===e)null!=t.clockWise&&(t.clockwise=t.clockWise);else if("gauge"===e){var i=function(t,e){e=e.split(",");for(var i=t,n=0;n<e.length&&null!=(i=i&&i[e[n]]);n++);return i}(t,"pointer.color");null!=i&&function(t,e,i,n){e=e.split(",");for(var a,o=t,r=0;r<e.length-1;r++)null==o[a=e[r]]&&(o[a]={}),o=o[a];!n&&null!=o[e[r]]||(o[e[r]]=i)}(t,"itemStyle.color",i)}lh(t)}}),i.dataRange&&(i.visualMap=i.dataRange),E(hh,function(t){var e=i[t];e&&(k(e)||(e=[e]),E(e,function(t){lh(t)}))})};function dh(m){E(m,function(h,c){var d=[],f=[NaN,NaN],t=[h.stackResultDimension,h.stackedOverDimension],p=h.data,g=h.isStackedByIndex,e=p.map(t,function(t,e,i){var n,a,o=p.get(h.stackedDimension,i);if(isNaN(o))return f;g?a=p.getRawIndex(i):n=p.get(h.stackedByDimension,i);for(var r=NaN,s=c-1;0<=s;s--){var l=m[s];if(g||(a=l.data.rawIndexOf(l.stackedByDimension,n)),0<=a){var u=l.data.getByRawIndex(l.stackResultDimension,a);if(0<=o&&0<u||o<=0&&u<0){o+=u,r=u;break}}}return d[0]=o,d[1]=r,d});p.hostModel.setData(e),h.data=e})}function fh(t,e){Lu.isInstance(t)||(t=Lu.seriesDataToSource(t)),this._source=t;var i=this._data=t.data,n=t.sourceFormat;n===Tu&&(this._offset=0,this._dimSize=e,this._data=i),L(this,gh[n===Su?n+"_"+t.seriesLayoutBy:n])}var ph=fh.prototype;ph.pure=!1;var gh={arrayRows_column:{pure:ph.persistent=!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(t){return this._data[t+this._source.startIndex]},appendData:yh},arrayRows_row:{pure:!0,count:function(){var t=this._data[0];return t?Math.max(0,t.length-this._source.startIndex):0},getItem:function(t){t+=this._source.startIndex;for(var e=[],i=this._data,n=0;n<i.length;n++){var a=i[n];e.push(a?a[t]:null)}return e},appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},objectRows:{pure:!0,count:mh,getItem:vh,appendData:yh},keyedColumns:{pure:!0,count:function(){var t=this._source.dimensionsDefine[0].name,e=this._data[t];return e?e.length:0},getItem:function(t){for(var e=[],i=this._source.dimensionsDefine,n=0;n<i.length;n++){var a=this._data[i[n].name];e.push(a?a[t]:null)}return e},appendData:function(t){var a=this._data;E(t,function(t,e){for(var i=a[e]||(a[e]=[]),n=0;n<(t||[]).length;n++)i.push(t[n])})}},original:{count:mh,getItem:vh,appendData:yh},typedArray:{persistent:!(ph.getSource=function(){return this._source}),pure:!0,count:function(){return this._data?this._data.length/this._dimSize:0},getItem:function(t,e){t-=this._offset,e=e||[];for(var i=this._dimSize*t,n=0;n<this._dimSize;n++)e[n]=this._data[i+n];return e},appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}}};function mh(){return this._data.length}function vh(t){return this._data[t]}function yh(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}var xh={arrayRows:_h,objectRows:function(t,e,i,n){return null!=i?t[n]:t},keyedColumns:_h,original:function(t,e,i,n){var a=Ma(t);return null!=i&&a instanceof Array?a[i]:a},typedArray:_h};function _h(t,e,i,n){return null!=i?t[i]:t}var wh={arrayRows:bh,objectRows:function(t,e,i,n){return Sh(t[e],this._dimensionInfos[e])},keyedColumns:bh,original:function(t,e,i,n){var a=t&&(null==t.value?t:t.value);return!this._rawData.pure&&function(t){return ya(t)&&!(t instanceof Array)}(t)&&(this.hasItemOption=!0),Sh(a instanceof Array?a[n]:a,this._dimensionInfos[e])},typedArray:function(t,e,i,n){return t[n]}};function bh(t,e,i,n){return Sh(t[n],this._dimensionInfos[e])}function Sh(t,e){var i=e&&e.type;if("ordinal"!==i)return"time"===i&&"number"!=typeof t&&null!=t&&"-"!==t&&(t=+Ll(t)),null==t||""===t?NaN:+t;var n=e&&e.ordinalMeta;return n?n.parseAndCollect(t):t}function Mh(t,e,i){if(t){var n=t.getRawDataItem(e);if(null!=n){var a,o,r=t.getProvider().getSource().sourceFormat,s=t.getDimensionInfo(i);return s&&(a=s.name,o=s.index),xh[r](n,e,o,a)}}}function Ih(t,e,i){if(t){var n=t.getProvider().getSource().sourceFormat;if(n===bu||n===Mu){var a=t.getRawDataItem(e);return n!==bu||z(a)||(a=null),a?a[i]:void 0}}}var Ah=/\{@(.+?)\}/g,Th={getDataParams:function(t,e){var i=this.getData(e),n=this.getRawValue(t,e),a=i.getRawIndex(t),o=i.getName(t),r=i.getRawDataItem(t),s=i.getItemVisual(t,"color"),l=i.getItemVisual(t,"borderColor"),u=this.ecModel.getComponent("tooltip"),h=Ea(u&&u.get("renderMode")),c=this.mainType,d="series"===c,f=i.userOutput;return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:o,dataIndex:a,data:r,dataType:e,value:n,color:s,borderColor:l,dimensionNames:f?f.dimensionNames:null,encode:f?f.encode:null,marker:Yl({color:s,renderMode:h}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(n,t,e,i,a){t=t||"normal";var o=this.getData(e),r=o.getItemModel(n),s=this.getDataParams(n,e);null!=i&&s.value instanceof Array&&(s.value=s.value[i]);var l=r.get("normal"===t?[a||"label","formatter"]:[t,a||"label","formatter"]);return"function"==typeof l?(s.status=t,s.dimensionIndex=i,l(s)):"string"==typeof l?Ul(l,s).replace(Ah,function(t,e){var i=e.length;return"["===e.charAt(0)&&"]"===e.charAt(i-1)&&(e=+e.slice(1,i-1)),Mh(o,n,e)}):void 0},getRawValue:function(t,e){return Mh(this.getData(e),t)},formatTooltip:function(){}};function Dh(t){return new Ch(t)}function Ch(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0,this.context}var Lh=Ch.prototype;Lh.perform=function(t){var e,i=this._upstream,n=t&&t.skip;if(this._dirty&&i){var a=this.context;a.data=a.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(e=this._plan(this.context));var o,r=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return 1<=t||(t=1),t}r===l&&s===u||(e="reset"),!this._dirty&&"reset"!==e||(this._dirty=!1,o=function(t,e){var i,n;t._dueIndex=t._outputDueEnd=t._dueEnd=0,t._settedOutputEnd=null,!e&&t._reset&&((i=t._reset(t.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),k(i)&&!i.length&&(i=null));t._progress=i,t._modBy=t._modDataCount=null;var a=t._downstream;return a&&a.dirty(),n}(this,n)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(o||d<f)){var p=this._progress;if(k(p))for(var g=0;g<p.length;g++)Gh(this,p[g],d,f,l,u);else Gh(this,p,d,f,l,u)}this._dueIndex=f;var m=null!=this._settedOutputEnd?this._settedOutputEnd:f;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var kh,Ph,Nh,Oh,Eh,Rh,zh=Rh={reset:function(t,e,i,n){Ph=t,kh=e,Nh=i,Oh=n,Eh=Math.ceil(Oh/Nh),Rh.next=1<Nh&&0<Oh?Vh:Bh}};function Bh(){return Ph<kh?Ph++:null}function Vh(){var t=Ph%Eh*Nh+Math.ceil(Ph/Eh),e=kh<=Ph?null:t<Oh?t:Ph;return Ph++,e}function Gh(t,e,i,n,a,o){zh.reset(i,n,a,o),t._callingProgress=e,t._callingProgress({start:i,end:n,count:n-i,next:zh.next},t.context)}Lh.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},Lh.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},Lh.pipe=function(t){this._downstream===t&&!this._dirty||((this._downstream=t)._upstream=this,t.dirty())},Lh.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},Lh.getUpstream=function(){return this._upstream},Lh.getDownstream=function(){return this._downstream},Lh.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t};var Fh=La(),Wh=fu.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendDataProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(t,e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Dh({count:Zh,reset:Uh}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i),Pu(this);var a=this.getInitialData(t,i);Yh(a,this),this.dataTask.context.data=a,Fh(this).dataBeforeProcessed=a,Hh(this)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?su(t):{},a=this.subType;fu.hasClass(a)&&(a+="Series"),m(t,e.getTheme().get(this.subType)),m(t,this.getDefaultOption()),ba(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&ru(t,n,i)},mergeOption:function(t,e){t=m(this.option,t,!0),this.fillDataTextStyle(t.data);var i=this.layoutMode;i&&ru(this.option,t,i),Pu(this);var n=this.getInitialData(t,e);Yh(n,this),this.dataTask.dirty(),this.dataTask.context.data=n,Fh(this).dataBeforeProcessed=n,Hh(this)},fillDataTextStyle:function(t){if(t&&!V(t))for(var e=["show"],i=0;i<t.length;i++)t[i]&&t[i].label&&ba(t[i],"label",e)},getInitialData:function(){},appendData:function(t){this.getRawData().appendData(t.data)},getData:function(t){var e=qh(this);if(e){var i=e.context.data;return null==t?i:i.getLinkedData(t)}return Fh(this).data},setData:function(t){var e=qh(this);if(e){var i=e.context;i.data!==t&&e.modifyOutputEnd&&e.setOutputEnd(t.count()),i.outputData=t,e!==this.dataTask&&(i.data=t)}Fh(this).data=t},getSource:function(){return function(t){return ku(t).source}(this)},getRawData:function(){return Fh(this).dataBeforeProcessed},getBaseAxis:function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},formatTooltip:function(a,h,t,c){var d=this,e="html"===(c=c||"html")?"<br/>":"\n",f="richText"===c,p={},g=0;function i(t){return{renderMode:c,content:Wl(zl(t)),style:p}}var m=this.getData(),o=m.mapDimension("defaultedTooltip",!0),n=o.length,r=this.getRawValue(a),s=k(r),v=m.getItemVisual(a,"color");z(v)&&v.colorStops&&(v=(v.colorStops[0]||{}).color),v=v||"transparent";var l=(1<n||s&&!n?function(t){var l=S(t,function(t,e,i){var n=m.getDimensionInfo(i);return t|(n&&!1!==n.tooltip&&null!=n.displayName)},0),u=[];function e(t,e){var i=m.getDimensionInfo(e);if(i&&!1!==i.otherDims.tooltip){var n=i.type,a="sub"+d.seriesIndex+"at"+g,o=Yl({color:v,type:"subItem",renderMode:c,markerId:a}),r="string"==typeof o?o:o.content,s=(l?r+Wl(i.displayName||"-")+": ":"")+Wl("ordinal"===n?t+"":"time"===n?h?"":ql("yyyy/MM/dd hh:mm:ss",t):zl(t));s&&u.push(s),f&&(p[a]=v,++g)}}o.length?E(o,function(t){e(Mh(m,a,t),t)}):E(t,e);var i=l?f?"\n":"<br/>":"",n=i+u.join(i||", ");return{renderMode:c,content:n,style:p}}(r):i(n?Mh(m,a,o[0]):s?r[0]:r)).content,u=d.seriesIndex+"at"+g,y=Yl({color:v,type:"item",renderMode:c,markerId:u});p[u]=v,++g;var x=m.getName(a),_=this.name;Ta(this)||(_=""),_=_?Wl(_)+(h?": ":e):"";var w="string"==typeof y?y:y.content;return{html:h?w+_+l:_+w+(x?Wl(x)+": "+l:l),markers:p}},isAnimationEnabled:function(){if(v.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,a=yu.getColorFromPalette.call(this,t,e,i);return a=a||n.getColorFromPalette(t,e,i)},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function Hh(t){var e=t.name;Ta(t)||(t.name=function(t){var i=t.getRawData(),e=i.mapDimension("seriesName",!0),n=[];return E(e,function(t){var e=i.getDimensionInfo(t);e.displayName&&n.push(e.displayName)}),n.join(" ")}(t)||e)}function Zh(t){return t.model.getRawData().count()}function Uh(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),Xh}function Xh(t,e){t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Yh(e,i){E(e.CHANGABLE_METHODS,function(t){e.wrapMethod(t,A(jh,i))})}function jh(t){var e=qh(t);e&&e.setOutputEnd(this.count())}function qh(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(t.uid))}return n}}b(Wh,Th),b(Wh,yu);var Kh=function(){this.group=new Si,this.uid=ml("viewComponent")};Kh.prototype={constructor:Kh,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){},filterForExposedEvent:null};var $h=Kh.prototype;$h.updateView=$h.updateLayout=$h.updateVisual=function(t,e,i,n){},Ga(Kh),Ua(Kh,{registerWhenExtend:!0});function Jh(){var s=La();return function(t){var e=s(t),i=t.pipelineContext,n=e.large,a=e.progressiveRender,o=e.large=i.large,r=e.progressiveRender=i.progressiveRender;return!!(n^o||a^r)&&"reset"}}var Qh=La(),tc=Jh();function ec(){this.group=new Si,this.uid=ml("viewChart"),this.renderTask=Dh({plan:oc,reset:rc}),this.renderTask.context={view:this}}var ic=ec.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){ac(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){ac(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};function nc(t,e,i){if(t&&(t.trigger(e,i),t.isGroup&&!Rs(t)))for(var n=0,a=t.childCount();n<a;n++)nc(t.childAt(n),e,i)}function ac(e,t,i){var n=Ca(e,t),a=t&&null!=t.highlightKey?zs(t.highlightKey):null;null!=n?E(wa(n),function(t){nc(e.getItemGraphicEl(t),i,a)}):e.eachItemGraphicEl(function(t){nc(t,i,a)})}function oc(t){return tc(t.model)}function rc(t){var e=t.model,i=t.ecModel,n=t.api,a=t.payload,o=e.pipelineContext.progressiveRender,r=t.view,s=a&&Qh(a).updateMethod,l=o?"incrementalPrepareRender":s&&r[s]?s:"render";return"render"!==l&&r[l](e,i,n,a),sc[l]}ic.updateView=ic.updateLayout=ic.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},Ga(ec),Ua(ec,{registerWhenExtend:!0}),ec.markUpdateMethod=function(t,e){Qh(t).updateMethod=e};var sc={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)}}},lc="\0__throttleOriginMethod",uc="\0__throttleRate",hc="\0__throttleType";function cc(t,i,n){var a,o,r,s,l,u=0,h=0,c=null;function d(){h=(new Date).getTime(),c=null,t.apply(r,s||[])}i=i||0;function e(){a=(new Date).getTime(),r=this,s=arguments;var t=l||i,e=l||n;l=null,o=a-(e?u:h)-t,clearTimeout(c),e?c=setTimeout(d,t):0<=o?d():c=setTimeout(d,-o),u=a}return e.clear=function(){c&&(clearTimeout(c),c=null)},e.debounceNextCall=function(t){l=t},e}function dc(t,e,i,n){var a=t[e];if(a){var o=a[lc]||a,r=a[hc];if(a[uc]!==i||r!==n){if(null==i||!n)return t[e]=o;(a=t[e]=cc(o,i,"debounce"===n))[lc]=o,a[hc]=n,a[uc]=i}return a}}function fc(t,e){var i=t[e];i&&i[lc]&&(t[e]=i[lc])}var pc={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),o=(e.visualColorAccessPath||"itemStyle.color").split("."),n=e.get(o)||e.getColorFromPalette(e.name,null,t.getSeriesCount());i.setVisual("color",n);var r=(e.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),a=e.get(r);if(i.setVisual("borderColor",a),!t.isSeriesFiltered(e)){"function"!=typeof n||n instanceof jr||i.each(function(t){i.setItemVisual(t,"color",n(e.getDataParams(t)))});return{dataEach:i.hasItemOption?function(t,e){var i=t.getItemModel(e),n=i.get(o,!0),a=i.get(r,!0);null!=n&&t.setItemVisual(e,"color",n),null!=a&&t.setItemVisual(e,"borderColor",a)}:null}}}},gc={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:""}}}},mc=function(t,e){var o=e.getModel("aria");if(o.get("show"))if(o.get("description"))t.setAttribute("aria-label",o.get("description"));else{var h=0;e.eachSeries(function(t,e){++h},this);var i,c=o.get("data.maxCount")||10,n=o.get("series.maxCount")||10,d=Math.min(h,n);if(!(h<1)){var a=function(){var t=e.getModel("title").option;t&&t.length&&(t=t[0]);return t&&t.text}();i=a?p(g("general.withTitle"),{title:a}):g("general.withoutTitle");var f=[];i+=p(g(1<h?"series.multiple.prefix":"series.single.prefix"),{seriesCount:h}),e.eachSeries(function(t,e){if(e<d){var i,n=t.get("name"),a="series."+(1<h?"multiple":"single")+".";i=p(i=g(n?a+"withName":a+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:function(t){return gc.series.typeNames[t]||"自定义图"}(t.subType)});var o=t.getData();(window.data=o).count()>c?i+=p(g("data.partialData"),{displayCnt:c}):i+=g("data.allData");for(var r=[],s=0;s<o.count();s++)if(s<c){var l=o.getName(s),u=Mh(o,s);r.push(p(g(l?"data.withName":"data.withoutName"),{name:l,value:u}))}i+=r.join(g("data.separator.middle"))+g("data.separator.end"),f.push(i)}}),i+=f.join(g("series.multiple.separator.middle"))+g("series.multiple.separator.end"),t.setAttribute("aria-label",i)}}function p(t,e){if("string"!=typeof t)return t;var i=t;return E(e,function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),i}function g(t){var e=o.get(t);if(null!=e)return e;for(var i=t.split("."),n=gc.aria,a=0;a<i.length;++a)n=n[i[a]];return n}},vc=Math.PI;function yc(t,e,i,n){this.ecInstance=t,this.api=e,this.unfinished;i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=Q()}var xc=yc.prototype;function _c(l,t,u,h,c){var d;function f(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}c=c||{},E(t,function(n,t){if(!c.visualType||c.visualType===n.visualType){var e=l._stageTaskMap.get(n.uid),i=e.seriesTaskMap,a=e.overallTask;if(a){var o,r=a.agentStubMap;r.each(function(t){f(c,t)&&(t.dirty(),o=!0)}),o&&a.dirty(),wc(a,h);var s=l.getPerformArgs(a,c.block);r.each(function(t){t.perform(s)}),d|=a.perform(s)}else i&&i.each(function(t,e){f(c,t)&&t.dirty();var i=l.getPerformArgs(t,c.block);i.skip=!n.performRawSeries&&u.isSeriesFiltered(t.context.model),wc(t,h),d|=t.perform(i)})}}),l.unfinished|=d}xc.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(t){var e=t.overallTask;e&&e.dirty()})},xc.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,a=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex?i.step:null,o=n&&n.modDataCount;return{step:a,modBy:null!=o?Math.ceil(o/a):null,modDataCount:o}}},xc.getPipeline=function(t){return this._pipelineMap.get(t)},xc.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),a=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,o=t.get("large")&&n>=t.get("largeThreshold"),r="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:a,modDataCount:r,large:o}},xc.restorePipelines=function(t){var n=this,a=n._pipelineMap=Q();t.eachSeries(function(t){var e=t.getProgressive(),i=t.uid;a.set(i,{id:i,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),kc(n,t,t.dataTask)})},xc.prepareStageTasks=function(){var i=this._stageTaskMap,n=this.ecInstance.getModel(),a=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,[]);t.reset&&function(n,a,t,o,r){var s=t.seriesTaskMap||(t.seriesTaskMap=Q()),e=a.seriesType,i=a.getTargetSeries;a.createOnAllSeries?o.eachRawSeries(l):e?o.eachRawSeriesByType(e,l):i&&i(o,r).each(l);function l(t){var e=t.uid,i=s.get(e)||s.set(e,Dh({plan:Ac,reset:Tc,count:Lc}));i.context={model:t,ecModel:o,api:r,useClearVisual:a.isVisual&&!a.isLayout,plan:a.plan,reset:a.reset,scheduler:n},kc(n,t,i)}var u=n._pipelineMap;s.each(function(t,e){u.get(e)||(t.dispose(),s.removeKey(e))})}(this,t,e,n,a),t.overallReset&&function(n,t,e,i,a){var o=e.overallTask=e.overallTask||Dh({reset:bc});o.context={ecModel:i,api:a,overallReset:t.overallReset,scheduler:n};var r=o.agentStubMap=o.agentStubMap||Q(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?i.eachRawSeriesByType(s,c):l?l(i,a).each(c):(u=!1,E(i.getSeries(),c));function c(t){var e=t.uid,i=r.get(e);i||(i=r.set(e,Dh({reset:Sc,onDirty:Ic})),o.dirty()),i.context={model:t,overallProgress:u,modifyOutputEnd:h},i.agent=o,i.__block=u,kc(n,t,i)}var d=n._pipelineMap;r.each(function(t,e){d.get(e)||(t.dispose(),o.dirty(),r.removeKey(e))})}(this,t,e,n,a)},this)},xc.prepareView=function(t,e,i,n){var a=t.renderTask,o=a.context;o.model=e,o.ecModel=i,o.api=n,a.__block=!t.incrementalPrepareRender,kc(this,e,a)},xc.performDataProcessorTasks=function(t,e){_c(this,this._dataProcessorHandlers,t,e,{block:!0})},xc.performVisualTasks=function(t,e,i){_c(this,this._visualHandlers,t,e,i)},xc.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},xc.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)})};var wc=xc.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function bc(t){t.overallReset(t.ecModel,t.api,t.payload)}function Sc(t,e){return t.overallProgress&&Mc}function Mc(){this.agent.dirty(),this.getDownstream().dirty()}function Ic(){this.agent&&this.agent.dirty()}function Ac(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Tc(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=wa(t.reset(t.model,t.ecModel,t.api,t.payload));return 1<e.length?N(e,function(t,e){return Cc(e)}):Dc}var Dc=Cc(0);function Cc(o){return function(t,e){var i=e.data,n=e.resetDefines[o];if(n&&n.dataEach)for(var a=t.start;a<t.end;a++)n.dataEach(i,a);else n&&n.progress&&n.progress(t,i)}}function Lc(t){return t.data.count()}function kc(t,e,i){var n=e.uid,a=t._pipelineMap.get(n);a.head||(a.head=i),a.tail&&a.tail.pipe(i),(a.tail=i).__idxInPipeline=a.count++,i.__pipeline=a}yc.wrapStageHandler=function(t,e){return O(t)&&(t={overallReset:t,seriesType:function(t){Pc=null;try{t(Nc,Oc)}catch(t){}return Pc}(t)}),t.uid=ml("stageHandler"),e&&(t.visualType=e),t};var Pc,Nc={},Oc={};function Ec(t,e){for(var i in e.prototype)t[i]=et}Ec(Nc,zu),Ec(Oc,Fu),Nc.eachSeriesByType=Nc.eachRawSeriesByType=function(t){Pc=t},Nc.eachComponent=function(t){"series"===t.mainType&&t.subType&&(Pc=t.subType)};function Rc(){return{axisLine:{lineStyle:{color:Vc}},axisTick:{lineStyle:{color:Vc}},axisLabel:{textStyle:{color:Vc}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:Vc}}}}var zc=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],Bc={color:zc,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],zc]},Vc="#eee",Gc=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],Fc={color:Gc,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:Vc},crossStyle:{color:Vc}}},legend:{textStyle:{color:Vc}},textStyle:{color:Vc},title:{textStyle:{color:Vc}},toolbox:{iconStyle:{normal:{borderColor:Vc}}},dataZoom:{textStyle:{color:Vc}},visualMap:{textStyle:{color:Vc}},timeline:{lineStyle:{color:Vc},itemStyle:{normal:{color:Gc[1]}},label:{normal:{textStyle:{color:Vc}}},controlStyle:{normal:{color:Vc,borderColor:Vc}}},timeAxis:Rc(),logAxis:Rc(),valueAxis:Rc(),categoryAxis:Rc(),line:{symbol:"circle"},graph:{color:Gc},gauge:{title:{textStyle:{color:Vc}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};Fc.categoryAxis.splitLine.show=!1,fu.extend({type:"dataset",defaultOption:{seriesLayoutBy:Du,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){!function(t){var e=t.option.source,i=Au;if(V(e))i=Tu;else if(k(e)){0===e.length&&(i=Su);for(var n=0,a=e.length;n<a;n++){var o=e[n];if(null!=o){if(k(o)){i=Su;break}if(z(o)){i=Mu;break}}}}else if(z(e)){for(var r in e)if(e.hasOwnProperty(r)&&P(e[r])){i=Iu;break}}else if(null!=e)throw new Error("Invalid data");ku(t).sourceFormat=i}(this)}}),Kh.extend({type:"dataset"});var Wc=hr.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var i=e.cx,n=e.cy,a=e.rx,o=e.ry,r=.5522848*a,s=.5522848*o;t.moveTo(i-a,n),t.bezierCurveTo(i-a,n-s,i-r,n-o,i,n-o),t.bezierCurveTo(i+r,n-o,i+a,n-s,i+a,n),t.bezierCurveTo(i+a,n+s,i+r,n+o,i,n+o),t.bezierCurveTo(i-r,n+o,i-a,n+s,i-a,n),t.closePath()}}),Hc=/[\s,]+/;function Zc(t){R(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));for(9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}function Uc(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}Uc.prototype.parse=function(t,e){e=e||{};var i=Zc(t);if(!i)throw new Error("Illegal svg");var n=new Si;this._root=n;var a=i.getAttribute("viewBox")||"",o=parseFloat(i.getAttribute("width")||e.width),r=parseFloat(i.getAttribute("height")||e.height);isNaN(o)&&(o=null),isNaN(r)&&(r=null),$c(i,n,null,!0);for(var s,l,u=i.firstChild;u;)this._parseNode(u,n),u=u.nextSibling;if(a){var h=j(a).split(Hc);4<=h.length&&(s={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(s&&null!=o&&null!=r&&(l=id(s,o,r),!e.ignoreViewBox)){var c=n;(n=new Si).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return e.ignoreRootClip||null==o||null==r||n.setClipPath(new Hr({shape:{x:0,y:0,width:o,height:r}})),{root:n,width:o,height:r,viewBoxRect:s,viewBoxTransform:l}},Uc.prototype._parseNode=function(t,e){var i,n,a=t.nodeName.toLowerCase();if("defs"===a?this._isDefine=!0:"text"===a&&(this._isText=!0),this._isDefine){if(n=Yc[a]){var o=n.call(this,t),r=t.getAttribute("id");r&&(this._defs[r]=o)}}else(n=Xc[a])&&(i=n.call(this,t,e),e.add(i));for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===a?this._isDefine=!1:"text"===a&&(this._isText=!1)},Uc.prototype._parseText=function(t,e){if(1===t.nodeType){var i=t.getAttribute("dx")||0,n=t.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var a=new Dr({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});jc(e,a),$c(t,a,this._defs);var o=a.style.fontSize;o&&o<9&&(a.style.fontSize=9,a.scale=a.scale||[1,1],a.scale[0]*=o/9,a.scale[1]*=o/9);var r=a.getBoundingRect();return this._textX+=r.width,e.add(a),a};var Xc={g:function(t,e){var i=new Si;return jc(e,i),$c(t,i,this._defs),i},rect:function(t,e){var i=new Hr;return jc(e,i),$c(t,i,this._defs),i.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)}),i},circle:function(t,e){var i=new Lr;return jc(e,i),$c(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),i},line:function(t,e){var i=new Ur;return jc(e,i),$c(t,i,this._defs),i.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)}),i},ellipse:function(t,e){var i=new Wc;return jc(e,i),$c(t,i,this._defs),i.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)}),i},polygon:function(t,e){var i=t.getAttribute("points");i=i&&qc(i);var n=new Rr({shape:{points:i||[]}});return jc(e,n),$c(t,n,this._defs),n},polyline:function(t,e){var i=new hr;jc(e,i),$c(t,i,this._defs);var n=t.getAttribute("points");return n=n&&qc(n),new zr({shape:{points:n||[]}})},image:function(t,e){var i=new Yn;return jc(e,i),$c(t,i,this._defs),i.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),i},text:function(t,e){var i=t.getAttribute("x")||0,n=t.getAttribute("y")||0,a=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(o);var r=new Si;return jc(e,r),$c(t,r,this._defs),r},tspan:function(t,e){var i=t.getAttribute("x"),n=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var a=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0,r=new Si;return jc(e,r),$c(t,r,this._defs),this._textX+=a,this._textY+=o,r},path:function(t,e){var i=Tr(t.getAttribute("d")||"");return jc(e,i),$c(t,i,this._defs),i}},Yc={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),i=parseInt(t.getAttribute("y1")||0,10),n=parseInt(t.getAttribute("x2")||10,10),a=parseInt(t.getAttribute("y2")||0,10),o=new Jr(e,i,n,a);return function(t,e){var i=t.firstChild;for(;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=0<n.indexOf("%")?parseInt(n,10)/100:n?parseFloat(n):0;var a=i.getAttribute("stop-color")||"#000000";e.addColorStop(n,a)}i=i.nextSibling}}(t,o),o},radialgradient:function(t){}};function jc(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),C(e.__inheritedStyle,t.__inheritedStyle))}function qc(t){for(var e=j(t).split(Hc),i=[],n=0;n<e.length;n+=2){var a=parseFloat(e[n]),o=parseFloat(e[n+1]);i.push([a,o])}return i}var Kc={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"};function $c(t,e,i,n){var a=e.__inheritedStyle||{},o="text"===e.type;if(1===t.nodeType&&(function(t,e){var i=t.getAttribute("transform");if(i){i=i.replace(/,/g," ");var n=null,a=[];i.replace(td,function(t,e,i){a.push(e,i)});for(var o=a.length-1;0<o;o-=2){var r=a[o],s=a[o-1];switch(n=n||Qt(),s){case"translate":r=j(r).split(Hc),ne(n,n,[parseFloat(r[0]),parseFloat(r[1]||0)]);break;case"scale":r=j(r).split(Hc),oe(n,n,[parseFloat(r[0]),parseFloat(r[1]||r[0])]);break;case"rotate":r=j(r).split(Hc),ae(n,n,parseFloat(r[0]));break;case"skew":r=j(r).split(Hc),console.warn("Skew transform is not supported yet");break;case"matrix":r=j(r).split(Hc);n[0]=parseFloat(r[0]),n[1]=parseFloat(r[1]),n[2]=parseFloat(r[2]),n[3]=parseFloat(r[3]),n[4]=parseFloat(r[4]),n[5]=parseFloat(r[5])}}e.setLocalTransform(n)}}(t,e),L(a,function(t){var e=t.getAttribute("style"),i={};if(!e)return i;var n,a={};ed.lastIndex=0;for(;null!=(n=ed.exec(e));)a[n[1]]=n[2];for(var o in Kc)Kc.hasOwnProperty(o)&&null!=a[o]&&(i[Kc[o]]=a[o]);return i}(t)),!n))for(var r in Kc)if(Kc.hasOwnProperty(r)){var s=t.getAttribute(r);null!=s&&(a[Kc[r]]=s)}var l=o?"textFill":"fill",u=o?"textStroke":"stroke";e.style=e.style||new Vi;var h=e.style;null!=a.fill&&h.set(l,Qc(a.fill,i)),null!=a.stroke&&h.set(u,Qc(a.stroke,i)),E(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(t){var e="lineWidth"===t&&o?"textStrokeWidth":t;null!=a[t]&&h.set(e,parseFloat(a[t]))}),a.textBaseline&&"auto"!==a.textBaseline||(a.textBaseline="alphabetic"),"alphabetic"===a.textBaseline&&(a.textBaseline="bottom"),"start"===a.textAlign&&(a.textAlign="left"),"end"===a.textAlign&&(a.textAlign="right"),E(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],function(t){null!=a[t]&&h.set(t,a[t])}),a.lineDash&&(e.style.lineDash=j(a.lineDash).split(Hc)),h[u]&&"none"!==h[u]&&(e[u]=!0),e.__inheritedStyle=a}var Jc=/url\(\s*#(.*?)\)/;function Qc(t,e){var i=e&&t&&t.match(Jc);return i?e[j(i[1])]:t}var td=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var ed=/([^\s:;]+)\s*:\s*([^:;]+)/g;function id(t,e,i){var n=e/t.width,a=i/t.height,o=Math.min(n,a);return{scale:[o,o],position:[-(t.x+t.width/2)*o+e/2,-(t.y+t.height/2)*o+i/2]}}var nd=Q(),ad={registerMap:function(t,e,i){var n;return E(n=k(e)?e:e.svg?[{type:"svg",source:e.svg,specialAreas:e.specialAreas}]:(e.geoJson&&!e.features&&(i=e.specialAreas,e=e.geoJson),[{type:"geoJSON",source:e,specialAreas:i}]),function(t){var e=t.type;"geoJson"===e&&(e=t.type="geoJSON"),(0,od[e])(t)}),nd.set(t,n)},retrieveMap:function(t){return nd.get(t)}},od={geoJSON:function(t){var e=t.source;t.geoJSON=R(e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")():e},svg:function(t){t.svgXML=Zc(t.source)}},rd=Y,sd=E,ld=O,ud=z,hd=fu.parseClassType,cd={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:3500,COMPONENT:4e3,BRUSH:5e3}},dd="__flagInMainProcess",fd="__optionUpdated",pd=/^[a-zA-Z0-9_]+$/;function gd(n,a){return function(t,e,i){!a&&this._disposed||(t=t&&t.toLowerCase(),Ct.prototype[n].call(this,t,e,i))}}function md(){Ct.call(this)}function vd(t,e,i){i=i||{},"string"==typeof e&&(e=Fd[e]),this.id,this.group,this._dom=t;var n=this._zr=fa(t,{renderer:i.renderer||"canvas",devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height});this._throttledZrFlush=cc(T(n.flush,n),17),(e=D(e))&&ch(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Hu;var a=this._api=function(i){var t=i._coordSysMgr;return L(new Fu(i),{getCoordinateSystems:T(t.getCoordinateSystems,t),getComponentByElement:function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return i._model.getComponent(e.mainType,e.index);t=t.parent}}})}(this);function o(t,e){return t.__prio-e.__prio}ki(Gd,o),ki(zd,o),this._scheduler=new yc(this,a,zd,Gd),Ct.call(this,this._ecEventProcessor=new Od),this._messageCenter=new md,this._initEvents(),this.resize=T(this.resize,this),this._pendingActions=[],n.animation.on("frame",this._onframe,this),function(t,e){t.on("rendered",function(){e.trigger("rendered"),!t.animation.isFinished()||e[fd]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")})}(n,this),K(this)}md.prototype.on=gd("on",!0),md.prototype.off=gd("off",!0),md.prototype.one=gd("one",!0),b(md,Ct);var yd=vd.prototype;function xd(t,e,i){if(!this._disposed){var n,a=this._model,o=this._coordSysMgr.getCoordinateSystems();e=Pa(a,e);for(var r=0;r<o.length;r++){var s=o[r];if(s[t]&&null!=(n=s[t](a,e,i)))return n}}}yd._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[fd]){var e=this[fd].silent;this[dd]=!0,wd(this),_d.update.call(this),this[dd]=!1,this[fd]=!1,Id.call(this,e),Ad.call(this,e)}else if(t.unfinished){var i=1,n=this._model,a=this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(n),t.performDataProcessorTasks(n),Sd(this,n),t.performVisualTasks(n),Ld(this,this._model,a,"remain"),i-=+new Date-o}while(0<i&&t.unfinished);t.unfinished||this._zr.flush()}}},yd.getDom=function(){return this._dom},yd.getZr=function(){return this._zr},yd.setOption=function(t,e,i){if(!this._disposed){var n;if(ud(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[dd]=!0,!this._model||e){var a=new qu(this._api),o=this._theme,r=this._model=new zu;r.scheduler=this._scheduler,r.init(null,null,o,a)}this._model.setOption(t,Bd),i?(this[fd]={silent:n},this[dd]=!1):(wd(this),_d.update.call(this),this._zr.flush(),this[fd]=!1,this[dd]=!1,Id.call(this,n),Ad.call(this,n))}},yd.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},yd.getModel=function(){return this._model},yd.getOption=function(){return this._model&&this._model.getOption()},yd.getWidth=function(){return this._zr.getWidth()},yd.getHeight=function(){return this._zr.getHeight()},yd.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},yd.getRenderedCanvas=function(t){if(v.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},yd.getSvgDataUrl=function(){if(v.svgSupported){var t=this._zr;return E(t.storage.getDisplayList(),function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},yd.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,i=this._model,n=[],a=this;sd(e,function(t){i.eachComponent({mainType:t},function(t){var e=a._componentsMap[t.__viewId];e.group.ignore||(n.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 sd(n,function(t){t.group.ignore=!1}),o}},yd.getConnectedDataURL=function(a){if(!this._disposed&&v.canvasSupported){var o=this.group,r=Math.min,s=Math.max;if(Zd[o]){var l=1/0,u=1/0,h=-1/0,c=-1/0,d=[],i=a&&a.pixelRatio||1;E(Hd,function(t,e){if(t.group===o){var i=t.getRenderedCanvas(D(a)),n=t.getDom().getBoundingClientRect();l=r(n.left,l),u=r(n.top,u),h=s(n.right,h),c=s(n.bottom,c),d.push({dom:i,left:n.left,top:n.top})}});var t=(h*=i)-(l*=i),e=(c*=i)-(u*=i),n=g();n.width=t,n.height=e;var f=fa(n);return a.connectedBackgroundColor&&f.add(new Hr({shape:{x:0,y:0,width:t,height:e},style:{fill:a.connectedBackgroundColor}})),sd(d,function(t){var e=new Yn({style:{x:t.left*i-l,y:t.top*i-u,image:t.dom}});f.add(e)}),f.refreshImmediately(),n.toDataURL("image/"+(a&&a.type||"png"))}return this.getDataURL(a)}},yd.convertToPixel=A(xd,"convertToPixel"),yd.convertFromPixel=A(xd,"convertFromPixel"),yd.containPixel=function(t,a){var o;if(!this._disposed)return E(t=Pa(this._model,t),function(t,n){0<=n.indexOf("Models")&&E(t,function(t){var e=t.coordinateSystem;if(e&&e.containPoint)o|=!!e.containPoint(a);else if("seriesModels"===n){var i=this._chartsMap[t.__viewId];i&&i.containPoint&&(o|=i.containPoint(a,t))}},this)},this),!!o},yd.getVisual=function(t,e){var i=(t=Pa(this._model,t,{defaultMainType:"series"})).seriesModel.getData(),n=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=n?i.getItemVisual(n,e):i.getVisual(e)},yd.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},yd.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var _d={prepareAndUpdate:function(t){wd(this),_d.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,a=this._coordSysMgr,o=this._scheduler;if(e){o.restoreData(e,t),o.performSeriesTasks(e),a.create(e,i),o.performDataProcessorTasks(e,t),Sd(this,e),a.update(e,i),Dd(e),o.performVisualTasks(e,t),Cd(this,e,i,t);var r=e.get("backgroundColor")||"transparent";if(v.canvasSupported)n.setBackgroundColor(r);else{var s=Ee(r);r=Ue(s,"rgb"),0===s[3]&&(r="transparent")}kd(e,i)}},updateTransform:function(a){var o=this._model,r=this,s=this._api;if(o){var l=[];o.eachComponent(function(t,e){var i=r.getViewOfComponentModel(e);if(i&&i.__alive)if(i.updateTransform){var n=i.updateTransform(e,o,s,a);n&&n.update&&l.push(i)}else l.push(i)});var n=Q();o.eachSeries(function(t){var e=r._chartsMap[t.__viewId];if(e.updateTransform){var i=e.updateTransform(t,o,s,a);i&&i.update&&n.set(t.uid,1)}else n.set(t.uid,1)}),Dd(o),this._scheduler.performVisualTasks(o,a,{setDirty:!0,dirtyMap:n}),Ld(r,o,s,a,n),kd(o,this._api)}},updateView:function(t){var e=this._model;e&&(ec.markUpdateMethod(t,"updateView"),Dd(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),Cd(this,this._model,this._api,t),kd(e,this._api))},updateVisual:function(t){_d.update.call(this,t)},updateLayout:function(t){_d.update.call(this,t)}};function wd(t){var e=t._model,i=t._scheduler;i.restorePipelines(e),i.prepareStageTasks(),Td(t,"component",e,i),Td(t,"chart",e,i),i.plan()}function bd(e,i,n,a,t){var o=e._model;if(a){var r={};r[a+"Id"]=n[a+"Id"],r[a+"Index"]=n[a+"Index"],r[a+"Name"]=n[a+"Name"];var s={mainType:a,query:r};t&&(s.subType=t);var l=n.excludeSeriesId;null!=l&&(l=Q(wa(l))),o&&o.eachComponent(s,function(t){l&&null!=l.get(t.id)||u(e["series"===a?"_chartsMap":"_componentsMap"][t.__viewId])},e)}else sd(e._componentsViews.concat(e._chartsViews),u);function u(t){t&&t.__alive&&t[i]&&t[i](t.__model,o,e._api,n)}}function Sd(t,e){var i=t._chartsMap,n=t._scheduler;e.eachSeries(function(t){n.updateStreamModes(t,i[t.__viewId])})}function Md(e,t){var i=e.type,n=e.escapeConnect,a=Ed[i],o=a.actionInfo,r=(o.update||"update").split(":"),s=r.pop();r=null!=r[0]&&hd(r[0]),this[dd]=!0;var l=[e],u=!1;e.batch&&(u=!0,l=N(e.batch,function(t){return(t=C(L({},t),e)).batch=null,t}));var h,c=[],d="highlight"===i||"downplay"===i;sd(l,function(t){(h=(h=a.action(t,this._model,this._api))||L({},t)).type=o.event||h.type,c.push(h),d?bd(this,s,t,"series"):r&&bd(this,s,t,r.main,r.sub)},this),"none"===s||d||r||(this[fd]?(wd(this),_d.update.call(this,e),this[fd]=!1):_d[s].call(this,e)),h=u?{type:o.event||i,escapeConnect:n,batch:c}:c[0],this[dd]=!1,t||this._messageCenter.trigger(h.type,h)}function Id(t){for(var e=this._pendingActions;e.length;){var i=e.shift();Md.call(this,i,t)}}function Ad(t){t||this.trigger("updated")}function Td(t,e,a,o){for(var r="component"===e,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,i=0;i<s.length;i++)s[i].__alive=!1;function n(t){var e="_ec_"+t.id+"_"+t.type,i=l[e];if(!i){var n=hd(t.type);(i=new(r?Kh.getClass(n.main,n.sub):ec.getClass(n.sub))).init(a,h),l[e]=i,s.push(i),u.add(i.group)}t.__viewId=i.__id=e,i.__alive=!0,i.__model=t,i.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},r||o.prepareView(i,t,a,h)}r?a.eachComponent(function(t,e){"series"!==t&&n(e)}):a.eachSeries(n);for(i=0;i<s.length;){var c=s[i];c.__alive?i++:(r||c.renderTask.dispose(),u.remove(c.group),c.dispose(a,h),s.splice(i,1),delete l[c.__id],c.__id=c.group.__ecComponentInfo=null)}}function Dd(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function Cd(t,e,i,n){!function(t,i,n,a,e){sd(e||t._componentsViews,function(t){var e=t.__model;t.render(e,i,n,a),Nd(e,t)})}(t,e,i,n),sd(t._chartsViews,function(t){t.__alive=!1}),Ld(t,e,i,n),sd(t._chartsViews,function(t){t.__alive||t.remove(e,i)})}function Ld(n,t,e,a,o){var r,s=n._scheduler;t.eachSeries(function(t){var e=n._chartsMap[t.__viewId];e.__alive=!0;var i=e.renderTask;s.updatePayload(i,a),o&&o.get(t.uid)&&i.dirty(),r|=i.perform(s.getPerformArgs(i)),e.group.silent=!!t.get("silent"),Nd(t,e),function(t,e){var i=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.style.blend!==i&&t.setStyle("blend",i),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",i)})})}(t,e)}),s.unfinished|=r,function(i,t){var e=i._zr.storage,n=0;e.traverse(function(t){n++}),n>t.get("hoverLayerThreshold")&&!v.node&&t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var e=i._chartsMap[t.__viewId];e.__alive&&e.group.traverse(function(t){t.useHoverLayer=!0})}})}(n,t),mc(n._zr.dom,t)}function kd(e,i){sd(Vd,function(t){t(e,i)})}yd.resize=function(t){if(!this._disposed){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[dd]=!0,i&&wd(this),_d.update.call(this),this[dd]=!1,Id.call(this,n),Ad.call(this,n)}}},yd.showLoading=function(t,e){if(!this._disposed&&(ud(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Wd[t])){var i=Wd[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},yd.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},yd.makeActionFromEvent=function(t){var e=L({},t);return e.type=Rd[t.type],e},yd.dispatchAction=function(t,e){this._disposed||(ud(e)||(e={silent:!!e}),Ed[t.type]&&this._model&&(this[dd]?this._pendingActions.push(t):(Md.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&v.browser.weChat&&this._throttledZrFlush(),Id.call(this,e.silent),Ad.call(this,e.silent))))},yd.appendData=function(t){if(!this._disposed){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0}},yd.on=gd("on",!1),yd.off=gd("off",!1),yd.one=gd("one",!1);var Pd=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Nd(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function Od(){this.eventInfo}yd._initEvents=function(){sd(Pd,function(u){function t(t){var e,i=this.getModel(),n=t.target;if("globalout"===u)e={};else if(n&&null!=n.dataIndex){var a=n.dataModel||i.getSeriesByIndex(n.seriesIndex);e=a&&a.getDataParams(n.dataIndex,n.dataType,n)||{}}else n&&n.eventData&&(e=L({},n.eventData));if(e){var o=e.componentType,r=e.componentIndex;"markLine"!==o&&"markPoint"!==o&&"markArea"!==o||(o="series",r=e.seriesIndex);var s=o&&null!=r&&i.getComponent(o,r),l=s&&this["series"===s.mainType?"_chartsMap":"_componentsMap"][s.__viewId];e.event=t,e.type=u,this._ecEventProcessor.eventInfo={targetEl:n,packedEvent:e,model:s,view:l},this.trigger(u,e)}}t.zrEventfulCallAtLast=!0,this._zr.on(u,t,this)},this),sd(Rd,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},yd.isDisposed=function(){return this._disposed},yd.clear=function(){this._disposed||this.setOption({series:[]},!0)},yd.dispose=function(){if(!this._disposed){this._disposed=!0,Oa(this.getDom(),Yd,"");var e=this._api,i=this._model;sd(this._componentsViews,function(t){t.dispose(i,e)}),sd(this._chartsViews,function(t){t.dispose(i,e)}),this._zr.dispose(),delete Hd[this.id]}},b(vd,Ct),Od.prototype={constructor:Od,normalizeQuery:function(t){var s={},l={},u={};if(R(t)){var e=hd(t);s.mainType=e.main||null,s.subType=e.sub||null}else{var h=["Index","Name","Id"],c={name:1,dataIndex:1,dataType:1};E(t,function(t,e){for(var i=!1,n=0;n<h.length;n++){var a=h[n],o=e.lastIndexOf(a);if(0<o&&o===e.length-a.length){var r=e.slice(0,o);"data"!==r&&(s.mainType=r,s[a.toLowerCase()]=t,i=!0)}}c.hasOwnProperty(e)&&(l[e]=t,i=!0),i||(u[e]=t)})}return{cptQuery:s,dataQuery:l,otherQuery:u}},filter:function(t,e,i){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,o=n.packedEvent,r=n.model,s=n.view;if(!r||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return h(l,r,"mainType")&&h(l,r,"subType")&&h(l,r,"index","componentIndex")&&h(l,r,"name")&&h(l,r,"id")&&h(u,o,"name")&&h(u,o,"dataIndex")&&h(u,o,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,a,o));function h(t,e,i,n){return null==t[i]||e[n||i]===t[i]}},afterTrigger:function(){this.eventInfo=null}};var Ed={},Rd={},zd=[],Bd=[],Vd=[],Gd=[],Fd={},Wd={},Hd={},Zd={},Ud=new Date-0,Xd=new Date-0,Yd="_echarts_instance_";function jd(t){Zd[t]=!1}var qd=jd;function Kd(t){return Hd[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,Yd)]}function $d(t,e){Fd[t]=e}function Jd(t){Bd.push(t)}function Qd(t,e){of(zd,t,e,1e3)}function tf(t,e,i){"function"==typeof e&&(i=e,e="");var n=ud(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,rd(pd.test(n)&&pd.test(e)),Ed[n]||(Ed[n]={action:i,actionInfo:t}),Rd[e]=n}function ef(t,e){Hu.register(t,e)}function nf(t,e){of(Gd,t,e,1e3,"layout")}function af(t,e){of(Gd,t,e,3e3,"visual")}function of(t,e,i,n,a){(ld(e)||ud(e))&&(i=e,e=n);var o=yc.wrapStageHandler(i,a);return o.__prio=e,o.__raw=i,t.push(o),o}function rf(t,e){Wd[t]=e}function sf(t){return fu.extend(t)}function lf(t){return Kh.extend(t)}function uf(t){return Wh.extend(t)}function hf(t){return ec.extend(t)}af(2e3,pc),Jd(ch),Qd(900,function(t){var o=Q();t.eachSeries(function(t){var e=t.get("stack");if(e){var i=o.get(e)||o.set(e,[]),n=t.getData(),a={stackResultDimension:n.getCalculationInfo("stackResultDimension"),stackedOverDimension:n.getCalculationInfo("stackedOverDimension"),stackedDimension:n.getCalculationInfo("stackedDimension"),stackedByDimension:n.getCalculationInfo("stackedByDimension"),isStackedByIndex:n.getCalculationInfo("isStackedByIndex"),data:n,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;i.length&&n.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(a)}}),o.each(dh)}),rf("default",function(n,t){C(t=t||{},{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var a=new Hr({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4}),o=new Kr({shape:{startAngle:-vc/2,endAngle:-vc/2+.1,r:10},style:{stroke:t.color,lineCap:"round",lineWidth:5},zlevel:t.zlevel,z:10001}),r=new Hr({style:{fill:"none",text:t.text,textPosition:"right",textDistance:10,textFill:t.textColor},zlevel:t.zlevel,z:10001});o.animateShape(!0).when(1e3,{endAngle:3*vc/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*vc/2}).delay(300).start("circularInOut");var e=new Si;return e.add(o),e.add(r),e.add(a),e.resize=function(){var t=n.getWidth()/2,e=n.getHeight()/2;o.setShape({cx:t,cy:e});var i=o.shape.r;r.setShape({x:t-i,y:e-i,width:2*i,height:2*i}),a.setShape({x:0,y:0,width:n.getWidth(),height:n.getHeight()})},e.resize(),e}),tf({type:"highlight",event:"highlight",update:"highlight"},et),tf({type:"downplay",event:"downplay",update:"downplay"},et),$d("light",Bc),$d("dark",Fc);function cf(t){return t}function df(t,e,i,n,a){this._old=t,this._new=e,this._oldKeyGetter=i||cf,this._newKeyGetter=n||cf,this.context=a}function ff(t,e,i,n,a){for(var o=0;o<t.length;o++){var r="_ec_"+a[n](t[o],o),s=e[r];null==s?(i.push(r),e[r]=o):(s.length||(e[r]=s=[s]),s.push(o))}}df.prototype={constructor:df,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t=this._old,e=this._new,i={},n=[],a=[];for(ff(t,{},n,"_oldKeyGetter",this),ff(e,i,a,"_newKeyGetter",this),o=0;o<t.length;o++){if(null!=(s=i[r=n[o]]))(u=s.length)?(1===u&&(i[r]=null),s=s.shift()):i[r]=null,this._update&&this._update(s,o);else this._remove&&this._remove(o)}for(var o=0;o<a.length;o++){var r=a[o];if(i.hasOwnProperty(r)){var s;if(null==(s=i[r]))continue;if(s.length)for(var l=0,u=s.length;l<u;l++)this._add&&this._add(s[l]);else this._add&&this._add(s)}}}};var pf=Q(["tooltip","label","itemName","itemId","seriesName"]);function gf(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function mf(t){return"category"===t?"ordinal":"time"===t?"time":"float"}var vf=z,yf="undefined",xf={float:typeof Float64Array==yf?Array:Float64Array,int:typeof Int32Array==yf?Array:Int32Array,ordinal:Array,number:Array,time:Array},_f=typeof Uint32Array==yf?Array:Uint32Array,wf=typeof Int32Array==yf?Array:Int32Array,bf=typeof Uint16Array==yf?Array:Uint16Array;function Sf(t){return 65535<t._rawCount?_f:bf}var Mf=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],If=["_extent","_approximateExtent","_rawExtent"];function Af(e,i){E(Mf.concat(i.__wrappedMethods||[]),function(t){i.hasOwnProperty(t)&&(e[t]=i[t])}),e.__wrappedMethods=i.__wrappedMethods,E(If,function(t){e[t]=D(i[t])}),e._calculationInfo=L(i._calculationInfo)}var Tf=function(t,e){t=t||["x","y"];for(var i={},n=[],a={},o=0;o<t.length;o++){var r=t[o];R(r)&&(r={name:r});var s=r.name;r.type=r.type||"float",r.coordDim||(r.coordDim=s,r.coordDimIndex=0),r.otherDims=r.otherDims||{},n.push(s),(i[s]=r).index=o,r.createInvertedIndices&&(a[s]=[])}this.dimensions=n,this._dimensionInfos=i,this.hostModel=e,this.dataType,this._indices=null,this._count=0,this._rawCount=0,this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this._visual={},this._layout={},this._itemVisuals=[],this.hasItemVisual={},this._itemLayouts=[],this._graphicEls=[],this._chunkSize=1e5,this._chunkCount=0,this._rawData,this._rawExtent={},this._extent={},this._approximateExtent={},this._dimensionsSummary=function(n){var t={},o=t.encode={},r=Q(),s=[],l=[],u=t.userOutput={dimensionNames:n.dimensions.slice(),encode:{}};E(n.dimensions,function(t){var a=n.getDimensionInfo(t),e=a.coordDim;if(e){var i=a.coordDimIndex;gf(o,e)[i]=t,a.isExtraCoord||(r.set(e,1),function(t){return!("ordinal"===t||"time"===t)}(a.type)&&(s[0]=t),gf(u.encode,e)[i]=a.index),a.defaultTooltip&&l.push(t)}pf.each(function(t,e){var i=gf(o,e),n=a.otherDims[e];null!=n&&!1!==n&&(i[n]=a.name)})});var a=[],h={};r.each(function(t,e){var i=o[e];h[e]=i[0],a=a.concat(i)}),t.dataDimsOnCoord=a,t.encodeFirstDimNotExtra=h;var e=o.label;e&&e.length&&(s=e.slice());var i=o.tooltip;return i&&i.length?l=i.slice():l.length||(l=s.slice()),o.defaultedLabel=s,o.defaultedTooltip=l,t}(this),this._invertedIndicesMap=a,this._calculationInfo={},this.userOutput=this._dimensionsSummary.userOutput},Df=Tf.prototype;function Cf(t,e,i,n,a){var o=xf[e.type],r=n-1,s=e.name,l=t[s][r];if(l&&l.length<i){for(var u=new o(Math.min(a-r*i,i)),h=0;h<l.length;h++)u[h]=l[h];t[s][r]=u}for(var c=n*i;c<a;c+=i)t[s].push(new o(Math.min(a-c,i)))}function Lf(a){var o=a._invertedIndicesMap;E(o,function(t,e){var i=a._dimensionInfos[e].ordinalMeta;if(i){t=o[e]=new wf(i.categories.length);for(var n=0;n<t.length;n++)t[n]=-1;for(n=0;n<a._count;n++)t[a.get(e,n)]=n}})}function kf(t,e,i){var n;if(null!=e){var a=t._chunkSize,o=Math.floor(i/a),r=i%a,s=t.dimensions[e],l=t._storage[s][o];if(l){n=l[r];var u=t._dimensionInfos[s].ordinalMeta;u&&u.categories.length&&(n=u.categories[n])}}return n}function Pf(t){return t}function Nf(t){return t<this._count&&0<=t?this._indices[t]:-1}function Of(t,e){var i=t._idList[e];return null==i&&(i=kf(t,t._idDimIdx,e)),null==i&&(i="e\0\0"+e),i}function Ef(t){return k(t)||(t=[t]),t}function Rf(t,e){var i=t.dimensions,n=new Tf(N(i,t.getDimensionInfo,t),t.hostModel);Af(n,t);for(var a=n._storage={},o=t._storage,r=0;r<i.length;r++){var s=i[r];o[s]&&(0<=_(e,s)?(a[s]=zf(o[s]),n._rawExtent[s]=Bf(),n._extent[s]=null):a[s]=o[s])}return n}function zf(t){for(var e,i,n=new Array(t.length),a=0;a<t.length;a++)n[a]=(e=t[a],i=void 0,(i=e.constructor)===Array?e.slice():new i(e));return n}function Bf(){return[1/0,-1/0]}Df.type="list",Df.hasItemOption=!0,Df.getDimension=function(t){return"number"!=typeof t&&(isNaN(t)||this._dimensionInfos.hasOwnProperty(t))||(t=this.dimensions[t]),t},Df.getDimensionInfo=function(t){return this._dimensionInfos[this.getDimension(t)]},Df.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},Df.mapDimension=function(t,e){var i=this._dimensionsSummary;if(null==e)return i.encodeFirstDimNotExtra[t];var n=i.encode[t];return!0===e?(n||[]).slice():n&&n[e]},Df.initData=function(t,e,i){(Lu.isInstance(t)||P(t))&&(t=new fh(t,this.dimensions.length)),this._rawData=t,this._storage={},this._indices=null,this._nameList=e||[],this._idList=[],this._nameRepeatCount={},i||(this.hasItemOption=!1),this.defaultDimValueGetter=wh[this._rawData.getSource().sourceFormat],this._dimValueGetter=i=i||this.defaultDimValueGetter,this._dimValueGetterArrayRows=wh.arrayRows,this._rawExtent={},this._initDataFromProvider(0,t.count()),t.pure&&(this.hasItemOption=!1)},Df.getProvider=function(){return this._rawData},Df.appendData=function(t){var e=this._rawData,i=this.count();e.appendData(t);var n=e.count();e.persistent||(n+=i),this._initDataFromProvider(i,n)},Df.appendValues=function(t,e){for(var i=this._chunkSize,n=this._storage,a=this.dimensions,o=a.length,r=this._rawExtent,s=this.count(),l=s+Math.max(t.length,e?e.length:0),u=this._chunkCount,h=0;h<o;h++){r[v=a[h]]||(r[v]=Bf()),n[v]||(n[v]=[]),Cf(n,this._dimensionInfos[v],i,u,l),this._chunkCount=n[v].length}for(var c=new Array(o),d=s;d<l;d++){for(var f=d-s,p=Math.floor(d/i),g=d%i,m=0;m<o;m++){var v=a[m],y=this._dimValueGetterArrayRows(t[f]||c,v,f,m);n[v][p][g]=y;var x=r[v];y<x[0]&&(x[0]=y),y>x[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},Lf(this)},Df._initDataFromProvider=function(t,e){if(!(e<=t)){for(var i,n=this._chunkSize,a=this._rawData,o=this._storage,r=this.dimensions,s=r.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;p<s;p++){c[w=r[p]]||(c[w]=Bf());var g=l[w];0===g.otherDims.itemName&&(i=this._nameDimIdx=p),0===g.otherDims.itemId&&(this._idDimIdx=p),o[w]||(o[w]=[]),Cf(o,g,n,f,e),this._chunkCount=o[w].length}for(var m=new Array(s),v=t;v<e;v++){m=a.getItem(v,m);for(var y=Math.floor(v/n),x=v%n,_=0;_<s;_++){var w,b=o[w=r[_]][y],S=this._dimValueGetter(m,w,v,_);b[x]=S;var M=c[w];S<M[0]&&(M[0]=S),S>M[1]&&(M[1]=S)}if(!a.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var A=r[i],T=o[A][y];if(T){I=T[x];var D=l[A].ordinalMeta;D&&D.categories.length&&(I=D.categories[I])}}var C=null==m?null:m.id;null==C&&null!=I&&(d[I]=d[I]||0,0<d[C=I]&&(C+="__ec__"+d[I]),d[I]++),null!=C&&(h[v]=C)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=e,this._extent={},Lf(this)}},Df.count=function(){return this._count},Df.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,i=this._count;if(e===Array){a=new e(i);for(var n=0;n<i;n++)a[n]=t[n]}else a=new e(t.buffer,0,i)}else{var a=new(e=Sf(this))(this.count());for(n=0;n<a.length;n++)a[n]=n}return a},Df.get=function(t,e){if(!(0<=e&&e<this._count))return NaN;var i=this._storage;if(!i[t])return NaN;e=this.getRawIndex(e);var n=Math.floor(e/this._chunkSize),a=e%this._chunkSize;return i[t][n][a]},Df.getByRawIndex=function(t,e){if(!(0<=e&&e<this._rawCount))return NaN;var i=this._storage[t];if(!i)return NaN;var n=Math.floor(e/this._chunkSize),a=e%this._chunkSize;return i[n][a]},Df._getFast=function(t,e){var i=Math.floor(e/this._chunkSize),n=e%this._chunkSize;return this._storage[t][i][n]},Df.getValues=function(t,e){var i=[];k(t)||(e=t,t=this.dimensions);for(var n=0,a=t.length;n<a;n++)i.push(this.get(t[n],e));return i},Df.hasValue=function(t){for(var e=this._dimensionsSummary.dataDimsOnCoord,i=0,n=e.length;i<n;i++)if(isNaN(this.get(e[i],t)))return!1;return!0},Df.getDataExtent=function(t){t=this.getDimension(t);var e=this._storage[t],i=Bf();if(!e)return i;var n,a=this.count();if(!this._indices)return this._rawExtent[t].slice();if(n=this._extent[t])return n.slice();for(var o=(n=i)[0],r=n[1],s=0;s<a;s++){var l=this._getFast(t,this.getRawIndex(s));l<o&&(o=l),r<l&&(r=l)}return n=[o,r],this._extent[t]=n},Df.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},Df.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},Df.getCalculationInfo=function(t){return this._calculationInfo[t]},Df.setCalculationInfo=function(t,e){vf(t)?L(this._calculationInfo,t):this._calculationInfo[t]=e},Df.getSum=function(t){var e=0;if(this._storage[t])for(var i=0,n=this.count();i<n;i++){var a=this.get(t,i);isNaN(a)||(e+=a)}return e},Df.getMedian=function(t){var i=[];this.each(t,function(t,e){isNaN(t)||i.push(t)});var e=[].concat(i).sort(function(t,e){return t-e}),n=this.count();return 0===n?0:n%2==1?e[(n-1)/2]:(e[n/2]+e[n/2-1])/2},Df.rawIndexOf=function(t,e){var i=(t&&this._invertedIndicesMap[t])[e];return null==i||isNaN(i)?-1:i},Df.indexOfName=function(t){for(var e=0,i=this.count();e<i;e++)if(this.getName(e)===t)return e;return-1},Df.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(null!=i&&i<this._count&&i===t)return t;for(var n=0,a=this._count-1;n<=a;){var o=(n+a)/2|0;if(e[o]<t)n=1+o;else{if(!(e[o]>t))return o;a=o-1}}return-1},Df.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var a=Number.MAX_VALUE,o=-1,r=0,s=this.count();r<s;r++){var l=e-this.get(t,r),u=Math.abs(l);l<=i&&u<=a&&((u<a||0<=l&&o<0)&&(a=u,o=l,n.length=0),n.push(r))}return n},Df.getRawIndex=Pf,Df.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],i=0;i<this.dimensions.length;i++){var n=this.dimensions[i];e.push(this.get(n,t))}return e},Df.getName=function(t){var e=this.getRawIndex(t);return this._nameList[e]||kf(this,this._nameDimIdx,e)||""},Df.getId=function(t){return Of(this,this.getRawIndex(t))},Df.each=function(t,e,i,n){if(this._count){"function"==typeof t&&(n=i,i=e,e=t,t=[]),i=i||n||this;for(var a=(t=N(Ef(t),this.getDimension,this)).length,o=0;o<this.count();o++)switch(a){case 0:e.call(i,o);break;case 1:e.call(i,this.get(t[0],o),o);break;case 2:e.call(i,this.get(t[0],o),this.get(t[1],o),o);break;default:for(var r=0,s=[];r<a;r++)s[r]=this.get(t[r],o);s[r]=o,e.apply(i,s)}}},Df.filterSelf=function(t,e,i,n){if(this._count){"function"==typeof t&&(n=i,i=e,e=t,t=[]),i=i||n||this,t=N(Ef(t),this.getDimension,this);for(var a=this.count(),o=new(Sf(this))(a),r=[],s=t.length,l=0,u=t[0],h=0;h<a;h++){var c,d=this.getRawIndex(h);if(0===s)c=e.call(i,h);else if(1===s){var f=this._getFast(u,d);c=e.call(i,f,h)}else{for(var p=0;p<s;p++)r[p]=this._getFast(u,d);r[p]=h,c=e.apply(i,r)}c&&(o[l++]=d)}return l<a&&(this._indices=o),this._count=l,this._extent={},this.getRawIndex=this._indices?Nf:Pf,this}},Df.selectRange=function(t){if(this._count){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);var n=e.length;if(n){var a=this.count(),o=new(Sf(this))(a),r=0,s=e[0],l=t[s][0],u=t[s][1],h=!1;if(!this._indices){var c=0;if(1===n){for(var d=this._storage[e[0]],f=0;f<this._chunkCount;f++)for(var p=d[f],g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){(l<=(w=p[m])&&w<=u||isNaN(w))&&(o[r++]=c),c++}h=!0}else if(2===n){d=this._storage[s];var v=this._storage[e[1]],y=t[e[1]][0],x=t[e[1]][1];for(f=0;f<this._chunkCount;f++){p=d[f];var _=v[f];for(g=Math.min(this._count-f*this._chunkSize,this._chunkSize),m=0;m<g;m++){var w=p[m],b=_[m];(l<=w&&w<=u||isNaN(w))&&(y<=b&&b<=x||isNaN(b))&&(o[r++]=c),c++}}h=!0}}if(!h)if(1===n)for(m=0;m<a;m++){var S=this.getRawIndex(m);(l<=(w=this._getFast(s,S))&&w<=u||isNaN(w))&&(o[r++]=S)}else for(m=0;m<a;m++){var M=!0;for(S=this.getRawIndex(m),f=0;f<n;f++){var I=e[f];((w=this._getFast(i,S))<t[I][0]||w>t[I][1])&&(M=!1)}M&&(o[r++]=this.getRawIndex(m))}return r<a&&(this._indices=o),this._count=r,this._extent={},this.getRawIndex=this._indices?Nf:Pf,this}}},Df.mapArray=function(t,e,i,n){"function"==typeof t&&(n=i,i=e,e=t,t=[]),i=i||n||this;var a=[];return this.each(t,function(){a.push(e&&e.apply(this,arguments))},i),a},Df.map=function(t,e,i,n){i=i||n||this;var a=Rf(this,t=N(Ef(t),this.getDimension,this));a._indices=this._indices,a.getRawIndex=a._indices?Nf:Pf;for(var o=a._storage,r=[],s=this._chunkSize,l=t.length,u=this.count(),h=[],c=a._rawExtent,d=0;d<u;d++){for(var f=0;f<l;f++)h[f]=this.get(t[f],d);h[l]=d;var p=e&&e.apply(i,h);if(null!=p){"object"!=typeof p&&(r[0]=p,p=r);for(var g=this.getRawIndex(d),m=Math.floor(g/s),v=g%s,y=0;y<p.length;y++){var x=t[y],_=p[y],w=c[x],b=o[x];b&&(b[m][v]=_),_<w[0]&&(w[0]=_),_>w[1]&&(w[1]=_)}}}return a},Df.downSample=function(t,e,i,n){for(var a=Rf(this,[t]),o=a._storage,r=[],s=Math.floor(1/e),l=o[t],u=this.count(),h=this._chunkSize,c=a._rawExtent[t],d=new(Sf(this))(u),f=0,p=0;p<u;p+=s){u-p<s&&(s=u-p,r.length=s);for(var g=0;g<s;g++){var m=this.getRawIndex(p+g),v=Math.floor(m/h),y=m%h;r[g]=l[v][y]}var x=i(r),_=this.getRawIndex(Math.min(p+n(r,x)||0,u-1)),w=_%h;(l[Math.floor(_/h)][w]=x)<c[0]&&(c[0]=x),x>c[1]&&(c[1]=x),d[f++]=_}return a._count=f,a._indices=d,a.getRawIndex=Nf,a},Df.getItemModel=function(t){var e=this.hostModel;return new dl(this.getRawDataItem(t),e,e&&e.ecModel)},Df.diff=function(e){var i=this;return new df(e?e.getIndices():[],this.getIndices(),function(t){return Of(e,t)},function(t){return Of(i,t)})},Df.getVisual=function(t){var e=this._visual;return e&&e[t]},Df.setVisual=function(t,e){if(vf(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},Df.setLayout=function(t,e){if(vf(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},Df.getLayout=function(t){return this._layout[t]},Df.getItemLayout=function(t){return this._itemLayouts[t]},Df.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?L(this._itemLayouts[t]||{},e):e},Df.clearItemLayouts=function(){this._itemLayouts.length=0},Df.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],a=n&&n[e];return null!=a||i?a:this.getVisual(e)},Df.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},a=this.hasItemVisual;if(this._itemVisuals[t]=n,vf(e))for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o],a[o]=!0);else n[e]=i,a[e]=!0},Df.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};function Vf(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType}function Gf(t,e,i){Lu.isInstance(e)||(e=Lu.seriesDataToSource(e)),i=i||{},t=(t||[]).slice();for(var n=(i.dimsDef||[]).slice(),l=Q(i.encodeDef),a=Q(),o=Q(),u=[],r=function(t,e,i,n){var a=Math.max(t.dimensionsDetectCount||1,e.length,i.length,n||0);return E(e,function(t){var e=t.dimsDef;e&&(a=Math.max(a,e.length))}),a}(e,t,n,i.dimCount),s=0;s<r;s++){var h=n[s]=L({},z(n[s])?n[s]:{name:n[s]}),c=h.name,d=u[s]={otherDims:{}};null!=c&&null==a.get(c)&&(d.name=d.displayName=c,a.set(c,s)),null!=h.type&&(d.type=h.type),null!=h.displayName&&(d.displayName=h.displayName)}l.each(function(t,i){if(1===(t=wa(t).slice()).length&&!R(t[0])&&t[0]<0)l.set(i,!1);else{var n=l.set(i,[]);E(t,function(t,e){R(t)&&(t=a.get(t)),null!=t&&t<r&&(n[e]=t,p(u[t],i,e))})}});var f=0;function p(t,e,i){null!=pf.get(e)?t.otherDims[e]=i:(t.coordDim=e,t.coordDimIndex=i,o.set(e,!0))}E(t,function(a,t){var o,r,s;if(R(a))o=a,a={};else{o=a.name;var e=a.ordinalMeta;a.ordinalMeta=null,(a=D(a)).ordinalMeta=e,r=a.dimsDef,s=a.otherDims,a.name=a.coordDim=a.coordDimIndex=a.dimsDef=a.otherDims=null}if(!1!==(i=l.get(o))){var i;if(!(i=wa(i)).length)for(var n=0;n<(r&&r.length||1);n++){for(;f<u.length&&null!=u[f].coordDim;)f++;f<u.length&&i.push(f++)}E(i,function(t,e){var i=u[t];if(p(C(i,a),o,e),null==i.name&&r){var n=r[e];z(n)||(n={name:n}),i.name=i.displayName=n.name,i.defaultTooltip=n.defaultTooltip}s&&C(i.otherDims,s)})}});var g=i.generateCoord,m=i.generateCoordCount,v=null!=m;m=g?m||1:0;for(var y,x,_=g||"value",w=0;w<r;w++){null==(d=u[w]=u[w]||{}).coordDim&&(d.coordDim=Ff(_,o,v),d.coordDimIndex=0,(!g||m<=0)&&(d.isExtraCoord=!0),m--),null==d.name&&(d.name=Ff(d.coordDim,a)),null==d.type&&(y=e,x=w,d.name,Eu(y.data,y.sourceFormat,y.seriesLayoutBy,y.dimensionsDefine,y.startIndex,x))&&(d.type="ordinal")}return u}function Ff(t,e,i){if(i||null!=e.get(t)){for(var n=0;null!=e.get(t+n);)n++;t+=n}return e.set(t,!0),t}Df.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(Vf,e)),this._graphicEls[t]=e},Df.getItemGraphicEl=function(t){return this._graphicEls[t]},Df.eachItemGraphicEl=function(i,n){E(this._graphicEls,function(t,e){t&&i&&i.call(n,t,e)})},Df.cloneShallow=function(t){if(!t){var e=N(this.dimensions,this.getDimensionInfo,this);t=new Tf(e,this.hostModel)}if(t._storage=this._storage,Af(t,this),this._indices){var i=this._indices.constructor;t._indices=new i(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?Nf:Pf,t},Df.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(U(arguments)))})},Df.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],Df.CHANGABLE_METHODS=["filterSelf","selectRange"];var Wf=function(t,e){return Gf((e=e||{}).coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};function Hf(t,i,e){var n,a,o,r,s=(e=e||{}).byIndex,l=e.stackedCoordDimension,u=!(!t||!t.get("stack"));if(E(i,function(t,e){R(t)&&(i[e]=t={name:t}),u&&!t.isExtraCoord&&(s||n||!t.ordinalMeta||(n=t),a||"ordinal"===t.type||"time"===t.type||l&&l!==t.coordDim||(a=t))}),!a||s||n||(s=!0),a){o="__\0ecstackresult",r="__\0ecstackedover",n&&(n.createInvertedIndices=!0);var h=a.coordDim,c=a.type,d=0;E(i,function(t){t.coordDim===h&&d++}),i.push({name:o,coordDim:h,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0}),d++,i.push({name:r,coordDim:r,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:a&&a.name,stackedByDimension:n&&n.name,isStackedByIndex:s,stackedOverDimension:r,stackResultDimension:o}}function Zf(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Uf(t,e){return Zf(t,e)?t.getCalculationInfo("stackResultDimension"):e}function Xf(t,e,i){i=i||{},Lu.isInstance(t)||(t=Lu.seriesDataToSource(t));var n,a=e.get("coordinateSystem"),o=Hu.get(a),r=xu(e);r&&(n=N(r.coordSysDims,function(t){var e={name:t},i=r.axisMap.get(t);if(i){var n=i.get("type");e.type=mf(n)}return e})),n=n||(o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]);var s,l,u=Wf(t,{coordDimensions:n,generateCoord:i.generateCoord});r&&E(u,function(t,e){var i=t.coordDim,n=r.categoryAxisMap.get(i);n&&(null==s&&(s=e),t.ordinalMeta=n.getOrdinalMeta()),null!=t.otherDims.itemName&&(l=!0)}),l||null==s||(u[s].otherDims.itemName=0);var h=Hf(e,u),c=new Tf(u,e);c.setCalculationInfo(h);var d=null!=s&&function(t){if(t.sourceFormat===bu){var e=function(t){var e=0;for(;e<t.length&&null==t[e];)e++;return t[e]}(t.data||[]);return null!=e&&!k(Ma(e))}}(t)?function(t,e,i,n){return n===s?i:this.defaultDimValueGetter(t,e,i,n)}:null;return c.hasItemOption=!1,c.initData(t,null,d),c}function Yf(t){this._setting=t||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}function jf(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}Yf.prototype.parse=function(t){return t},Yf.prototype.getSetting=function(t){return this._setting[t]},Yf.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},Yf.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},Yf.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},Yf.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},Yf.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},Yf.prototype.getExtent=function(){return this._extent.slice()},Yf.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},Yf.prototype.isBlank=function(){return this._isBlank},Yf.prototype.setBlank=function(t){this._isBlank=t},Yf.prototype.getLabel=null,Ga(Yf),Ua(Yf,{registerWhenExtend:!0}),jf.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&N(i,$f);return new jf({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var qf=jf.prototype;function Kf(t){return t._map||(t._map=Q(t.categories))}function $f(t){return z(t)&&null!=t.value?t.value:t+""}qf.getOrdinal=function(t){return Kf(this).get(t)},qf.parseAndCollect=function(t){var e,i=this._needCollect;if("string"!=typeof t&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=Kf(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var Jf=Yf.prototype,Qf=Yf.extend({type:"ordinal",init:function(t,e){t&&!k(t)||(t=new jf({categories:t})),this._ordinalMeta=t,this._extent=e||[0,t.categories.length-1]},parse:function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},contain:function(t){return t=this.parse(t),Jf.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return Jf.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(Jf.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push(i),i++;return t},getLabel:function(t){if(!this.isBlank())return this._ordinalMeta.categories[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:et,niceExtent:et});Qf.create=function(){return new Qf};var tp=_l;function ep(t){return Sl(t)+2}function ip(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function np(t,e){isFinite(t[0])||(t[0]=e[0]),isFinite(t[1])||(t[1]=e[1]),ip(t,0,e),ip(t,1,e),t[0]>t[1]&&(t[0]=t[1])}var ap=_l,op=Yf.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),op.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=ep(t)},getTicks:function(){return function(t,e,i,n){var a=[];if(!t)return a;e[0]<i[0]&&a.push(e[0]);for(var o=i[0];o<=i[1]&&(a.push(o),(o=tp(o+t,n))!==a[a.length-1]);)if(1e4<a.length)return[];return e[1]>(a.length?a[a.length-1]:i[1])&&a.push(e[1]),a}(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getLabel:function(t,e){if(null==t)return"";var i=e&&e.precision;return null==i?i=Sl(t)||0:"auto"===i&&(i=this._intervalPrecision),zl(t=ap(t,i,!0))},niceTicks:function(t,e,i){t=t||5;var n=this._extent,a=n[1]-n[0];if(isFinite(a)){a<0&&(a=-a,n.reverse());var o=function(t,e,i,n){var a={},o=t[1]-t[0],r=a.interval=Nl(o/e,!0);null!=i&&r<i&&(r=a.interval=i),null!=n&&n<r&&(r=a.interval=n);var s=a.intervalPrecision=ep(r);return np(a.niceTickExtent=[tp(Math.ceil(t[0]/r)*r,s),tp(Math.floor(t[1]/r)*r,s)],t),a}(n,t,e,i);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var i=e[0];t.fixMax||(e[1]+=i/2),e[0]-=i/2}else e[1]=1;var n=e[1]-e[0];isFinite(n)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var a=this._interval;t.fixMin||(e[0]=ap(Math.floor(e[0]/a)*a)),t.fixMax||(e[1]=ap(Math.ceil(e[1]/a)*a))}});op.create=function(){return new op};var rp="__ec_stack_",sp="undefined"!=typeof Float32Array?Float32Array:Array;function lp(t){return t.get("stack")||rp+t.seriesIndex}function up(t){return t.dim+t.index}function hp(t,e){var i=[];return e.eachSeriesByType(t,function(t){mp(t)&&!vp(t)&&i.push(t)}),i}function cp(t){var g=function(t){var l={};E(t,function(t){var e=t.coordinateSystem.getBaseAxis();if("time"===e.type||"value"===e.type)for(var i=t.getData(),n=e.dim+"_"+e.index,a=i.mapDimension(e.dim),o=0,r=i.count();o<r;++o){var s=i.get(a,o);l[n]?l[n].push(s):l[n]=[s]}});var e=[];for(var i in l)if(l.hasOwnProperty(i)){var n=l[i];if(n){n.sort(function(t,e){return t-e});for(var a=null,o=1;o<n.length;++o){var r=n[o]-n[o-1];0<r&&(a=null===a?r:Math.min(a,r))}e[i]=a}}return e}(t),m=[];return E(t,function(t){var e,i=t.coordinateSystem.getBaseAxis(),n=i.getExtent();if("category"===i.type)e=i.getBandWidth();else if("value"===i.type||"time"===i.type){var a=i.dim+"_"+i.index,o=g[a],r=Math.abs(n[1]-n[0]),s=i.scale.getExtent(),l=Math.abs(s[1]-s[0]);e=o?r/l*o:r}else{var u=t.getData();e=Math.abs(n[1]-n[0])/u.count()}var h=xl(t.get("barWidth"),e),c=xl(t.get("barMaxWidth"),e),d=xl(t.get("barMinWidth")||1,e),f=t.get("barGap"),p=t.get("barCategoryGap");m.push({bandWidth:e,barWidth:h,barMaxWidth:c,barMinWidth:d,barGap:f,barCategoryGap:p,axisKey:up(i),stackId:lp(t)})}),dp(m)}function dp(t){var d={};E(t,function(t,e){var i=t.axisKey,n=t.bandWidth,a=d[i]||{bandWidth:n,remainedWidth:n,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=a.stacks;d[i]=a;var r=t.stackId;o[r]||a.autoWidthCount++,o[r]=o[r]||{width:0,maxWidth:0};var s=t.barWidth;s&&!o[r].width&&(o[r].width=s,s=Math.min(a.remainedWidth,s),a.remainedWidth-=s);var l=t.barMaxWidth;l&&(o[r].maxWidth=l);var u=t.barMinWidth;u&&(o[r].minWidth=u);var h=t.barGap;null!=h&&(a.gap=h);var c=t.barCategoryGap;null!=c&&(a.categoryGap=c)});var f={};return E(d,function(t,i){f[i]={};var e=t.stacks,n=t.bandWidth,a=xl(t.categoryGap,n),o=xl(t.gap,1),r=t.remainedWidth,s=t.autoWidthCount,l=(r-a)/(s+(s-1)*o);l=Math.max(l,0),E(e,function(t){var e=t.maxWidth,i=t.minWidth;if(t.width){n=t.width;e&&(n=Math.min(n,e)),i&&(n=Math.max(n,i)),t.width=n,r-=n,s--}else{var n=l;e&&e<n&&(n=Math.min(e,r)),i&&n<i&&(n=i),n!==l&&(t.width=n,r-=n,s--)}}),l=(r-a)/(s+(s-1)*o),l=Math.max(l,0);var u,h=0;E(e,function(t,e){t.width||(t.width=l),h+=(u=t).width*(1+o)}),u&&(h-=u.width*o);var c=-h/2;E(e,function(t,e){f[i][e]=f[i][e]||{bandWidth:n,offset:c,width:t.width},c+=t.width*(1+o)})}),f}function fp(t,e,i){if(t&&e){var n=t[up(e)];return null!=n&&null!=i&&(n=n[lp(i)]),n}}function pp(t,e){var i=hp(t,e),A=cp(i),T={};E(i,function(t){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),a=lp(t),o=A[up(n)][a],r=o.offset,s=o.width,l=i.getOtherAxis(n),u=t.get("barMinHeight")||0;T[a]=T[a]||[],e.setLayout({bandWidth:o.bandWidth,offset:r,size:s});for(var h=e.mapDimension(l.dim),c=e.mapDimension(n.dim),d=Zf(e,h),f=l.isHorizontal(),p=yp(n,l,d),g=0,m=e.count();g<m;g++){var v=e.get(h,g),y=e.get(c,g);if(!isNaN(v)&&!isNaN(y)){var x,_,w,b,S,M=0<=v?"p":"n",I=p;if(d&&(T[a][y]||(T[a][y]={p:p,n:p}),I=T[a][y][M]),f)x=I,_=(S=i.dataToPoint([v,y]))[1]+r,w=S[0]-p,b=s,Math.abs(w)<u&&(w=(w<0?-1:1)*u),d&&(T[a][y][M]+=w);else x=(S=i.dataToPoint([y,v]))[0]+r,_=I,w=s,b=S[1]-p,Math.abs(b)<u&&(b=(b<=0?-1:1)*u),d&&(T[a][y][M]+=b);e.setItemLayout(g,{x:x,y:_,width:w,height:b})}}},this)}var gp={seriesType:"bar",plan:Jh(),reset:function(t){if(mp(t)&&vp(t)){var e=t.getData(),h=t.coordinateSystem,c=h.getBaseAxis(),d=h.getOtherAxis(c),f=e.mapDimension(d.dim),p=e.mapDimension(c.dim),g=d.isHorizontal(),m=g?0:1,v=fp(cp([t]),c,t).width;return.5<v||(v=.5),{progress:function(t,e){var i,n=t.count,a=new sp(2*n),o=new sp(n),r=[],s=[],l=0,u=0;for(;null!=(i=t.next());)s[m]=e.get(f,i),s[1-m]=e.get(p,i),r=h.dataToPoint(s,null,r),a[l++]=r[0],a[l++]=r[1],o[u++]=i;e.setLayout({largePoints:a,largeDataIndices:o,barWidth:v,valueAxisStart:yp(c,d,!1),valueAxisHorizontal:g})}}}}};function mp(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function vp(t){return t.pipelineContext&&t.pipelineContext.large}function yp(t,e){return e.toGlobalCoord(e.dataToCoord("log"===e.type?1:0))}var xp=op.prototype,_p=Math.ceil,wp=Math.floor,bp=36e5,Sp=864e5,Mp=op.extend({type:"time",getLabel:function(t){var e=this._stepLvl,i=new Date(t);return ql(e[0],i,this.getSetting("useUTC"))},niceExtent:function(t){var e=this._extent;if(e[0]===e[1]&&(e[0]-=Sp,e[1]+=Sp),e[1]===-1/0&&e[0]===1/0){var i=new Date;e[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),e[0]=e[1]-Sp}this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var n=this._interval;t.fixMin||(e[0]=_l(wp(e[0]/n)*n)),t.fixMax||(e[1]=_l(_p(e[1]/n)*n))},niceTicks:function(t,e,i){t=t||10;var n=this._extent,a=n[1]-n[0],o=a/t;null!=e&&o<e&&(o=e),null!=i&&i<o&&(o=i);var r=Ip.length,s=function(t,e,i,n){for(;i<n;){var a=i+n>>>1;t[a][1]<e?i=1+a:n=a}return i}(Ip,o,0,r),l=Ip[Math.min(s,r-1)],u=l[1];"year"===l[0]&&(u*=Nl(a/u/t,!0));var h=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,c=[Math.round(_p((n[0]-h)/u)*u+h),Math.round(wp((n[1]-h)/u)*u+h)];np(c,n),this._stepLvl=l,this._interval=u,this._niceExtent=c},parse:function(t){return+Ll(t)}});E(["contain","normalize"],function(e){Mp.prototype[e]=function(t){return xp[e].call(this,this.parse(t))}});var Ip=[["hh:mm:ss",1e3],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",6e4],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",bp],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",6*bp],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",Sp],["MM-dd\nyyyy",2*Sp],["MM-dd\nyyyy",3*Sp],["MM-dd\nyyyy",4*Sp],["MM-dd\nyyyy",5*Sp],["MM-dd\nyyyy",6*Sp],["week",7*Sp],["MM-dd\nyyyy",864e6],["week",14*Sp],["week",21*Sp],["month",31*Sp],["week",42*Sp],["month",62*Sp],["week",70*Sp],["quarter",95*Sp],["month",31*Sp*4],["month",13392e6],["half-year",16416e6],["month",31*Sp*8],["month",26784e6],["year",380*Sp]];Mp.create=function(t){return new Mp({useUTC:t.ecModel.get("useUTC")})};var Ap=Yf.prototype,Tp=op.prototype,Dp=Sl,Cp=_l,Lp=Math.floor,kp=Math.ceil,Pp=Math.pow,Np=Math.log,Op=Yf.extend({type:"log",base:10,$constructor:function(){Yf.apply(this,arguments),this._originalScale=new op},getTicks:function(){var i=this._originalScale,n=this._extent,a=i.getExtent();return N(Tp.getTicks.call(this),function(t){var e=_l(Pp(this.base,t));return e=t===n[0]&&i.__fixMin?Ep(e,a[0]):e,e=t===n[1]&&i.__fixMax?Ep(e,a[1]):e},this)},getLabel:Tp.getLabel,scale:function(t){return t=Ap.scale.call(this,t),Pp(this.base,t)},setExtent:function(t,e){var i=this.base;t=Np(t)/Np(i),e=Np(e)/Np(i),Tp.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=Ap.getExtent.call(this);e[0]=Pp(t,e[0]),e[1]=Pp(t,e[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(e[0]=Ep(e[0],n[0])),i.__fixMax&&(e[1]=Ep(e[1],n[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=Np(t[0])/Np(e),t[1]=Np(t[1])/Np(e),Ap.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i==1/0||i<=0)){var n=kl(i);for(t/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&0<Math.abs(n);)n*=10;var a=[_l(kp(e[0]/n)*n),_l(Lp(e[1]/n)*n)];this._interval=n,this._niceExtent=a}},niceExtent:function(t){Tp.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});function Ep(t,e){return Cp(t,Dp(e))}function Rp(t,e){var i,n,a,o=t.type,r=e.getMin(),s=e.getMax(),l=null!=r,u=null!=s,h=t.getExtent();"ordinal"===o?i=e.getCategories().length:(k(n=e.get("boundaryGap"))||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=xl(n[0],1),n[1]=xl(n[1],1),a=h[1]-h[0]||Math.abs(h[0])),null==r&&(r="ordinal"===o?i?0:NaN:h[0]-n[0]*a),null==s&&(s="ordinal"===o?i?i-1:NaN:h[1]+n[1]*a),"dataMin"===r?r=h[0]:"function"==typeof r&&(r=r({min:h[0],max:h[1]})),"dataMax"===s?s=h[1]:"function"==typeof s&&(s=s({min:h[0],max:h[1]})),null!=r&&isFinite(r)||(r=NaN),null!=s&&isFinite(s)||(s=NaN),t.setBlank(F(r)||F(s)||"ordinal"===o&&!t.getOrdinalMeta().categories.length),e.getNeedCrossZero()&&(0<r&&0<s&&!l&&(r=0),r<0&&s<0&&!u&&(s=0));var c=e.ecModel;if(c&&"time"===o){var d,f=hp("bar",c);if(E(f,function(t){d|=t.getBaseAxis()===e.axis}),d){var p=cp(f),g=function(t,e,i,n){var a=i.axis.getExtent(),o=a[1]-a[0],r=fp(n,i.axis);if(void 0===r)return{min:t,max:e};var s=1/0;E(r,function(t){s=Math.min(t.offset,s)});var l=-1/0;E(r,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/o)-h;return{min:t-=s/u*c,max:e+=l/u*c}}(r,s,e,p);r=g.min,s=g.max}}return[r,s]}function zp(t,e){var i=Rp(t,e),n=null!=e.getMin(),a=null!=e.getMax(),o=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var r=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:o,fixMin:n,fixMax:a,minInterval:"interval"===r||"time"===r?e.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function Bp(t,e){if(e=e||t.get("type"))switch(e){case"category":return new Qf(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new op;default:return(Yf.getClass(e)||op).create(t)}}function Vp(i){var e,n=i.getLabelModel().get("formatter"),a="category"===i.type?i.scale.getExtent()[0]:null;return"string"==typeof n?(e=n,n=function(t){return t=i.scale.getLabel(t),e.replace("{value}",null!=t?t:"")}):"function"==typeof n?function(t,e){return null!=a&&(e=t-a),n(Gp(i,t),e)}:function(t){return i.scale.getLabel(t)}}function Gp(t,e){return"category"===t.type?t.scale.getLabel(e):e}function Fp(t){var e=t.get("interval");return null==e?"auto":e}function Wp(t){return"category"===t.type&&0===Fp(t.getLabelModel())}E(["contain","normalize"],function(e){Op.prototype[e]=function(t){return t=Np(t)/Np(this.base),Ap[e].call(this,t)}}),Op.create=function(){return new Op};var Hp={getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!F(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!F(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:et,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},Zp=ds({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,a=e.width/2,o=e.height/2;t.moveTo(i,n-o),t.lineTo(i+a,n+o),t.lineTo(i-a,n+o),t.closePath()}}),Up=ds({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,a=e.width/2,o=e.height/2;t.moveTo(i,n-o),t.lineTo(i+a,n),t.lineTo(i,n+o),t.lineTo(i-a,n),t.closePath()}}),Xp=ds({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,a=e.width/5*3,o=Math.max(a,e.height),r=a/2,s=r*r/(o-r),l=n-o+r+s,u=Math.asin(s/r),h=Math.cos(u)*r,c=Math.sin(u),d=Math.cos(u),f=.6*r,p=.7*r;t.moveTo(i-h,l+s),t.arc(i,l,r,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),t.closePath()}}),Yp=ds({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,a=e.x,o=e.y,r=n/3*2;t.moveTo(a,o),t.lineTo(a+r,o+i),t.lineTo(a,o+i/4*3),t.lineTo(a-r,o+i),t.lineTo(a,o),t.closePath()}}),jp={line:function(t,e,i,n,a){a.x1=t,a.y1=e+n/2,a.x2=t+i,a.y2=e+n/2},rect:function(t,e,i,n,a){a.x=t,a.y=e,a.width=i,a.height=n},roundRect:function(t,e,i,n,a){a.x=t,a.y=e,a.width=i,a.height=n,a.r=Math.min(i,n)/4},square:function(t,e,i,n,a){var o=Math.min(i,n);a.x=t,a.y=e,a.width=o,a.height=o},circle:function(t,e,i,n,a){a.cx=t+i/2,a.cy=e+n/2,a.r=Math.min(i,n)/2},diamond:function(t,e,i,n,a){a.cx=t+i/2,a.cy=e+n/2,a.width=i,a.height=n},pin:function(t,e,i,n,a){a.x=t+i/2,a.y=e+n/2,a.width=i,a.height=n},arrow:function(t,e,i,n,a){a.x=t+i/2,a.y=e+n/2,a.width=i,a.height=n},triangle:function(t,e,i,n,a){a.cx=t+i/2,a.cy=e+n/2,a.width=i,a.height=n}},qp={};E({line:Ur,rect:Hr,roundRect:Hr,square:Hr,circle:Lr,diamond:Up,pin:Xp,arrow:Yp,triangle:Zp},function(t,e){qp[e]=new t});var Kp=ds({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,i){var n=dn(t,e,i),a=this.shape;return a&&"pin"===a.symbolType&&"inside"===e.textPosition&&(n.y=i.y+.4*i.height),n},buildPath:function(t,e,i){var n=e.symbolType;if("none"!==n){var a=qp[n];a=a||qp[n="rect"],jp[n](e.x,e.y,e.width,e.height,a.shape),a.buildPath(t,a.shape,i)}}});function $p(t,e){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=t:this.__isEmptyBrush?(i.stroke=t,i.fill=e||"#fff"):(i.fill&&(i.fill=t),i.stroke&&(i.stroke=t)),this.dirty(!1)}}function Jp(t,e,i,n,a,o,r){var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(s=0===t.indexOf("image://")?ms(t.slice(8),new bi(e,i,n,a),r?"center":"cover"):0===t.indexOf("path://")?gs(t.slice(7),{},new bi(e,i,n,a),r?"center":"cover"):new Kp({shape:{symbolType:t,x:e,y:i,width:n,height:a}})).__isEmptyBrush=l,s.setColor=$p,s.setColor(o),s}var Qp={isDimensionStacked:Zf,enableDataStack:Hf,getStackedDimension:Uf};var tg=(Object.freeze||Object)({createList:function(t){return Xf(t.getSource(),t)},getLayoutRect:au,dataStack:Qp,createScale:function(t,e){var i=e;dl.isInstance(e)||b(i=new dl(e),Hp);var n=Bp(i);return n.setExtent(t[0],t[1]),zp(n,i),n},mixinAxisModelCommonMethods:function(t){b(t,Hp)},completeDimensions:Gf,createDimensions:Wf,createSymbol:Jp}),eg=1e-8;function ig(t,e){return Math.abs(t-e)<eg}function ng(t,e,i){var n=0,a=t[0];if(!a)return!1;for(var o=1;o<t.length;o++){var r=t[o];n+=$o(a[0],a[1],r[0],r[1],e,i),a=r}var s=t[0];return ig(a[0],s[0])&&ig(a[1],s[1])||(n+=$o(a[0],a[1],s[0],s[1],e,i)),0!==n}function ag(t,e,i){if(this.name=t,this.geometries=e,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}function og(t,e,i){for(var n=[],a=e[0],o=e[1],r=0;r<t.length;r+=2){var s=t.charCodeAt(r)-64,l=t.charCodeAt(r+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),a=s+=a,o=l+=o,n.push([s/i,l/i])}return n}ag.prototype={constructor:ag,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],a=[],o=[],r=this.geometries,s=0;s<r.length;s++){if("polygon"===r[s].type)Io(r[s].exterior,a,o),St(i,i,a),Mt(n,n,o)}return 0===s&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new bi(i[0],i[1],n[0]-i[0],n[1]-i[1])},contain:function(t){var e=this.getBoundingRect(),i=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var n=0,a=i.length;n<a;n++)if("polygon"===i[n].type){var o=i[n].exterior,r=i[n].interiors;if(ng(o,t[0],t[1])){for(var s=0;s<(r?r.length:0);s++)if(ng(r[s]))continue t;return!0}}return!1},transformTo:function(t,e,i,n){var a=this.getBoundingRect(),o=a.width/a.height;i?n=n||i/o:i=o*n;for(var r=new bi(t,e,i,n),s=a.calculateTransform(r),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var h=l[u].exterior,c=l[u].interiors,d=0;d<h.length;d++)bt(h[d],h[d],s);for(var f=0;f<(c?c.length:0);f++)for(d=0;d<c[f].length;d++)bt(c[f][d],c[f][d],s)}(a=this._rect).copy(r),this.center=[a.x+a.width/2,a.y+a.height/2]},cloneShallow:function(t){null==t&&(t=this.name);var e=new ag(t,this.geometries,this.center);return e._rect=this._rect,e.transformTo=null,e}};function rg(t){return function(t){if(!t.UTF8Encoding)return;var e=t.UTF8Scale;null==e&&(e=1024);for(var i=t.features,n=0;n<i.length;n++)for(var a=i[n].geometry,o=a.coordinates,r=a.encodeOffsets,s=0;s<o.length;s++){var l=o[s];if("Polygon"===a.type)o[s]=og(l,r[s],e);else if("MultiPolygon"===a.type)for(var u=0;u<l.length;u++){var h=l[u];l[u]=og(h,r[s][u],e)}}t.UTF8Encoding=!1}(t),N(M(t.features,function(t){return t.geometry&&t.properties&&0<t.geometry.coordinates.length}),function(t){var e=t.properties,i=t.geometry,n=i.coordinates,a=[];"Polygon"===i.type&&a.push({type:"polygon",exterior:n[0],interiors:n.slice(1)}),"MultiPolygon"===i.type&&E(n,function(t){t[0]&&a.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var o=new ag(e.name,a,e.cp);return o.properties=e,o})}var sg=La();function lg(t){return"category"===t.type?function(t){var e=t.getLabelModel(),i=hg(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(t):function(i){var t=i.scale.getTicks(),n=Vp(i);return{labels:N(t,function(t,e){return{formattedLabel:n(t,e),rawLabel:i.scale.getLabel(t),tickValue:t}})}}(t)}function ug(t,e){return"category"===t.type?function(t,e){var i,n,a=cg(t,"ticks"),o=Fp(e),r=dg(a,o);if(r)return r;e.get("show")&&!t.scale.isBlank()||(i=[]);if(O(o))i=gg(t,o,!0);else if("auto"===o){var s=hg(t,t.getLabelModel());n=s.labelCategoryInterval,i=N(s.labels,function(t){return t.tickValue})}else i=pg(t,n=o,!0);return fg(a,o,{ticks:i,tickCategoryInterval:n})}(t,e):{ticks:t.scale.getTicks()}}function hg(t,e){var i,n=cg(t,"labels"),a=Fp(e),o=dg(n,a);return o||fg(n,a,{labels:O(a)?gg(t,a):pg(t,i="auto"===a?function(t){var e=sg(t).autoInterval;return null!=e?e:sg(t).autoInterval=t.calculateCategoryInterval()}(t):a),labelCategoryInterval:i})}function cg(t,e){return sg(t)[e]||(sg(t)[e]=[])}function dg(t,e){for(var i=0;i<t.length;i++)if(t[i].key===e)return t[i].value}function fg(t,e,i){return t.push({key:e,value:i}),i}function pg(t,e,i){var n=Vp(t),a=t.scale,o=a.getExtent(),r=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=o[0],h=a.count();0!==u&&1<l&&2<h/l&&(u=Math.round(Math.ceil(u/l)*l));var c=Wp(t),d=r.get("showMinLabel")||c,f=r.get("showMaxLabel")||c;d&&u!==o[0]&&g(o[0]);for(var p=u;p<=o[1];p+=l)g(p);function g(t){s.push(i?t:{formattedLabel:n(t),rawLabel:a.getLabel(t),tickValue:t})}return f&&p-l!==o[1]&&g(o[1]),s}function gg(t,i,n){var a=t.scale,o=Vp(t),r=[];return E(a.getTicks(),function(t){var e=a.getLabel(t);i(t,e)&&r.push(n?t:{formattedLabel:o(t),rawLabel:e,tickValue:t})}),r}var mg=[0,1],vg=function(t,e,i){this.dim=t,this.scale=e,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function yg(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}vg.prototype={constructor:vg,contain:function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return i<=t&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return Ml(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&yg(i=i.slice(),n.count()),yl(t,mg,i,e)},coordToData:function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&yg(i=i.slice(),n.count());var a=yl(t,i,mg,e);return this.scale.scale(a)},pointToData:function(t,e){},getTicksCoords:function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=N(ug(this,e).ticks,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this);return function(t,e,i,n){var a=e.length;if(!t.onBand||i||!a)return;var o,r,s=t.getExtent();if(1===a)e[0].coord=s[0],o=e[1]={coord:s[0]};else{var l=e[a-1].tickValue-e[0].tickValue,u=(e[a-1].coord-e[0].coord)/l;E(e,function(t){t.coord-=u/2});var h=t.scale.getExtent();r=1+h[1]-e[a-1].tickValue,o={coord:e[a-1].coord+u*r},e.push(o)}var c=s[0]>s[1];d(e[0].coord,s[0])&&(n?e[0].coord=s[0]:e.shift());n&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]});d(s[1],o.coord)&&(n?o.coord=s[1]:e.pop());n&&d(o.coord,s[1])&&e.push({coord:s[1]});function d(t,e){return t=_l(t),e=_l(e),c?e<t:t<e}}(this,i,e.get("alignWithLabel"),t.clamp),i},getViewLabels:function(){return lg(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return function(t){var e=function(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()}}(t),i=Vp(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,a=t.scale,o=a.getExtent(),r=a.count();if(o[1]-o[0]<1)return 0;var s=1;40<r&&(s=Math.max(1,Math.floor(r/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,f=0;l<=o[1];l+=s){var p,g,m=un(i(l),e.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,y=f/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var x=Math.max(0,Math.floor(Math.min(v,y))),_=sg(t.model),w=t.getExtent(),b=_.lastAutoInterval,S=_.lastTickCount;return null!=b&&null!=S&&Math.abs(b-x)<=1&&Math.abs(S-r)<=1&&x<b&&_.axisExtend0===w[0]&&_.axisExtend1===w[1]?x=b:(_.lastTickCount=r,_.lastAutoInterval=x,_.axisExtend0=w[0],_.axisExtend1=w[1]),x}(this)}};var xg=rg,_g={};E(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){_g[t]=it[t]});var wg={};function bg(t,e){var i=t.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return Mh(t,e,i[0]);if(n){for(var a=[],o=0;o<i.length;o++){var r=Mh(t,e,i[o]);a.push(r)}return a.join(" ")}}function Sg(t,e,i){Si.call(this),this.updateData(t,e,i)}E(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],function(t){wg[t]=ol[t]}),Wh.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(t,e){return Xf(this.getSource(),this)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},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}});var Mg=Sg.prototype,Ig=Sg.getSymbolSize=function(t,e){var i=t.getItemVisual(e,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};function Ag(t){return[t[0]/2,t[1]/2]}function Tg(t,e){this.parent.drift(t,e)}Mg._createSymbol=function(t,e,i,n,a){this.removeAll();var o=Jp(t,-1,-1,2,2,e.getItemVisual(i,"color"),a);o.attr({z2:100,culling:!0,scale:Ag(n)}),o.drift=Tg,this._symbolType=t,this.add(o)},Mg.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(t)},Mg.getSymbolPath=function(){return this.childAt(0)},Mg.getScale=function(){return this.childAt(0).scale},Mg.highlight=function(){this.childAt(0).trigger("emphasis")},Mg.downplay=function(){this.childAt(0).trigger("normal")},Mg.setZ=function(t,e){var i=this.childAt(0);i.zlevel=t,i.z=e},Mg.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":e.cursor},Mg.updateData=function(t,e,i){this.silent=!1;var n=t.getItemVisual(e,"symbol")||"circle",a=t.hostModel,o=Ig(t,e),r=n!==this._symbolType;if(r){var s=t.getItemVisual(e,"symbolKeepAspect");this._createSymbol(n,t,e,o,s)}else{(l=this.childAt(0)).silent=!1,js(l,{scale:Ag(o)},a,e)}if(this._updateCommon(t,e,o,i),r){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),qs(l,h,a,e)}this._seriesModel=a};var Dg=["itemStyle"],Cg=["emphasis","itemStyle"],Lg=["label"],kg=["emphasis","label"];function Pg(t,e){if(!this.incremental&&!this.useHoverLayer)if("emphasis"===e){var i=this.__symbolOriginalScale,n=i[1]/i[0],a={scale:[Math.max(1.1*i[0],i[0]+3),Math.max(1.1*i[1],i[1]+3*n)]};this.animateTo(a,400,"elasticOut")}else"normal"===e&&this.animateTo({scale:this.__symbolOriginalScale},400,"elasticOut")}function Ng(t){this.group=new Si,this._symbolCtor=t||Sg}Mg._updateCommon=function(i,t,e,n){var a=this.childAt(0),o=i.hostModel,r=i.getItemVisual(t,"color");"image"!==a.type?a.useStyle({strokeNoScale:!0}):a.setStyle({opacity:null,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});var s=n&&n.itemStyle,l=n&&n.hoverItemStyle,u=n&&n.symbolRotate,h=n&&n.symbolOffset,c=n&&n.labelModel,d=n&&n.hoverLabelModel,f=n&&n.hoverAnimation,p=n&&n.cursorStyle;if(!n||i.hasItemOption){var g=n&&n.itemModel?n.itemModel:i.getItemModel(t);s=g.getModel(Dg).getItemStyle(["color"]),l=g.getModel(Cg).getItemStyle(),u=g.getShallow("symbolRotate"),h=g.getShallow("symbolOffset"),c=g.getModel(Lg),d=g.getModel(kg),f=g.getShallow("hoverAnimation"),p=g.getShallow("cursor")}else l=L({},l);var m=a.style;a.attr("rotation",(u||0)*Math.PI/180||0),h&&a.attr("position",[xl(h[0],e[0]),xl(h[1],e[1])]),p&&a.attr("cursor",p),a.setColor(r,n&&n.symbolInnerColor),a.setStyle(s);var v=i.getItemVisual(t,"opacity");null!=v&&(m.opacity=v);var y=i.getItemVisual(t,"liftZ"),x=a.__z2Origin;null!=y?null==x&&(a.__z2Origin=a.z2,a.z2+=y):null!=x&&(a.z2=x,a.__z2Origin=null);var _=n&&n.useNameLabel;Bs(m,l,c,d,{labelFetcher:o,labelDataIndex:t,defaultText:function(t,e){return _?i.getName(t):bg(i,t)},isRectText:!0,autoColor:r}),a.__symbolOriginalScale=Ag(e),a.hoverStyle=l,a.highDownOnUpdate=f&&o.isAnimationEnabled()?Pg:null,Os(a)},Mg.fadeOut=function(t,e){var i=this.childAt(0);this.silent=i.silent=!0,e&&e.keepLabel||(i.style.text=null),js(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,t)},w(Sg,Si);var Og=Ng.prototype;function Eg(t,e,i,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(i,"symbol")}function Rg(t){return null==t||z(t)||(t={isIgnore:t}),t||{}}function zg(t){var e=t.hostModel;return{itemStyle:e.getModel("itemStyle").getItemStyle(["color"]),hoverItemStyle:e.getModel("emphasis.itemStyle").getItemStyle(),symbolRotate:e.get("symbolRotate"),symbolOffset:e.get("symbolOffset"),hoverAnimation:e.get("hoverAnimation"),labelModel:e.getModel("label"),hoverLabelModel:e.getModel("emphasis.label"),cursorStyle:e.get("cursor")}}function Bg(t,e,i){var n,a=t.getBaseAxis(),o=t.getOtherAxis(a),r=function(t,e){var i=0,n=t.scale.getExtent();"start"===e?i=n[0]:"end"===e?i=n[1]:0<n[0]?i=n[0]:n[1]<0&&(i=n[1]);return i}(o,i),s=a.dim,l=o.dim,u=e.mapDimension(l),h=e.mapDimension(s),c="x"===l||"radius"===l?1:0,d=N(t.dimensions,function(t){return e.mapDimension(t)}),f=e.getCalculationInfo("stackResultDimension");return(n|=Zf(e,d[0]))&&(d[0]=f),(n|=Zf(e,d[1]))&&(d[1]=f),{dataDimsForPoint:d,valueStart:r,valueAxisDim:l,baseAxisDim:s,stacked:!!n,valueDim:u,baseDim:h,baseDataOffset:c,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Vg(t,e,i,n){var a=NaN;t.stacked&&(a=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=t.valueStart);var o=t.baseDataOffset,r=[];return r[o]=i.get(t.baseDim,n),r[1-o]=a,e.dataToPoint(r)}Og.updateData=function(a,o){o=Rg(o);var r=this.group,s=a.hostModel,l=this._data,u=this._symbolCtor,h=zg(a);l||r.removeAll(),a.diff(l).add(function(t){var e=a.getItemLayout(t);if(Eg(a,e,t,o)){var i=new u(a,t,h);i.attr("position",e),a.setItemGraphicEl(t,i),r.add(i)}}).update(function(t,e){var i=l.getItemGraphicEl(e),n=a.getItemLayout(t);Eg(a,n,t,o)?(i?(i.updateData(a,t,h),js(i,{position:n},s)):(i=new u(a,t)).attr("position",n),r.add(i),a.setItemGraphicEl(t,i)):r.remove(i)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&e.fadeOut(function(){r.remove(e)})}).execute(),this._data=a},Og.isPersistent=function(){return!0},Og.updateLayout=function(){var n=this._data;n&&n.eachItemGraphicEl(function(t,e){var i=n.getItemLayout(e);t.attr("position",i)})},Og.incrementalPrepareUpdate=function(t){this._seriesScope=zg(t),this._data=null,this.group.removeAll()},Og.incrementalUpdate=function(t,e,i){function n(t){t.isGroup||(t.incremental=t.useHoverLayer=!0)}i=Rg(i);for(var a=t.start;a<t.end;a++){var o=e.getItemLayout(a);if(Eg(e,o,a,i)){var r=new this._symbolCtor(e,a,this._seriesScope);r.traverse(n),r.attr("position",o),this.group.add(r),e.setItemGraphicEl(a,r)}}},Og.remove=function(t){var e=this.group,i=this._data;i&&t?i.eachItemGraphicEl(function(t){t.fadeOut(function(){e.remove(t)})}):e.removeAll()};var Gg=St,Fg=Mt,Wg=ut,Hg=ot,Zg=[],Ug=[],Xg=[];function Yg(t){return isNaN(t[0])||isNaN(t[1])}function jg(t,e,i,n,a,o,r,s,l,u){return"none"!==u&&u?function(t,e,i,n,a,o,r,s,l,u,h){for(var c=0,d=i,f=0;f<n;f++){var p=e[d];if(a<=d||d<0)break;if(Yg(p)){if(h){d+=o;continue}break}if(d===i)t[0<o?"moveTo":"lineTo"](p[0],p[1]);else if(0<l){var g=e[c],m="y"===u?1:0,v=(p[m]-g[m])*l;Hg(Ug,g),Ug[m]=g[m]+v,Hg(Xg,p),Xg[m]=p[m]-v,t.bezierCurveTo(Ug[0],Ug[1],Xg[0],Xg[1],p[0],p[1])}else t.lineTo(p[0],p[1]);c=d,d+=o}return f}.apply(this,arguments):function(t,e,i,n,a,o,r,s,l,u,h){for(var c=0,d=i,f=0;f<n;f++){var p=e[d];if(a<=d||d<0)break;if(Yg(p)){if(h){d+=o;continue}break}if(d===i)t[0<o?"moveTo":"lineTo"](p[0],p[1]),Hg(Ug,p);else if(0<l){var g=d+o,m=e[g];if(h)for(;m&&Yg(e[g]);)m=e[g+=o];var v=.5,y=e[c];if(!(m=e[g])||Yg(m))Hg(Xg,p);else{var x,_;if(Yg(m)&&!h&&(m=p),ht(Zg,m,y),"x"===u||"y"===u){var w="x"===u?0:1;x=Math.abs(p[w]-y[w]),_=Math.abs(p[w]-m[w])}else x=yt(p,y),_=yt(p,m);Wg(Xg,p,Zg,-l*(1-(v=_/(_+x))))}Gg(Ug,Ug,s),Fg(Ug,Ug,r),Gg(Xg,Xg,s),Fg(Xg,Xg,r),t.bezierCurveTo(Ug[0],Ug[1],Xg[0],Xg[1],p[0],p[1]),Wg(Ug,p,Zg,l*v)}else t.lineTo(p[0],p[1]);c=d,d+=o}return f}.apply(this,arguments)}function qg(t,e){var i=[1/0,1/0],n=[-1/0,-1/0];if(e)for(var a=0;a<t.length;a++){var o=t[a];o[0]<i[0]&&(i[0]=o[0]),o[1]<i[1]&&(i[1]=o[1]),o[0]>n[0]&&(n[0]=o[0]),o[1]>n[1]&&(n[1]=o[1])}return{min:e?i:n,max:e?n:i}}var Kg=hr.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:Cr(hr.prototype.brush),buildPath:function(t,e){var i=e.points,n=0,a=i.length,o=qg(i,e.smoothConstraint);if(e.connectNulls){for(;0<a&&Yg(i[a-1]);a--);for(;n<a&&Yg(i[n]);n++);}for(;n<a;)n+=jg(t,i,n,a,a,1,o.min,o.max,e.smooth,e.smoothMonotone,e.connectNulls)+1}}),$g=hr.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:Cr(hr.prototype.brush),buildPath:function(t,e){var i=e.points,n=e.stackedOnPoints,a=0,o=i.length,r=e.smoothMonotone,s=qg(i,e.smoothConstraint),l=qg(n,e.smoothConstraint);if(e.connectNulls){for(;0<o&&Yg(i[o-1]);o--);for(;a<o&&Yg(i[a]);a++);}for(;a<o;){var u=jg(t,i,a,o,o,1,s.min,s.max,e.smooth,r,e.connectNulls);jg(t,n,a+u-1,u,o,-1,l.min,l.max,e.stackedOnSmooth,r,e.connectNulls),a+=u+1,t.closePath()}}});function Jg(t,e,i){var n=t.getArea(),a=t.getBaseAxis().isHorizontal(),o=n.x,r=n.y,s=n.width,l=n.height,u=i.get("lineStyle.width")||2,h=new Hr({shape:{x:o-=u/2,y:r-=u/2,width:s+=u,height:l+=u}});return e&&(h.shape[a?"width":"height"]=0,qs(h,{shape:{width:s,height:l}},i)),h}function Qg(t,e,i){var n=t.getArea(),a=new Pr({shape:{cx:_l(t.cx,1),cy:_l(t.cy,1),r0:_l(n.r0,1),r:_l(n.r,1),startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});return e&&(a.shape.endAngle=n.startAngle,qs(a,{shape:{endAngle:n.endAngle}},i)),a}function tm(t,e,i){return t?"polar"===t.type?Qg(t,e,i):"cartesian2d"===t.type?Jg(t,e,i):null:null}function em(t,e){if(t.length===e.length){for(var i=0;i<t.length;i++){var n=t[i],a=e[i];if(n[0]!==a[0]||n[1]!==a[1])return}return!0}}function im(t){return"number"==typeof t?t:t?.5:0}function nm(t,e,i){for(var n=e.getBaseAxis(),a="x"===n.dim||"radius"===n.dim?0:1,o=[],r=0;r<t.length-1;r++){var s=t[r+1],l=t[r];o.push(l);var u=[];switch(i){case"end":u[a]=s[a],u[1-a]=l[1-a],o.push(u);break;case"middle":var h=(l[a]+s[a])/2,c=[];u[a]=c[a]=h,u[1-a]=l[1-a],c[1-a]=s[1-a],o.push(u),o.push(c);break;default:u[a]=l[a],u[1-a]=s[1-a],o.push(u)}}return t[r]&&o.push(t[r]),o}function am(t,e,i){var n=t.get("showAllSymbol"),a="auto"===n;if(!n||a){var o=i.getAxesByScale("ordinal")[0];if(o&&(!a||!function(t,e){var i=t.getExtent(),n=Math.abs(i[1]-i[0])/t.scale.count();isNaN(n)&&(n=0);for(var a=e.count(),o=Math.max(1,Math.round(a/5)),r=0;r<a;r+=o)if(1.5*Sg.getSymbolSize(e,r)[t.isHorizontal()?1:0]>n)return!1;return!0}(o,e))){var r=e.mapDimension(o.dim),s={};return E(o.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(r,t))}}}}function om(t,e,i){if("cartesian2d"!==t.type)return Qg(t,e,i);var n=t.getBaseAxis().isHorizontal(),a=Jg(t,e,i);if(!i.get("clip",!0)){var o=a.shape,r=Math.max(o.width,o.height);n?(o.y-=r,o.height+=2*r):(o.x-=r,o.width+=2*r)}return a}ec.extend({type:"line",init:function(){var t=new Si,e=new Ng;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,i){var n=t.coordinateSystem,a=this.group,o=t.getData(),r=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=o.mapArray(o.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=t.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(t,e,i){if(!i.valueDim)return[];for(var n=[],a=0,o=e.count();a<o;a++)n.push(Vg(i,t,e,a));return n}(n,o,Bg(n,o,v)),x=t.get("showSymbol"),_=x&&!u&&am(t,o,n),w=this._data;w&&w.eachItemGraphicEl(function(t,e){t.__temp&&(a.remove(t),w.setItemGraphicEl(e,null))}),x||c.remove(),a.add(p);var b,S=!u&&t.get("step");n&&n.getArea&&(null!=(b=n.getArea()).width?(b.x-=.1,b.y-=.1,b.width+=.2,b.height+=.2):b.r0&&(b.r0-=.5,b.r1+=.5)),d&&h.type===n.type&&S===this._step?(m&&!f?f=this._newPolygon(l,y,n,g):f&&!m&&(p.remove(f),f=this._polygon=null),p.setClipPath(om(n,!1,t)),x&&c.updateData(o,{isIgnore:_,clipShape:b}),o.eachItemGraphicEl(function(t){t.stopAnimation(!0)}),em(this._stackedOnPoints,y)&&em(this._points,l)||(g?this._updateAnimation(o,y,n,i,S,v):(S&&(l=nm(l,n,S),y=nm(y,n,S)),d.setShape({points:l}),f&&f.setShape({points:l,stackedOnPoints:y})))):(x&&c.updateData(o,{isIgnore:_,clipShape:b}),S&&(l=nm(l,n,S),y=nm(y,n,S)),d=this._newPolyline(l,n,g),m&&(f=this._newPolygon(l,y,n,g)),p.setClipPath(om(n,!0,t)));var M=function(t,e){var i=t.getVisual("visualMeta");if(i&&i.length&&t.count()&&"cartesian2d"===e.type){for(var n,a,o=i.length-1;0<=o;o--){var r=i[o].dimension,s=t.dimensions[r],l=t.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){a=i[o];break}}if(a){var u=e.getAxis(n),h=N(a.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),c=h.length,d=a.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";E(h,function(t){t.offset=(t.coord-f)/g}),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new Jr(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(o,n)||o.getVisual("color");d.useStyle(C(r.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=t.get("smooth");if(I=im(t.get("smooth")),d.setShape({smooth:I,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),f){var A=o.getCalculationInfo("stackedOnSeries"),T=0;f.useStyle(C(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),A&&(T=im(A.get("smooth"))),f.setShape({smooth:I,stackedOnSmooth:T,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=o,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=S,this._valueOrigin=v},dispose:function(){},highlight:function(t,e,i,n){var a=t.getData(),o=Ca(a,n);if(!(o instanceof Array)&&null!=o&&0<=o){var r=a.getItemGraphicEl(o);if(!r){var s=a.getItemLayout(o);if(!s)return;(r=new Sg(a,o)).position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,a.setItemGraphicEl(o,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else ec.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var a=t.getData(),o=Ca(a,n);if(null!=o&&0<=o){var r=a.getItemGraphicEl(o);r&&(r.__temp?(a.setItemGraphicEl(o,null),this.group.remove(r)):r.downplay())}else ec.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new Kg({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new $g({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i},_updateAnimation:function(t,e,i,n,a,o){var r=this._polyline,s=this._polygon,l=t.hostModel,u=function(t,e,i,n,a,o,r,s){for(var l=function(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}(t,e),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=Bg(a,e,r),v=Bg(o,t,s),y=0;y<l.length;y++){var x=l[y],_=!0;switch(x.cmd){case"=":var w=t.getItemLayout(x.idx),b=e.getItemLayout(x.idx1);(isNaN(w[0])||isNaN(w[1]))&&(w=b.slice()),u.push(w),h.push(b),c.push(i[x.idx]),d.push(n[x.idx1]),g.push(e.getRawIndex(x.idx1));break;case"+":var S=x.idx;u.push(a.dataToPoint([e.get(m.dataDimsForPoint[0],S),e.get(m.dataDimsForPoint[1],S)])),h.push(e.getItemLayout(S).slice()),c.push(Vg(m,a,e,S)),d.push(n[S]),g.push(e.getRawIndex(S));break;case"-":S=x.idx;var M=t.getRawIndex(S);M!==S?(u.push(t.getItemLayout(S)),h.push(o.dataToPoint([t.get(v.dataDimsForPoint[0],S),t.get(v.dataDimsForPoint[1],S)])),c.push(i[S]),d.push(Vg(v,o,t,S)),g.push(M)):_=!1}_&&(f.push(x),p.push(p.length))}p.sort(function(t,e){return g[t]-g[e]});var I=[],A=[],T=[],D=[],C=[];for(y=0;y<p.length;y++){S=p[y];I[y]=u[S],A[y]=h[S],T[y]=c[S],D[y]=d[S],C[y]=f[S]}return{current:I,next:A,stackedOnCurrent:T,stackedOnNext:D,status:C}}(this._data,t,this._stackedOnPoints,e,this._coordSys,i,this._valueOrigin,o),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;a&&(h=nm(u.current,i,a),c=nm(u.stackedOnCurrent,i,a),d=nm(u.next,i,a),f=nm(u.stackedOnNext,i,a)),r.shape.__points=u.current,r.shape.points=h,js(r,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),js(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;m<g.length;m++){if("="===g[m].cmd){var v=t.getItemGraphicEl(g[m].idx1);v&&p.push({el:v,ptIdx:m})}}r.animators&&r.animators.length&&r.animators[0].during(function(){for(var t=0;t<p.length;t++){p[t].el.attr("position",r.shape.__points[p[t].ptIdx])}})},remove:function(t){var i=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(t,e){t.__temp&&(i.remove(t),n.setItemGraphicEl(e,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}});function rm(t,r,s){return{seriesType:t,performRawSeries:!0,reset:function(l,t,e){var i=l.getData(),u=l.get("symbol"),h=l.get("symbolSize"),n=l.get("symbolKeepAspect"),c=O(u),d=O(h),f=c||d,a=!c&&u?u:r,o=d?null:h;if(i.setVisual({legendSymbol:s||a,symbol:a,symbolSize:o,symbolKeepAspect:n}),!t.isSeriesFiltered(l))return{dataEach:i.hasItemOption||f?function(t,e){if(f){var i=l.getRawValue(e),n=l.getDataParams(e);c&&t.setItemVisual(e,"symbol",u(i,n)),d&&t.setItemVisual(e,"symbolSize",h(i,n))}if(t.hasItemOption){var a=t.getItemModel(e),o=a.getShallow("symbol",!0),r=a.getShallow("symbolSize",!0),s=a.getShallow("symbolKeepAspect",!0);null!=o&&t.setItemVisual(e,"symbol",o),null!=r&&t.setItemVisual(e,"symbolSize",r),null!=s&&t.setItemVisual(e,"symbolKeepAspect",s)}}:null}}}}function sm(t){return{seriesType:t,plan:Jh(),reset:function(t){var e=t.getData(),c=t.coordinateSystem,d=t.pipelineContext.large;if(c){var f=N(c.dimensions,function(t){return e.mapDimension(t)}).slice(0,2),p=f.length,i=e.getCalculationInfo("stackResultDimension");return Zf(e,f[0])&&(f[0]=i),Zf(e,f[1])&&(f[1]=i),p&&{progress:function(t,e){for(var i=t.end-t.start,n=d&&new Float32Array(i*p),a=t.start,o=0,r=[],s=[];a<t.end;a++){var l;if(1===p){var u=e.get(f[0],a);l=!isNaN(u)&&c.dataToPoint(u,null,s)}else{u=r[0]=e.get(f[0],a);var h=r[1]=e.get(f[1],a);l=!isNaN(u)&&!isNaN(h)&&c.dataToPoint(r,null,s)}d?(n[o++]=l?l[0]:NaN,n[o++]=l?l[1]:NaN):e.setItemLayout(a,l&&l.slice()||[NaN,NaN])}d&&e.setLayout("symbolPoints",n)}}}}}}function lm(t,e){return Math.round(t.length/2)}var um={average:function(t){for(var e=0,i=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],i++);return 0===i?NaN:e/i},sum:function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i]||0;return e},max:function(t){for(var e=-1/0,i=0;i<t.length;i++)t[i]>e&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;i<t.length;i++)t[i]<e&&(e=t[i]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}};function hm(t){return this._axes[t]}function cm(t){this._axes={},this._dimList=[],this.name=t||""}function dm(t){cm.call(this,t)}cm.prototype={constructor:cm,type:"cartesian",getAxis:function(t){return this._axes[t]},getAxes:function(){return N(this._dimList,hm,this)},getAxesByScale:function(e){return e=e.toLowerCase(),M(this.getAxes(),function(t){return t.scale.type===e})},addAxis:function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},dataToCoord:function(t){return this._dataCoordConvert(t,"dataToCoord")},coordToData:function(t){return this._dataCoordConvert(t,"coordToData")},_dataCoordConvert:function(t,e){for(var i=this._dimList,n=t instanceof Array?[]:{},a=0;a<i.length;a++){var o=i[a],r=this._axes[o];n[o]=r[e](t[o])}return n}},dm.prototype={constructor:dm,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(t){var e=this.getAxis("x"),i=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},dataToPoint:function(t,e,i){var n=this.getAxis("x"),a=this.getAxis("y");return(i=i||[])[0]=n.toGlobalCoord(n.dataToCoord(t[0])),i[1]=a.toGlobalCoord(a.dataToCoord(t[1])),i},clampData:function(t,e){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,a=i.getExtent(),o=n.getExtent(),r=i.parse(t[0]),s=n.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(a[0],a[1]),r),Math.max(a[0],a[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},pointToData:function(t,e){var i=this.getAxis("x"),n=this.getAxis("y");return(e=e||[])[0]=i.coordToData(i.toLocalCoord(t[0])),e[1]=n.coordToData(n.toLocalCoord(t[1])),e},getOtherAxis:function(t){return this.getAxis("x"===t.dim?"y":"x")},getArea:function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1]),n=Math.min(e[0],e[1]);return new bi(i,n,Math.max(t[0],t[1])-i,Math.max(e[0],e[1])-n)}},w(dm,cm);function fm(t,e,i,n,a){vg.call(this,t,e,i),this.type=n||"value",this.position=a||"bottom"}fm.prototype={constructor:fm,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},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},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},w(fm,vg);var pm={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:"#333",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:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},gm={};gm.categoryAxis=m({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},pm),gm.valueAxis=m({boundaryGap:[0,0],splitNumber:5},pm),gm.timeAxis=C({scale:!0,min:"dataMin",max:"dataMax"},gm.valueAxis),gm.logAxis=C({scale:!0,logBase:10},gm.valueAxis);function mm(o,t,r,e){E(vm,function(a){t.extend({type:o+"Axis."+a,mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?su(t):{};m(t,e.getTheme().get(a+"Axis")),m(t,this.getDefaultOption()),t.type=r(o,t),i&&ru(t,n,i)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=jf.createByAxisModel(this))},getCategories:function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:p([{},gm[a+"Axis"],e],!0)})}),fu.registerSubTypeDefaulter(o+"Axis",A(r,o))}var vm=["value","category","time","log"],ym=fu.extend({type:"cartesian2dAxis",axis:null,init:function(){ym.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){ym.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){ym.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function xm(t,e){return e.type||(e.data?"category":"value")}m(ym.prototype,Hp);var _m={offset:0};function wm(t,e){return t.getCoordSysModel()===e}function bm(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}mm("x",ym,xm,_m),mm("y",ym,xm,_m),fu.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Sm=bm.prototype;function Mm(t,e,i,n){i.getAxesOnZeroOf=function(){return a?[a]:[]};var a,o=t[e],r=i.model,s=r.get("axisLine.onZero"),l=r.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)Im(o[l])&&(a=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&Im(o[u])&&!n[h(o[u])]){a=o[u];break}a&&(n[h(a)]=!0)}function h(t){return t.dim+"_"+t.index}}function Im(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(0<i&&0<n||i<0&&n<0)}(t)}Sm.type="grid",Sm.axisPointerEnabled=!0,Sm.getRect=function(){return this._rect},Sm.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model),E(i.x,function(t){zp(t.scale,t.model)}),E(i.y,function(t){zp(t.scale,t.model)});var n={};E(i.x,function(t){Mm(i,"y",t,n)}),E(i.y,function(t){Mm(i,"x",t,n)}),this.resize(this.model,e)},Sm.resize=function(t,e,i){var a=au(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=a;var n=this._axesList;function o(){E(n,function(t){var e=t.isHorizontal(),i=e?[0,a.width]:[0,a.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),function(t,e){var i=t.getExtent(),n=i[0]+i[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}}(t,e?a.x:a.y)})}o(),!i&&t.get("containLabel")&&(E(n,function(t){if(!t.model.get("axisLabel.inside")){var e=function(t){var e=t.model,i=t.scale;if(e.get("axisLabel.show")&&!i.isBlank()){var n,a,o="category"===t.type,r=i.getExtent();a=o?i.count():(n=i.getTicks()).length;var s,l,u,h,c,d,f,p,g,m=t.getLabelModel(),v=Vp(t),y=1;40<a&&(y=Math.ceil(a/40));for(var x=0;x<a;x+=y){var _=v(n?n[x]:r[0]+x),w=m.getTextRect(_),b=(l=w,u=m.get("rotate")||0,void 0,h=u*Math.PI/180,c=l.plain(),d=c.width,f=c.height,p=d*Math.cos(h)+f*Math.sin(h),g=d*Math.sin(h)+f*Math.cos(h),new bi(c.x,c.y,p,g));s?s.union(b):s=b}return s}}(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get("axisLabel.margin");a[i]-=e[i]+n,"top"===t.position?a.y+=e.height+n:"left"===t.position&&(a.x+=e.width+n)}}}),o())},Sm.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i){if(null==e)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[e]}},Sm.getAxes=function(){return this._axesList.slice()},Sm.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}z(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===t||a[n].getAxis("y").index===e)return a[n]},Sm.getCartesians=function(){return this._coordsList.slice()},Sm.convertToPixel=function(t,e,i){var n=this._findConvertTarget(t,e);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},Sm.convertFromPixel=function(t,e,i){var n=this._findConvertTarget(t,e);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},Sm._findConvertTarget=function(t,e){var i,n,a=e.seriesModel,o=e.xAxisModel||a&&a.getReferringComponents("xAxis")[0],r=e.yAxisModel||a&&a.getReferringComponents("yAxis")[0],s=e.gridModel,l=this._coordsList;if(a)_(l,i=a.coordinateSystem)<0&&(i=null);else if(o&&r)i=this.getCartesian(o.componentIndex,r.componentIndex);else if(o)n=this.getAxis("x",o.componentIndex);else if(r)n=this.getAxis("y",r.componentIndex);else if(s){s.coordinateSystem===this&&(i=this._coordsList[0])}return{cartesian:i,axis:n}},Sm.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},Sm._initCartesian=function(r,t,e){var s={left:!1,right:!1,top:!1,bottom:!1},l={x:{},y:{}},u={x:0,y:0};if(t.eachComponent("xAxis",i("x"),this),t.eachComponent("yAxis",i("y"),this),!u.x||!u.y)return this._axesMap={},void(this._axesList=[]);function i(o){return function(t,e){if(wm(t,r)){var i=t.get("position");"x"===o?"top"!==i&&"bottom"!==i&&(i=s.bottom?"top":"bottom"):"left"!==i&&"right"!==i&&(i=s.left?"right":"left"),s[i]=!0;var n=new fm(o,Bp(t),[0,0],t.get("type"),i),a="category"===n.type;n.onBand=a&&t.get("boundaryGap"),n.inverse=t.get("inverse"),(t.axis=n).model=t,n.grid=this,n.index=e,this._axesList.push(n),l[o][e]=n,u[o]++}}}E((this._axesMap=l).x,function(a,o){E(l.y,function(t,e){var i="x"+o+"y"+e,n=new dm(i);n.grid=this,n.model=r,this._coordsMap[i]=n,this._coordsList.push(n),n.addAxis(a),n.addAxis(t)},this)},this)},Sm._updateScale=function(l,u){function h(e,i){E(e.mapDimension(i.dim,!0),function(t){i.scale.unionExtentFromData(e,Uf(e,t))})}E(this._axesList,function(t){t.scale.setExtent(1/0,-1/0)}),l.eachSeries(function(t){if(Dm(t)){var e=Tm(t,l),i=e[0],n=e[1];if(!wm(i,u)||!wm(n,u))return;var a=this.getCartesian(i.componentIndex,n.componentIndex),o=t.getData(),r=a.getAxis("x"),s=a.getAxis("y");"list"===o.type&&(h(o,r,t),h(o,s,t))}},this)},Sm.getTooltipAxes=function(n){var a=[],o=[];return E(this.getCartesians(),function(t){var e=null!=n&&"auto"!==n?t.getAxis(n):t.getBaseAxis(),i=t.getOtherAxis(e);_(a,e)<0&&a.push(e),_(o,i)<0&&o.push(i)}),{baseAxes:a,otherAxes:o}};var Am=["xAxis","yAxis"];function Tm(e){return N(Am,function(t){return e.getReferringComponents(t)[0]})}function Dm(t){return"cartesian2d"===t.get("coordinateSystem")}bm.create=function(n,a){var o=[];return n.eachComponent("grid",function(t,e){var i=new bm(t,n,a);i.name="grid_"+e,i.resize(t,a,!0),t.coordinateSystem=i,o.push(i)}),n.eachSeries(function(t){if(Dm(t)){var e=Tm(t),i=e[0],n=e[1],a=i.getCoordSysModel().coordinateSystem;t.coordinateSystem=a.getCartesian(i.componentIndex,n.componentIndex)}}),o},bm.dimensions=bm.prototype.dimensions=dm.prototype.dimensions,Hu.register("cartesian2d",bm);function Cm(t,e){this.opt=e,this.axisModel=t,C(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new Si;var i=new Si({position:e.position.slice(),rotation:e.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i}var Lm=Math.PI;Cm.prototype={constructor:Cm,hasBuilder:function(t){return!!km[t]},add:function(t){km[t].call(this)},getGroup:function(){return this.group}};var km={axisLine:function(){var o=this.opt,t=this.axisModel;if(t.get("axisLine.show")){var e=this.axisModel.axis.getExtent(),i=this._transform,r=[e[0],0],n=[e[1],0];i&&(bt(r,r,i),bt(n,n,i));var s=L({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new Ur({anid:"line",subPixelOptimize:!0,shape:{x1:r[0],y1:r[1],x2:n[0],y2:n[1]},style:s,strokeContainThreshold:o.strokeContainThreshold||5,silent:!0,z2:1}));var l=t.get("axisLine.symbol"),a=t.get("axisLine.symbolSize"),u=t.get("axisLine.symbolOffset")||0;if("number"==typeof u&&(u=[u,u]),null!=l){"string"==typeof l&&(l=[l,l]),"string"!=typeof a&&"number"!=typeof a||(a=[a,a]);var h=a[0],c=a[1];E([{rotate:o.rotation+Math.PI/2,offset:u[0],r:0},{rotate:o.rotation-Math.PI/2,offset:u[1],r:Math.sqrt((r[0]-n[0])*(r[0]-n[0])+(r[1]-n[1])*(r[1]-n[1]))}],function(t,e){if("none"!==l[e]&&null!=l[e]){var i=Jp(l[e],-h/2,-c/2,h,c,s.stroke,!0),n=t.r+t.offset,a=[r[0]+n*Math.cos(o.rotation),r[1]-n*Math.sin(o.rotation)];i.attr({rotation:t.rotate,position:a,silent:!0,z2:11}),this.group.add(i)}},this)}}},axisTickLabel:function(){var t=this.axisModel,e=this.opt,i=function(t,e,i){var n=e.axis;if(!e.get("axisTick.show")||n.scale.isBlank())return;for(var a=e.getModel("axisTick"),o=a.getModel("lineStyle"),r=a.get("length"),s=n.getTicksCoords(),l=[],u=[],h=t._transform,c=[],d=0;d<s.length;d++){var f=s[d].coord;l[0]=f,l[1]=0,u[0]=f,u[1]=i.tickDirection*r,h&&(bt(l,l,h),bt(u,u,h));var p=new Ur({anid:"tick_"+s[d].tickValue,subPixelOptimize:!0,shape:{x1:l[0],y1:l[1],x2:u[0],y2:u[1]},style:C(o.getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")}),z2:2,silent:!0});t.group.add(p),c.push(p)}return c}(this,t,e);!function(t,e,i){if(Wp(t.axis))return;var n=t.get("axisLabel.showMinLabel"),a=t.get("axisLabel.showMaxLabel");i=i||[];var o=(e=e||[])[0],r=e[1],s=e[e.length-1],l=e[e.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(Em(o),Em(u)):Rm(o,r)&&(n?(Em(r),Em(h)):(Em(o),Em(u)));!1===a?(Em(s),Em(c)):Rm(l,s)&&(a?(Em(l),Em(d)):(Em(s),Em(c)))}(t,function(u,h,c){var d=h.axis;if(!W(c.axisLabelShow,h.get("axisLabel.show"))||d.scale.isBlank())return;var f=h.getModel("axisLabel"),p=f.get("margin"),t=d.getViewLabels(),e=(W(c.labelRotate,f.get("rotate"))||0)*Lm/180,g=Nm(c.rotation,e,c.labelDirection),m=h.getCategories&&h.getCategories(!0),v=[],y=Om(h),x=h.get("triggerEvent");return E(t,function(t,e){var i=t.tickValue,n=t.formattedLabel,a=t.rawLabel,o=f;m&&m[i]&&m[i].textStyle&&(o=new dl(m[i].textStyle,f,h.ecModel));var r=o.getTextColor()||h.get("axisLine.lineStyle.color"),s=[d.dataToCoord(i),c.labelOffset+c.labelDirection*p],l=new Dr({anid:"label_"+i,position:s,rotation:g.rotation,silent:y,z2:10});Gs(l.style,o,{text:n,textAlign:o.getShallow("align",!0)||g.textAlign,textVerticalAlign:o.getShallow("verticalAlign",!0)||o.getShallow("baseline",!0)||g.textVerticalAlign,textFill:"function"==typeof r?r("category"===d.type?a:"value"===d.type?i+"":i,e):r}),x&&(l.eventData=Pm(h),l.eventData.targetType="axisLabel",l.eventData.value=a),u._dumbGroup.add(l),l.updateTransform(),v.push(l),u.group.add(l),l.decomposeTransform()}),v}(this,t,e),i)},axisName:function(){var t=this.opt,e=this.axisModel,i=W(t.axisName,e.get("name"));if(i){var n,a,o=e.get("nameLocation"),r=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=this.axisModel.axis.getExtent(),h=u[0]>u[1]?-1:1,c=["start"===o?u[0]-h*l:"end"===o?u[1]+h*l:(u[0]+u[1])/2,zm(o)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*Lm/180),zm(o)?n=Nm(t.rotation,null!=d?d:t.rotation,r):(n=function(t,e,i,n){var a,o,r=Tl(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;a=Dl(r-Lm/2)?(o=l?"bottom":"top","center"):Dl(r-1.5*Lm)?(o=l?"top":"bottom","center"):(o="middle",r<1.5*Lm&&Lm/2<r?l?"left":"right":l?"right":"left");return{rotation:r,textAlign:a,textVerticalAlign:o}}(t,o,d||0,u),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(n.rotation)),isFinite(a)||(a=null)));var f=s.getFont(),p=e.get("nameTruncate",!0)||{},g=p.ellipsis,m=W(t.nameTruncateMaxWidth,p.maxWidth,a),v=null!=g&&null!=m?$l(i,m,f,g,{minChar:2,placeholder:p.placeholder}):i,y=e.get("tooltip",!0),x=e.mainType,_={componentType:x,name:i,$vars:["name"]};_[x+"Index"]=e.componentIndex;var w=new Dr({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:Om(e),z2:1,tooltip:y&&y.show?L({content:i,formatter:function(){return i},formatterParams:_},y):null});Gs(w.style,s,{text:v,textFont:f,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:s.get("align")||n.textAlign,textVerticalAlign:s.get("verticalAlign")||n.textVerticalAlign}),e.get("triggerEvent")&&(w.eventData=Pm(e),w.eventData.targetType="axisName",w.eventData.name=i),this._dumbGroup.add(w),w.updateTransform(),this.group.add(w),w.decomposeTransform()}}},Pm=Cm.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},Nm=Cm.innerTextLayout=function(t,e,i){var n,a=Tl(e-t);return{rotation:a,textAlign:Dl(a)?(n=0<i?"top":"bottom","center"):Dl(a-Lm)?(n=0<i?"bottom":"top","center"):(n="middle",0<a&&a<Lm?0<i?"right":"left":0<i?"left":"right"),textVerticalAlign:n}};var Om=Cm.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)};function Em(t){t&&(t.ignore=!0)}function Rm(t,e){var i=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(i&&n){var a=te([]);return ae(a,a,-t.rotation),i.applyTransform(ie([],a,t.getLocalTransform())),n.applyTransform(ie([],a,e.getLocalTransform())),i.intersect(n)}}function zm(t){return"middle"===t||"center"===t}var Bm=E,Vm=A;function Gm(t,e){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(p,g,t){var o=g.getComponent("tooltip"),m=g.getComponent("axisPointer"),v=m.get("link",!0)||[],y=[];Bm(t.getCoordinateSystems(),function(c){if(c.axisPointerEnabled){var t=Zm(c.model),d=p.coordSysAxesInfo[t]={},f=(p.coordSysMap[t]=c).model.getModel("tooltip",o);if(Bm(c.getAxes(),Vm(a,!1,null)),c.getTooltipAxes&&o&&f.get("show")){var e="axis"===f.get("trigger"),i="cross"===f.get("axisPointer.type"),n=c.getTooltipAxes(f.get("axisPointer.axis"));(e||i)&&Bm(n.baseAxes,Vm(a,!i||"cross",e)),i&&Bm(n.otherAxes,Vm(a,"cross",!1))}}function a(t,e,i){var n=i.model.getModel("axisPointer",m),a=n.get("show");if(a&&("auto"!==a||t||Hm(n))){null==e&&(e=n.get("triggerTooltip"));var o=(n=t?function(t,e,i,n,a,o){var r=e.getModel("axisPointer"),s={};Bm(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){s[t]=D(r.get(t))}),s.snap="category"!==t.type&&!!o,"cross"===r.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===a){var u=r.get("label.show");if(l.show=null==u||u,!o){var h=s.lineStyle=r.get("crossStyle");h&&C(l,h.textStyle)}}return t.model.getModel("axisPointer",new dl(s,i,n))}(i,f,m,g,t,e):n).get("snap"),r=Zm(i.model),s=e||o||"category"===i.type,l=p.axesInfo[r]={key:r,axis:i,coordSys:c,axisPointerModel:n,triggerTooltip:e,involveSeries:s,snap:o,useHandle:Hm(n),seriesModels:[]};d[r]=l,p.seriesInvolved|=s;var u=function(t,e){for(var i=e.model,n=e.dim,a=0;a<t.length;a++){var o=t[a]||{};if(Fm(o[n+"AxisId"],i.id)||Fm(o[n+"AxisIndex"],i.componentIndex)||Fm(o[n+"AxisName"],i.name))return a}}(v,i);if(null!=u){var h=y[u]||(y[u]={axesInfo:{}});h.axesInfo[r]=l,h.mapper=v[u].mapper,l.linkGroup=h}}}})}(i,t,e),i.seriesInvolved&&function(a,t){t.eachSeries(function(i){var n=i.coordinateSystem,t=i.get("tooltip.trigger",!0),e=i.get("tooltip.show",!0);n&&"none"!==t&&!1!==t&&"item"!==t&&!1!==e&&!1!==i.get("axisPointer.show",!0)&&Bm(a.coordSysAxesInfo[Zm(n.model)],function(t){var e=t.axis;n.getAxis(e.dim)===e&&(t.seriesModels.push(i),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=i.getData().count())})},this)}(i,t),i}function Fm(t,e){return"all"===t||k(t)&&0<=_(t,e)||t===e}function Wm(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Zm(t)]}function Hm(t){return!!t.get("handle.show")}function Zm(t){return t.type+"||"+t.id}var Um=lf({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,i,n){this.axisPointerClass&&function(t){var e=Wm(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,a=i.option,o=i.get("status"),r=i.get("value");null!=r&&(r=n.parse(r));var s=Hm(i);null==o&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r<l[0]&&(r=l[0]),a.value=r,s&&(a.status=e.axis.scale.isBlank()?"hide":"show")}}(t),Um.superApply(this,"render",arguments),Xm(this,t,e,i,n,!0)},updateAxisPointer:function(t,e,i,n,a){Xm(this,t,e,i,n,!1)},remove:function(t,e){var i=this._axisPointer;i&&i.remove(e),Um.superApply(this,"remove",arguments)},dispose:function(t,e){Ym(this,e),Um.superApply(this,"dispose",arguments)}});function Xm(t,e,i,n,a,o){var r=Um.getAxisPointerClass(t.axisPointerClass);if(r){var s=function(t){var e=Wm(t);return e&&e.axisPointerModel}(e);s?(t._axisPointer||(t._axisPointer=new r)).render(e,s,n,o):Ym(t,n)}}function Ym(t,e,i){var n=t._axisPointer;n&&n.dispose(e,i),t._axisPointer=null}var jm=[];function qm(t,e,i){i=i||{};var n=t.coordinateSystem,a=e.axis,o={},r=a.getAxesOnZeroOf()[0],s=a.position,l=r?"onZero":s,u=a.dim,h=n.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},f=e.get("offset")||0,p="x"===u?[c[2]-f,c[3]+f]:[c[0]-f,c[1]+f];if(r){var g=r.toGlobalCoord(r.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}o.position=["y"===u?p[d[l]]:c[0],"x"===u?p[d[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=r?p[d[s]]-p[d.onZero]:0,e.get("axisTick.inside")&&(o.tickDirection=-o.tickDirection),W(i.labelInside,e.get("axisLabel.inside"))&&(o.labelDirection=-o.labelDirection);var m=e.get("axisLabel.rotate");return o.labelRotate="top"===l?-m:m,o.z2=1,o}Um.registerAxisPointerClass=function(t,e){jm[t]=e},Um.getAxisPointerClass=function(t){return t&&jm[t]};var Km=["axisLine","axisTickLabel","axisName"],$m=["splitArea","splitLine"],Jm=Um.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,i,n){this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new Si,this.group.add(this._axisGroup),e.get("show")){var o=e.getCoordSysModel(),r=qm(o,e),s=new Cm(e,r);E(Km,s.add,s),this._axisGroup.add(s.getGroup()),E($m,function(t){e.get(t+".show")&&this["_"+t](e,o)},this),Qs(a,this._axisGroup,e),Jm.superCall(this,"render",e,t,i,n)}},remove:function(){this._splitAreaColors=null},_splitLine:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitLine"),a=n.getModel("lineStyle"),o=a.get("color");o=k(o)?o:[o];for(var r=e.coordinateSystem.getRect(),s=i.isHorizontal(),l=0,u=i.getTicksCoords({tickModel:n}),h=[],c=[],d=a.getLineStyle(),f=0;f<u.length;f++){var p=i.toGlobalCoord(u[f].coord);s?(h[0]=p,h[1]=r.y,c[0]=p,c[1]=r.y+r.height):(h[0]=r.x,h[1]=p,c[0]=r.x+r.width,c[1]=p);var g=l++%o.length,m=u[f].tickValue;this._axisGroup.add(new Ur({anid:null!=m?"line_"+u[f].tickValue:null,subPixelOptimize:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:C({stroke:o[g]},d),silent:!0}))}}},_splitArea:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitArea"),a=n.getModel("areaStyle"),o=a.get("color"),r=e.coordinateSystem.getRect(),s=i.getTicksCoords({tickModel:n,clamp:!0});if(s.length){var l=o.length,u=this._splitAreaColors,h=Q(),c=0;if(u)for(var d=0;d<s.length;d++){var f=u.get(s[d].tickValue);if(null!=f){c=(f+(l-1)*d)%l;break}}var p=i.toGlobalCoord(s[0].coord),g=a.getAreaStyle();o=k(o)?o:[o];for(d=1;d<s.length;d++){var m,v,y,x,_=i.toGlobalCoord(s[d].coord);p=i.isHorizontal()?(m=p,v=r.y,y=_-m,x=r.height,m+y):(m=r.x,v=p,y=r.width,v+(x=_-v));var w=s[d-1].tickValue;null!=w&&h.set(w,c),this._axisGroup.add(new Hr({anid:null!=w?"area_"+w:null,shape:{x:m,y:v,width:y,height:x},style:C({fill:o[c]},g),silent:!0})),c=(c+1)%l}this._splitAreaColors=h}}}});Jm.extend({type:"xAxis"}),Jm.extend({type:"yAxis"}),lf({type:"grid",render:function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new Hr({shape:t.coordinateSystem.getRect(),style:C({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))}}),Jd(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})}),af(rm("line","circle","line")),nf(sm("line")),Qd(cd.PROCESSOR.STATISTIC,{seriesType:"line",modifyOutputEnd:!0,reset:function(t,e,i){var n=t.getData(),a=t.get("sampling"),o=t.coordinateSystem;if("cartesian2d"===o.type&&a){var r,s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),h=u[1]-u[0],c=Math.round(n.count()/h);1<c&&("string"==typeof a?r=um[a]:"function"==typeof a&&(r=a),r&&t.setData(n.downSample(n.mapDimension(l.dim),1/c,r,lm)))}}});var Qm=Wh.extend({type:"series.__base_bar__",getInitialData:function(t,e){return Xf(this.getSource(),this)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var i=e.dataToPoint(e.clampData(t)),n=this.getData(),a=n.getLayout("offset"),o=n.getLayout("size");return i[e.getBaseAxis().isHorizontal()?0:1]+=a+o/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});function tv(t,e,i,n,a,o){Bs(t,e,i.getModel("label"),i.getModel("emphasis.label"),{labelFetcher:a,labelDataIndex:o,defaultText:bg(a.getData(),o),isRectText:!0,autoColor:n}),ev(t),ev(e)}function ev(t,e){"outside"===t.textPosition&&(t.textPosition=e)}Qm.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return t<e&&(t=e),t},defaultOption:{clip:!0,roundCap:!1}});var iv=Xa([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),nv={getBarItemStyle:function(t){var e=iv(this,t);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(e.lineDash=i)}return e}},av=ds({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},buildPath:function(t,e){var i=e.cx,n=e.cy,a=Math.max(e.r0||0,0),o=Math.max(e.r,0),r=.5*(o-a),s=a+r,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(t.moveTo(c*a+i,d*a+n),t.arc(c*s+i,d*s+n,r,-Math.PI+l,l,!h)),t.arc(i,n,o,l,u,!h),t.moveTo(f*o+i,p*o+n),t.arc(f*s+i,p*s+n,r,u-2*Math.PI,u-Math.PI,!h),0!==a&&(t.arc(i,n,a,u,l,h),t.moveTo(c*a+i,p*a+n)),t.closePath()}}),ov=["itemStyle","barBorderWidth"],rv=[0,0];L(dl.prototype,nv),hf({type:"bar",render:function(t,e,i){this._updateDrawMode(t);var n=t.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(t,e,i):this._renderNormal(t,e,i)),this.group},incrementalPrepareRender:function(t,e,i){this._clear(),this._updateDrawMode(t)},incrementalRender:function(t,e,i,n){this._incrementalRenderLarge(t,e)},_updateDrawMode:function(t){var e=t.pipelineContext.large;(null==this._isLargeDraw||e^this._isLargeDraw)&&(this._isLargeDraw=e,this._clear())},_renderNormal:function(o,t,e){var r,s=this.group,l=o.getData(),u=this._data,h=o.coordinateSystem,i=h.getBaseAxis();"cartesian2d"===h.type?r=i.isHorizontal():"polar"===h.type&&(r="angle"===i.dim);var c=o.isAnimationEnabled()?o:null,d=o.get("clip",!0),f=function(t,e){var i=t.getArea&&t.getArea();if("cartesian2d"===t.type){var n=t.getBaseAxis();if("category"!==n.type||!n.onBand){var a=e.getLayout("bandWidth");n.isHorizontal()?(i.x-=a,i.width+=2*a):(i.y-=a,i.height+=2*a)}}return i}(h,l);s.removeClipPath();var p=o.get("roundCap",!0);l.diff(u).add(function(t){if(l.hasValue(t)){var e=l.getItemModel(t),i=fv[h.type](l,t,e);if(d)if(uv[h.type](f,i))return void s.remove(n);var n=hv[h.type](t,i,r,c,!1,p);l.setItemGraphicEl(t,n),s.add(n),pv(n,l,t,e,i,o,r,"polar"===h.type)}}).update(function(t,e){var i=u.getItemGraphicEl(e);if(l.hasValue(t)){var n=l.getItemModel(t),a=fv[h.type](l,t,n);if(d)if(uv[h.type](f,a))return void s.remove(i);i?js(i,{shape:a},c,t):i=hv[h.type](t,a,r,c,!0,p),l.setItemGraphicEl(t,i),s.add(i),pv(i,l,t,n,a,o,r,"polar"===h.type)}else s.remove(i)}).remove(function(t){var e=u.getItemGraphicEl(t);"cartesian2d"===h.type?e&&cv(t,c,e):e&&dv(t,c,e)}).execute(),this._data=l},_renderLarge:function(t,e,i){this._clear(),mv(t,this.group);var n=t.get("clip",!0)?tm(t.coordinateSystem,!1,t):null;n?this.group.setClipPath(n):this.group.removeClipPath()},_incrementalRenderLarge:function(t,e){mv(e,this.group,!0)},dispose:et,remove:function(t){this._clear(t)},_clear:function(e){var t=this.group,i=this._data;e&&e.get("animation")&&i&&!this._isLargeDraw?i.eachItemGraphicEl(function(t){"sector"===t.type?dv(t.dataIndex,e,t):cv(t.dataIndex,e,t)}):t.removeAll(),this._data=null}});var sv=Math.max,lv=Math.min,uv={cartesian2d:function(t,e){var i=e.width<0?-1:1,n=e.height<0?-1:1;i<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var a=sv(e.x,t.x),o=lv(e.x+e.width,t.x+t.width),r=sv(e.y,t.y),s=lv(e.y+e.height,t.y+t.height);e.x=a,e.y=r,e.width=o-a,e.height=s-r;var l=e.width<0||e.height<0;return i<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),l},polar:function(t){return!1}},hv={cartesian2d:function(t,e,i,n,a){var o=new Hr({shape:L({},e)});if(n){var r=i?"height":"width",s={};o.shape[r]=0,s[r]=e[r],ol[a?"updateProps":"initProps"](o,{shape:s},n,t)}return o},polar:function(t,e,i,n,a,o){var r=e.startAngle<e.endAngle,s=new(!i&&o?av:Pr)({shape:C({clockwise:r},e)});if(n){var l=i?"r":"endAngle",u={};s.shape[l]=i?0:e.startAngle,u[l]=e[l],ol[a?"updateProps":"initProps"](s,{shape:u},n,t)}return s}};function cv(t,e,i){i.style.text=null,js(i,{shape:{width:0}},e,t,function(){i.parent&&i.parent.remove(i)})}function dv(t,e,i){i.style.text=null,js(i,{shape:{r:i.shape.r0}},e,t,function(){i.parent&&i.parent.remove(i)})}var fv={cartesian2d:function(t,e,i){var n=t.getItemLayout(e),a=function(t,e){var i=t.get(ov)||0;return Math.min(i,Math.abs(e.width),Math.abs(e.height))}(i,n),o=0<n.width?1:-1,r=0<n.height?1:-1;return{x:n.x+o*a/2,y:n.y+r*a/2,width:n.width-o*a,height:n.height-r*a}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};function pv(t,e,i,n,a,o,r,s){var l=e.getItemVisual(i,"color"),u=e.getItemVisual(i,"opacity"),h=n.getModel("itemStyle"),c=n.getModel("emphasis.itemStyle").getBarItemStyle();s||t.setShape("r",h.get("barBorderRadius")||0),t.useStyle(C({fill:l,opacity:u},h.getBarItemStyle()));var d=n.getShallow("cursor");d&&t.attr("cursor",d);r?a.height:a.width;s||tv(t.style,c,n,l,o,i),Os(t,c)}var gv=hr.extend({type:"largeBar",shape:{points:[]},buildPath:function(t,e){for(var i=e.points,n=this.__startPoint,a=this.__baseDimIdx,o=0;o<i.length;o+=2)n[a]=i[o+a],t.moveTo(n[0],n[1]),t.lineTo(i[o],i[o+1])}});function mv(t,e,i){var n=t.getData(),a=[],o=n.getLayout("valueAxisHorizontal")?1:0;a[1-o]=n.getLayout("valueAxisStart");var r=new gv({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:a,__baseDimIdx:o,__largeDataIndices:n.getLayout("largeDataIndices"),__barWidth:n.getLayout("barWidth")});e.add(r),function(t,e,i){var n=i.getVisual("borderColor")||i.getVisual("color"),a=e.getModel("itemStyle").getItemStyle(["color","borderColor"]);t.useStyle(a),t.style.fill=null,t.style.stroke=n,t.style.lineWidth=i.getLayout("barWidth")}(r,t,n),r.seriesIndex=t.seriesIndex,t.get("silent")||(r.on("mousedown",vv),r.on("mousemove",vv))}var vv=cc(function(t){var e=function(t,e,i){var n=t.__baseDimIdx,a=1-n,o=t.shape.points,r=t.__largeDataIndices,s=Math.abs(t.__barWidth/2),l=t.__startPoint[a];rv[0]=e,rv[1]=i;for(var u=rv[n],h=rv[1-n],c=u-s,d=u+s,f=0,p=o.length/2;f<p;f++){var g=2*f,m=o[g+n],v=o[g+a];if(c<=m&&m<=d&&(l<=v?l<=h&&h<=v:v<=h&&h<=l))return r[f]}return-1}(this,t.offsetX,t.offsetY);this.dataIndex=0<=e?e:null},30,!1);nf(cd.VISUAL.LAYOUT,A(pp,"bar")),nf(cd.VISUAL.PROGRESSIVE_LAYOUT,gp),af({seriesType:"bar",reset:function(t){t.getData().setVisual("legendSymbol","roundRect")}});function yv(t,e,i){e=k(e)&&{coordDimensions:e}||L({},e);var n=t.getSource(),a=Wf(n,e),o=new Tf(a,t);return o.initData(n,i),o}var xv={updateSelectedMap:function(t){this._targetList=k(t)?t.slice():[],this._selectTargetMap=S(t||[],function(t,e){return t.set(e.name,e),t},Q())},select:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);"single"===this.get("selectedMode")&&this._selectTargetMap.each(function(t){t.selected=!1}),i&&(i.selected=!0)},unSelect:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);i&&(i.selected=!1)},toggleSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);if(null!=i)return this[i.selected?"unSelect":"select"](t,e),i.selected},isSelected:function(t,e){var i=null!=e?this._targetList[e]:this._selectTargetMap.get(t);return i&&i.selected}},_v=uf({type:"series.pie",init:function(t){_v.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(t)},mergeOption:function(t){_v.superCall(this,"mergeOption",t),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(t,e){return yv(this,["value"])},_createSelectableList:function(){for(var t=this.getRawData(),e=t.mapDimension("value"),i=[],n=0,a=t.count();n<a;n++)i.push({name:t.getName(n),value:t.get(e,n),selected:Ih(t,n,"selected")});return i},getDataParams:function(t){var e=this.getData(),i=_v.superCall(this,"getDataParams",t),n=[];return e.each(e.mapDimension("value"),function(t){n.push(t)}),i.percent=Il(n,t,e.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(t){ba(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,hoverOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,label:{rotate:!1,show:!0,position:"outer"},labelLine:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},animationType:"expansion",animationTypeUpdate:"transition",animationEasing:"cubicOut"}});function wv(t,e,i,n){var a=e.getData(),o=this.dataIndex,r=a.getName(o),s=e.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:t,name:r,seriesId:e.id}),a.each(function(t){bv(a.getItemGraphicEl(t),a.getItemLayout(t),e.isSelected(a.getName(t)),s,i)})}function bv(t,e,i,n,a){var o=(e.startAngle+e.endAngle)/2,r=i?n:0,s=[Math.cos(o)*r,Math.sin(o)*r];a?t.animate().when(200,{position:s}).start("bounceOut"):t.attr("position",s)}function Sv(t,e){Si.call(this);var i=new Pr({z2:2}),n=new zr,a=new Dr;this.add(i),this.add(n),this.add(a),this.updateData(t,e,!0)}b(_v,xv);var Mv=Sv.prototype;Mv.updateData=function(t,e,i){var n=this.childAt(0),a=this.childAt(1),o=this.childAt(2),r=t.hostModel,s=t.getItemModel(e),l=t.getItemLayout(e),u=L({},l);u.label=null;var h=r.getShallow("animationTypeUpdate");i?(n.setShape(u),"scale"===r.getShallow("animationType")?(n.shape.r=l.r0,qs(n,{shape:{r:l.r}},r,e)):(n.shape.endAngle=l.startAngle,js(n,{shape:{endAngle:l.endAngle}},r,e))):"expansion"===h?n.setShape(u):js(n,{shape:u},r,e);var c=t.getItemVisual(e,"color");n.useStyle(C({lineJoin:"bevel",fill:c},s.getModel("itemStyle").getItemStyle())),n.hoverStyle=s.getModel("emphasis.itemStyle").getItemStyle();var d=s.getShallow("cursor");d&&n.attr("cursor",d),bv(this,t.getItemLayout(e),r.isSelected(null,e),r.get("selectedOffset"),r.get("animation"));var f=!i&&"transition"===h;this._updateLabel(t,e,f),this.highDownOnUpdate=s.get("hoverAnimation")&&r.isAnimationEnabled()?function(t,e){"emphasis"===e?(a.ignore=a.hoverIgnore,o.ignore=o.hoverIgnore,n.stopAnimation(!0),n.animateTo({shape:{r:l.r+r.get("hoverOffset")}},300,"elasticOut")):(a.ignore=a.normalIgnore,o.ignore=o.normalIgnore,n.stopAnimation(!0),n.animateTo({shape:{r:l.r}},300,"elasticOut"))}:null,Os(this)},Mv._updateLabel=function(t,e,i){var n=this.childAt(1),a=this.childAt(2),o=t.hostModel,r=t.getItemModel(e),s=t.getItemLayout(e).label,l=t.getItemVisual(e,"color");if(!s||isNaN(s.x)||isNaN(s.y))a.ignore=a.normalIgnore=a.hoverIgnore=n.ignore=n.normalIgnore=n.hoverIgnore=!0;else{var u={points:s.linePoints||[[s.x,s.y],[s.x,s.y],[s.x,s.y]]},h={x:s.x,y:s.y};i?(js(n,{shape:u},o,e),js(a,{style:h},o,e)):(n.attr({shape:u}),a.attr({style:h})),a.attr({rotation:s.rotation,origin:[s.x,s.y],z2:10});var c=r.getModel("label"),d=r.getModel("emphasis.label"),f=r.getModel("labelLine"),p=r.getModel("emphasis.labelLine");l=t.getItemVisual(e,"color");Bs(a.style,a.hoverStyle={},c,d,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:l,useInsideStyle:!!s.inside},{textAlign:s.textAlign,textVerticalAlign:s.verticalAlign,opacity:t.getItemVisual(e,"opacity")}),a.ignore=a.normalIgnore=!c.get("show"),a.hoverIgnore=!d.get("show"),n.ignore=n.normalIgnore=!f.get("show"),n.hoverIgnore=!p.get("show"),n.setStyle({stroke:l,opacity:t.getItemVisual(e,"opacity")}),n.setStyle(f.getModel("lineStyle").getLineStyle()),n.hoverStyle=p.getModel("lineStyle").getLineStyle();var g=f.get("smooth");g&&!0===g&&(g=.4),n.setShape({smooth:g})}},w(Sv,Si);function Iv(i,t){E(t,function(o){o.update="updateView",tf(o,function(t,e){var a={};return e.eachComponent({mainType:"series",subType:i,query:t},function(i){i[o.method]&&i[o.method](t.name,t.dataIndex);var n=i.getData();n.each(function(t){var e=n.getName(t);a[e]=i.isSelected(e)||!1})}),{name:t.name,selected:a,seriesId:t.seriesId}})})}function Av(n){return{getTargetSeries:function(t){var e={},i=Q();return t.eachSeriesByType(n,function(t){t.__paletteScope=e,i.set(t.uid,t)}),i},reset:function(s,t){var l=s.getRawData(),u={},h=s.getData();h.each(function(t){var e=h.getRawIndex(t);u[e]=t}),l.each(function(t){var e,i=u[t],n=null!=i&&h.getItemVisual(i,"color",!0),a=null!=i&&h.getItemVisual(i,"borderColor",!0);if(n&&a||(e=l.getItemModel(t)),n)l.setItemVisual(t,"color",n);else{var o=e.get("itemStyle.color")||s.getColorFromPalette(l.getName(t)||t+"",s.__paletteScope,l.count());l.setItemVisual(t,"color",o),null!=i&&h.setItemVisual(i,"color",o)}if(a)l.setItemVisual(t,"borderColor",a);else{var r=e.get("itemStyle.borderColor");l.setItemVisual(t,"borderColor",r),null!=i&&h.setItemVisual(i,"borderColor",r)}})}}}ec.extend({type:"pie",init:function(){var t=new Si;this._sectorGroup=t},render:function(t,e,i,n){if(!n||n.from!==this.uid){var a=t.getData(),o=this._data,r=this.group,s=e.get("animation"),l=!o,u=t.get("animationType"),h=t.get("animationTypeUpdate"),c=A(wv,this.uid,t,s,i),d=t.get("selectedMode");if(a.diff(o).add(function(t){var e=new Sv(a,t);l&&"scale"!==u&&e.eachChild(function(t){t.stopAnimation(!0)}),d&&e.on("click",c),a.setItemGraphicEl(t,e),r.add(e)}).update(function(t,e){var i=o.getItemGraphicEl(e);l||"transition"===h||i.eachChild(function(t){t.stopAnimation(!0)}),i.updateData(a,t),i.off("click"),d&&i.on("click",c),r.add(i),a.setItemGraphicEl(t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);r.remove(e)}).execute(),s&&0<a.count()&&(l?"scale"!==u:"transition"!==h)){for(var f=a.getItemLayout(0),p=1;isNaN(f.startAngle)&&p<a.count();++p)f=a.getItemLayout(p);var g=Math.max(i.getWidth(),i.getHeight())/2,m=T(r.removeClipPath,r);r.setClipPath(this._createClipPath(f.cx,f.cy,g,f.startAngle,f.clockwise,m,t,l))}else r.removeClipPath();this._data=a}},dispose:function(){},_createClipPath:function(t,e,i,n,a,o,r,s){var l=new Pr({shape:{cx:t,cy:e,r0:0,r:i,startAngle:n,endAngle:n,clockwise:a}});return(s?qs:js)(l,{shape:{endAngle:n+(a?1:-1)*Math.PI*2}},r,o),l},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,a=t[1]-i.cy,o=Math.sqrt(n*n+a*a);return o<=i.r&&o>=i.r0}}});var Tv=Math.PI/180;function Dv(a,t,e,i,n,o,r){function s(t,e,i){for(var n=t;n<e;n++)if(a[n].y+=i,t<n&&n+1<e&&a[n+1].y>a[n].y+a[n].height)return void l(n,i/2);l(e-1,i/2)}function l(t,e){for(var i=t;0<=i&&(a[i].y-=e,!(0<i&&a[i].y>a[i-1].y+a[i-1].height));i--);}function u(t,e,i,n,a,o){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s<l;s++){var u=Math.abs(t[s].y-n),h=t[s].len,c=t[s].len2,d=u<a+h?Math.sqrt((a+h+c)*(a+h+c)-u*u):Math.abs(t[s].x-i);e&&r<=d&&(d=r-10),!e&&d<=r&&(d=r+10),t[s].x=i+d*o,r=d}}a.sort(function(t,e){return t.y-e.y});for(var h,c=0,d=a.length,f=[],p=[],g=0;g<d;g++)(h=a[g].y-c)<0&&s(g,d,-h),c=a[g].y+a[g].height;r-c<0&&l(d-1,c-r);for(g=0;g<d;g++)a[g].y>=e?p.push(a[g]):f.push(a[g]);u(f,!1,t,e,i,n),u(p,!0,t,e,i,n)}function Cv(t){return"center"===t.position}function Lv(I,A,t,e,i){var T,D,C=I.getData(),L=[],k=!1,P=(I.get("minShowLabelAngle")||0)*Tv;C.each(function(t){var e=C.getItemLayout(t),i=C.getItemModel(t),n=i.getModel("label"),a=n.get("position")||i.get("emphasis.label.position"),o=i.getModel("labelLine"),r=o.get("length"),s=o.get("length2");if(!(e.angle<P)){var l,u,h,c,d=(e.startAngle+e.endAngle)/2,f=Math.cos(d),p=Math.sin(d);T=e.cx,D=e.cy;var g="inside"===a||"inner"===a;if("center"===a)l=e.cx,u=e.cy,c="center";else{var m=(g?(e.r+e.r0)/2*f:e.r*f)+T,v=(g?(e.r+e.r0)/2*p:e.r*p)+D;if(l=m+3*f,u=v+3*p,!g){var y=m+f*(r+A-e.r),x=v+p*(r+A-e.r),_=y+(f<0?-1:1)*s;l=_+(f<0?-5:5),h=[[m,v],[y,x],[_,u=x]]}c=g?"center":0<f?"left":"right"}var w,b=n.getFont(),S=n.get("rotate");w="number"==typeof S?S*(Math.PI/180):S?f<0?-d+Math.PI:-d:0;var M=un(I.getFormattedLabel(t,"normal")||C.getName(t),b,c,"top");k=!!w,e.label={x:l,y:u,position:a,height:M.height,len:r,len2:s,linePoints:h,textAlign:c,verticalAlign:"middle",rotation:w,inside:g},g||L.push(e.label)}}),!k&&I.get("avoidLabelOverlap")&&function(t,e,i,n,a,o){for(var r=[],s=[],l=0;l<t.length;l++)Cv(t[l])||(t[l].x<e?r.push(t[l]):s.push(t[l]));for(Dv(s,e,i,n,1,0,o),Dv(r,e,i,n,-1,0,o),l=0;l<t.length;l++)if(!Cv(t[l])){var u=t[l].linePoints;if(u){var h=u[1][0]-u[2][0];t[l].x<e?u[2][0]=t[l].x+3:u[2][0]=t[l].x-3,u[1][1]=u[2][1]=t[l].y,u[1][0]=u[2][0]+h}}}(L,T,D,A,0,e)}function kv(t){return{seriesType:t,reset:function(t,e){var n=e.findComponents({mainType:"legend"});if(n&&n.length){var a=t.getData();a.filterSelf(function(t){for(var e=a.getName(t),i=0;i<n.length;i++)if(!n[i].isSelected(e))return!1;return!0})}}}}var Pv=2*Math.PI,Nv=Math.PI/180;Iv("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),af(Av("pie")),nf(A(function(t,e,A,i){e.eachSeriesByType(t,function(t){var a=t.getData(),e=a.mapDimension("value"),i=t.get("center"),n=t.get("radius");k(n)||(n=[0,n]),k(i)||(i=[i,i]);var o=A.getWidth(),r=A.getHeight(),s=Math.min(o,r),l=xl(i[0],o),u=xl(i[1],r),h=xl(n[0],s/2),c=xl(n[1],s/2),d=-t.get("startAngle")*Nv,f=t.get("minAngle")*Nv,p=0;a.each(e,function(t){isNaN(t)||p++});var g=a.getSum(e),m=Math.PI/(g||p)*2,v=t.get("clockwise"),y=t.get("roseType"),x=t.get("stillShowZeroSum"),_=a.getDataExtent(e);_[0]=0;var w=Pv,b=0,S=d,M=v?1:-1;if(a.each(e,function(t,e){var i;if(isNaN(t))a.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:l,cy:u,r0:h,r:y?NaN:c});else{(i="area"!==y?0===g&&x?m:t*m:Pv/p)<f?w-=i=f:b+=t;var n=S+M*i;a.setItemLayout(e,{angle:i,startAngle:S,endAngle:n,clockwise:v,cx:l,cy:u,r0:h,r:y?yl(t,_,[h,c]):c}),S=n}}),w<Pv&&p)if(w<=.001){var I=Pv/p;a.each(e,function(t,e){if(!isNaN(t)){var i=a.getItemLayout(e);i.angle=I,i.startAngle=d+M*e*I,i.endAngle=d+M*(e+1)*I}})}else m=w/b,S=d,a.each(e,function(t,e){if(!isNaN(t)){var i=a.getItemLayout(e),n=i.angle===f?f:t*m;i.startAngle=S,i.endAngle=S+M*n,S+=M*n}});Lv(t,c,0,r)})},"pie")),Qd(kv("pie")),Wh.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(t,e){return Xf(this.getSource(),this)},brushSelector:"point",getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},clip:!0}});var Ov=ds({shape:{points:null},symbolProxy:null,softClipShape:null,buildPath:function(t,e){var i=e.points,n=e.size,a=this.symbolProxy,o=a.shape;if(!((t.getContext?t.getContext():t)&&n[0]<4))for(var r=0;r<i.length;){var s=i[r++],l=i[r++];isNaN(s)||isNaN(l)||this.softClipShape&&!this.softClipShape.contain(s,l)||(o.x=s-n[0]/2,o.y=l-n[1]/2,o.width=n[0],o.height=n[1],a.buildPath(t,o,!0))}},afterBrush:function(t){var e=this.shape,i=e.points,n=e.size;if(n[0]<4){this.setTransform(t);for(var a=0;a<i.length;){var o=i[a++],r=i[a++];isNaN(o)||isNaN(r)||this.softClipShape&&!this.softClipShape.contain(o,r)||t.fillRect(o-n[0]/2,r-n[1]/2,n[0],n[1])}this.restoreTransform(t)}},findDataIndex:function(t,e){for(var i=this.shape,n=i.points,a=i.size,o=Math.max(a[0],4),r=Math.max(a[1],4),s=n.length/2-1;0<=s;s--){var l=2*s,u=n[l]-o/2,h=n[1+l]-r/2;if(u<=t&&h<=e&&t<=u+o&&e<=h+r)return s}return-1}});function Ev(){this.group=new Si}var Rv=Ev.prototype;function zv(t,e,i){vg.call(this,t,e,i),this.type="value",this.angle=0,this.name="",this.model}function Bv(t,e,i){this._model=t,this.dimensions=[],this._indicatorAxes=N(t.getIndicatorModels(),function(t,e){var i="indicator_"+e,n=new zv(i,"log"===t.get("axisType")?new Op:new op);return n.name=t.get("name"),(n.model=t).axis=n,this.dimensions.push(i),n},this),this.resize(t,i),this.cx,this.cy,this.r,this.r0,this.startAngle}Rv.isPersistent=function(){return!this._incremental},Rv.updateData=function(t,e){this.group.removeAll();var i=new Ov({rectHover:!0,cursor:"default"});i.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(i,t,!1,e),this.group.add(i),this._incremental=null},Rv.updateLayout=function(t){if(!this._incremental){var n=t.getLayout("symbolPoints");this.group.eachChild(function(t){if(null!=t.startIndex){var e=2*(t.endIndex-t.startIndex),i=4*t.startIndex*2;n=new Float32Array(n.buffer,i,e)}t.setShape("points",n)})}},Rv.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),2e6<t.count()?(this._incremental||(this._incremental=new ts({silent:!0})),this.group.add(this._incremental)):this._incremental=null},Rv.incrementalUpdate=function(t,e,i){var n;this._incremental?(n=new Ov,this._incremental.addDisplayable(n,!0)):((n=new Ov({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end})).incremental=!0,this.group.add(n)),n.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(n,e,!!this._incremental,i)},Rv._setCommon=function(i,t,e,n){var a=t.hostModel;n=n||{};var o=t.getVisual("symbolSize");i.setShape("size",o instanceof Array?o:[o,o]),i.softClipShape=n.clipShape||null,i.symbolProxy=Jp(t.getVisual("symbol"),0,0,0,0),i.setColor=i.symbolProxy.setColor;var r=i.shape.size[0]<4;i.useStyle(a.getModel("itemStyle").getItemStyle(r?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("color");s&&i.setColor(s),e||(i.seriesIndex=a.seriesIndex,i.on("mousemove",function(t){i.dataIndex=null;var e=i.findDataIndex(t.offsetX,t.offsetY);0<=e&&(i.dataIndex=e+(i.startIndex||0))}))},Rv.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},Rv._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},hf({type:"scatter",render:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n,{clipShape:this._getClipShape(t)}),this._finished=!0},incrementalPrepareRender:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||1e4<n.count()||!this._symbolDraw.isPersistent())return{update:!0};var a=sm().reset(t);a.progress&&a.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_getClipShape:function(t){var e=t.coordinateSystem,i=e&&e.getArea&&e.getArea();return t.get("clip",!0)?i:null},_updateSymbolDraw:function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new Ev:new Ng,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),af(rm("scatter","circle")),nf(sm("scatter")),w(zv,vg),Bv.prototype.getIndicatorAxes=function(){return this._indicatorAxes},Bv.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},Bv.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(i),this.cy-t*Math.sin(i)]},Bv.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var a,o=Math.atan2(-i,e),r=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],h=Math.abs(o-u.angle);h<r&&(a=u,s=l,r=h)}return[s,+(a&&a.coordToData(n))]},Bv.prototype.resize=function(t,e){var i=t.get("center"),n=e.getWidth(),a=e.getHeight(),o=Math.min(n,a)/2;this.cx=xl(i[0],n),this.cy=xl(i[1],a),this.startAngle=t.get("startAngle")*Math.PI/180;var r=t.get("radius");"string"!=typeof r&&"number"!=typeof r||(r=[0,r]),this.r0=xl(r[0],o),this.r=xl(r[1],o),E(this._indicatorAxes,function(t,e){t.setExtent(this.r0,this.r);var i=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),t.angle=i},this)},Bv.prototype.update=function(n,t){var a=this._indicatorAxes,o=this._model;E(a,function(t){t.scale.setExtent(1/0,-1/0)}),n.eachSeriesByType("radar",function(t,e){if("radar"===t.get("coordinateSystem")&&n.getComponent("radar",t.get("radarIndex"))===o){var i=t.getData();E(a,function(t){t.scale.unionExtentFromData(i,i.mapDimension(t.dim))})}},this);var f=o.get("splitNumber");function p(t){var e=Math.pow(10,Math.floor(Math.log(t)/Math.LN10)),i=t/e;return 2===i?i=5:i*=2,i*e}E(a,function(t,e){var i=Rp(t.scale,t.model);zp(t.scale,t.model);var n=t.model,a=t.scale,o=n.getMin(),r=n.getMax(),s=a.getInterval();if(null!=o&&null!=r)a.setExtent(+o,+r),a.setInterval((r-o)/f);else if(null!=o)for(var l;l=o+s*f,a.setExtent(+o,l),a.setInterval(s),s=p(s),l<i[1]&&isFinite(l)&&isFinite(i[1]););else if(null!=r)for(var u;u=r-s*f,a.setExtent(u,+r),a.setInterval(s),s=p(s),u>i[0]&&isFinite(u)&&isFinite(i[0]););else{var h=a.getTicks().length-1;f<h&&(s=p(s));var c=Math.round((i[0]+i[1])/2/s)*s,d=Math.round(f/2);a.setExtent(_l(c-d*s),_l(c+(f-d)*s)),a.setInterval(s)}})},Bv.dimensions=[],Bv.create=function(i,n){var a=[];return i.eachComponent("radar",function(t){var e=new Bv(t,i,n);a.push(e),t.coordinateSystem=e}),i.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=a[t.get("radarIndex")||0])}),a},Hu.register("radar",Bv);var Vv=gm.valueAxis;function Gv(t,e){return C({show:e},t)}sf({type:"radar",optionUpdated:function(){var a=this.get("boundaryGap"),o=this.get("splitNumber"),r=this.get("scale"),s=this.get("axisLine"),l=this.get("axisTick"),u=this.get("axisType"),h=this.get("axisLabel"),c=this.get("name"),d=this.get("name.show"),f=this.get("name.formatter"),p=this.get("nameGap"),g=this.get("triggerEvent"),t=N(this.get("indicator")||[],function(t){null!=t.max&&0<t.max&&!t.min?t.min=0:null!=t.min&&t.min<0&&!t.max&&(t.max=0);var e=c;if(null!=t.color&&(e=C({color:t.color},c)),t=m(D(t),{boundaryGap:a,splitNumber:o,scale:r,axisLine:s,axisTick:l,axisType:u,axisLabel:h,name:t.text,nameLocation:"end",nameGap:p,nameTextStyle:e,triggerEvent:g},!1),d||(t.name=""),"string"==typeof f){var i=t.name;t.name=f.replace("{value}",null!=i?i:"")}else"function"==typeof f&&(t.name=f(t.name,t));var n=L(new dl(t,null,this.ecModel),Hp);return n.mainType="radar",n.componentIndex=this.componentIndex,n},this);this.getIndicatorModels=function(){return t}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:m({lineStyle:{color:"#bbb"}},Vv.axisLine),axisLabel:Gv(Vv.axisLabel,!1),axisTick:Gv(Vv.axisTick,!1),axisType:"interval",splitLine:Gv(Vv.splitLine,!0),splitArea:Gv(Vv.splitArea,!0),indicator:[]}});var Fv=["axisLine","axisTickLabel","axisName"];lf({type:"radar",render:function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem;E(N(e.getIndicatorAxes(),function(t){return new Cm(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){E(Fv,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){var n=t.coordinateSystem,e=n.getIndicatorAxes();if(e.length){var i=t.get("shape"),a=t.getModel("splitLine"),o=t.getModel("splitArea"),r=a.getModel("lineStyle"),s=o.getModel("areaStyle"),l=a.get("show"),u=o.get("show"),h=r.get("color"),c=s.get("color");h=k(h)?h:[h],c=k(c)?c:[c];var d=[],f=[];if("circle"===i)for(var p=e[0].getTicksCoords(),g=n.cx,m=n.cy,v=0;v<p.length;v++){if(l)d[I(d,h,v)].push(new Lr({shape:{cx:g,cy:m,r:p[v].coord}}));if(u&&v<p.length-1)f[I(f,c,v)].push(new Nr({shape:{cx:g,cy:m,r0:p[v].coord,r:p[v+1].coord}}))}else{var y,x=N(e,function(t,e){var i=t.getTicksCoords();return y=null==y?i.length-1:Math.min(i.length-1,y),N(i,function(t){return n.coordToPoint(t.coord,e)})}),_=[];for(v=0;v<=y;v++){for(var w=[],b=0;b<e.length;b++)w.push(x[b][v]);if(w[0]&&w.push(w[0].slice()),l)d[I(d,h,v)].push(new zr({shape:{points:w}}));if(u&&_)f[I(f,c,v-1)].push(new Rr({shape:{points:w.concat(_)}}));_=w.slice().reverse()}}var S=r.getLineStyle(),M=s.getAreaStyle();E(f,function(t,e){this.group.add(ys(t,{style:C({stroke:"none",fill:c[e%c.length]},M),silent:!0}))},this),E(d,function(t,e){this.group.add(ys(t,{style:C({fill:"none",stroke:h[e%h.length]},S),silent:!0}))},this)}function I(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}}});var Wv=Wh.extend({type:"series.radar",dependencies:["radar"],init:function(t){Wv.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},getInitialData:function(t,e){return yv(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(n){var a=this.getData(),t=this.coordinateSystem.getIndicatorAxes(),e=this.getData().getName(n);return Wl(""===e?this.name:e)+"<br/>"+N(t,function(t,e){var i=a.get(a.mapDimension(t.dim),n);return Wl(t.name+" : "+i)}).join("<br />")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});hf({type:"radar",render:function(l,t,e){var i=l.coordinateSystem,g=this.group,m=l.getData(),s=this._data;function u(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var a=function(t){return k(t)||(t=[+t,+t]),t}(t.getItemVisual(e,"symbolSize")),o=Jp(i,-1,-1,2,2,n);return o.attr({style:{strokeNoScale:!0},z2:100,scale:[a[0]/2,a[1]/2]}),o}}function h(t,e,i,n,a,o){i.removeAll();for(var r=0;r<e.length-1;r++){var s=u(n,a);s&&(t[s.__dimIdx=r]?(s.attr("position",t[r]),ol[o?"initProps":"updateProps"](s,{position:e[r]},l,a)):s.attr("position",e[r]),i.add(s))}}function c(t){return N(t,function(t){return[i.cx,i.cy]})}m.diff(s).add(function(t){var e=m.getItemLayout(t);if(e){var i=new Rr,n=new zr,a={shape:{points:e}};i.shape.points=c(e),n.shape.points=c(e),qs(i,a,l,t),qs(n,a,l,t);var o=new Si,r=new Si;o.add(n),o.add(i),o.add(r),h(n.shape.points,e,r,m,t,!0),m.setItemGraphicEl(t,o)}}).update(function(t,e){var i=s.getItemGraphicEl(e),n=i.childAt(0),a=i.childAt(1),o=i.childAt(2),r={shape:{points:m.getItemLayout(t)}};r.shape.points&&(h(n.shape.points,r.shape.points,o,m,t,!1),js(n,r,l),js(a,r,l),m.setItemGraphicEl(t,i))}).remove(function(t){g.remove(s.getItemGraphicEl(t))}).execute(),m.eachItemGraphicEl(function(t,i){var e=m.getItemModel(i),n=t.childAt(0),a=t.childAt(1),o=t.childAt(2),r=m.getItemVisual(i,"color");g.add(t),n.useStyle(C(e.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:r})),n.hoverStyle=e.getModel("emphasis.lineStyle").getLineStyle();var s=e.getModel("areaStyle"),l=e.getModel("emphasis.areaStyle"),u=s.isEmpty()&&s.parentModel.isEmpty(),h=l.isEmpty()&&l.parentModel.isEmpty();h=h&&u,a.ignore=u,a.useStyle(C(s.getAreaStyle(),{fill:r,opacity:.7})),a.hoverStyle=l.getAreaStyle();var c=e.getModel("itemStyle").getItemStyle(["color"]),d=e.getModel("emphasis.itemStyle").getItemStyle(),f=e.getModel("label"),p=e.getModel("emphasis.label");o.eachChild(function(t){t.setStyle(c),t.hoverStyle=D(d);var e=m.get(m.dimensions[t.__dimIdx],i);null!=e&&!isNaN(e)||(e=""),Bs(t.style,t.hoverStyle,f,p,{labelFetcher:m.hostModel,labelDataIndex:i,labelDimIndex:t.__dimIdx,defaultText:e,autoColor:r,isRectText:!0})}),t.highDownOnUpdate=function(t,e){a.attr("ignore","emphasis"===e?h:u)},Os(t)}),this._data=m},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});function Hv(t){return!isNaN(t[0])&&!isNaN(t[1])}function Zv(t){return[t.cx,t.cy]}af(Av("radar")),af(rm("radar","circle")),nf(function(t){t.eachSeriesByType("radar",function(t){var i=t.getData(),a=[],o=t.coordinateSystem;if(o){var e=o.getIndicatorAxes();E(e,function(t,n){i.each(i.mapDimension(e[n].dim),function(t,e){a[e]=a[e]||[];var i=o.dataToPoint(t,n);a[e][n]=Hv(i)?i:Zv(o)})}),i.each(function(t){var e=I(a[t],function(t){return Hv(t)})||Zv(o);a[t].push(e.slice()),i.setItemLayout(t,a[t])})}})}),Qd(kv("radar")),Jd(function(i){var t=i.polar;if(t){k(t)||(t=[t]);var n=[];E(t,function(t,e){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),i.radar=i.radar||[],k(i.radar)||(i.radar=[i.radar]),i.radar.push(t)):n.push(t)}),i.polar=n}E(i.series,function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)})});for(var Uv=[126,25],Xv=[[[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]]],Yv=0;Yv<Xv.length;Yv++)for(var jv=0;jv<Xv[Yv].length;jv++)Xv[Yv][jv][0]/=10.5,Xv[Yv][jv][1]/=-14,Xv[Yv][jv][0]+=Uv[0],Xv[Yv][jv][1]+=Uv[1];var qv={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]},Kv={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]},$v=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]],Jv=La(),Qv={load:function(n,t){var e=Jv(t).parsed;if(e)return e;var i,a=t.specialAreas||{},o=t.geoJSON;try{i=o?rg(o):[]}catch(t){throw new Error("Invalid geoJson format\n"+t.message)}return function(t,e){"china"===t&&e.push(new ag("南海诸岛",N(Xv,function(t){return{type:"polygon",exterior:t}}),Uv))}(n,i),E(i,function(t){var e=t.name;!function(t,e){if("china"===t){var i=qv[e.name];if(i){var n=e.center;n[0]+=i[0]/10.5,n[1]+=-i[1]/14}}}(n,t),function(t,e){if("world"===t){var i=Kv[e.name];if(i){var n=e.center;n[0]=i[0],n[1]=i[1]}}}(n,t),function(t,e){"china"===t&&"台湾"===e.name&&e.geometries.push({type:"polygon",exterior:$v[0]})}(n,t);var i=a[e];i&&t.transformTo(i.left,i.top,i.width,i.height)}),Jv(t).parsed={regions:i,boundingRect:function(t){for(var e,i=0;i<t.length;i++){var n=t[i].getBoundingRect();(e=e||n.clone()).union(n)}return e}(i)}}};var ty=La();function ey(t,e){var i,n,a=t.svgXML;try{Y(null!=(n=(i=a&&function(t,e){return(new Uc).parse(t,e)}(a,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root))}catch(t){throw new Error("Invalid svg format\n"+t.message)}var o=i.width,r=i.height,s=i.viewBoxRect;if(e||(e=null==o||null==r?n.getBoundingRect():new bi(0,0,0,0),null!=o&&(e.width=o),null!=r&&(e.height=r)),s){var l=id(s,e.width,e.height),u=n;(n=new Si).add(u),u.scale=l.scale,u.position=l.position}return n.setClipPath(new Hr({shape:e.plain()})),{root:n,boundingRect:e}}var iy={geoJSON:Qv,svg:{load:function(t,e){var i=ty(e).originRoot;if(i)return{root:i,boundingRect:ty(e).boundingRect};var n=ey(e);return ty(e).originRoot=n.root,ty(e).boundingRect=n.boundingRect,n},makeGraphic:function(t,e,i){var n=ty(e),a=n.rootMap||(n.rootMap=Q()),o=a.get(i);if(o)return o;var r=n.originRoot,s=n.boundingRect;return o=n.originRootHostKey?ey(e,s).root:(n.originRootHostKey=i,r),a.set(i,o)},removeGraphic:function(t,e,i){var n=ty(e),a=n.rootMap;a&&a.removeKey(i),i===n.originRootHostKey&&(n.originRootHostKey=null)}}},ny={load:function(n,a){var o,r=[],s=Q(),l=Q();return E(oy(n),function(t){var e=iy[t.type].load(n,t);E(e.regions,function(t){var e=t.name;a&&a.hasOwnProperty(e)&&(t=t.cloneShallow(e=a[e])),r.push(t),s.set(e,t),l.set(e,t.center)});var i=e.boundingRect;i&&(o?o.union(i):o=i.clone())}),{regions:r,regionsMap:s,nameCoordMap:l,boundingRect:o||new bi(0,0,0,0)}},makeGraphic:ay("makeGraphic"),removeGraphic:ay("removeGraphic")};function ay(o){return function(i,n){var t=oy(i),a=[];return E(t,function(t){var e=iy[t.type][o];e&&a.push(e(i,t,n))}),a}}function oy(t){return ad.retrieveMap(t)||[]}b(Wh.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(t){for(var e=yv(this,["value"]),i=e.mapDimension("value"),n=Q(),a=[],o=[],r=0,s=e.count();r<s;r++){var l=e.getName(r);n.set(l,!0),a.push({name:l,value:e.get(i,r),selected:Ih(e,r,"selected")})}return E(ny.load(this.getMapType(),this.option.nameMap).regions,function(t){var e=t.name;n.get(e)||(a.push({name:e}),o.push(e))}),this.updateSelectedMap(a),e.appendValues([],o),e},getHostGeoModel:function(){var t=this.option.geoIndex;return null!=t?this.dependentModels.geo[t]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},getRawValue:function(t){var e=this.getData();return e.get(e.mapDimension("value"),t)},getRegionModel:function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},formatTooltip:function(t){for(var e=this.getData(),i=zl(this.getRawValue(t)),n=e.getName(t),a=this.seriesGroup,o=[],r=0;r<a.length;r++){var s=a[r].originalData.indexOfName(n),l=e.mapDimension("value");isNaN(a[r].originalData.get(l,s))||o.push(Wl(a[r].name))}return o.join(", ")+"<br />"+Wl(n+" : "+i)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,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)"}}}}),xv);var ry="\0_ec_interaction_mutex";function sy(t,e){return!!ly(t)[e]}function ly(t){return t[ry]||(t[ry]={})}function uy(i){this.pointerChecker,this._zr=i,this._opt={};var t=T,n=t(hy,this),a=t(cy,this),o=t(dy,this),r=t(fy,this),s=t(py,this);Ct.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(t,e){this.disable(),this._opt=C(D(e)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(i.on("mousedown",n),i.on("mousemove",a),i.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(i.on("mousewheel",r),i.on("pinch",s))},this.disable=function(){i.off("mousedown",n),i.off("mousemove",a),i.off("mouseup",o),i.off("mousewheel",r),i.off("pinch",s)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function hy(t){if(!(Wt(t)||t.target&&t.target.draggable)){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function cy(t){if(this._dragging&&vy("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!sy(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,a=this._y,o=e-n,r=i-a;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&Ft(t.event),my(this,"pan","moveOnMouseMove",t,{dx:o,dy:r,oldX:n,oldY:a,newX:e,newY:i})}}function dy(t){Wt(t)||(this._dragging=!1)}function fy(t){var e=vy("zoomOnMouseWheel",t,this._opt),i=vy("moveOnMouseWheel",t,this._opt),n=t.wheelDelta,a=Math.abs(n),o=t.offsetX,r=t.offsetY;if(0!==n&&(e||i)){if(e){var s=3<a?1.4:1<a?1.2:1.1;gy(this,"zoom","zoomOnMouseWheel",t,{scale:0<n?s:1/s,originX:o,originY:r})}if(i){var l=Math.abs(n);gy(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(0<n?1:-1)*(3<l?.4:1<l?.15:.05),originX:o,originY:r})}}}function py(t){sy(this._zr,"globalPan")||gy(this,"zoom",null,t,{scale:1<t.pinchScale?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY})}function gy(t,e,i,n,a){t.pointerChecker&&t.pointerChecker(n,a.originX,a.originY)&&(Ft(n.event),my(t,e,i,n,a))}function my(t,e,i,n,a){a.isAvailableBehavior=T(vy,null,i,n),t.trigger(e,a)}function vy(t,e,i){var n=i[t];return!t||n&&(!R(n)||e.event[n+"Key"])}function yy(t,e,i){var n=t.target,a=n.position;a[0]+=e,a[1]+=i,n.dirty()}function xy(t,e,i,n){var a=t.target,o=t.zoomLimit,r=a.position,s=a.scale,l=t.zoom=t.zoom||1;if(l*=e,o){var u=o.min||0,h=o.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/t.zoom;t.zoom=l,r[0]-=(i-r[0])*(c-1),r[1]-=(n-r[1])*(c-1),s[0]*=c,s[1]*=c,a.dirty()}tf({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),b(uy,Ct);var _y={axisPointer:1,tooltip:1,brush:1};function wy(t,e,i){var n=e.getComponentByElement(t.topTarget),a=n&&n.coordinateSystem;return n&&n!==i&&!_y[n.mainType]&&a&&a.model!==i}function by(t){var e=t.getItemStyle(),i=t.get("areaColor");return null!=i&&(e.fill=i),e}function Sy(i,t){t.eachChild(function(e){E(e.__regions,function(t){e.trigger(i.isSelected(t.name)?"emphasis":"normal")})})}function My(t,e){var i=new Si;this.uid=ml("ec_map_draw"),this._controller=new uy(t.getZr()),this._controllerHost={target:e?i:null},this.group=i,this._updateGroup=e,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new Si),i.add(this._backgroundGroup=new Si)}My.prototype={constructor:My,draw:function(_,t,e,i,n){var w="geo"===_.mainType,b=_.getData&&_.getData();w&&t.eachComponent({mainType:"series",subType:"map"},function(t){b||t.getHostGeoModel()!==_||(b=t.getData())});var a=_.coordinateSystem;this._updateBackground(a);var S=this._regionsGroup,M=this.group;a._roamTransformable.transform&&(M.transform=a._roamTransformable.transform.slice(),M.decomposeTransform());var I=a._rawTransformable.scale,A=a._rawTransformable.position;S.removeAll();var T=["itemStyle"],D=["emphasis","itemStyle"],C=["label"],L=["emphasis","label"],k=Q();E(a.regions,function(t){var e=k.get(t.name)||k.set(t.name,new Si),o=new $r({segmentIgnoreThreshold:1,shape:{paths:[]}});e.add(o);var i,n=(x=_.getRegionModel(t.name)||_).getModel(T),a=x.getModel(D),r=by(n),s=by(a),l=x.getModel(C),u=x.getModel(L);if(b){i=b.indexOfName(t.name);var h=b.getItemVisual(i,"color",!0);h&&(r.fill=h)}function c(t){return[t[0]*I[0]+A[0],t[1]*I[1]+A[1]]}E(t.geometries,function(t){if("polygon"===t.type){for(var e=[],i=0;i<t.exterior.length;++i)e.push(c(t.exterior[i]));o.shape.paths.push(new Rr({segmentIgnoreThreshold:1,shape:{points:e}}));for(i=0;i<(t.interiors?t.interiors.length:0);++i){for(var n=t.interiors[i],a=(e=[],0);a<n.length;++a)e.push(c(n[a]));o.shape.paths.push(new Rr({segmentIgnoreThreshold:1,shape:{points:e}}))}}}),o.setStyle(r),o.style.strokeNoScale=!0,o.culling=!0;var d=l.get("show"),f=u.get("show"),p=b&&isNaN(b.get(b.mapDimension("value"),i)),g=b&&b.getItemLayout(i);if(w||p&&(d||f)||g&&g.showLabel){var m,v=w?t.name:i;(!b||0<=i)&&(m=_);var y=new Dr({position:c(t.center.slice()),scale:[1/M.scale[0],1/M.scale[1]],z2:10,silent:!0});Bs(y.style,y.hoverStyle={},l,u,{labelFetcher:m,labelDataIndex:v,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),e.add(y)}if(b)b.setItemGraphicEl(i,e);else{var x=_.getRegionModel(t.name);o.eventData={componentType:"geo",componentIndex:_.componentIndex,geoIndex:_.componentIndex,name:t.name,region:x&&x.option||{}}}(e.__regions||(e.__regions=[])).push(t),e.highDownSilentOnTouch=!!_.get("selectedMode"),Os(e,s),S.add(e)}),this._updateController(_,t,e),function(n,a,o,r,s){o.off("click"),o.off("mousedown"),a.get("selectedMode")&&(o.on("mousedown",function(){n._mouseDownFlag=!0}),o.on("click",function(t){if(n._mouseDownFlag){n._mouseDownFlag=!1;for(var e=t.target;!e.__regions;)e=e.parent;if(e){var i={type:("geo"===a.mainType?"geo":"map")+"ToggleSelect",batch:N(e.__regions,function(t){return{name:t.name,from:s.uid}})};i[a.mainType+"Id"]=a.id,r.dispatchAction(i),Sy(a,o)}}}))}(this,_,S,e,i),Sy(_,S)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&ny.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(t){var e=t.map;this._mapName!==e&&E(ny.makeGraphic(e,this.uid),function(t){this._backgroundGroup.add(t)},this),this._mapName=e},_updateController:function(n,t,a){var o=n.coordinateSystem,e=this._controller,i=this._controllerHost;i.zoomLimit=n.get("scaleLimit"),i.zoom=o.getZoom(),e.enable(n.get("roam")||!1);var r=n.mainType;function s(){var t={type:"geoRoam",componentType:r};return t[r+"Id"]=n.id,t}e.off("pan").on("pan",function(t){this._mouseDownFlag=!1,yy(i,t.dx,t.dy),a.dispatchAction(L(s(),{dx:t.dx,dy:t.dy}))},this),e.off("zoom").on("zoom",function(t){if(this._mouseDownFlag=!1,xy(i,t.scale,t.originX,t.originY),a.dispatchAction(L(s(),{zoom:t.scale,originX:t.originX,originY:t.originY})),this._updateGroup){var e=this.group.scale;this._regionsGroup.traverse(function(t){"text"===t.type&&t.attr("scale",[1/e[0],1/e[1]])})}},this),e.setPointerChecker(function(t,e,i){return o.getViewRectAfterRoam().contain(e,i)&&!wy(t,a,n)})}};var Iy="__seriesMapHighDown",Ay="__seriesMapCallKey";function Ty(t){var e=this[Iy];e&&e.recordVersion===this[Ay]&&Dy(e,t)}function Dy(t,e){var i=t.circle,n=t.labelModel,a=t.hoverLabelModel,o=t.emphasisText,r=t.normalText;e?(i.style.extendFrom(Gs({},a,{text:a.get("show")?o:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=os):(Gs(i.style,n,{text:n.get("show")?r:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}function Cy(t,e,i){var n=t.getZoom(),a=t.getCenter(),o=e.zoom,r=t.dataToPoint(a);if(null!=e.dx&&null!=e.dy){r[0]-=e.dx,r[1]-=e.dy;a=t.pointToData(r);t.setCenter(a)}if(null!=o){if(i){var s=i.min||0,l=i.max||1/0;o=Math.max(Math.min(n*o,l),s)/n}t.scale[0]*=o,t.scale[1]*=o;var u=t.position,h=(e.originX-u[0])*(o-1),c=(e.originY-u[1])*(o-1);u[0]-=h,u[1]-=c,t.updateTransform();a=t.pointToData(r);t.setCenter(a),t.setZoom(o*n)}return{center:t.getCenter(),zoom:t.getZoom()}}hf({type:"map",render:function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var a=this.group;if(a.removeAll(),!t.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id)(o=this._mapDraw)&&a.add(o.group);else if(t.needsDrawMap){var o=this._mapDraw||new My(i,!0);a.add(o.group),o.draw(t,e,i,this,n),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(x,t,e){var _=x.originalData,w=this.group;_.each(_.mapDimension("value"),function(t,e){if(!isNaN(t)){var i=_.getItemLayout(e);if(i&&i.point){var n=i.point,a=i.offset,o=new Lr({style:{fill:x.getData().getVisual("color")},shape:{cx:n[0]+9*a,cy:n[1],r:3},silent:!0,z2:8+(a?0:os+1)});if(!a){var r=x.mainSeries.getData(),s=_.getName(e),l=r.indexOfName(s),u=_.getItemModel(e),h=u.getModel("label"),c=u.getModel("emphasis.label"),d=r.getItemGraphicEl(l),f=H(x.getFormattedLabel(l,"normal"),s),p=H(x.getFormattedLabel(l,"emphasis"),f),g=d[Iy],m=Math.random();if(!g){g=d[Iy]={};var v=A(Ty,!0),y=A(Ty,!1);d.on("mouseover",v).on("mouseout",y).on("emphasis",v).on("normal",y)}L(g,{recordVersion:d[Ay]=m,circle:o,labelModel:h,hoverLabelModel:c,emphasisText:p,normalText:f}),Dy(g,!1)}w.add(o)}}})}}),tf({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(n,t){var a=n.componentType||"series";t.eachComponent({mainType:a,query:n},function(t){var e=t.coordinateSystem;if("geo"===e.type){var i=Cy(e,n,t.get("scaleLimit"));t.setCenter&&t.setCenter(i.center),t.setZoom&&t.setZoom(i.zoom),"series"===a&&E(t.seriesGroup,function(t){t.setCenter(i.center),t.setZoom(i.zoom)})}})});var Ly=bt;function ky(){ce.call(this)}function Py(t){this.name=t,this.zoomLimit,ce.call(this),this._roamTransformable=new ky,this._rawTransformable=new ky,this._center,this._zoom}function Ny(t,e,i,n){var a=i.seriesModel,o=a?a.coordinateSystem:null;return o===this?o[t](n):null}function Oy(t,e,i,n){Py.call(this,t),this.map=e;var a=ny.load(e,i);this._nameCoordMap=a.nameCoordMap,this._regionsMap=a.regionsMap,this._invertLongitute=null==n||n,this.regions=a.regions,this._rect=a.boundingRect}function Ey(t,e,i,n){var a=i.geoModel,o=i.seriesModel,r=a?a.coordinateSystem:o?o.coordinateSystem||(o.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return r===this?r[t](n):null}function Ry(t,e){var i=t.get("boundingCoords");if(null!=i){var n=i[0],a=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(a[0])||isNaN(a[1])||this.setBoundingRect(n[0],n[1],a[0]-n[0],a[1]-n[1])}var o,r=this.getBoundingRect(),s=t.get("layoutCenter"),l=t.get("layoutSize"),u=e.getWidth(),h=e.getHeight(),c=r.width/r.height*this.aspectScale,d=!1;if(s&&l&&(s=[xl(s[0],u),xl(s[1],h)],l=xl(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0)),d){var f={};1<c?(f.width=l,f.height=l/c):(f.height=l,f.width=l*c),f.y=s[1]-f.height/2,f.x=s[0]-f.width/2}else(o=t.getBoxLayoutParams()).aspect=c,f=au(o,{width:u,height:h});this.setViewRect(f.x,f.y,f.width,f.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function zy(i,t){E(t.get("geoCoord"),function(t,e){i.addGeoCoord(e,t)})}b(ky,ce),Py.prototype={constructor:Py,type:"view",dimensions:["x","y"],setBoundingRect:function(t,e,i,n){return this._rect=new bi(t,e,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(t,e,i,n){this.transformTo(t,e,i,n),this._viewRect=new bi(t,e,i,n)},transformTo:function(t,e,i,n){var a=this.getBoundingRect(),o=this._rawTransformable;o.transform=a.calculateTransform(new bi(t,e,i,n)),o.decomposeTransform(),this._updateTransform()},setCenter:function(t){t&&(this._center=t,this._updateCenterAndZoom())},setZoom:function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},getDefaultCenter:function(){var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),a=this.getZoom();n=bt([],n,t),i=bt([],i,t),e.origin=n,e.position=[i[0]-n[0],i[1]-n[1]],e.scale=[a,a],this._updateTransform()},_updateTransform:function(){var t=this._roamTransformable,e=this._rawTransformable;(e.parent=t).updateTransform(),e.updateTransform(),ee(this.transform||(this.transform=[]),e.transform||Qt()),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],re(this.invTransform,this.transform),this.decomposeTransform()},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},dataToPoint:function(t,e,i){var n=e?this._rawTransform:this.transform;return i=i||[],n?Ly(i,t,n):ot(i,t)},pointToData:function(t){var e=this.invTransform;return e?Ly([],t,e):[t[0],t[1]]},convertToPixel:A(Ny,"dataToPoint"),convertFromPixel:A(Ny,"pointToData"),containPoint:function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])}},b(Py,ce),Oy.prototype={constructor:Oy,type:"geo",dimensions:["lng","lat"],containCoord:function(t){for(var e=this.regions,i=0;i<e.length;i++)if(e[i].contain(t))return!0;return!1},transformTo:function(t,e,i,n){var a=this.getBoundingRect(),o=this._invertLongitute;a=a.clone(),o&&(a.y=-a.y-a.height);var r=this._rawTransformable;if(r.transform=a.calculateTransform(new bi(t,e,i,n)),r.decomposeTransform(),o){var s=r.scale;s[1]=-s[1]}r.updateTransform(),this._updateTransform()},getRegion:function(t){return this._regionsMap.get(t)},getRegionByCoord:function(t){for(var e=this.regions,i=0;i<e.length;i++)if(e[i].contain(t))return e[i]},addGeoCoord:function(t,e){this._nameCoordMap.set(t,e)},getGeoCoord:function(t){return this._nameCoordMap.get(t)},getBoundingRect:function(){return this._rect},dataToPoint:function(t,e,i){if("string"==typeof t&&(t=this.getGeoCoord(t)),t)return Py.prototype.dataToPoint.call(this,t,e,i)},convertToPixel:A(Ey,"dataToPoint"),convertFromPixel:A(Ey,"pointToData")},b(Oy,Py);var By={dimensions:Oy.prototype.dimensions,create:function(t,s){var l=[];t.eachComponent("geo",function(t,e){var i=t.get("map"),n=t.get("aspectScale"),a=!0,o=ad.retrieveMap(i);o&&o[0]&&"svg"===o[0].type?(null==n&&(n=1),a=!1):null==n&&(n=.75);var r=new Oy(i+e,i,t.get("nameMap"),a);r.aspectScale=n,r.zoomLimit=t.get("scaleLimit"),l.push(r),zy(r,t),(t.coordinateSystem=r).model=t,r.resize=Ry,r.resize(t,s)}),t.eachSeries(function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=l[e]}});var i={};return t.eachSeriesByType("map",function(t){if(!t.getHostGeoModel()){var e=t.getMapType();i[e]=i[e]||[],i[e].push(t)}}),E(i,function(t,e){var i=new Oy(e,e,p(N(t,function(t){return t.get("nameMap")})));i.zoomLimit=W.apply(null,N(t,function(t){return t.get("scaleLimit")})),l.push(i),i.resize=Ry,i.aspectScale=t[0].get("aspectScale"),i.resize(t[0],s),E(t,function(t){zy(t.coordinateSystem=i,t)})}),l},getFilledRegions:function(t,e,i){for(var n=(t||[]).slice(),a=Q(),o=0;o<n.length;o++)a.set(n[o].name,n[o]);return E(ny.load(e,i).regions,function(t){var e=t.name;a.get(e)||n.push({name:e})}),n}};ef("geo",By);nf(function(i){var a={};i.eachSeriesByType("map",function(t){var e=t.getMapType();if(!t.getHostGeoModel()&&!a[e]){var l={};E(t.seriesGroup,function(t){var r=t.coordinateSystem,s=t.originalData;t.get("showLegendSymbol")&&i.getComponent("legend")&&s.each(s.mapDimension("value"),function(t,e){var i=s.getName(e),n=r.getRegion(i);if(n&&!isNaN(t)){var a=l[i]||0,o=r.dataToPoint(n.center);l[i]=a+1,s.setItemLayout(e,{point:o,offset:a})}})});var n=t.getData();n.each(function(t){var e=n.getName(t),i=n.getItemLayout(t)||{};i.showLabel=!l[e],n.setItemLayout(t,i)}),a[e]=!0}})}),af(function(t){t.eachSeriesByType("map",function(t){var e=t.get("color"),i=t.getModel("itemStyle"),n=i.get("areaColor"),a=i.get("color")||e[t.seriesIndex%e.length];t.getData().setVisual({areaColor:n,color:a})})}),Qd(cd.PROCESSOR.STATISTIC,function(t){var n={};t.eachSeriesByType("map",function(t){var e=t.getHostGeoModel(),i=e?"o"+e.id:"i"+t.getMapType();(n[i]=n[i]||[]).push(t)}),E(n,function(t,e){for(var i=function(u,h){var c={};return E(u,function(n){n.each(n.mapDimension("value"),function(t,e){var i="ec-"+n.getName(e);c[i]=c[i]||[],isNaN(t)||c[i].push(t)})}),u[0].map(u[0].mapDimension("value"),function(t,e){for(var i,n="ec-"+u[0].getName(e),a=0,o=1/0,r=-1/0,s=c[n].length,l=0;l<s;l++)o=Math.min(o,c[n][l]),r=Math.max(r,c[n][l]),a+=c[n][l];return i="min"===h?o:"max"===h?r:"average"===h?a/s:a,0===s?NaN:i})}(N(t,function(t){return t.getData()}),t[0].get("mapValueCalculation")),n=0;n<t.length;n++)t[n].originalData=t[n].getData();for(n=0;n<t.length;n++)(t[n].seriesGroup=t)[n].needsDrawMap=0===n&&!t[n].getHostGeoModel(),t[n].setData(i.cloneShallow()),t[n].mainSeries=t[0]})}),Jd(function(t){var e=[];E(t.series,function(t){t&&"map"===t.type&&(e.push(t),t.map=t.map||t.mapType,C(t,t.mapLocation))})}),Iv("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var Vy=E,Gy="\0__link_datas",Fy="\0__link_mainData";function Wy(i){var n=i.mainData,t=i.datas;t||(t={main:n},i.datasAttr={main:"data"}),i.datas=i.mainData=null,Yy(n,t,i),Vy(t,function(e){Vy(n.TRANSFERABLE_METHODS,function(t){e.wrapMethod(t,A(Hy,i))})}),n.wrapMethod("cloneShallow",A(Uy,i)),Vy(n.CHANGABLE_METHODS,function(t){n.wrapMethod(t,A(Zy,i))}),Y(t[n.dataType]===n)}function Hy(t,e){if(function(t){return t[Fy]===t}(this)){var i=L({},this[Gy]);Yy(i[this.dataType]=e,i,t)}else jy(e,this.dataType,this[Fy],t);return e}function Zy(t,e){return t.struct&&t.struct.update(this),e}function Uy(i,n){return Vy(n[Gy],function(t,e){t!==n&&jy(t.cloneShallow(),e,n,i)}),n}function Xy(t){var e=this[Fy];return null==t||null==e?e:e[Gy][t]}function Yy(i,t,n){i[Gy]={},Vy(t,function(t,e){jy(t,e,i,n)})}function jy(t,e,i,n){(i[Gy][e]=t)[Fy]=i,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=Xy}function qy(t,e){this.name=t||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=e}function Ky(e,t,i){this.root,this.data,this._nodes=[],this.hostModel=e,this.levelModels=N(t||[],function(t){return new dl(t,e,e.ecModel)}),this.leavesModel=new dl(i||{},e,e.ecModel)}function $y(t,e){var i=e.children;t.parentNode!==e&&(i.push(t),t.parentNode=e)}function Jy(t,e){var i=t.isExpand?t.children:[],n=t.parentNode.children,a=t.hierNode.i?n[t.hierNode.i-1]:null;if(i.length){!function(t){var e=t.children,i=e.length,n=0,a=0;for(;0<=--i;){var o=e[i];o.hierNode.prelim+=n,o.hierNode.modifier+=n,a+=o.hierNode.change,n+=o.hierNode.shift+a}}(t);var o=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;a?(t.hierNode.prelim=a.hierNode.prelim+e(t,a),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else a&&(t.hierNode.prelim=a.hierNode.prelim+e(t,a));t.parentNode.hierNode.defaultAncestor=function(t,e,i,n){if(e){for(var a=t,o=t,r=o.parentNode.children[0],s=e,l=a.hierNode.modifier,u=o.hierNode.modifier,h=r.hierNode.modifier,c=s.hierNode.modifier;s=ix(s),o=nx(o),s&&o;){a=ix(a),r=nx(r),a.hierNode.ancestor=t;var d=s.hierNode.prelim+c-o.hierNode.prelim-u+n(s,o);0<d&&(ax((p=t,g=i,(f=s).hierNode.ancestor.parentNode===p.parentNode?f.hierNode.ancestor:g),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=a.hierNode.modifier,h+=r.hierNode.modifier}s&&!ix(a)&&(a.hierNode.thread=s,a.hierNode.modifier+=c-l),o&&!nx(r)&&(r.hierNode.thread=o,r.hierNode.modifier+=u-h,i=t)}var f,p,g;return i}(t,a,t.parentNode.hierNode.defaultAncestor||n[0],e)}function Qy(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function tx(t){return arguments.length?t:ox}function ex(t,e){var i={};return t-=Math.PI/2,i.x=e*Math.cos(t),i.y=e*Math.sin(t),i}function ix(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function nx(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function ax(t,e,i){var n=i/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=i,e.hierNode.modifier+=i,e.hierNode.prelim+=i,t.hierNode.change+=n}function ox(t,e){return t.parentNode===e.parentNode?1:2}function rx(t,e){var i=t.getItemLayout(e);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==t.getItemVisual(e,"symbol")}function sx(t,e,i){return i.itemModel=e,i.itemStyle=e.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=e.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=e.getModel("lineStyle").getLineStyle(),i.labelModel=e.getModel("label"),i.hoverLabelModel=e.getModel("emphasis.label"),!1===t.isExpand&&0!==t.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function lx(t,e,i,n,a,o){var r=!i,s=t.tree.getNodeByDataIndex(e),l=s.getModel(),u=(o=sx(s,l,o),t.tree.root),h=s.parentNode===u?s:s.parentNode||s,c=t.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=s.getLayout();r?(i=new Sg(t,e,o)).attr("position",[f.x,f.y]):i.updateData(t,e,o),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),t.setItemGraphicEl(e,i),js(i,{position:[p.x,p.y]},a);var g=i.getSymbolPath();if("radial"===o.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(p.x===x.x&&!0===s.isExpand){var w={};w.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,w.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(w.y-x.y,w.x-x.x))<0&&(m=2*Math.PI+m),(v=w.x<x.x)&&(m-=Math.PI)}else(m=Math.atan2(p.y-x.y,p.x-x.x))<0&&(m=2*Math.PI+m),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(v=p.x<x.x)&&(m-=Math.PI):(v=p.x>x.x)||(m-=Math.PI);var b=v?"left":"right",S=o.labelModel.get("rotate"),M=S*(Math.PI/180);g.setStyle({textPosition:o.labelModel.get("position")||b,textRotation:null==S?-m:M,textOrigin:"center",verticalAlign:"middle"})}if(s.parentNode&&s.parentNode!==u){var I=i.__edge;js(I=I||(i.__edge=new qr({shape:hx(o,f,f),style:C({opacity:0,strokeNoScale:!0},o.lineStyle)})),{shape:hx(o,d,p),style:{opacity:1}},a),n.add(I)}}function ux(t,e,i,n,a,o){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,u=s.getModel(),h=(o=sx(s,u,o),s.parentNode===l?s:s.parentNode||s);null==(r=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;js(i,{position:[r.x+1,r.y+1]},a,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var c=i.__edge;c&&js(c,{shape:hx(o,r,r),style:{opacity:0}},a,function(){n.remove(c)})}function hx(t,e,i){var n,a,o,r,s,l,u,h,c=t.orient;if("radial"!==t.layout)return s=e.x,u=e.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*t.curvature,a=u,o=l+(s-l)*t.curvature,r=h),"TB"!==c&&"BT"!==c||(n=s,a=u+(h-u)*t.curvature,o=l,r=h+(u-h)*t.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:a,cpx2:o,cpy2:r};s=e.rawX,u=e.rawY,l=i.rawX,h=i.rawY;var d=ex(s,u),f=ex(s,u+(h-u)*t.curvature),p=ex(l,h+(u-h)*t.curvature),g=ex(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}function cx(t,e){for(var i,n=[t];i=n.pop();)if(e(i),i.isExpand){var a=i.children;if(a.length)for(var o=a.length-1;0<=o;o--)n.push(a[o])}}qy.prototype={constructor:qy,isRemoved:function(){return this.dataIndex<0},eachNode:function(t,e,i){"function"==typeof t&&(i=e,e=t,t=null),R(t=t||{})&&(t={order:t});var n,a=t.order||"preorder",o=this[t.attr||"children"];"preorder"===a&&(n=e.call(i,this));for(var r=0;!n&&r<o.length;r++)o[r].eachNode(t,e,i);"postorder"===a&&e.call(i,this)},updateDepthAndHeight:function(t){var e=0;this.depth=t;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(t+1),n.height>e&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;e<n;e++){var a=i[e].getNodeById(t);if(a)return a}},contains:function(t){if(t===this)return!0;for(var e=0,i=this.children,n=i.length;e<n;e++){var a=i[e].contains(t);if(a)return a}},getAncestors:function(t){for(var e=[],i=t?this:this.parentNode;i;)e.push(i),i=i.parentNode;return e.reverse(),e},getValue:function(t){var e=this.hostTree.data;return e.get(e.getDimension(t||"value"),this.dataIndex)},setLayout:function(t,e){0<=this.dataIndex&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e,i=this.hostTree,n=i.data.getItemModel(this.dataIndex),a=this.getLevelModel();return a||0!==this.children.length&&(0===this.children.length||!1!==this.isExpand)||(e=this.getLeavesModel()),n.getModel(t,(a||e||i.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},getLeavesModel:function(){return this.hostTree.leavesModel},setVisual:function(t,e){0<=this.dataIndex&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},isDescendantOf:function(t){return t!==this&&t.isAncestorOf(this)}},Ky.prototype={constructor:Ky,type:"tree",eachNode:function(t,e,i){this.root.eachNode(t,e,i)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;i<n;i++)e[i].dataIndex=-1;for(i=0,n=t.count();i<n;i++)e[t.getRawIndex(i)].dataIndex=i},clearLayouts:function(){this.data.clearItemLayouts()}},Ky.createTree=function(t,e,i){var s=new Ky(e,i.levels,i.leaves),l=[],u=1;!function t(e,i){var n=e.value;u=Math.max(u,k(n)?n.length:1);l.push(e);var a=new qy(e.name,s);i?$y(a,i):s.root=a;s._nodes.push(a);var o=e.children;if(o)for(var r=0;r<o.length;r++)t(o[r],a)}(t),s.root.updateDepthAndHeight(0);var n=Wf(l,{coordDimensions:["value"],dimensionsCount:u}),a=new Tf(n,e);return a.initData(l),Wy({mainData:a,struct:s,structAttr:"tree"}),s.update(),s},Wh.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(t){var e={name:t.name,children:t.data},i=t.leaves||{},n={};n.leaves=i;var a=Ky.createTree(e,this,n),o=0;a.eachNode("preorder",function(t){t.depth>o&&(o=t.depth)});var r=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:o;return a.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=r}),a.data},getOrient:function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},formatTooltip:function(t){for(var e=this.getData().tree,i=e.root.children[0],n=e.getNodeByDataIndex(t),a=n.getValue(),o=n.name;n&&n!==i;)o=n.parentNode.name+"."+o,n=n.parentNode;return Wl(o+(isNaN(a)||null==a?"":" : "+a))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",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",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}}),hf({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new Si,this._controller=new uy(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(n,t,i,e){var a=n.getData(),o=n.layoutInfo,r=this._mainGroup,s=n.get("layout");"radial"===s?r.attr("position",[o.x+o.width/2,o.y+o.height/2]):r.attr("position",[o.x,o.y]),this._updateViewCoordSys(n,o,s),this._updateController(n,t,i);var l=this._data,u={expandAndCollapse:n.get("expandAndCollapse"),layout:s,orient:n.getOrient(),curvature:n.get("lineStyle.curveness"),symbolRotate:n.get("symbolRotate"),symbolOffset:n.get("symbolOffset"),hoverAnimation:n.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};a.diff(l).add(function(t){rx(a,t)&&lx(a,t,null,r,n,u)}).update(function(t,e){var i=l.getItemGraphicEl(e);rx(a,t)?lx(a,t,i,r,n,u):i&&ux(l,e,i,r,n,u)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&ux(l,t,e,r,n,u)}).execute(),this._nodeScaleRatio=n.get("nodeScaleRatio"),this._updateNodeAndLinkScale(n),!0===u.expandAndCollapse&&a.eachItemGraphicEl(function(t,e){t.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:n.id,dataIndex:e})})}),this._data=a},_updateViewCoordSys:function(t){var i=t.getData(),n=[];i.each(function(t){var e=i.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||n.push([+e.x,+e.y])});var e=[],a=[];Io(n,e,a);var o=this._min,r=this._max;a[0]-e[0]==0&&(e[0]=o?o[0]:e[0]-1,a[0]=r?r[0]:a[0]+1),a[1]-e[1]==0&&(e[1]=o?o[1]:e[1]-1,a[1]=r?r[1]:a[1]+1);var s=t.coordinateSystem=new Py;s.zoomLimit=t.get("scaleLimit"),s.setBoundingRect(e[0],e[1],a[0]-e[0],a[1]-e[1]),s.setCenter(t.get("center")),s.setZoom(t.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=e,this._max=a},_updateController:function(a,t,o){var e=this._controller,i=this._controllerHost,r=this.group;e.setPointerChecker(function(t,e,i){var n=r.getBoundingRect();return n.applyTransform(r.transform),n.contain(e,i)&&!wy(t,o,a)}),e.enable(a.get("roam")),i.zoomLimit=a.get("scaleLimit"),i.zoom=a.coordinateSystem.getZoom(),e.off("pan").off("zoom").on("pan",function(t){yy(i,t.dx,t.dy),o.dispatchAction({seriesId:a.id,type:"treeRoam",dx:t.dx,dy:t.dy})},this).on("zoom",function(t){xy(i,t.scale,t.originX,t.originY),o.dispatchAction({seriesId:a.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(a)},this)},_updateNodeAndLinkScale:function(t){var e=t.getData(),i=this._getNodeGlobalScale(t),n=[i,i];e.eachItemGraphicEl(function(t,e){t.attr("scale",n)})},_getNodeGlobalScale:function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=this._nodeScaleRatio,n=e.scale,a=n&&n[0]||1;return((e.getZoom()-1)*i+1)/a},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}}),tf({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(n,t){t.eachComponent({mainType:"series",subType:"tree",query:n},function(t){var e=n.dataIndex,i=t.getData().tree.getNodeByDataIndex(e);i.isExpand=!i.isExpand})}),tf({type:"treeRoam",event:"treeRoam",update:"none"},function(i,t){t.eachComponent({mainType:"series",subType:"tree",query:i},function(t){var e=Cy(t.coordinateSystem,i);t.setCenter&&t.setCenter(e.center),t.setZoom&&t.setZoom(e.zoom)})});function dx(t,e,i){if(t&&0<=_(e,t.type)){var n=i.getData().tree.root,a=t.targetNode;if("string"==typeof a&&(a=n.getNodeById(a)),a&&n.contains(a))return{node:a};var o=t.targetNodeId;if(null!=o&&(a=n.getNodeById(o)))return{node:a}}}function fx(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function px(t,e){return 0<=_(fx(t),e)}function gx(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}af(rm("tree","circle")),nf(function(t,e){t.eachSeriesByType("tree",function(t){!function(t,e){var i=function(t,e){return au(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=i;var n=t.get("layout"),a=0,o=0,r=null;r="radial"===n?(a=2*Math.PI,o=Math.min(i.height,i.width)/2,tx(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(a=i.width,o=i.height,tx());var s=t.getData().tree.root,l=s.children[0];if(l){!function(t){t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var e,i,n=[t];e=n.pop();)if(i=e.children,e.isExpand&&i.length)for(var a=i.length-1;0<=a;a--){var o=i[a];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},n.push(o)}}(s),function(t,e,i){for(var n,a=[t],o=[];n=a.pop();)if(o.push(n),n.isExpand){var r=n.children;if(r.length)for(var s=0;s<r.length;s++)a.push(r[s])}for(;n=o.pop();)e(n,i)}(l,Jy,r),s.hierNode.modifier=-l.hierNode.prelim,cx(l,Qy);var u=l,h=l,c=l;cx(l,function(t){var e=t.getLayout().x;e<u.getLayout().x&&(u=t),e>h.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)});var d=u===h?1:r(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=a/(h.getLayout().x+d+f),g=o/(c.depth-1||1),cx(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=ex(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)});else{var y=t.getOrient();"RL"===y||"LR"===y?(g=o/(h.getLayout().x+d+f),p=a/(c.depth-1||1),cx(l,function(t){v=(t.getLayout().x+f)*g,m="LR"===y?(t.depth-1)*p:a-(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):"TB"!==y&&"BT"!==y||(p=a/(h.getLayout().x+d+f),g=o/(c.depth-1||1),cx(l,function(t){m=(t.getLayout().x+f)*p,v="TB"===y?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))}}}(t,e)})}),Wh.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,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)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};!function i(t){var n=0;E(t.children,function(t){i(t);var e=t.value;k(e)&&(e=e[0]),n+=e});var e=t.value;k(e)&&(e=e[0]);null!=e&&!isNaN(e)||(e=n);e<0&&(e=0);k(t.value)?t.value[0]=e:t.value=e}(i);var n=t.levels||[];n=t.levels=function(t,e){var n,i=e.get("color");if(!i)return;if(E(t=t||[],function(t){var e=new dl(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),!n){(t[0]||(t[0]={})).color=i.slice()}return t}(n,e);var a={};return a.levels=n,Ky.createTree(i,this,a).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=k(i)?zl(i[0]):zl(i);return Wl(e.getName(t)+": "+n)},getDataParams:function(t){var e=Wh.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=gx(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},L(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=Q(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},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)}});var mx=5;function vx(t){this.group=new Si,t.add(this.group)}function yx(t,e,i,n,a,o){var r=[[a?t:t-mx,e],[t+i,e],[t+i,e+n],[a?t:t-mx,e+n]];return o||r.splice(2,0,[t+i+mx,e+n/2]),a||r.push([t,e+n/2]),r}vx.prototype={constructor:vx,render:function(t,e,i,n){var a=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),a.get("show")&&i){var r=a.getModel("itemStyle"),s=r.getModel("textStyle"),l={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(t,l,r,s,n),ou(o,l.pos,l.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var a=n.getModel().get("name"),o=i.getTextRect(a),r=Math.max(o.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:n,text:a,width:r})}},_renderContent:function(t,e,i,n,a){for(var o,r,s=0,l=e.emptyItemWidth,u=t.get("breadcrumb.height"),h=function(t,e,i){var n=e.width,a=e.height,o=xl(t.x,n),r=xl(t.y,a),s=xl(t.x2,n),l=xl(t.y2,a);return(isNaN(o)||isNaN(parseFloat(t.x)))&&(o=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=a),i=Vl(i||0),{width:Math.max(s-o-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}(e.pos,e.box),c=e.totalWidth,d=e.renderList,f=d.length-1;0<=f;f--){var p=d[f],g=p.node,m=p.width,v=p.text;c>h.width&&(c-=m-l,m=l,v=null);var y=new Rr({shape:{points:yx(s,0,m,u,f===d.length-1,0===f)},style:C(i.getItemStyle(),{lineJoin:"bevel",text:v,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:A(a,g)});this.group.add(y),o=t,r=g,y.eventData={componentType:"series",componentSubType:"treemap",componentIndex:o.componentIndex,seriesIndex:o.componentIndex,seriesName:o.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&gx(r,o)},s+=m+8}},remove:function(){this.group.removeAll()}};function xx(t){var e=Lx(t);return e.stroke=e.fill=e.lineWidth=null,e}var _x=T,bx=Si,Sx=Hr,Mx=E,Ix=["label"],Ax=["emphasis","label"],Tx=["upperLabel"],Dx=["emphasis","upperLabel"],Cx=10,Lx=Xa([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]);function kx(d,r,s,l,u,i,f,t,e,n){if(f){var p=f.getLayout();if(p&&p.isInView){var h=p.width,c=p.height,g=p.borderWidth,m=p.invisible,v=f.getRawIndex(),y=t&&t.getRawIndex(),a=f.viewChildren,x=p.upperHeight,o=a&&a.length,_=f.getModel("itemStyle"),w=f.getModel("emphasis.itemStyle"),b=T("nodeGroup",bx);if(b){if(e.add(b),b.attr("position",[p.x||0,p.y||0]),b.__tmNodeWidth=h,b.__tmNodeHeight=c,p.isAboveViewRoot)return b;var S=T("background",Sx,n,1);if(S&&function(t,n,a){n.dataIndex=f.dataIndex,n.seriesIndex=d.seriesIndex,n.setShape({x:0,y:0,width:h,height:c});var o=f.getVisual("borderColor",!0),r=w.get("borderColor");I(n,function(){var t=xx(_);t.fill=o;var e=Lx(w);if(e.fill=r,a){var i=h-2*g;A(t,e,o,i,x,{x:g,y:0,width:i,height:x})}else t.text=e.text=null;n.setStyle(t),Os(n,e)}),t.add(n)}(b,S,o&&p.upperHeight),!o){var M=T("content",Sx,n,2);M&&function(t,i){i.dataIndex=f.dataIndex,i.seriesIndex=d.seriesIndex;var n=Math.max(h-2*g,0),a=Math.max(c-2*g,0);i.culling=!0,i.setShape({x:g,y:g,width:n,height:a});var o=f.getVisual("color",!0);I(i,function(){var t=xx(_);t.fill=o;var e=Lx(w);A(t,e,o,n,a),i.setStyle(t),Os(i,e)}),t.add(i)}(b,M)}return b}}}function I(t,e){m?t.invisible||i.push(t):(e(),t.__tmWillVisible||(t.invisible=!1))}function A(t,e,i,n,a,o){var r=f.getModel(),s=W(d.getFormattedLabel(f.dataIndex,"normal",null,null,o?"upperLabel":"label"),r.get("name"));if(!o&&p.isLeafRoot){var l=d.get("drillDownIcon",!0);s=l?l+" "+s:s}var u=r.getModel(o?Tx:Ix),h=r.getModel(o?Dx:Ax),c=u.getShallow("show");Bs(t,e,u,h,{defaultText:c?s:null,autoColor:i,isRectText:!0}),o&&(t.textRect=D(o)),t.truncate=c&&u.get("ellipsis")?{outerWidth:n,outerHeight:a,minChar:2}:null}function T(t,e,i,n){var a=null!=y&&s[t][y],o=u[t];return a?(s[t][y]=null,function(t,e,i){(t[v]={}).old="nodeGroup"===i?e.position.slice():L({},e.shape)}(o,a,t)):m||((a=new e({z:function(t,e){var i=t*Cx+e;return(i-1)/i}(i,n)})).__tmDepth=i,function(t,e,i){var n=t[v]={},a=f.parentNode;if(a&&(!l||"drillDown"===l.direction)){var o=0,r=0,s=u.background[a.getRawIndex()];!l&&s&&s.old&&(o=s.old.width,r=s.old.height),n.old="nodeGroup"===i?[0,r]:{x:o,y:r,width:0,height:0}}n.fadein="nodeGroup"!==i}(o,0,a.__tmStorageName=t)),r[t][v]=a}}hf({type:"treemap",init:function(t,e){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,i,n){if(!(_(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var a=dx(n,["treemapZoomToNode","treemapRootToNode"],t),o=n&&n.type,r=t.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===o&&a&&l?{rootNodeGroup:l.nodeGroup[a.node.getRawIndex()],direction:n.direction}:null,h=this._giveContainerGroup(r),c=this._doRender(h,t,u);s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?c.renderFinally():this._doAnimation(h,c,t,u),this._resetController(i),this._renderBreadcrumb(t,i,a)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new bx,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){var n=e.getData().tree,a=this._oldTree,o={nodeGroup:[],background:[],content:[]},r={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],c=A(kx,e,r,s,i,o,l);!function o(r,s,l,u,h){u?Mx(s=r,function(t,e){t.isRemoved()||i(e,e)}):new df(s,r,t,t).add(i).update(i).remove(A(i,null)).execute();function t(t){return t.getId()}function i(t,e){var i=null!=t?r[t]:null,n=null!=e?s[e]:null,a=c(i,n,l,h);a&&o(i&&i.viewChildren||[],n&&n.viewChildren||[],a,u,h+1)}}(n.root?[n.root]:[],a&&a.root?[a.root]:[],t,n===a||!a,0);var u,h,d=(h={nodeGroup:[],background:[],content:[]},(u=s)&&Mx(u,function(t,e){var i=h[e];Mx(t,function(t){t&&(i.push(t),t.__tmWillDelete=1)})}),h);return this._oldTree=n,this._storage=r,{lastsForAnimation:o,willDeleteEls:d,renderFinally:function(){Mx(d,function(t){Mx(t,function(t){t.parent&&t.parent.remove(t)})}),Mx(l,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,o,e,s){if(e.get("animation")){var l=e.get("animationDurationUpdate"),u=e.get("animationEasing"),h=function(){var o,r=[],s={};return{add:function(t,e,i,n,a){return R(n)&&(a=n,n=0),!s[t.id]&&(s[t.id]=1,r.push({el:t,target:e,time:i,delay:n,easing:a}),!0)},done:function(t){return o=t,this},start:function(){for(var t=r.length,e=0,i=r.length;e<i;e++){var n=r[e];n.el.animateTo(n.target,n.time,n.delay,n.easing,a)}return this;function a(){--t||(r.length=0,s={},o&&o())}}}}();Mx(o.willDeleteEls,function(t,r){Mx(t,function(t,e){if(!t.invisible){var i,n=t.parent;if(s&&"drillDown"===s.direction)i=n===s.rootNodeGroup?{shape:{x:0,y:0,width:n.__tmNodeWidth,height:n.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var a=0,o=0;n.__tmWillDelete||(a=n.__tmNodeWidth/2,o=n.__tmNodeHeight/2),i="nodeGroup"===r?{position:[a,o],style:{opacity:0}}:{shape:{x:a,y:o,width:0,height:0},style:{opacity:0}}}i&&h.add(t,i,l,u)}})}),Mx(this._storage,function(t,a){Mx(t,function(t,e){var i=o.lastsForAnimation[a][e],n={};i&&("nodeGroup"===a?i.old&&(n.position=t.position.slice(),t.attr("position",i.old)):(i.old&&(n.shape=L({},t.shape),t.setShape(i.old)),i.fadein?(t.setStyle("opacity",0),n.style={opacity:1}):1!==t.style.opacity&&(n.style={opacity:1})),h.add(t,n,l,u))})},this),this._state="animating",h.done(_x(function(){this._state="ready",o.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||((e=this._controller=new uy(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",_x(this._onPan,this)),e.on("zoom",_x(this._onZoom,this)));var n=new bi(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,i){return n.contain(e,i)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t){if("animating"!==this._state&&(3<Math.abs(t.dx)||3<Math.abs(t.dy))){var e=this.seriesModel.getData().tree.root;if(!e)return;var i=e.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},_onZoom:function(t){var e=t.originX,i=t.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var a=n.getLayout();if(!a)return;var o=new bi(a.x,a.y,a.width,a.height),r=this.seriesModel.layoutInfo;e-=r.x,i-=r.y;var s=Qt();ne(s,s,[-e,-i]),oe(s,s,[t.scale,t.scale]),ne(s,s,[e,i]),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}})}},_initEvents:function(t){t.on("click",function(t){if("ready"===this._state){var e=this.seriesModel.get("nodeClick",!0);if(e){var i=this.findTarget(t.offsetX,t.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===e)this._zoomToNode(i);else if("link"===e){var a=n.hostTree.data.getItemModel(n.dataIndex),o=a.get("link",!0),r=a.get("target",!0)||"blank";o&&window.open(o,r)}}}}},this)},_renderBreadcrumb:function(e,t,i){i=i||((i=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||{node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new vx(this.group))).render(e,t,i.node,_x(function(t){"animating"!==this._state&&(px(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))},this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(a,o){var r;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(t){var e=this._storage.background[t.getRawIndex()];if(e){var i=e.transformCoordToLocal(a,o),n=e.shape;if(!(n.x<=i[0]&&i[0]<=n.x+n.width&&n.y<=i[1]&&i[1]<=n.y+n.height))return!1;r={node:t,offsetX:i[0],offsetY:i[1]}}},this),r}});for(var Px=function(){},Nx=["treemapZoomToNode","treemapRender","treemapMove"],Ox=0;Ox<Nx.length;Ox++)tf({type:Nx[Ox],update:"updateView"},Px);tf({type:"treemapRootToNode",update:"updateView"},function(a,t){t.eachComponent({mainType:"series",subType:"treemap",query:a},function(t,e){var i=dx(a,["treemapZoomToNode","treemapRootToNode"],t);if(i){var n=t.getViewRoot();n&&(a.direction=px(n,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}})});var Ex=E,Rx=z,zx=-1,Bx=function(t){var e=t.mappingMethod,i=t.type,n=this.option=D(t);this.type=i,this.mappingMethod=e,this._normalizeData=qx[e];var a=Vx[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._doMap=a._doMap[e],"piecewise"===e?(Gx(n),function(i){var t=i.pieceList;i.hasSpecialVisual=!1,E(t,function(t,e){t.originIndex=e,null!=t.visual&&(i.hasSpecialVisual=!0)})}(n)):"category"===e?n.categories?function(t){var e=t.categories,i=t.visual,n=t.categoryMap={};if(Ex(e,function(t,e){n[t]=e}),!k(i)){var a=[];z(i)?Ex(i,function(t,e){var i=n[e];a[null!=i?i:zx]=t}):a[zx]=i,i=jx(t,a)}for(var o=e.length-1;0<=o;o--)null==i[o]&&(delete n[e[o]],e.pop())}(n):Gx(n,!0):(Y("linear"!==e||n.dataExtent),Gx(n))};Bx.prototype={constructor:Bx,mapValueToVisual:function(t){var e=this._normalizeData(t);return this._doMap(e,t)},getNormalizer:function(){return T(this._normalizeData,this)}};var Vx=Bx.visualHandlers={color:{applyVisual:Hx("color"),getColorMapper:function(){var a=this.option;return T("category"===a.mappingMethod?function(t,e){return e||(t=this._normalizeData(t)),Zx.call(this,t)}:function(t,e,i){var n=!!i;return e||(t=this._normalizeData(t)),i=Ve(t,a.parsedVisual,i),n?i:Ue(i,"rgba")},this)},_doMap:{linear:function(t){return Ue(Ve(t,this.option.parsedVisual),"rgba")},category:Zx,piecewise:function(t,e){var i=Yx.call(this,e);return null==i&&(i=Ue(Ve(t,this.option.parsedVisual),"rgba")),i},fixed:Ux}},colorHue:Fx(function(t,e){return He(t,e)}),colorSaturation:Fx(function(t,e){return He(t,null,e)}),colorLightness:Fx(function(t,e){return He(t,null,null,e)}),colorAlpha:Fx(function(t,e){return Ze(t,e)}),opacity:{applyVisual:Hx("opacity"),_doMap:Xx([0,1])},liftZ:{applyVisual:Hx("liftZ"),_doMap:{linear:Ux,category:Ux,piecewise:Ux,fixed:Ux}},symbol:{applyVisual:function(t,e,i){var n=this.mapValueToVisual(t);if(R(n))i("symbol",n);else if(Rx(n))for(var a in n)n.hasOwnProperty(a)&&i(a,n[a])},_doMap:{linear:Wx,category:Zx,piecewise:function(t,e){var i=Yx.call(this,e);return null==i&&(i=Wx.call(this,t)),i},fixed:Ux}},symbolSize:{applyVisual:Hx("symbolSize"),_doMap:Xx([0,1])}};function Gx(t,e){var i=t.visual,n=[];z(i)?Ex(i,function(t){n.push(t)}):null!=i&&n.push(i);e||1!==n.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(n[1]=n[0]),jx(t,n)}function Fx(n){return{applyVisual:function(t,e,i){t=this.mapValueToVisual(t),i("color",n(e("color"),t))},_doMap:Xx([0,1])}}function Wx(t){var e=this.option.visual;return e[Math.round(yl(t,[0,1],[0,e.length-1],!0))]||{}}function Hx(n){return function(t,e,i){i(n,this.mapValueToVisual(t))}}function Zx(t){var e=this.option.visual;return e[this.option.loop&&t!==zx?t%e.length:t]}function Ux(){return this.option.visual[0]}function Xx(n){return{linear:function(t){return yl(t,n,this.option.visual,!0)},category:Zx,piecewise:function(t,e){var i=Yx.call(this,e);return null==i&&(i=yl(t,n,this.option.visual,!0)),i},fixed:Ux}}function Yx(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=i[Bx.findPieceIndex(t,i)];if(n&&n.visual)return n.visual[this.type]}}function jx(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=N(e,function(t){return Ee(t)})),e}var qx={linear:function(t){return yl(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,i=Bx.findPieceIndex(t,e,!0);if(null!=i)return yl(i,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?zx:e},fixed:et};function Kx(t,e,i){return t?e<=i:e<i}Bx.listVisualTypes=function(){var i=[];return E(Vx,function(t,e){i.push(e)}),i},Bx.addVisualHandler=function(t,e){Vx[t]=e},Bx.isValidType=function(t){return Vx.hasOwnProperty(t)},Bx.eachVisual=function(t,e,i){z(t)?E(t,e,i):e.call(i,t)},Bx.mapVisual=function(t,n,a){var o,r=k(t)?[]:z(t)?{}:(o=!0,null);return Bx.eachVisual(t,function(t,e){var i=n.call(a,t,e);o?r=i:r[e]=i}),r},Bx.retrieveVisuals=function(i){var n,a={};return i&&Ex(Vx,function(t,e){i.hasOwnProperty(e)&&(a[e]=i[e],n=!0)}),n?a:null},Bx.prepareVisualTypes=function(t){if(Rx(t)){var i=[];Ex(t,function(t,e){i.push(e)}),t=i}else{if(!k(t))return[];t=t.slice()}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},Bx.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},Bx.findPieceIndex=function(n,t,e){for(var a,o=1/0,i=0,r=t.length;i<r;i++){var s=t[i].value;if(null!=s){if(s===n||"string"==typeof s&&s===n+"")return i;e&&c(s,i)}}for(i=0,r=t.length;i<r;i++){var l=t[i],u=l.interval,h=l.close;if(u){if(u[0]===-1/0){if(Kx(h[1],n,u[1]))return i}else if(u[1]===1/0){if(Kx(h[0],u[0],n))return i}else if(Kx(h[0],u[0],n)&&Kx(h[1],n,u[1]))return i;e&&c(u[0],i),e&&c(u[1],i)}}if(e)return n===1/0?t.length-1:n===-1/0?0:a;function c(t,e){var i=Math.abs(t-n);i<o&&(o=i,a=e)}};var $x=k,Jx="itemStyle",Qx={seriesType:"treemap",reset:function(t,e,i,n){var a=t.getData().tree,o=a.root,r=t.getModel(Jx);o.isRemoved()||!function n(t,e,a,o,r,s){var l=t.getModel();var i=t.getLayout();if(!i||i.invisible||!i.isInView)return;var u=t.getModel(Jx);var h=a[t.depth];var c=t_(u,e,h,o);var d=u.get("borderColor");var f=u.get("borderColorSaturation");var p;null!=f&&(p=e_(c),g=f,d=null!=(m=p)?He(m,null,null,g):null);var g,m;t.setVisual("borderColor",d);var v=t.viewChildren;if(v&&v.length){var y=n_(t,l,i,u,c,v);E(v,function(t,e){if(t.depth>=r.length||t===r[t.depth]){var i=o_(l,c,t,e,y,s);n(t,i,a,o,r,s)}})}else p=e_(c),t.setVisual("color",p)}(o,{},N(a.levelModels,function(t){return t?t.get(Jx):null}),r,t.getViewRoot().getAncestors(),t)}};function t_(i,n,a,o){var r=L({},n);return E(["color","colorAlpha","colorSaturation"],function(t){var e=i.get(t,!0);null==e&&a&&(e=a[t]),null==e&&(e=n[t]),null==e&&(e=o.get(t)),null!=e&&(r[t]=e)}),r}function e_(t){var e=i_(t,"color");if(e){var i=i_(t,"colorAlpha"),n=i_(t,"colorSaturation");return n&&(e=He(e,null,null,n)),i&&(e=Ze(e,i)),e}}function i_(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function n_(t,e,i,n,a,o){if(o&&o.length){var r=a_(e,"color")||null!=a.color&&"none"!==a.color&&(a_(e,"colorAlpha")||a_(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),u=i.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:r.name,dataExtent:u,visual:r.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new Bx(c);return d.__drColorMappingBy=h,d}}}function a_(t,e){var i=t.get(e);return $x(i)&&i.length?{name:e,range:i}:null}function o_(t,e,i,n,a,o){var r=L({},e);if(a){var s=a.type,l="color"===s&&a.__drColorMappingBy,u="index"===l?n:"id"===l?o.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));r[s]=a.mapValueToVisual(u)}return r}var r_=Math.max,s_=Math.min,l_=W,u_=E,h_=["itemStyle","borderWidth"],c_=["itemStyle","gapWidth"],d_=["upperLabel","show"],f_=["upperLabel","height"],p_={seriesType:"treemap",reset:function(t,e,i,n){var a=i.getWidth(),o=i.getHeight(),r=t.option,s=au(t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=r.size||[],u=xl(l_(s.width,l[0]),a),h=xl(l_(s.height,l[1]),o),c=n&&n.type,d=dx(n,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=t.getViewRoot(),g=fx(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(t,e,i,n,a){var o,r=(e||{}).node,s=[n,a];if(!r||r===i)return s;var l=n*a,u=l*t.option.zoomToNodeRatio;for(;o=r.parentNode;){for(var h=0,c=o.children,d=0,f=c.length;d<f;d++)h+=c[d].getValue();var p=r.getValue();if(0===p)return s;u*=h/p;var g=o.getModel(),m=g.get(h_),v=Math.max(m,y_(g));u+=4*m*m+(3*m+v)*Math.pow(u,.5),Al<u&&(u=Al),r=o}u<l&&(u=l);var y=Math.pow(u/l,.5);return[n*y,a*y]}(t,d,p,u,h):f?[f.width,f.height]:[u,h],v=r.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:r.squareRatio,sort:v,leafDepth:r.leafDepth};p.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};p.setLayout(x),function t(e,i,n,a){var o;var r;if(e.isRemoved())return;var s=e.getLayout();o=s.width;r=s.height;var l=e.getModel();var u=l.get(h_);var h=l.get(c_)/2;var c=y_(l);var d=Math.max(u,c);var f=u-h;var p=d-h;var l=e.getModel();e.setLayout({borderWidth:u,upperHeight:d,upperLabelHeight:c},!0);o=r_(o-2*f,0);r=r_(r-f-p,0);var g=o*r;var m=g_(e,l,g,i,n,a);if(!m.length)return;var v={x:f,y:p,width:o,height:r};var y=s_(o,r);var x=1/0;var _=[];_.area=0;for(var w=0,b=m.length;w<b;){var S=m[w];_.push(S),_.area+=S.getLayout().area;var M=m_(_,y,i.squareRatio);x=M<=x?(w++,M):(_.area-=_.pop().getLayout().area,v_(_,y,v,h,!1),y=s_(v.width,v.height),_.length=_.area=0,1/0)}_.length&&v_(_,y,v,h,!0);if(!n){var I=l.get("childrenVisibleMin");null!=I&&g<I&&(n=!0)}for(var w=0,b=m.length;w<b;w++)t(m[w],i,n,a+1)}(p,y,!1,0);x=p.getLayout();u_(g,function(t,e){var i=(g[e+1]||p).getValue();t.setLayout(L({dataExtent:[i,i],borderWidth:0,upperHeight:0},x))})}var _=t.getData().tree.root;_.setLayout(function(t,e,i){if(e)return{x:e.x,y:e.y};var n={x:0,y:0};if(!i)return n;var a=i.node,o=a.getLayout();if(!o)return n;var r=[o.width/2,o.height/2],s=a;for(;s;){var l=s.getLayout();r[0]+=l.x,r[1]+=l.y,s=s.parentNode}return{x:t.width/2-r[0],y:t.height/2-r[1]}}(s,f,d),!0),t.setLayoutInfo(s),function e(t,i,n,a,o){var r=t.getLayout();var s=n[o];var l=s&&s===t;if(s&&!l||o===n.length&&t!==a)return;t.setLayout({isInView:!0,invisible:!l&&!i.intersect(r),isAboveViewRoot:l},!0);var u=new bi(i.x-r.x,i.y-r.y,i.width,i.height);u_(t.viewChildren||[],function(t){e(t,u,n,a,o+1)})}(_,new bi(-s.x,-s.y,a,o),g,p,0)}};function g_(t,e,i,n,a,o){var r=t.children||[],s=n.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=n.leafDepth&&n.leafDepth<=o;if(a&&!l)return t.viewChildren=[];!function(t,n){n&&t.sort(function(t,e){var i="asc"===n?t.getValue()-e.getValue():e.getValue()-t.getValue();return 0==i?"asc"===n?t.dataIndex-e.dataIndex:e.dataIndex-t.dataIndex:i})}(r=M(r,function(t){return!t.isRemoved()}),s);var u=function(t,e,i){for(var n=0,a=0,o=e.length;a<o;a++)n+=e[a].getValue();var r=t.get("visualDimension");if(e&&e.length)if("value"===r&&i)s=[e[e.length-1].getValue(),e[0].getValue()],"asc"===i&&s.reverse();else{var s=[1/0,-1/0];u_(e,function(t){var e=t.getValue(r);e<s[0]&&(s[0]=e),e>s[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(e,r,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,i,n,a){if(!n)return i;for(var o=t.get("visibleMin"),r=a.length,s=r,l=r-1;0<=l;l--){var u=a["asc"===n?r-l-1:l].getValue();u/i*e<o&&(s=l,i-=u)}return"asc"===n?a.splice(0,r-s):a.splice(s,r-s),i}(e,i,u.sum,s,r),0===u.sum)return t.viewChildren=[];for(var h=0,c=r.length;h<c;h++){var d=r[h].getValue()/u.sum*i;r[h].setLayout({area:d})}return l&&(r.length&&t.setLayout({isLeafRoot:!0},!0),r.length=0),t.viewChildren=r,t.setLayout({dataExtent:u.dataExtent},!0),r}function m_(t,e,i){for(var n,a=0,o=1/0,r=0,s=t.length;r<s;r++)(n=t[r].getLayout().area)&&(n<o&&(o=n),a<n&&(a=n));var l=t.area*t.area,u=e*e*i;return l?r_(u*a/l,l/(u*o)):1/0}function v_(t,e,i,n,a){var o=e===i.width?0:1,r=1-o,s=["x","y"],l=["width","height"],u=i[s[o]],h=e?t.area/e:0;(a||h>i[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;c<d;c++){var f=t[c],p={},g=h?f.getLayout().area/h:0,m=p[l[r]]=r_(h-2*n,0),v=i[s[o]]+i[l[o]]-u,y=c===d-1||v<g?v:g,x=p[l[o]]=r_(y-2*n,0);p[s[r]]=i[s[r]]+s_(n,m/2),p[s[o]]=u+s_(n,x/2),u+=y,f.setLayout(p,!0)}i[s[r]]+=h,i[l[r]]-=h}function y_(t){return t.get(d_)?t.get(f_):0}function x_(t){return"_EC_"+t}af(Qx),nf(p_);function __(t){this._directed=t||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData}var w_=__.prototype;function b_(t,e){this.id=null==t?"":t,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==e?-1:e}function S_(t,e,i){this.node1=t,this.node2=e,this.dataIndex=null==i?-1:i}w_.type="graph",w_.isDirected=function(){return this._directed},w_.addNode=function(t,e){t=null==t?""+e:""+t;var i=this._nodesMap;if(!i[x_(t)]){var n=new b_(t,e);return(n.hostGraph=this).nodes.push(n),i[x_(t)]=n}},w_.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},w_.getNodeById=function(t){return this._nodesMap[x_(t)]},w_.addEdge=function(t,e,i){var n=this._nodesMap,a=this._edgesMap;if("number"==typeof t&&(t=this.nodes[t]),"number"==typeof e&&(e=this.nodes[e]),b_.isInstance(t)||(t=n[x_(t)]),b_.isInstance(e)||(e=n[x_(e)]),t&&e){var o=t.id+"-"+e.id;if(!a[o]){var r=new S_(t,e,i);return(r.hostGraph=this)._directed&&(t.outEdges.push(r),e.inEdges.push(r)),t.edges.push(r),t!==e&&e.edges.push(r),this.edges.push(r),a[o]=r}}},w_.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},w_.getEdge=function(t,e){b_.isInstance(t)&&(t=t.id),b_.isInstance(e)&&(e=e.id);var i=this._edgesMap;return this._directed?i[t+"-"+e]:i[t+"-"+e]||i[e+"-"+t]},w_.eachNode=function(t,e){for(var i=this.nodes,n=i.length,a=0;a<n;a++)0<=i[a].dataIndex&&t.call(e,i[a],a)},w_.eachEdge=function(t,e){for(var i=this.edges,n=i.length,a=0;a<n;a++)0<=i[a].dataIndex&&0<=i[a].node1.dataIndex&&0<=i[a].node2.dataIndex&&t.call(e,i[a],a)},w_.breadthFirstTraverse=function(t,e,i,n){if(b_.isInstance(e)||(e=this._nodesMap[x_(e)]),e){for(var a="out"===i?"outEdges":"in"===i?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(n,e,null))for(var r=[e];r.length;){var s=r.shift(),l=s[a];for(o=0;o<l.length;o++){var u=l[o],h=u.node1===s?u.node2:u.node1;if(!h.__visited){if(t.call(n,h,s))return;r.push(h),h.__visited=!0}}}}},w_.update=function(){for(var t=this.data,i=this.edgeData,e=this.nodes,n=this.edges,a=0,o=e.length;a<o;a++)e[a].dataIndex=-1;for(a=0,o=t.count();a<o;a++)e[t.getRawIndex(a)].dataIndex=a;i.filterSelf(function(t){var e=n[i.getRawIndex(t)];return 0<=e.node1.dataIndex&&0<=e.node2.dataIndex});for(a=0,o=n.length;a<o;a++)n[a].dataIndex=-1;for(a=0,o=i.count();a<o;a++)n[i.getRawIndex(a)].dataIndex=a},w_.clone=function(){for(var t=new __(this._directed),e=this.nodes,i=this.edges,n=0;n<e.length;n++)t.addNode(e[n].id,e[n].dataIndex);for(n=0;n<i.length;n++){var a=i[n];t.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return t},b_.prototype={constructor:b_,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)}},S_.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)};function M_(i,n){return{getValue:function(t){var e=this[i][n];return e.get(e.getDimension(t||"value"),this.dataIndex)},setVisual:function(t,e){0<=this.dataIndex&&this[i][n].setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this[i][n].getItemVisual(this.dataIndex,t,e)},setLayout:function(t,e){0<=this.dataIndex&&this[i][n].setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this[i][n].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[i][n].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[i][n].getRawIndex(this.dataIndex)}}}b(b_,M_("hostGraph","data")),b(S_,M_("hostGraph","edgeData")),__.Node=b_,__.Edge=S_,Wa(b_),Wa(S_);function I_(t,e,i,n,a){for(var o=new __(n),r=0;r<t.length;r++)o.addNode(W(t[r].id,t[r].name,r),r);var s=[],l=[],u=0;for(r=0;r<e.length;r++){var h=e[r],c=h.source,d=h.target;o.addEdge(c,d,u)&&(l.push(h),s.push(W(h.id,c+" > "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=Xf(t,i);else{var g=Hu.get(p),m=g&&"view"!==g.type&&g.dimensions||[];_(m,"value")<0&&m.concat(["value"]);var v=Wf(t,{coordDimensions:m});(f=new Tf(v,i)).initData(t)}var y=new Tf(["value"],i);return y.initData(l,s),a&&a(f,y),Wy({mainData:f,struct:o,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var A_=uf({type:"series.graph",init:function(t){A_.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){A_.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){A_.superApply(this,"mergeDefaultAndTheme",arguments),ba(t,["edgeLabel"],["show"])},getInitialData:function(t,s){var e=t.edges||t.links||[],i=t.data||t.nodes||[],l=this;if(i&&e)return I_(i,e,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t){var e=l._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var i=l.getModel("edgeLabel"),n=new dl({label:i.option},i.parentModel,s),a=l.getModel("emphasis.edgeLabel"),o=new dl({emphasis:{label:a.option}},a.parentModel,s);function r(t){return(t=this.parsePath(t))&&"label"===t[0]?n:t&&"emphasis"===t[0]&&"label"===t[1]?o:this.parentModel}e.wrapMethod("getItemModel",function(t){return t.customizeGetParent(r),t})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,i){if("edge"!==i)return A_.superApply(this,"formatTooltip",arguments);var n=this.getData(),a=this.getDataParams(t,i),o=n.graph.getEdgeByIndex(t),r=n.getName(o.node1.dataIndex),s=n.getName(o.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),l=Wl(l.join(" > ")),a.value&&(l+=" : "+Wl(a.value)),l},_updateCategoriesData:function(){var t=N(this.option.categories||[],function(t){return null!=t.value?t:L({value:0},t)}),e=new Tf(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return A_.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,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"},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),T_=Ur.prototype,D_=qr.prototype;function C_(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var L_=ds({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){this[C_(e)?"_buildPathLine":"_buildPathCurve"](t,e)},_buildPathLine:T_.buildPath,_buildPathCurve:D_.buildPath,pointAt:function(t){return this[C_(this.shape)?"_pointAtLine":"_pointAtCurve"](t)},_pointAtLine:T_.pointAt,_pointAtCurve:D_.pointAt,tangentAt:function(t){var e=this.shape,i=C_(e)?[e.x2-e.x1,e.y2-e.y1]:this._tangentAtCurve(t);return mt(i,i)},_tangentAtCurve:D_.tangentAt}),k_=["fromSymbol","toSymbol"];function P_(t){return"_"+t+"Type"}function N_(t,e,i){var n=e.getItemVisual(i,"color"),a=e.getItemVisual(i,t),o=e.getItemVisual(i,t+"Size");if(a&&"none"!==a){k(o)||(o=[o,o]);var r=Jp(a,-o[0]/2,-o[1]/2,o[0],o[1],n);return r.name=t,r}}function O_(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var i=e[2];i?(t.cpx1=i[0],t.cpy1=i[1]):(t.cpx1=NaN,t.cpy1=NaN)}function E_(t,e,i){Si.call(this),this._createLine(t,e,i)}var R_=E_.prototype;function z_(t){this._ctor=t||E_,this.group=new Si}R_.beforeUpdate=function(){var t=this.childOfName("fromSymbol"),e=this.childOfName("toSymbol"),i=this.childOfName("label");if(t||e||!i.ignore){for(var n=1,a=this.parent;a;)a.scale&&(n/=a.scale[0]),a=a.parent;var o=this.childOfName("line");if(this.__dirty||o.__dirty){var r=o.shape.percent,s=o.pointAt(0),l=o.pointAt(r),u=ht([],l,s);if(mt(u,u),t){t.attr("position",s);var h=o.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(h[1],h[0])),t.attr("scale",[n*r,n*r])}if(e){e.attr("position",l);h=o.tangentAt(1);e.attr("rotation",-Math.PI/2-Math.atan2(h[1],h[0])),e.attr("scale",[n*r,n*r])}if(!i.ignore){var c,d,f;i.attr("position",l);var p=5*n;if("end"===i.__position)c=[u[0]*p+l[0],u[1]*p+l[1]],d=.8<u[0]?"left":u[0]<-.8?"right":"center",f=.8<u[1]?"top":u[1]<-.8?"bottom":"middle";else if("middle"===i.__position){var g=r/2,m=[(h=o.tangentAt(g))[1],-h[0]],v=o.pointAt(g);0<m[1]&&(m[0]=-m[0],m[1]=-m[1]),c=[v[0]+m[0]*p,v[1]+m[1]*p],d="center",f="bottom";var y=-Math.atan2(h[1],h[0]);l[0]<s[0]&&(y=Math.PI+y),i.attr("rotation",y)}else c=[-u[0]*p+s[0],-u[1]*p+s[1]],d=.8<u[0]?"right":u[0]<-.8?"left":"center",f=.8<u[1]?"bottom":u[1]<-.8?"top":"middle";i.attr({style:{textVerticalAlign:i.__verticalAlign||f,textAlign:i.__textAlign||d},position:c,scale:[n,n]})}}}},R_._createLine=function(i,n,t){var e=i.hostModel,a=function(t){var e=new L_({name:"line",subPixelOptimize:!0});return O_(e.shape,t),e}(i.getItemLayout(n));a.shape.percent=0,qs(a,{shape:{percent:1}},e,n),this.add(a);var o=new Dr({name:"label",lineLabelOriginalOpacity:1});this.add(o),E(k_,function(t){var e=N_(t,i,n);this.add(e),this[P_(t)]=i.getItemVisual(n,t)},this),this._updateCommonStl(i,n,t)},R_.updateData=function(a,o,t){var e=a.hostModel,i=this.childOfName("line"),n=a.getItemLayout(o),r={shape:{}};O_(r.shape,n),js(i,r,e,o),E(k_,function(t){var e=a.getItemVisual(o,t),i=P_(t);if(this[i]!==e){this.remove(this.childOfName(t));var n=N_(t,a,o);this.add(n)}this[i]=e},this),this._updateCommonStl(a,o,t)},R_._updateCommonStl=function(t,e,i){var n=t.hostModel,a=this.childOfName("line"),o=i&&i.lineStyle,r=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||t.hasItemOption){var u=t.getItemModel(e);o=u.getModel("lineStyle").getLineStyle(),r=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var h=t.getItemVisual(e,"color"),c=Z(t.getItemVisual(e,"opacity"),o.opacity,1);a.useStyle(C({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},o)),a.hoverStyle=r,E(k_,function(t){var e=this.childOfName(t);e&&(e.setColor(h),e.setStyle({opacity:c}))},this);var d,f,p=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((p||g)&&(d=h||"#000",null==(f=n.getFormattedLabel(e,"normal",t.dataType)))){var v=n.getRawValue(e);f=null==v?t.getName(e):isFinite(v)?_l(v):v}var y=p?f:null,x=g?H(n.getFormattedLabel(e,"emphasis",t.dataType),f):null,_=m.style;null==y&&null==x||(Gs(m.style,s,{text:y},{autoColor:d}),m.__textAlign=_.textAlign,m.__verticalAlign=_.textVerticalAlign,m.__position=s.get("position")||"middle"),m.hoverStyle=null!=x?{text:x,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!p&&!g,Os(this)},R_.highlight=function(){this.trigger("emphasis")},R_.downplay=function(){this.trigger("normal")},R_.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},R_.setLinePoints=function(t){var e=this.childOfName("line");O_(e.shape,t),e.dirty()},w(E_,Si);var B_=z_.prototype;function V_(t){var e=t.hostModel;return{lineStyle:e.getModel("lineStyle").getLineStyle(),hoverLineStyle:e.getModel("emphasis.lineStyle").getLineStyle(),labelModel:e.getModel("label"),hoverLabelModel:e.getModel("emphasis.label")}}function G_(t){return isNaN(t[0])||isNaN(t[1])}function F_(t){return!G_(t[0])&&!G_(t[1])}function W_(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=t.option.nodeScaleRatio,n=e.scale,a=n&&n[0]||1;return((e.getZoom()-1)*i+1)/a}function H_(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}B_.isPersistent=function(){return!0},B_.updateData=function(i){var n=this,e=n.group,a=n._lineData;n._lineData=i,a||e.removeAll();var o=V_(i);i.diff(a).add(function(t){!function(t,e,i,n){if(!F_(e.getItemLayout(i)))return;var a=new t._ctor(e,i,n);e.setItemGraphicEl(i,a),t.group.add(a)}(n,i,t,o)}).update(function(t,e){!function(t,e,i,n,a,o){var r=e.getItemGraphicEl(n);if(!F_(i.getItemLayout(a)))return t.group.remove(r);r?r.updateData(i,a,o):r=new t._ctor(i,a,o);i.setItemGraphicEl(a,r),t.group.add(r)}(n,a,i,e,t,o)}).remove(function(t){e.remove(a.getItemGraphicEl(t))}).execute()},B_.updateLayout=function(){var i=this._lineData;i&&i.eachItemGraphicEl(function(t,e){t.updateLayout(i,e)},this)},B_.incrementalPrepareUpdate=function(t){this._seriesScope=V_(t),this._lineData=null,this.group.removeAll()},B_.incrementalUpdate=function(t,e){function i(t){t.isGroup||(t.incremental=t.useHoverLayer=!0)}for(var n=t.start;n<t.end;n++){if(F_(e.getItemLayout(n))){var a=new this._ctor(e,n,this._seriesScope);a.traverse(i),this.group.add(a),e.setItemGraphicEl(n,a)}}},B_.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},B_._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var Z_=[],U_=[],X_=[],Y_=fo,j_=_t,q_=Math.abs;function K_(t,e,i){for(var n,a=t[0],o=t[1],r=t[2],s=1/0,l=i*i,u=.1,h=.1;h<=.9;h+=.1){Z_[0]=Y_(a[0],o[0],r[0],h),Z_[1]=Y_(a[1],o[1],r[1],h),(f=q_(j_(Z_,e)-l))<s&&(s=f,n=h)}for(var c=0;c<32;c++){var d=n+u;U_[0]=Y_(a[0],o[0],r[0],n),U_[1]=Y_(a[1],o[1],r[1],n),X_[0]=Y_(a[0],o[0],r[0],d),X_[1]=Y_(a[1],o[1],r[1],d);var f=j_(U_,e)-l;if(q_(f)<.01)break;var p=j_(X_,e)-l;u/=2,f<0?0<=p?n+=u:n-=u:0<=p?n-=u:n+=u}return n}function $_(t,l){var u=[],h=mo,c=[[],[],[]],d=[[],[]],f=[];l/=2,t.eachEdge(function(t,e){var i=t.getLayout(),n=t.getVisual("fromSymbol"),a=t.getVisual("toSymbol");i.__original||(i.__original=[rt(i[0]),rt(i[1])],i[2]&&i.__original.push(rt(i[2])));var o=i.__original;if(null!=i[2]){if(ot(c[0],o[0]),ot(c[1],o[2]),ot(c[2],o[1]),n&&"none"!==n){var r=H_(t.node1),s=K_(c,o[0],r*l);h(c[0][0],c[1][0],c[2][0],s,u),c[0][0]=u[3],c[1][0]=u[4],h(c[0][1],c[1][1],c[2][1],s,u),c[0][1]=u[3],c[1][1]=u[4]}if(a&&"none"!==a){r=H_(t.node2),s=K_(c,o[1],r*l);h(c[0][0],c[1][0],c[2][0],s,u),c[1][0]=u[1],c[2][0]=u[2],h(c[0][1],c[1][1],c[2][1],s,u),c[1][1]=u[1],c[2][1]=u[2]}ot(i[0],c[0]),ot(i[1],c[2]),ot(i[2],c[1])}else{if(ot(d[0],o[0]),ot(d[1],o[1]),ht(f,d[1],d[0]),mt(f,f),n&&"none"!==n){r=H_(t.node1);ut(d[0],d[0],f,r*l)}if(a&&"none"!==a){r=H_(t.node2);ut(d[1],d[1],f,-r*l)}ot(i[0],d[0]),ot(i[1],d[1])}})}var J_="__focusNodeAdjacency",Q_="__unfocusNodeAdjacency",tw=["itemStyle","opacity"],ew=["lineStyle","opacity"];function iw(t,e){var i=t.getVisual("opacity");return null!=i?i:t.getModel().get(e)}function nw(t,e,i){var n=t.getGraphicEl(),a=iw(t,e);null!=i&&(null==a&&(a=1),a*=i),n.downplay&&n.downplay(),n.traverse(function(t){if(!t.isGroup){var e=t.lineLabelOriginalOpacity;null!=e&&null==i||(e=a),t.setStyle("opacity",e)}})}function aw(t,e){var i=iw(t,e),n=t.getGraphicEl();n.traverse(function(t){t.isGroup||t.setStyle("opacity",i)}),n.highlight&&n.highlight()}hf({type:"graph",init:function(t,e){var i=new Ng,n=new z_,a=this.group;this._controller=new uy(e.getZr()),this._controllerHost={target:a},a.add(i.group),a.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(a,t,o){var e=a.coordinateSystem;this._model=a;var i=this._symbolDraw,n=this._lineDraw,r=this.group;if("view"===e.type){var s={position:e.position,scale:e.scale};this._firstRender?r.attr(s):js(r,s,a)}$_(a.getGraph(),W_(a));var l=a.getData();i.updateData(l);var u=a.getEdgeData();n.updateData(u),this._updateNodeAndLinkScale(),this._updateController(a,t,o),clearTimeout(this._layoutTimeout);var h=a.forceLayout,c=a.get("force.layoutAnimation");h&&this._startForceLayoutIteration(h,c),l.eachItemGraphicEl(function(t,e){var i=l.getItemModel(e);t.off("drag").off("dragend");var n=i.get("draggable");n&&t.on("drag",function(){h&&(h.warmUp(),this._layouting||this._startForceLayoutIteration(h,c),h.setFixed(e),l.setItemLayout(e,t.position))},this).on("dragend",function(){h&&h.setUnfixed(e)},this),t.setDraggable(n&&h),t[J_]&&t.off("mouseover",t[J_]),t[Q_]&&t.off("mouseout",t[Q_]),i.get("focusNodeAdjacency")&&(t.on("mouseover",t[J_]=function(){o.dispatchAction({type:"focusNodeAdjacency",seriesId:a.id,dataIndex:t.dataIndex})}),t.on("mouseout",t[Q_]=function(){o.dispatchAction({type:"unfocusNodeAdjacency",seriesId:a.id})}))},this),l.graph.eachEdge(function(t){var e=t.getGraphicEl();e[J_]&&e.off("mouseover",e[J_]),e[Q_]&&e.off("mouseout",e[Q_]),t.getModel().get("focusNodeAdjacency")&&(e.on("mouseover",e[J_]=function(){o.dispatchAction({type:"focusNodeAdjacency",seriesId:a.id,edgeDataIndex:t.dataIndex})}),e.on("mouseout",e[Q_]=function(){o.dispatchAction({type:"unfocusNodeAdjacency",seriesId:a.id})}))});var d="circular"===a.get("layout")&&a.get("circular.rotateLabel"),f=l.getLayout("cx"),p=l.getLayout("cy");l.eachItemGraphicEl(function(t,e){var i=l.getItemModel(e).get("label.rotate")||0,n=t.getSymbolPath();if(d){var a=l.getItemLayout(e),o=Math.atan2(a[1]-p,a[0]-f);o<0&&(o=2*Math.PI+o);var r=a[0]<f;r&&(o-=Math.PI);var s=r?"left":"right";Vs(n,{textRotation:-o,textPosition:s,textOrigin:"center"},{textPosition:s})}else Vs(n,{textRotation:i*=Math.PI/180})}),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},focusNodeAdjacency:function(t,e,i,n){var a=this._model.getData().graph,o=n.dataIndex,r=n.edgeDataIndex,s=a.getNodeByIndex(o),l=a.getEdgeByIndex(r);(s||l)&&(a.eachNode(function(t){nw(t,tw,.1)}),a.eachEdge(function(t){nw(t,ew,.1)}),s&&(aw(s,tw),E(s.edges,function(t){t.dataIndex<0||(aw(t,ew),aw(t.node1,tw),aw(t.node2,tw))})),l&&(aw(l,ew),aw(l.node1,tw),aw(l.node2,tw)))},unfocusNodeAdjacency:function(t,e,i,n){var a=this._model.getData().graph;a.eachNode(function(t){nw(t,tw)}),a.eachEdge(function(t){nw(t,ew)})},_startForceLayoutIteration:function(t,i){var n=this;!function e(){t.step(function(t){n.updateLayout(n._model),(n._layouting=!t)&&(i?n._layoutTimeout=setTimeout(e,16):e())})}()},_updateController:function(a,t,o){var e=this._controller,i=this._controllerHost,r=this.group;e.setPointerChecker(function(t,e,i){var n=r.getBoundingRect();return n.applyTransform(r.transform),n.contain(e,i)&&!wy(t,o,a)}),"view"===a.coordinateSystem.type?(e.enable(a.get("roam")),i.zoomLimit=a.get("scaleLimit"),i.zoom=a.coordinateSystem.getZoom(),e.off("pan").off("zoom").on("pan",function(t){yy(i,t.dx,t.dy),o.dispatchAction({seriesId:a.id,type:"graphRoam",dx:t.dx,dy:t.dy})}).on("zoom",function(t){xy(i,t.scale,t.originX,t.originY),o.dispatchAction({seriesId:a.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(),$_(a.getGraph(),W_(a)),this._lineDraw.updateLayout()},this)):e.disable()},_updateNodeAndLinkScale:function(){var t=this._model,e=t.getData(),i=W_(t),n=[i,i];e.eachItemGraphicEl(function(t,e){t.attr("scale",n)})},updateLayout:function(t){$_(t.getGraph(),W_(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}}),tf({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},function(){}),tf({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},function(){});tf({type:"graphRoam",event:"graphRoam",update:"none"},function(i,t){t.eachComponent({mainType:"series",query:i},function(t){var e=Cy(t.coordinateSystem,i);t.setCenter&&t.setCenter(e.center),t.setZoom&&t.setZoom(e.zoom)})});function ow(t){return t instanceof Array||(t=[t,t]),t}function rw(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),sw(i)}}function sw(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.curveness")||0,i=rt(t.node1.getLayout()),n=rt(t.node2.getLayout()),a=[i,n];+e&&a.push([(i[0]+n[0])/2-(i[1]-n[1])*e,(i[1]+n[1])/2-(n[0]-i[0])*e]),t.setLayout(a)})}var lw=Math.PI,uw=[];function hw(t,e){var i=t.coordinateSystem;if(!i||"view"===i.type){var n=i.getBoundingRect(),a=t.getData(),o=a.graph,s=n.width/2+n.x,l=n.height/2+n.y,r=Math.min(n.width,n.height)/2,u=a.count();a.setLayout({cx:s,cy:l}),u&&(cw[e](t,i,o,a,r,s,l,u),o.eachEdge(function(t){var e,i=t.getModel().get("lineStyle.curveness")||0,n=rt(t.node1.getLayout()),a=rt(t.node2.getLayout()),o=(n[0]+a[0])/2,r=(n[1]+a[1])/2;+i&&(e=[s*(i*=3)+o*(1-i),l*i+r*(1-i)]),t.setLayout([n,a,e])}))}}var cw={value:function(t,e,i,n,a,o,r,s){var l=0,u=n.getSum("value"),h=2*Math.PI/(u||s);i.eachNode(function(t){var e=t.getValue("value"),i=h*(u?e:1)/2;l+=i,t.setLayout([a*Math.cos(l)+o,a*Math.sin(l)+r]),l+=i})},symbolSize:function(t,e,i,n,a,o,r,s){var l=0;uw.length=s;var u=W_(t);i.eachNode(function(t){var e=H_(t);isNaN(e)&&(e=2),e<0&&(e=0),e*=u;var i=Math.asin(e/2/a);isNaN(i)&&(i=lw/2),uw[t.dataIndex]=i,l+=2*i});var h=(2*lw-l)/s/2,c=0;i.eachNode(function(t){var e=h+uw[t.dataIndex];c+=e,t.setLayout([a*Math.cos(c)+o,a*Math.sin(c)+r]),c+=e})}},dw=ut;Qd(function(t){var o=t.findComponents({mainType:"legend"});o&&o.length&&t.eachSeriesByType("graph",function(t){var e=t.getCategoriesData(),n=t.getGraph().data,a=e.mapArray(e.getName);n.filterSelf(function(t){var e=n.getItemModel(t).getShallow("category");if(null!=e){"number"==typeof e&&(e=a[e]);for(var i=0;i<o.length;i++)if(!o[i].isSelected(e))return!1}return!0})},this)}),af(rm("graph","circle",null)),af(function(t){var h={};t.eachSeriesByType("graph",function(s){var l=s.getCategoriesData(),a=s.getData(),u={};l.each(function(t){var e=l.getName(t);u["ec-"+e]=t;var i=l.getItemModel(t),n=i.get("itemStyle.color")||s.getColorFromPalette(e,h);l.setItemVisual(t,"color",n);for(var a=["opacity","symbol","symbolSize","symbolKeepAspect"],o=0;o<a.length;o++){var r=i.getShallow(a[o],!0);null!=r&&l.setItemVisual(t,a[o],r)}}),l.count()&&a.each(function(t){var e=a.getItemModel(t).getShallow("category");if(null!=e){"string"==typeof e&&(e=u["ec-"+e]);for(var i=["color","opacity","symbol","symbolSize","symbolKeepAspect"],n=0;n<i.length;n++)null==a.getItemVisual(t,i[n],!0)&&a.setItemVisual(t,i[n],l.getItemVisual(e,i[n]))}})})}),af(function(t){t.eachSeriesByType("graph",function(t){var s=t.getGraph(),l=t.getEdgeData(),e=ow(t.get("edgeSymbol")),i=ow(t.get("edgeSymbolSize")),u="lineStyle.color".split("."),h="lineStyle.opacity".split(".");l.setVisual("fromSymbol",e&&e[0]),l.setVisual("toSymbol",e&&e[1]),l.setVisual("fromSymbolSize",i&&i[0]),l.setVisual("toSymbolSize",i&&i[1]),l.setVisual("color",t.get(u)),l.setVisual("opacity",t.get(h)),l.each(function(t){var e=l.getItemModel(t),i=s.getEdgeByIndex(t),n=ow(e.getShallow("symbol",!0)),a=ow(e.getShallow("symbolSize",!0)),o=e.get(u),r=e.get(h);switch(o){case"source":o=i.node1.getVisual("color");break;case"target":o=i.node2.getVisual("color")}n[0]&&i.setVisual("fromSymbol",n[0]),n[1]&&i.setVisual("toSymbol",n[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1]),i.setVisual("color",o),i.setVisual("opacity",r)})})}),nf(function(t,e){t.eachSeriesByType("graph",function(t){var e=t.get("layout"),i=t.coordinateSystem;if(i&&"view"!==i.type){var n=t.getData(),a=[];E(i.dimensions,function(t){a=a.concat(n.mapDimension(t,!0))});for(var o=0;o<n.count();o++){for(var r=[],s=!1,l=0;l<a.length;l++){var u=n.get(a[l],o);isNaN(u)||(s=!0),r.push(u)}s?n.setItemLayout(o,i.dataToPoint(r)):n.setItemLayout(o,[NaN,NaN])}sw(n.graph)}else e&&"none"!==e||rw(t)})}),nf(cd.VISUAL.POST_CHART_LAYOUT,function(t){t.eachSeriesByType("graph",function(t){"circular"===t.get("layout")&&hw(t,"symbolSize")})}),nf(function(t){t.eachSeriesByType("graph",function(t){if(!(l=t.coordinateSystem)||"view"===l.type)if("force"===t.get("layout")){var c=t.preservedPoints||{},d=t.getGraph(),f=d.data,e=d.edgeData,i=t.getModel("force"),n=i.get("initLayout");t.preservedPoints?f.each(function(t){var e=f.getId(t);f.setItemLayout(t,c[e]||[NaN,NaN])}):n&&"none"!==n?"circular"===n&&hw(t,"value"):rw(t);var a=f.getDataExtent("value"),o=e.getDataExtent("value"),r=i.get("repulsion"),s=i.get("edgeLength");k(r)||(r=[r,r]),k(s)||(s=[s,s]),s=[s[1],s[0]];var l,u=f.mapArray("value",function(t,e){var i=f.getItemLayout(e),n=yl(t,a,r);return isNaN(n)&&(n=(r[0]+r[1])/2),{w:n,rep:n,fixed:f.getItemModel(e).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}}),h=e.mapArray("value",function(t,e){var i=d.getEdgeByIndex(e),n=yl(t,o,s);isNaN(n)&&(n=(s[0]+s[1])/2);var a=i.getModel();return{n1:u[i.node1.dataIndex],n2:u[i.node2.dataIndex],d:n,curveness:a.get("lineStyle.curveness")||0,ignoreForceLayout:a.get("ignoreForceLayout")}}),p=(l=t.coordinateSystem).getBoundingRect(),g=function(f,p,t){for(var e=t.rect,i=e.width,n=e.height,g=[e.x+i/2,e.y+n/2],m=null==t.gravity?.1:t.gravity,a=0;a<f.length;a++){var o=f[a];o.p||(o.p=at(i*(Math.random()-.5)+g[0],n*(Math.random()-.5)+g[1])),o.pp=rt(o.p),o.edges=null}var r=null==t.friction?.6:t.friction,v=r;return{warmUp:function(){v=.8*r},setFixed:function(t){f[t].fixed=!0},setUnfixed:function(t){f[t].fixed=!1},step:function(t){for(var e=[],i=f.length,n=0;n<p.length;n++){var a=p[n];if(!a.ignoreForceLayout){var o=a.n1;ht(e,(u=a.n2).p,o.p);var r=ct(e)-a.d,s=u.w/(o.w+u.w);isNaN(s)&&(s=0),mt(e,e),o.fixed||dw(o.p,o.p,e,s*r*v),u.fixed||dw(u.p,u.p,e,-(1-s)*r*v)}}for(n=0;n<i;n++){(d=f[n]).fixed||(ht(e,g,d.p),dw(d.p,d.p,e,m*v))}for(n=0;n<i;n++){o=f[n];for(var l=n+1;l<i;l++){var u;ht(e,(u=f[l]).p,o.p),0===(r=ct(e))&&(st(e,Math.random()-.5,Math.random()-.5),r=1);var h=(o.rep+u.rep)/r/r;o.fixed||dw(o.pp,o.pp,e,h),u.fixed||dw(u.pp,u.pp,e,-h)}}var c=[];for(n=0;n<i;n++){var d;(d=f[n]).fixed||(ht(c,d.p,d.pp),dw(d.p,d.p,c,v),ot(d.pp,d.p))}v*=.992,t&&t(f,p,v<.01)}}}(u,h,{rect:p,gravity:i.get("gravity"),friction:i.get("friction")}),m=g.step;g.step=function(h){for(var t=0,e=u.length;t<e;t++)u[t].fixed&&ot(u[t].p,d.getNodeByIndex(t).getLayout());m(function(t,e,i){for(var n=0,a=t.length;n<a;n++)t[n].fixed||d.getNodeByIndex(n).setLayout(t[n].p),c[f.getId(n)]=t[n].p;for(n=0,a=e.length;n<a;n++){var o=e[n],r=d.getEdgeByIndex(n),s=o.n1.p,l=o.n2.p,u=r.getLayout();(u=u?u.slice():[])[0]=u[0]||[],u[1]=u[1]||[],ot(u[0],s),ot(u[1],l),+o.curveness&&(u[2]=[(s[0]+l[0])/2-(s[1]-l[1])*o.curveness,(s[1]+l[1])/2-(l[0]-s[0])*o.curveness]),r.setLayout(u)}h&&h(i)})},t.forceLayout=g,t.preservedPoints=c,g.step()}else t.forceLayout=null})}),ef("graphView",{create:function(t,d){var f=[];return t.eachSeriesByType("graph",function(t){var e=t.get("coordinateSystem");if(!e||"view"===e){var i=t.getData(),n=[],a=[];Io(i.mapArray(function(t){var e=i.getItemModel(t);return[+e.get("x"),+e.get("y")]}),n,a),a[0]-n[0]==0&&(a[0]+=1,n[0]-=1),a[1]-n[1]==0&&(a[1]+=1,n[1]-=1);var o=(a[0]-n[0])/(a[1]-n[1]),r=function(t,e,i){var n=t.getBoxLayoutParams();return n.aspect=i,au(n,{width:e.getWidth(),height:e.getHeight()})}(t,d,o);isNaN(o)&&(n=[r.x,r.y],a=[r.x+r.width,r.y+r.height]);var s=a[0]-n[0],l=a[1]-n[1],u=r.width,h=r.height,c=t.coordinateSystem=new Py;c.zoomLimit=t.get("scaleLimit"),c.setBoundingRect(n[0],n[1],s,l),c.setViewRect(r.x,r.y,u,h),c.setCenter(t.get("center")),c.setZoom(t.get("zoom")),f.push(c)}}),f}});Wh.extend({type:"series.gauge",getInitialData:function(t,e){return yv(this,["value"])},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}});var fw=hr.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(t,e){var i=Math.cos,n=Math.sin,a=e.r,o=e.width,r=e.angle,s=e.x-i(r)*o*(a/3<=o?1:2),l=e.y-n(r)*o*(a/3<=o?1:2);r=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+i(r)*o,e.y+n(r)*o),t.lineTo(e.x+i(e.angle)*a,e.y+n(e.angle)*a),t.lineTo(e.x-i(r)*o,e.y-n(r)*o),t.lineTo(s,l)}});function pw(t,e){return e&&("string"==typeof e?t=e.replace("{value}",null!=t?t:""):"function"==typeof e&&(t=e(t))),t}var gw=2*Math.PI,mw=(ec.extend({type:"gauge",render:function(t,e,i){this.group.removeAll();var n=t.get("axisLine.lineStyle.color"),a=function(t,e){var i=t.get("center"),n=e.getWidth(),a=e.getHeight(),o=Math.min(n,a);return{cx:xl(i[0],e.getWidth()),cy:xl(i[1],e.getHeight()),r:xl(t.get("radius"),o/2)}}(t,i);this._renderMain(t,e,i,n,a)},dispose:function(){},_renderMain:function(t,e,i,n,a){for(var o=this.group,r=t.getModel("axisLine"),s=r.getModel("lineStyle"),l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,h=((g=-t.get("endAngle")/180*Math.PI)-u)%gw,c=u,d=s.get("width"),f=r.get("show"),p=0;f&&p<n.length;p++){var g,m=Math.min(Math.max(n[p][0],0),1),v=new Pr({shape:{startAngle:c,endAngle:g=u+h*m,cx:a.cx,cy:a.cy,clockwise:l,r0:a.r-d,r:a.r},silent:!0});v.setStyle({fill:n[p][1]}),v.setStyle(s.getLineStyle(["color","borderWidth","borderColor"])),o.add(v),c=g}function y(t){if(t<=0)return n[0][1];for(var e=0;e<n.length;e++)if(n[e][0]>=t&&(0===e?0:n[e-1][0])<t)return n[e][1];return n[e-1][1]}if(!l){var x=u;u=g,g=x}this._renderTicks(t,e,i,y,a,u,g,l),this._renderPointer(t,e,i,y,a,u,g,l),this._renderTitle(t,e,i,y,a),this._renderDetail(t,e,i,y,a)},_renderTicks:function(t,e,i,n,a,o,r,s){for(var l=this.group,u=a.cx,h=a.cy,c=a.r,d=+t.get("min"),f=+t.get("max"),p=t.getModel("splitLine"),g=t.getModel("axisTick"),m=t.getModel("axisLabel"),v=t.get("splitNumber"),y=g.get("splitNumber"),x=xl(p.get("length"),c),_=xl(g.get("length"),c),w=o,b=(r-o)/v,S=b/y,M=p.getModel("lineStyle").getLineStyle(),I=g.getModel("lineStyle").getLineStyle(),A=0;A<=v;A++){var T=Math.cos(w),D=Math.sin(w);if(p.get("show")){var C=new Ur({shape:{x1:T*c+u,y1:D*c+h,x2:T*(c-x)+u,y2:D*(c-x)+h},style:M,silent:!0});"auto"===M.stroke&&C.setStyle({stroke:n(A/v)}),l.add(C)}if(m.get("show")){var L=pw(_l(A/v*(f-d)+d),m.get("formatter")),k=m.get("distance"),P=n(A/v);l.add(new Dr({style:Gs({},m,{text:L,x:T*(c-x-k)+u,y:D*(c-x-k)+h,textVerticalAlign:D<-.4?"top":.4<D?"bottom":"middle",textAlign:T<-.4?"left":.4<T?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&A!==v){for(var N=0;N<=y;N++){T=Math.cos(w),D=Math.sin(w);var O=new Ur({shape:{x1:T*c+u,y1:D*c+h,x2:T*(c-_)+u,y2:D*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&O.setStyle({stroke:n((A+N/y)/v)}),l.add(O),w+=S}w-=S}else w+=b}},_renderPointer:function(n,t,e,a,o,i,r,s){var l=this.group,u=this._data;if(n.get("pointer.show")){var h=[+n.get("min"),+n.get("max")],c=[i,r],d=n.getData(),f=d.mapDimension("value");d.diff(u).add(function(t){var e=new fw({shape:{angle:i}});qs(e,{shape:{angle:yl(d.get(f,t),h,c,!0)}},n),l.add(e),d.setItemGraphicEl(t,e)}).update(function(t,e){var i=u.getItemGraphicEl(e);js(i,{shape:{angle:yl(d.get(f,t),h,c,!0)}},n),l.add(i),d.setItemGraphicEl(t,i)}).remove(function(t){var e=u.getItemGraphicEl(t);l.remove(e)}).execute(),d.eachItemGraphicEl(function(t,e){var i=d.getItemModel(e),n=i.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:xl(n.get("width"),o.r),r:xl(n.get("length"),o.r)}),t.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",a(yl(d.get(f,e),h,[0,1],!0))),Os(t,i.getModel("emphasis.itemStyle").getItemStyle())}),this._data=d}else u&&u.eachItemGraphicEl(function(t){l.remove(t)})},_renderTitle:function(t,e,i,n,a){var o=t.getData(),r=o.mapDimension("value"),s=t.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=a.cx+xl(l[0],a.r),h=a.cy+xl(l[1],a.r),c=+t.get("min"),d=+t.get("max"),f=n(yl(t.getData().get(r,0),[c,d],[0,1],!0));this.group.add(new Dr({silent:!0,style:Gs({},s,{x:u,y:h,text:o.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(t,e,i,n,a){var o=t.getModel("detail"),r=+t.get("min"),s=+t.get("max");if(o.get("show")){var l=o.get("offsetCenter"),u=a.cx+xl(l[0],a.r),h=a.cy+xl(l[1],a.r),c=xl(o.get("width"),a.r),d=xl(o.get("height"),a.r),f=t.getData(),p=f.get(f.mapDimension("value"),0),g=n(yl(p,[r,s],[0,1],!0));this.group.add(new Dr({silent:!0,style:Gs({},o,{x:u,y:h,text:pw(p,o.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}}),uf({type:"series.funnel",init:function(t){mw.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){return yv(this,["value"])},_defaultLabelLine:function(t){ba(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},getDataParams:function(t){var e=this.getData(),i=mw.superCall(this,"getDataParams",t),n=e.mapDimension("value"),a=e.getSum(n);return i.percent=a?+(e.get(n,t)/a*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}}));function vw(t,e){Si.call(this);var i=new Rr,n=new zr,a=new Dr;this.add(i),this.add(n),this.add(a),this.highDownOnUpdate=function(t,e){"emphasis"===e?(n.ignore=n.hoverIgnore,a.ignore=a.hoverIgnore):(n.ignore=n.normalIgnore,a.ignore=a.normalIgnore)},this.updateData(t,e,!0)}var yw=vw.prototype,xw=["itemStyle","opacity"];yw.updateData=function(t,e,i){var n=this.childAt(0),a=t.hostModel,o=t.getItemModel(e),r=t.getItemLayout(e),s=t.getItemModel(e).get(xw);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:r.points}),n.setStyle({opacity:0}),qs(n,{style:{opacity:s}},a,e)):js(n,{style:{opacity:s},shape:{points:r.points}},a,e);var l=o.getModel("itemStyle"),u=t.getItemVisual(e,"color");n.setStyle(C({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),Os(this)},yw._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),a=t.hostModel,o=t.getItemModel(e),r=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");js(i,{shape:{points:r.linePoints||r.linePoints}},a,e),js(n,{style:{x:r.x,y:r.y}},a,e),n.attr({rotation:r.rotation,origin:[r.x,r.y],z2:10});var l=o.getModel("label"),u=o.getModel("emphasis.label"),h=o.getModel("labelLine"),c=o.getModel("emphasis.labelLine");s=t.getItemVisual(e,"color");Bs(n.style,n.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!r.inside},{textAlign:r.textAlign,textVerticalAlign:r.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},w(vw,Si);ec.extend({type:"funnel",render:function(t,e,i){var n=t.getData(),a=this._data,o=this.group;n.diff(a).add(function(t){var e=new vw(n,t);n.setItemGraphicEl(t,e),o.add(e)}).update(function(t,e){var i=a.getItemGraphicEl(e);i.updateData(n,t),o.add(i),n.setItemGraphicEl(t,i)}).remove(function(t){var e=a.getItemGraphicEl(t);o.remove(e)}).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});af(Av("funnel")),nf(function(t,w,e){t.eachSeriesByType("funnel",function(t){var a=t.getData(),o=a.mapDimension("value"),e=t.get("sort"),r=function(t,e){return au(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,w),i=function(t,e){for(var i=t.mapDimension("value"),n=t.mapArray(i,function(t){return t}),a=[],o="ascending"===e,r=0,s=t.count();r<s;r++)a[r]=r;return"function"==typeof e?a.sort(e):"none"!==e&&a.sort(function(t,e){return o?n[t]-n[e]:n[e]-n[t]}),a}(a,e),s=[xl(t.get("minSize"),r.width),xl(t.get("maxSize"),r.width)],n=a.getDataExtent(o),l=t.get("min"),u=t.get("max");null==l&&(l=Math.min(n[0],0)),null==u&&(u=n[1]);function h(t,e){var i,n=yl(a.get(o,t)||0,[l,u],s,!0);switch(c){case"left":i=r.x;break;case"center":i=r.x+(r.width-n)/2;break;case"right":i=r.x+r.width-n}return[[i,e],[i+n,e]]}var c=t.get("funnelAlign"),d=t.get("gap"),f=(r.height-d*(a.count()-1))/a.count(),p=r.y;"ascending"===e&&(f=-f,d=-d,p+=r.height,i=i.reverse());for(var g=0;g<i.length;g++){var m=i[g],v=i[g+1],y=a.getItemModel(m).get("itemStyle.height");null==y?y=f:(y=xl(y,r.height),"ascending"===e&&(y=-y));var x=h(m,p),_=h(v,p+y);p+=y+d,a.setItemLayout(m,{points:x.concat(_.slice().reverse())})}!function(g){g.each(function(t){var e,i,n,a,o=g.getItemModel(t),r=o.getModel("label").get("position"),s=o.getModel("labelLine"),l=g.getItemLayout(t),u=l.points,h="inner"===r||"inside"===r||"center"===r||"insideLeft"===r||"insideRight"===r;if(h)e="insideLeft"===r?(i=(u[0][0]+u[3][0])/2+5,n=(u[0][1]+u[3][1])/2,"left"):"insideRight"===r?(i=(u[1][0]+u[2][0])/2-5,n=(u[1][1]+u[2][1])/2,"right"):(i=(u[0][0]+u[1][0]+u[2][0]+u[3][0])/4,n=(u[0][1]+u[1][1]+u[2][1]+u[3][1])/4,"center"),a=[[i,n],[i,n]];else{var c,d,f,p=s.get("length");e="left"===r?(c=(u[3][0]+u[0][0])/2,d=(u[3][1]+u[0][1])/2,i=(f=c-p)-5,"right"):"right"===r?(c=(u[1][0]+u[2][0])/2,d=(u[1][1]+u[2][1])/2,i=(f=c+p)+5,"left"):"rightTop"===r?(c=u[1][0],d=u[1][1],i=(f=c+p)+5,"top"):"rightBottom"===r?(c=u[2][0],d=u[2][1],i=(f=c+p)+5,"bottom"):"leftTop"===r?(c=u[0][0],d=u[1][1],i=(f=c-p)-5,"right"):"leftBottom"===r?(c=u[3][0],d=u[2][1],i=(f=c-p)-5,"right"):(c=(u[1][0]+u[2][0])/2,d=(u[1][1]+u[2][1])/2,i=(f=c+p)+5,"left");a=[[c,d],[f,d]],n=d}l.label={linePoints:a,x:i,y:n,verticalAlign:"middle",textAlign:e,inside:h}})}(a)})}),Qd(kv("funnel"));function _w(t,e,i,n,a){vg.call(this,t,e,i),this.type=n||"value",this.axisIndex=a}_w.prototype={constructor:_w,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},w(_w,vg);function ww(t,e,i,n,a,o){t=t||0;var r=i[1]-i[0];if(null!=a&&(a=Sw(a,[0,r])),null!=o&&(o=Math.max(o,null!=a?a:0)),"all"===n){var s=Math.abs(e[1]-e[0]);a=o=Sw(s=Sw(s,[0,r]),[a,o]),n=0}e[0]=Sw(e[0],i),e[1]=Sw(e[1],i);var l=bw(e,n);e[n]+=t;var u=a||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,e[n]=Sw(e[n],h);var c=bw(e,n);return null!=a&&(c.sign!==l.sign||c.span<a)&&(e[1-n]=e[n]+l.sign*a),c=bw(e,n),null!=o&&c.span>o&&(e[1-n]=e[n]+c.sign*o),e}function bw(t,e){var i=t[e]-t[1-e];return{span:Math.abs(i),sign:0<i?-1:i<0?1:e?-1:1}}function Sw(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var Mw=E,Iw=Math.min,Aw=Math.max,Tw=Math.floor,Dw=Math.ceil,Cw=_l,Lw=Math.PI;function kw(t,e,i){this._axesMap=Q(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,i)}function Pw(t,e){return Iw(Aw(t,e[0]),e[1])}kw.prototype={type:"parallel",constructor:kw,_init:function(t,r,e){var i=t.dimensions,s=t.parallelAxisIndex;Mw(i,function(t,e){var i=s[e],n=r.getComponent("parallelAxis",i),a=this._axesMap.set(t,new _w(t,Bp(n),[0,0],n.get("type"),i)),o="category"===a.type;a.onBand=o&&n.get("boundaryGap"),a.inverse=n.get("inverse"),(n.axis=a).model=n,a.coordinateSystem=n.coordinateSystem=this},this)},update:function(t,e){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,a=e.pixelDimIndex,o=t[1-a],r=t[a];return i<=o&&o<=i+e.axisLength&&n<=r&&r<=n+e.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,n){n.eachSeries(function(t){if(e.contains(t,n)){var i=t.getData();Mw(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),zp(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=au(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,i=this._rect,n=["x","y"],a=["width","height"],o=e.get("layout"),r="horizontal"===o?0:1,s=i[a[r]],l=[0,s],u=this.dimensions.length,h=Pw(e.get("axisExpandWidth"),l),c=Pw(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&3<u&&c<u&&1<c&&0<h&&0<s,f=e.get("axisExpandWindow");f?(t=Pw(f[1]-f[0],l),f[1]=f[0]+t):(t=Pw(h*(c-1),l),(f=[h*(e.get("axisExpandCenter")||Tw(u/2))-t/2])[1]=f[0]+t);var p=(s-t)/(u-c);p<3&&(p=0);var g=[Tw(Cw(f[0]/h,1))+1,Dw(Cw(f[1]/h,1))-1],m=p/h*f[0];return{layout:o,pixelDimIndex:r,layoutBase:i[n[r]],layoutLength:s,axisBase:i[n[1-r]],axisLength:i[a[1-r]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var l=this._rect,t=this._axesMap,e=this.dimensions,u=this._makeLayoutInfo(),h=u.layout;t.each(function(t){var e=[0,u.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])}),Mw(e,function(t,e){var i=(u.axisExpandable?function(t,e){var i,n,a=e.layoutLength,o=e.axisExpandWidth,r=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;t<l[0]?(i=t*s,n=s):t<=l[1]?(i=e.axisExpandWindow0Pos+t*o-e.axisExpandWindow[0],u=o,h=!0):(i=a-(r-1-t)*s,n=s);return{position:i,axisNameAvailableWidth:u,axisLabelShow:h,nameTruncateMaxWidth:n}}:function(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}})(e,u),n={horizontal:{x:i.position,y:u.axisLength},vertical:{x:0,y:i.position}},a={horizontal:Lw/2,vertical:0},o=[n[h].x+l.x,n[h].y+l.y],r=a[h],s=Qt();ae(s,s,r),ne(s,s,o),this._axesLayout[t]={position:o,rotation:r,transform:s,axisNameAvailableWidth:i.axisNameAvailableWidth,axisLabelShow:i.axisLabelShow,nameTruncateMaxWidth:i.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(e,t,i,n){null==i&&(i=0),null==n&&(n=e.count());var a=this._axesMap,o=this.dimensions,r=[],s=[];E(o,function(t){r.push(e.mapDimension(t)),s.push(a.get(t).model)});for(var l=this.hasAxisBrushed(),u=i;u<n;u++){var h;if(l){h="active";for(var c=e.getValues(r,u),d=0,f=o.length;d<f;d++){if("inactive"===s[d].getActiveState(c[d])){h="inactive";break}}}else h="normal";t(h,u)}},hasAxisBrushed:function(){for(var t=this.dimensions,e=this._axesMap,i=!1,n=0,a=t.length;n<a;n++)"normal"!==e.get(t[n]).model.getActiveState()&&(i=!0);return i},axisCoordToPoint:function(t,e){return $s([t,0],this._axesLayout[e].transform)},getAxisLayout:function(t){return D(this._axesLayout[t])},getSlidedAxisExpandWindow:function(t){var e=this._makeLayoutInfo(),i=e.pixelDimIndex,n=e.axisExpandWindow.slice(),a=n[1]-n[0],o=[0,e.axisExpandWidth*(e.axisCount-1)];if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:n};var r,s=t[i]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",u=e.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),c=null!=h[0];if(u)c&&u&&s<a*h[0]?(l="jump",r=s-a*h[2]):c&&u&&s>a*(1-h[0])?(l="jump",r=s-a*(1-h[2])):0<=(r=s-a*h[1])&&(r=s-a*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?ww(r,n,o,"all"):l="none";else{a=n[1]-n[0];(n=[Aw(0,o[1]*s/a-a/2)])[1]=Iw(o[1],n[0]+a),n[0]=n[1]-a}return{axisExpandWindow:n,behavior:l}}},Hu.register("parallel",{create:function(n,a){var o=[];return n.eachComponent("parallel",function(t,e){var i=new kw(t,n,a);i.name="parallel_"+e,i.resize(t,a),(t.coordinateSystem=i).model=t,o.push(i)}),n.eachSeries(function(t){if("parallel"===t.get("coordinateSystem")){var e=n.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=e.coordinateSystem}}),o}});var Nw=fu.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Xa([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=D(t);if(e)for(var i=e.length-1;0<=i;i--)wl(e[i])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(t))return"inactive";if(1===e.length){var i=e[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var n=0,a=e.length;n<a;n++)if(e[n][0]<=t&&t<=e[n][1])return"active";return"inactive"}});m(Nw.prototype,Hp),mm("parallel",Nw,function(t,e){return e.type||(e.data?"category":"value")},{type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10}),fu.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",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},init:function(){fu.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(t){var e=this.option;t&&m(e,t,!0),this._initDimensions()},contains:function(t,e){var i=t.get("parallelIndex");return null!=i&&e.getComponent("parallel",i)===this},setAxisExpand:function(e){E(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])},this)},_initDimensions:function(){var e=this.dimensions=[],i=this.parallelAxisIndex=[];E(M(this.dependentModels.parallelAxis,function(t){return(t.get("parallelIndex")||0)===this.componentIndex},this),function(t){e.push("dim"+t.get("dim")),i.push(t.componentIndex)})}});tf({type:"axisAreaSelect",event:"axisAreaSelected"},function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(t){t.axis.model.setActiveIntervals(e.intervals)})}),tf("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(t){t.setAxisExpand(e)})});var Ow=A,Ew=E,Rw=N,zw=Math.min,Bw=Math.max,Vw=Math.pow,Gw=1e4,Fw=6,Ww=6,Hw="globalPan",Zw={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Uw={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},Xw={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},Yw=0;function jw(t){Ct.call(this),this._zr=t,this.group=new Si,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._lastMouseMovePoint={},this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+Yw++,this._handlers={},Ew(_b,function(t,e){this._handlers[e]=T(t,this)},this)}function qw(t,e){var i=bb[e.brushType].createCover(t,e);return i.__brushOption=e,Jw(i,e),t.group.add(i),i}function Kw(t,e){var i=tb(e);return i.endCreating&&(i.endCreating(t,e),Jw(e,e.__brushOption)),e}function $w(t,e){var i=e.__brushOption;tb(e).updateCoverShape(t,e,i.range,i)}function Jw(t,e){var i=e.z;null==i&&(i=Gw),t.traverse(function(t){t.z=i,t.z2=i})}function Qw(t,e){tb(e).updateCommon(t,e),$w(t,e)}function tb(t){return bb[t.__brushOption.brushType]}function eb(t,e,i){var n,a=t._panels;if(!a)return!0;var o=t._transform;return Ew(a,function(t){t.isTargetByCursor(e,i,o)&&(n=t)}),n}function ib(t,e){var i=t._panels;if(!i)return!0;var n=e.__brushOption.panelId;return null==n||i[n]}function nb(e){var t=e._covers,i=t.length;return Ew(t,function(t){e.group.remove(t)},e),t.length=0,!!i}function ab(t,e){var i=Rw(t._covers,function(t){var e=t.__brushOption,i=D(e.range);return{brushType:e.brushType,panelId:e.panelId,range:i}});t.trigger("brush",i,{isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ob(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function rb(e,i,t,n){var a=new Si;return a.add(new Hr({name:"main",style:hb(t),silent:!0,draggable:!0,cursor:"move",drift:Ow(e,i,a,"nswe"),ondragend:Ow(ab,i,{isEnd:!0})})),Ew(n,function(t){a.add(new Hr({name:t,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Ow(e,i,a,t),ondragend:Ow(ab,i,{isEnd:!0})}))}),a}function sb(t,e,i,n){var a=n.brushStyle.lineWidth||0,o=Bw(a,Ww),r=i[0][0],s=i[1][0],l=r-a/2,u=s-a/2,h=i[0][1],c=i[1][1],d=h-o+a/2,f=c-o+a/2,p=h-r,g=c-s,m=p+a,v=g+a;ub(t,e,"main",r,s,p,g),n.transformable&&(ub(t,e,"w",l,u,o,v),ub(t,e,"e",d,u,o,v),ub(t,e,"n",l,u,m,o),ub(t,e,"s",l,f,m,o),ub(t,e,"nw",l,u,o,o),ub(t,e,"ne",d,u,o,o),ub(t,e,"sw",l,f,o,o),ub(t,e,"se",d,f,o,o))}function lb(n,a){var t=a.__brushOption,o=t.transformable,e=a.childAt(0);e.useStyle(hb(t)),e.attr({silent:!o,cursor:o?"move":"default"}),Ew(["w","e","n","s","se","sw","ne","nw"],function(t){var e=a.childOfName(t),i=function t(e,i){{if(1<i.length){i=i.split("");var n=[t(e,i[0]),t(e,i[1])];return"e"!==n[0]&&"w"!==n[0]||n.reverse(),n.join("")}var a={w:"left",e:"right",n:"top",s:"bottom"},o={left:"w",right:"e",top:"n",bottom:"s"},n=Js(a[i],Ks(e.group));return o[n]}}(n,t);e&&e.attr({silent:!o,invisible:!o,cursor:o?Uw[i]+"-resize":null})})}function ub(t,e,i,n,a,o,r){var s=e.childOfName(i);s&&s.setShape(function(t){var e=zw(t[0][0],t[1][0]),i=zw(t[0][1],t[1][1]),n=Bw(t[0][0],t[1][0]),a=Bw(t[0][1],t[1][1]);return{x:e,y:i,width:n-e,height:a-i}}(gb(t,e,[[n,a],[n+o,a+r]])))}function hb(t){return C({strokeNoScale:!0},t.brushStyle)}function cb(t,e,i,n){var a=[zw(t,i),zw(e,n)],o=[Bw(t,i),Bw(e,n)];return[[a[0],o[0]],[a[1],o[1]]]}function db(t,e,i,n,a,o,r,s){var l=n.__brushOption,u=t(l.range),h=pb(i,o,r);Ew(a.split(""),function(t){var e=Zw[t];u[e[0]][e[1]]+=h[e[0]]}),l.range=e(cb(u[0][0],u[1][0],u[0][1],u[1][1])),Qw(i,n),ab(i,{isEnd:!1})}function fb(t,e,i,n,a){var o=e.__brushOption.range,r=pb(t,i,n);Ew(o,function(t){t[0]+=r[0],t[1]+=r[1]}),Qw(t,e),ab(t,{isEnd:!1})}function pb(t,e,i){var n=t.group,a=n.transformCoordToLocal(e,i),o=n.transformCoordToLocal(0,0);return[a[0]-o[0],a[1]-o[1]]}function gb(t,e,i){var n=ib(t,e);return n&&!0!==n?n.clipPath(i,t._transform):D(i)}function mb(t){var e=t.event;e.preventDefault&&e.preventDefault()}function vb(t,e,i){return t.childOfName("main").contain(e,i)}function yb(t,e,i,n){var a,o=t._creatingCover,r=t._creatingPanel,s=t._brushOption;if(t._track.push(i.slice()),function(t){var e=t._track;if(!e.length)return!1;var i=e[e.length-1],n=e[0],a=i[0]-n[0],o=i[1]-n[1],r=Vw(a*a+o*o,.5);return Fw<r}(t)||o){if(r&&!o){"single"===s.brushMode&&nb(t);var l=D(s);l.brushType=xb(l.brushType,r),l.panelId=!0===r?null:r.panelId,o=t._creatingCover=qw(t,l),t._covers.push(o)}if(o){var u=bb[xb(t._brushType,r)];o.__brushOption.range=u.getCreatingRange(gb(t,o,t._track)),n&&(Kw(t,o),u.updateCommon(t,o)),$w(t,o),a={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&eb(t,e,i)&&nb(t)&&(a={isEnd:n,removeOnClick:!0});return a}function xb(t,e){return"auto"===t?e.defaultBrushType:t}jw.prototype={constructor:jw,enableBrush:function(t){return this._brushType&&function(t){var i=t._zr;(function(t,e,i){var n=ly(t);n[e]===i&&(n[e]=null)})(i,Hw,t._uid),Ew(t._handlers,function(t,e){i.off(e,t)}),t._brushType=t._brushOption=null}(this),t.brushType&&function(t,e){var i=t._zr;t._enableGlobalPan||function(t,e,i){ly(t)[e]=i}(i,Hw,t._uid);Ew(t._handlers,function(t,e){i.on(e,t)}),t._brushType=e.brushType,t._brushOption=m(D(Xw),e,!0)}(this,t),this},setPanels:function(t){if(t&&t.length){var e=this._panels={};E(t,function(t){e[t.panelId]=D(t)})}else this._panels=null;return this},mount:function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({position:t.position||[0,0],rotation:t.rotation||0,scale:t.scale||[1,1]}),this._transform=e.getLocalTransform(),this},eachCover:function(t,e){Ew(this._covers,t,e)},updateCovers:function(a){a=N(a,function(t){return m(D(Xw),t,!0)});var i="\0-brush-index-",o=this._covers,r=this._covers=[],s=this,l=this._creatingCover;return new df(o,a,function(t,e){return n(t.__brushOption,e)},n).add(t).update(t).remove(function(t){o[t]!==l&&s.group.remove(o[t])}).execute(),this;function n(t,e){return(null!=t.id?t.id:i+e)+"-"+t.brushType}function t(t,e){var i=a[t];if(null!=e&&o[e]===l)r[t]=o[e];else{var n=r[t]=null!=e?(o[e].__brushOption=i,o[e]):Kw(s,qw(s,i));Qw(s,n)}}},unmount:function(){return this.enableBrush(!1),nb(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},b(jw,Ct);var _b={mousedown:function(t){if(this._dragging)wb(this,t);else if(!t.target||!t.target.draggable){mb(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=eb(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=this._lastMouseMovePoint;e.x=t.offsetX,e.y=t.offsetY;var i=this.group.transformCoordToLocal(e.x,e.y);if(function(t,e,i){if(t._brushType){var n=t._zr,a=t._covers,o=eb(t,e,i);if(!t._dragging)for(var r=0;r<a.length;r++){var s=a[r].__brushOption;if(o&&(!0===o||s.panelId===o.panelId)&&bb[s.brushType].contain(a[r],i[0],i[1]))return}o&&n.setCursorStyle("crosshair")}}(this,t,i),this._dragging){mb(t);var n=yb(this,t,i,!1);n&&ab(this,n)}},mouseup:function(t){wb(this,t)},globalout:function(t){wb(this,t,!0)}};function wb(t,e,i){if(t._dragging){i||mb(e);var n=e.offsetX,a=e.offsetY,o=t._lastMouseMovePoint;i&&(n=o.x,a=o.y);var r=t.group.transformCoordToLocal(n,a),s=yb(t,e,r,!0);t._dragging=!1,t._track=[],t._creatingCover=null,s&&ab(t,s)}}var bb={lineX:Sb(0),lineY:Sb(1),rect:{createCover:function(t,e){return rb(Ow(db,function(t){return t},function(t){return t}),t,e,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(t){var e=ob(t);return cb(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,i,n){sb(t,e,i,n)},updateCommon:lb,contain:vb},polygon:{createCover:function(t,e){var i=new Si;return i.add(new zr({name:"main",style:hb(e),silent:!0})),i},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new Rr({name:"main",draggable:!0,drift:Ow(fb,t,e),ondragend:Ow(ab,t,{isEnd:!0})}))},updateCoverShape:function(t,e,i,n){e.childAt(0).setShape({points:gb(t,e,i)})},updateCommon:lb,contain:vb}};function Sb(l){return{createCover:function(t,e){return rb(Ow(db,function(t){var e=[t,[0,100]];return l&&e.reverse(),e},function(t){return t[l]}),t,e,[["w","e"],["n","s"]][l])},getCreatingRange:function(t){var e=ob(t);return[zw(e[0][l],e[1][l]),Bw(e[0][l],e[1][l])]},updateCoverShape:function(t,e,i,n){var a,o=ib(t,e);if(!0!==o&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(l,t._transform);else{var r=t._zr;a=[0,[r.getWidth(),r.getHeight()][1-l]]}var s=[i,a];l&&s.reverse(),sb(t,e,s,n)},updateCommon:lb,contain:vb}}function Mb(i){return i=Tb(i),function(t,e){return tl(t,i)}}function Ib(a,o){return a=Tb(a),function(t){var e=null!=o?o:t,i=e?a.width:a.height,n=e?a.x:a.y;return[n,n+(i||0)]}}function Ab(n,a,o){return n=Tb(n),function(t,e,i){return n.contain(e[0],e[1])&&!wy(t,a,o)}}function Tb(t){return bi.create(t)}var Db=["axisLine","axisTickLabel","axisName"],Cb=lf({type:"parallelAxis",init:function(t,e){Cb.superApply(this,"init",arguments),(this._brushController=new jw(e.getZr())).on("brush",T(this._onBrush,this))},render:function(t,e,i,n){if(!function(t,e,i){return i&&"axisAreaSelect"===i.type&&e.findComponents({mainType:"parallelAxis",query:i})[0]===t}(t,e,n)){this.axisModel=t,this.api=i,this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new Si,this.group.add(this._axisGroup),t.get("show")){var o=function(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}(t,e),r=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,u=t.axis.dim,h=L({strokeContainThreshold:l},r.getAxisLayout(u)),c=new Cm(t,h);E(Db,c.add,c),this._axisGroup.add(c.getGroup()),this._refreshBrushController(h,s,t,o,l,i);var d=n&&!1===n.animation?null:t;Qs(a,this._axisGroup,d)}}},_refreshBrushController:function(t,e,i,n,a,o){var r=i.axis.getExtent(),s=r[1]-r[0],l=Math.min(30,.1*Math.abs(s)),u=bi.create({x:r[0],y:-a/2,width:s,height:a});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,position:t.position}).setPanels([{panelId:"pl",clipPath:Mb(u),isTargetByCursor:Ab(u,o,n),getLinearBrushOtherExtent:Ib(u,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(function(t){var e=t.axis;return N(t.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}(i))},_onBrush:function(t,e){var i=this.axisModel,n=i.axis,a=N(t,function(t){return[n.coordToData(t.range[0],!0),n.coordToData(t.range[1],!0)]});!i.option.realtime!==e.isEnd&&!e.removeOnClick||this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:a})},dispose:function(){this._brushController.dispose()}});lf({type:"parallel",render:function(t,e,i){this._model=t,this._api=i,this._handlers||(this._handlers={},E(Lb,function(t,e){i.getZr().on(e,this._handlers[e]=T(t,this))},this)),dc(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},dispose:function(t,i){E(this._handlers,function(t,e){i.getZr().off(e,t)}),this._handlers=null},_throttledDispatchExpand:function(t){this._dispatchExpand(t)},_dispatchExpand:function(t){t&&this._api.dispatchAction(L({type:"parallelAxisExpand"},t))}});var Lb={mousedown:function(t){kb(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(kb(this,"click")&&e){var i=[t.offsetX,t.offsetY];if(5<Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&kb(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};function kb(t,e){var i=t._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===e}Jd(function(t){!function(t){if(t.parallel)return;var e=!1;E(t.series,function(t){t&&"parallel"===t.type&&(e=!0)}),e&&(t.parallel=[{}])}(t),function(n){E(wa(n.parallelAxis),function(t){if(z(t)){var e=t.parallelIndex||0,i=wa(n.parallel)[e];i&&i.parallelAxisDefault&&m(t,i.parallelAxisDefault,!1)}})}(t)}),Wh.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){var i=this.getSource();return function(t,e){if(t.encodeDefine)return;var i=e.ecModel.getComponent("parallel",e.get("parallelIndex"));if(!i)return;var n=t.encodeDefine=Q();E(i.dimensions,function(t){var e=function(t){return+t.replace("dim","")}(t);n.set(t,e)})}(i,this),Xf(i,this)},getRawIndicesByActiveState:function(i){var t=this.coordinateSystem,n=this.getData(),a=[];return t.eachActiveState(n,function(t,e){i===t&&a.push(n.getRawIndex(e))}),a},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});ec.extend({type:"parallel",init:function(){this._dataGroup=new Si,this.group.add(this._dataGroup),this._data,this._initialized},render:function(o,t,e,r){var i=this._dataGroup,s=o.getData(),l=this._data,u=o.coordinateSystem,h=u.dimensions,c=Ob(o);if(s.diff(l).add(function(t){Eb(Nb(s,i,t,h,u),s,t,c)}).update(function(t,e){var i=l.getItemGraphicEl(e),n=Pb(s,t,h,u);s.setItemGraphicEl(t,i);var a=r&&!1===r.animation?null:o;js(i,{shape:{points:n}},a,t),Eb(i,s,t,c)}).remove(function(t){var e=l.getItemGraphicEl(t);i.remove(e)}).execute(),!this._initialized){this._initialized=!0;var n=function(t,e,i){var n=t.model,a=t.getRect(),o=new Hr({shape:{x:a.x,y:a.y,width:a.width,height:a.height}}),r="horizontal"===n.get("layout")?"width":"height";return o.setShape(r,0),qs(o,{shape:{width:a.width,height:a.height}},e,i),o}(u,o,function(){setTimeout(function(){i.removeClipPath()})});i.setClipPath(n)}this._data=s},incrementalPrepareRender:function(t,e,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(t,e,i){for(var n=e.getData(),a=e.coordinateSystem,o=a.dimensions,r=Ob(e),s=t.start;s<t.end;s++){var l=Nb(n,this._dataGroup,s,o,a);l.incremental=!0,Eb(l,n,s,r)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});function Pb(t,e,i,n){for(var a,o=[],r=0;r<i.length;r++){var s=i[r],l=t.get(t.mapDimension(s),e);a=l,("category"===n.getAxis(s).type?null==a:null==a||isNaN(a))||o.push(n.dataToPoint(l,s))}return o}function Nb(t,e,i,n,a){var o=Pb(t,i,n,a),r=new zr({shape:{points:o},silent:!0,z2:10});return e.add(r),t.setItemGraphicEl(i,r),r}function Ob(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),{lineStyle:t.getModel("lineStyle").getLineStyle(),smooth:null!=e?e:.3}}function Eb(t,e,i,n){var a=n.lineStyle;e.hasItemOption&&(a=e.getItemModel(i).getModel("lineStyle").getLineStyle());t.useStyle(a);var o=t.style;o.fill=null,o.stroke=e.getItemVisual(i,"color"),o.opacity=e.getItemVisual(i,"opacity"),n.smooth&&(t.shape.smooth=n.smooth)}var Rb=["lineStyle","normal","opacity"];af({seriesType:"parallel",reset:function(t,e,i){var n=t.getModel("itemStyle"),a=t.getModel("lineStyle"),o=e.get("color"),r=a.get("color")||n.get("color")||o[t.seriesIndex%o.length],s=t.get("inactiveOpacity"),l=t.get("activeOpacity"),u=t.getModel("lineStyle").getLineStyle(),h=t.coordinateSystem,c=t.getData(),d={normal:u.opacity,active:l,inactive:s};return c.setVisual("color",r),{progress:function(t,a){h.eachActiveState(a,function(t,e){var i=d[t];if("normal"===t&&a.hasItemOption){var n=a.getItemModel(e).get(Rb,!0);null!=n&&(i=n)}a.setItemVisual(e,"opacity",i)},t.start,t.end)}}}});var zb=Wh.extend({type:"series.sankey",layoutInfo:null,levelModels:null,getInitialData:function(t,e){for(var i=t.edges||t.links,n=t.data||t.nodes,a=t.levels,o=this.levelModels={},r=0;r<a.length;r++)null!=a[r].depth&&0<=a[r].depth&&(o[a[r].depth]=new dl(a[r],this,e));if(n&&i)return I_(n,i,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t,n){return t.customizeGetParent(function(t){var e=this.parentModel,i=e.getData().getItemLayout(n).depth;return e.levelModels[i]||this.parentModel}),t}),e.wrapMethod("getItemModel",function(t,n){return t.customizeGetParent(function(t){var e=this.parentModel,i=e.getGraph().getEdgeByIndex(n).node1.getLayout().depth;return e.levelModels[i]||this.parentModel}),t})}).data},setNodePosition:function(t,e){var i=this.option.data[t];i.localX=e[0],i.localY=e[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(t,e,i){if("edge"===i){var n=this.getDataParams(t,i),a=n.data,o=a.source+" -- "+a.target;return n.value&&(o+=" : "+n.value),Wl(o)}if("node"!==i)return zb.superCall(this,"formatTooltip",t,e);var r=this.getGraph().getNodeByIndex(t).getLayout().value,s=this.getDataParams(t,i).data.name;if(r)o=s+" : "+r;return Wl(o)},optionUpdated:function(){var t=this.option;!0===t.focusNodeAdjacency&&(t.focusNodeAdjacency="allEdges")},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.6}},animationEasing:"linear",animationDuration:1e3}}),Bb=["itemStyle","opacity"],Vb=["lineStyle","opacity"];function Gb(t,e){return t.getVisual("opacity")||t.getModel().get(e)}function Fb(t,e,i){var n=t.getGraphicEl(),a=Gb(t,e);null!=i&&(null==a&&(a=1),a*=i),n.downplay&&n.downplay(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",a)})}function Wb(t,e){var i=Gb(t,e),n=t.getGraphicEl();n.highlight&&n.highlight(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",i)})}var Hb=ds({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(t,e){var i=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+i,e.y2),t.bezierCurveTo(e.cpx2+i,e.cpy2,e.cpx1+i,e.cpy1,e.x1+i,e.y1)):(t.lineTo(e.x2,e.y2+i),t.bezierCurveTo(e.cpx2,e.cpy2+i,e.cpx1,e.cpy1+i,e.x1,e.y1+i)),t.closePath()}});hf({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(w,t,n){var a=this,e=w.getGraph(),b=this.group,i=w.layoutInfo,S=i.width,M=i.height,u=w.getData(),I=w.getData("edge"),A=w.get("orient");this._model=w,b.removeAll(),b.attr("position",[i.x,i.y]),e.eachEdge(function(t){var e=new Hb;e.dataIndex=t.dataIndex,e.seriesIndex=w.seriesIndex,e.dataType="edge";var i,n,a,o,r,s,l,u,h=t.getModel("lineStyle"),c=h.get("curveness"),d=t.node1.getLayout(),f=t.node1.getModel(),p=f.get("localX"),g=f.get("localY"),m=t.node2.getLayout(),v=t.node2.getModel(),y=v.get("localX"),x=v.get("localY"),_=t.getLayout();switch(e.shape.extent=Math.max(1,_.dy),u="vertical"===(e.shape.orient=A)?(i=(null!=p?p*S:d.x)+_.sy,n=(null!=g?g*M:d.y)+d.dy,a=(null!=y?y*S:m.x)+_.ty,r=i,s=n*(1-c)+(o=null!=x?x*M:m.y)*c,l=a,n*c+o*(1-c)):(i=(null!=p?p*S:d.x)+d.dx,n=(null!=g?g*M:d.y)+_.sy,r=i*(1-c)+(a=null!=y?y*S:m.x)*c,s=n,l=i*c+a*(1-c),o=(null!=x?x*M:m.y)+_.ty),e.setShape({x1:i,y1:n,x2:a,y2:o,cpx1:r,cpy1:s,cpx2:l,cpy2:u}),e.setStyle(h.getItemStyle()),e.style.fill){case"source":e.style.fill=t.node1.getVisual("color");break;case"target":e.style.fill=t.node2.getVisual("color")}Os(e,t.getModel("emphasis.lineStyle").getItemStyle()),b.add(e),I.setItemGraphicEl(t.dataIndex,e)}),e.eachNode(function(t){var e=t.getLayout(),i=t.getModel(),n=i.get("localX"),a=i.get("localY"),o=i.getModel("label"),r=i.getModel("emphasis.label"),s=new Hr({shape:{x:null!=n?n*S:e.x,y:null!=a?a*M:e.y,width:e.dx,height:e.dy},style:i.getModel("itemStyle").getItemStyle()}),l=t.getModel("emphasis.itemStyle").getItemStyle();Bs(s.style,l,o,r,{labelFetcher:w,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),s.setStyle("fill",t.getVisual("color")),Os(s,l),b.add(s),u.setItemGraphicEl(t.dataIndex,s),s.dataType="node"}),u.eachItemGraphicEl(function(t,i){var e=u.getItemModel(i);e.get("draggable")&&(t.drift=function(t,e){a._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=e,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:w.id,dataIndex:u.getRawIndex(i),localX:this.shape.x/S,localY:this.shape.y/M})},t.ondragend=function(){a._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move"),e.get("focusNodeAdjacency")&&(t.off("mouseover").on("mouseover",function(){a._focusAdjacencyDisabled||n.dispatchAction({type:"focusNodeAdjacency",seriesId:w.id,dataIndex:t.dataIndex})}),t.off("mouseout").on("mouseout",function(){a._focusAdjacencyDisabled||n.dispatchAction({type:"unfocusNodeAdjacency",seriesId:w.id})}))}),I.eachItemGraphicEl(function(t,e){I.getItemModel(e).get("focusNodeAdjacency")&&(t.off("mouseover").on("mouseover",function(){a._focusAdjacencyDisabled||n.dispatchAction({type:"focusNodeAdjacency",seriesId:w.id,edgeDataIndex:t.dataIndex})}),t.off("mouseout").on("mouseout",function(){a._focusAdjacencyDisabled||n.dispatchAction({type:"unfocusNodeAdjacency",seriesId:w.id})}))}),!this._data&&w.get("animation")&&b.setClipPath(function(t,e,i){var n=new Hr({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return qs(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}(b.getBoundingRect(),w,function(){b.removeClipPath()})),this._data=w.getData()},dispose:function(){},focusNodeAdjacency:function(t,e,i,n){var a=this._model.getData(),o=a.graph,r=n.dataIndex,s=a.getItemModel(r),l=n.edgeDataIndex;if(null!=r||null!=l){var u=o.getNodeByIndex(r),h=o.getEdgeByIndex(l);if(o.eachNode(function(t){Fb(t,Bb,.1)}),o.eachEdge(function(t){Fb(t,Vb,.1)}),u){Wb(u,Bb);var c=s.get("focusNodeAdjacency");"outEdges"===c?E(u.outEdges,function(t){t.dataIndex<0||(Wb(t,Vb),Wb(t.node2,Bb))}):"inEdges"===c?E(u.inEdges,function(t){t.dataIndex<0||(Wb(t,Vb),Wb(t.node1,Bb))}):"allEdges"===c&&E(u.edges,function(t){t.dataIndex<0||(Wb(t,Vb),Wb(t.node1,Bb),Wb(t.node2,Bb))})}h&&(Wb(h,Vb),Wb(h.node1,Bb),Wb(h.node2,Bb))}},unfocusNodeAdjacency:function(t,e,i,n){var a=this._model.getGraph();a.eachNode(function(t){Fb(t,Bb)}),a.eachEdge(function(t){Fb(t,Vb)})}}),tf({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])})});function Zb(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&0<=e.depth}function Ub(t,l,u,h,c){var d="vertical"===c?"x":"y";E(t,function(t){var e,i,n;t.sort(function(t,e){return t.getLayout()[d]-e.getLayout()[d]});for(var a=0,o=t.length,r="vertical"===c?"dx":"dy",s=0;s<o;s++)0<(n=a-(i=t[s]).getLayout()[d])&&(e=i.getLayout()[d]+n,"vertical"===c?i.setLayout({x:e},!0):i.setLayout({y:e},!0)),a=i.getLayout()[d]+i.getLayout()[r]+l;if(0<(n=a-l-("vertical"===c?h:u)))for(e=i.getLayout()[d]-n,"vertical"===c?i.setLayout({x:e},!0):i.setLayout({y:e},!0),a=e,s=o-2;0<=s;--s)0<(n=(i=t[s]).getLayout()[d]+i.getLayout()[r]+l-a)&&(e=i.getLayout()[d]-n,"vertical"===c?i.setLayout({x:e},!0):i.setLayout({y:e},!0)),a=i.getLayout()[d]})}function Xb(t,a,o){E(t.slice().reverse(),function(t){E(t,function(t){if(t.outEdges.length){var e=$b(t.outEdges,Yb,o)/$b(t.outEdges,Kb,o);if("vertical"===o){var i=t.getLayout().x+(e-qb(t,o))*a;t.setLayout({x:i},!0)}else{var n=t.getLayout().y+(e-qb(t,o))*a;t.setLayout({y:n},!0)}}})})}function Yb(t,e){return qb(t.node2,e)*t.getValue()}function jb(t,e){return qb(t.node1,e)*t.getValue()}function qb(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Kb(t){return t.getValue()}function $b(t,e,i){for(var n=0,a=t.length,o=-1;++o<a;){var r=+e.call(t,t[o],i);isNaN(r)||(n+=r)}return n}function Jb(t,a,o){E(t,function(t){E(t,function(t){if(t.inEdges.length){var e=$b(t.inEdges,jb,o)/$b(t.inEdges,Kb,o);if("vertical"===o){var i=t.getLayout().x+(e-qb(t,o))*a;t.setLayout({x:i},!0)}else{var n=t.getLayout().y+(e-qb(t,o))*a;t.setLayout({y:n},!0)}}})})}nf(function(t,u,e){t.eachSeriesByType("sankey",function(t){var e=t.get("nodeWidth"),i=t.get("nodeGap"),n=function(t,e){return au(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,u),a=(t.layoutInfo=n).width,o=n.height,r=t.getGraph(),s=r.nodes,l=r.edges;!function(t){E(t,function(t){var e=$b(t.outEdges,Kb),i=$b(t.inEdges,Kb),n=Math.max(e,i);t.setLayout({value:n},!0)})}(s),function(t,e,i,n,a,o,r,s,l){(function(t,e,i,n,a,o,r){for(var s=[],l=[],u=[],h=[],c=0,d=0;d<e.length;d++)s[d]=1;for(d=0;d<t.length;d++)l[d]=t[d].inEdges.length,0===l[d]&&u.push(t[d]);var f=-1;for(;u.length;){for(var p=0;p<u.length;p++){var g=u[p],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&0<=m.depth;v&&m.depth>f&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===o?g.setLayout({dy:i},!0):g.setLayout({dx:i},!0);for(var y=0;y<g.outEdges.length;y++){var x=g.outEdges[y],_=e.indexOf(x);s[_]=0;var w=x.node2,b=t.indexOf(w);0==--l[b]&&h.indexOf(w)<0&&h.push(w)}}++c,u=h,h=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var S=c-1<f?f:c-1;r&&"left"!==r&&function(t,e,i,n){if("right"===e){for(var a=[],o=t,r=0;o.length;){for(var s=0;s<o.length;s++){var l=o[s];l.setLayout({skNodeHeight:r},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];a.indexOf(h.node1)<0&&a.push(h.node1)}}o=a,a=[],++r}E(t,function(t){Zb(t)||t.setLayout({depth:Math.max(0,n-t.getLayout().skNodeHeight)},!0)})}else"justify"===e&&function(t,e){E(t,function(t){Zb(t)||t.outEdges.length||t.setLayout({depth:e},!0)})}(t,n)}(t,r,0,S);!function(t,i,n){E(t,function(t){var e=t.getLayout().depth*i;"vertical"===n?t.setLayout({y:e},!0):t.setLayout({x:e},!0)})}(t,"vertical"===o?(a-i)/S:(n-i)/S,o)})(t,e,i,a,o,s,l),function(t,e,i,n,a,o,r){var s=function(t,e){var i=[],n="vertical"===e?"y":"x",a=Ra(t,function(t){return t.getLayout()[n]});return a.keys.sort(function(t,e){return t-e}),E(a.keys,function(t){i.push(a.buckets.get(t))}),i}(t,r);(function(t,e,a,o,r,s){var l=1/0;E(t,function(t){var e=t.length,i=0;E(t,function(t){i+=t.getLayout().value});var n="vertical"===s?(o-(e-1)*r)/i:(a-(e-1)*r)/i;n<l&&(l=n)}),E(t,function(t){E(t,function(t,e){var i=t.getLayout().value*l;"vertical"===s?(t.setLayout({x:e},!0),t.setLayout({dx:i},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:i},!0))})}),E(e,function(t){var e=+t.getValue()*l;t.setLayout({dy:e},!0)})})(s,e,i,n,a,r),Ub(s,a,i,n,r);for(var l=1;0<o;o--)Xb(s,l*=.99,r),Ub(s,a,i,n,r),Jb(s,l,r),Ub(s,a,i,n,r)}(t,e,o,a,n,r,s),function(t,e){var i="vertical"===e?"x":"y";E(t,function(t){t.outEdges.sort(function(t,e){return t.node2.getLayout()[i]-e.node2.getLayout()[i]}),t.inEdges.sort(function(t,e){return t.node1.getLayout()[i]-e.node1.getLayout()[i]})}),E(t,function(t){var e=0,i=0;E(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),E(t.inEdges,function(t){t.setLayout({ty:i},!0),i+=t.getLayout().dy})})}(t,s)}(s,l,e,i,a,o,0!==M(s,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))})}),af(function(t,e){t.eachSeriesByType("sankey",function(n){var t=n.getGraph().nodes;if(t.length){var a=1/0,o=-1/0;E(t,function(t){var e=t.getLayout().value;e<a&&(a=e),o<e&&(o=e)}),E(t,function(t){var e=new Bx({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:n.get("color")}).mapValueToVisual(t.getLayout().value),i=t.getModel().get("itemStyle.color");null!=i?t.setVisual("color",i):t.setVisual("color",e)})}})});var Qb={_baseAxisDim:null,getInitialData:function(t,e){var i,n,a=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),r=a.get("type"),s=o.get("type");"category"===r?(t.layout="horizontal",i=a.getOrdinalMeta(),n=!0):"category"===s?(t.layout="vertical",i=o.getOrdinalMeta(),n=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[a,o],f=d[u].get("type"),p=d[1-u].get("type"),g=t.data;if(g&&n){var m=[];E(g,function(t,e){var i;t.value&&k(t.value)?(i=t.value.slice(),t.value.unshift(e)):k(t)?(i=t.slice(),t.unshift(e)):i=t,m.push(i)}),t.data=m}var v=this.defaultValueDimensions;return yv(this,{coordDimensions:[{name:h,type:mf(f),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:mf(p),dimsDef:v.slice()}],dimensionsCount:v.length+1})},getBaseAxis:function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis}};b(Wh.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}}),Qb,!0);var tS=["itemStyle"],eS=["emphasis","itemStyle"],iS=(ec.extend({type:"boxplot",render:function(t,e,i){var a=t.getData(),o=this.group,r=this._data;this._data||o.removeAll();var s="horizontal"===t.get("layout")?1:0;a.diff(r).add(function(t){if(a.hasValue(t)){var e=nS(a.getItemLayout(t),a,t,s,!0);a.setItemGraphicEl(t,e),o.add(e)}}).update(function(t,e){var i=r.getItemGraphicEl(e);if(a.hasValue(t)){var n=a.getItemLayout(t);i?aS(n,i,a,t):i=nS(n,a,t,s),o.add(i),a.setItemGraphicEl(t,i)}else o.remove(i)}).remove(function(t){var e=r.getItemGraphicEl(t);e&&o.remove(e)}).execute(),this._data=a},remove:function(t){var e=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(t){t&&e.remove(t)})},dispose:et}),hr.extend({type:"boxplotBoxPath",shape:{},buildPath:function(t,e){var i=e.points,n=0;for(t.moveTo(i[n][0],i[n][1]),n++;n<4;n++)t.lineTo(i[n][0],i[n][1]);for(t.closePath();n<i.length;n++)t.moveTo(i[n][0],i[n][1]),n++,t.lineTo(i[n][0],i[n][1])}}));function nS(t,e,i,n,a){var o=t.ends,r=new iS({shape:{points:a?function(t,e,i){return N(t,function(t){return(t=t.slice())[e]=i.initBaseline,t})}(o,n,t):o}});return aS(t,r,e,i,a),r}function aS(t,e,i,n,a){var o=i.hostModel;(0,ol[a?"initProps":"updateProps"])(e,{shape:{points:t.ends}},o,n);var r=i.getItemModel(n),s=r.getModel(tS),l=i.getItemVisual(n,"color"),u=s.getItemStyle(["borderColor"]);u.stroke=l,u.strokeNoScale=!0,e.useStyle(u),e.z2=100,Os(e,r.getModel(eS).getItemStyle())}var oS=["itemStyle","borderColor"],rS=E;af(function(n,t){var a=n.get("color");n.eachRawSeriesByType("boxplot",function(t){var e=a[t.seriesIndex%a.length],i=t.getData();i.setVisual({legendSymbol:"roundRect",color:t.get(oS)||e}),n.isSeriesFiltered(t)||i.each(function(t){var e=i.getItemModel(t);i.setItemVisual(t,{color:e.get(oS,!0)})})})}),nf(function(t){var e=function(t){var n=[],a=[];return t.eachSeriesByType("boxplot",function(t){var e=t.getBaseAxis(),i=_(a,e);i<0&&(i=a.length,a[i]=e,n[i]={axis:e,seriesModels:[]}),n[i].seriesModels.push(t)}),n}(t);rS(e,function(i){var t=i.seriesModels;t.length&&(function(t){var e,i,n=t.axis,a=t.seriesModels,o=a.length,r=t.boxWidthList=[],s=t.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;rS(a,function(t){u=Math.max(u,t.getData().count())}),e=n.getExtent(),Math.abs(e[1]-e[0])}rS(a,function(t){var e=t.get("boxWidth");k(e)||(e=[e,e]),l.push([xl(e[0],i)||0,xl(e[1],i)||0])});var h=.8*i-2,c=h/o*.3,d=(h-c*(o-1))/o,f=d/2-h/2;rS(a,function(t,e){s.push(f),f+=c+d,r.push(Math.min(Math.max(d,l[e][0]),l[e][1]))})}(i),rS(t,function(t,e){!function(t,r,e){var s=t.coordinateSystem,l=t.getData(),o=e/2,u="horizontal"===t.get("layout")?0:1,h=1-u,i=["x","y"],n=l.mapDimension(i[u]),a=l.mapDimension(i[h],!0);if(null==n||a.length<5)return;for(var c=0;c<l.count();c++){var d=l.get(n,c),f=x(d,a[2],c),p=x(d,a[0],c),g=x(d,a[1],c),m=x(d,a[3],c),v=x(d,a[4],c),y=[];_(y,g,0),_(y,m,1),y.push(p,g,v,m),w(y,p),w(y,v),w(y,f),l.setItemLayout(c,{initBaseline:f[h],ends:y})}function x(t,e,i){var n,a=l.get(e,i),o=[];return o[u]=t,o[h]=a,isNaN(t)||isNaN(a)?n=[NaN,NaN]:(n=s.dataToPoint(o))[u]+=r,n}function _(t,e,i){var n=e.slice(),a=e.slice();n[u]+=o,a[u]-=o,i?t.push(n,a):t.push(a,n)}function w(t,e){var i=e.slice(),n=e.slice();i[u]-=o,n[u]+=o,t.push(i,n)}}(t,i.boxOffsetList[e],i.boxWidthList[e])}))})}),b(Wh.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(t,e,i){var n=e.getItemLayout(t);return n&&i.rect(n.brushRect)}}),Qb,!0);var sS=["itemStyle"],lS=["emphasis","itemStyle"],uS=["color","color0","borderColor","borderColor0"],hS=(ec.extend({type:"candlestick",render:function(t,e,i){this.group.removeClipPath(),this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},incrementalPrepareRender:function(t,e,i){this._clear(),this._updateDrawMode(t)},incrementalRender:function(t,e,i,n){this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},_updateDrawMode:function(t){var e=t.pipelineContext.large;(null==this._isLargeDraw||e^this._isLargeDraw)&&(this._isLargeDraw=e,this._clear())},_renderNormal:function(a){var o=a.getData(),r=this._data,s=this.group,l=o.getLayout("isSimpleBox"),u=a.get("clip",!0),t=a.coordinateSystem,h=t.getArea&&t.getArea();this._data||s.removeAll(),o.diff(r).add(function(t){if(o.hasValue(t)){var e,i=o.getItemLayout(t);if(u&&dS(h,i))return;qs(e=cS(i,t,!0),{shape:{points:i.ends}},a,t),fS(e,o,t,l),s.add(e),o.setItemGraphicEl(t,e)}}).update(function(t,e){var i=r.getItemGraphicEl(e);if(o.hasValue(t)){var n=o.getItemLayout(t);u&&dS(h,n)?s.remove(i):(i?js(i,{shape:{points:n.ends}},a,t):i=cS(n,t),fS(i,o,t,l),s.add(i),o.setItemGraphicEl(t,i))}else s.remove(i)}).remove(function(t){var e=r.getItemGraphicEl(t);e&&s.remove(e)}).execute(),this._data=o},_renderLarge:function(t){this._clear(),gS(t,this.group);var e=t.get("clip",!0)?tm(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},_incrementalRenderNormal:function(t,e){for(var i,n=e.getData(),a=n.getLayout("isSimpleBox");null!=(i=t.next());){var o;fS(o=cS(n.getItemLayout(i),i),n,i,a),o.incremental=!0,this.group.add(o)}},_incrementalRenderLarge:function(t,e){gS(e,this.group,!0)},remove:function(t){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:et}),hr.extend({type:"normalCandlestickBox",shape:{},buildPath:function(t,e){var i=e.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))}}));function cS(t,e,i){var n=t.ends;return new hS({shape:{points:i?function(t,e){return N(t,function(t){return(t=t.slice())[1]=e.initBaseline,t})}(n,t):n},z2:100})}function dS(t,e){for(var i=!0,n=0;n<e.ends.length;n++)if(t.contain(e.ends[n][0],e.ends[n][1])){i=!1;break}return i}function fS(t,e,i,n){var a=e.getItemModel(i),o=a.getModel(sS),r=e.getItemVisual(i,"color"),s=e.getItemVisual(i,"borderColor")||r,l=o.getItemStyle(uS);t.useStyle(l),t.style.strokeNoScale=!0,t.style.fill=r,t.style.stroke=s,t.__simpleBox=n,Os(t,a.getModel(lS).getItemStyle())}var pS=hr.extend({type:"largeCandlestickBox",shape:{},buildPath:function(t,e){for(var i=e.points,n=0;n<i.length;)if(this.__sign===i[n++]){var a=i[n++];t.moveTo(a,i[n++]),t.lineTo(a,i[n++])}else n+=3}});function gS(t,e,i){var n=t.getData(),a=n.getLayout("largePoints"),o=new pS({shape:{points:a},__sign:1});e.add(o);var r=new pS({shape:{points:a},__sign:-1});e.add(r),mS(1,o,t,n),mS(-1,r,t,n),i&&(o.incremental=!0,r.incremental=!0)}function mS(t,e,i,n){var a=0<t?"P":"N",o=n.getVisual("borderColor"+a)||n.getVisual("color"+a),r=i.getModel(sS).getItemStyle(uS);e.useStyle(r),e.style.fill=null,e.style.stroke=o}var vS=["itemStyle","borderColor"],yS=["itemStyle","borderColor0"],xS=["itemStyle","color"],_S=["itemStyle","color0"],wS={seriesType:"candlestick",plan:Jh(),performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=t.pipelineContext.large;if(i.setVisual({legendSymbol:"roundRect",colorP:o(1,t),colorN:o(-1,t),borderColorP:r(1,t),borderColorN:r(-1,t)}),!e.isSeriesFiltered(t))return!n&&{progress:function(t,e){var i;for(;null!=(i=t.next());){var n=e.getItemModel(i),a=e.getItemLayout(i).sign;e.setItemVisual(i,{color:o(a,n),borderColor:r(a,n)})}}};function o(t,e){return e.get(0<t?xS:_S)}function r(t,e){return e.get(0<t?vS:yS)}}},bS="undefined"!=typeof Float32Array?Float32Array:Array,SS={seriesType:"candlestick",plan:Jh(),reset:function(t){var x=t.coordinateSystem,e=t.getData(),_=function(t,e){var i,n=t.getBaseAxis(),a="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),o=xl(H(t.get("barMaxWidth"),a),a),r=xl(H(t.get("barMinWidth"),1),a),s=t.get("barWidth");return null!=s?xl(s,a):Math.max(Math.min(a/2,o),r)}(t,e),i=["x","y"],w=e.mapDimension(i[0]),n=e.mapDimension(i[1],!0),b=n[0],S=n[1],M=n[2],I=n[3];if(e.setLayout({candleWidth:_,isSimpleBox:_<=1.3}),!(null==w||n.length<4))return{progress:t.pipelineContext.large?function(t,e){var i,n,a=new bS(4*t.count),o=0,r=[],s=[];for(;null!=(n=t.next());){var l=e.get(w,n),u=e.get(b,n),h=e.get(S,n),c=e.get(M,n),d=e.get(I,n);isNaN(l)||isNaN(c)||isNaN(d)?(a[o++]=NaN,o+=3):(a[o++]=MS(e,n,u,h,S),r[0]=l,r[1]=c,i=x.dataToPoint(r,null,s),a[o++]=i?i[0]:NaN,a[o++]=i?i[1]:NaN,r[1]=d,i=x.dataToPoint(r,null,s),a[o++]=i?i[1]:NaN)}e.setLayout("largePoints",a)}:function(t,e){var i;for(;null!=(i=t.next());){var n=e.get(w,i),a=e.get(b,i),o=e.get(S,i),r=e.get(M,i),s=e.get(I,i),l=Math.min(a,o),u=Math.max(a,o),h=g(l,n),c=g(u,n),d=g(r,n),f=g(s,n),p=[];m(p,c,0),m(p,h,1),p.push(y(f),y(c),y(d),y(h)),e.setItemLayout(i,{sign:MS(e,i,a,o,S),initBaseline:o<a?c[1]:h[1],ends:p,brushRect:v(r,s,n)})}function g(t,e){var i=[];return i[0]=e,i[1]=t,isNaN(e)||isNaN(t)?[NaN,NaN]:x.dataToPoint(i)}function m(t,e,i){var n=e.slice(),a=e.slice();n[0]=_s(n[0]+_/2,1,!1),a[0]=_s(a[0]-_/2,1,!0),i?t.push(n,a):t.push(a,n)}function v(t,e,i){var n=g(t,i),a=g(e,i);return n[0]-=_/2,a[0]-=_/2,{x:n[0],y:n[1],width:_,height:a[1]-n[1]}}function y(t){return t[0]=_s(t[0],1),t}}}}};function MS(t,e,i,n,a){return n<i?-1:i<n?1:0<e?t.get(a,e-1)<=n?1:-1:1}Jd(function(t){t&&k(t.series)&&E(t.series,function(t){z(t)&&"k"===t.type&&(t.type="candlestick")})}),af(wS),nf(SS),Wh.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){return Xf(this.getSource(),this)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});function IS(t,e){var i=e.rippleEffectColor||e.color;t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?i:null,fill:"fill"===e.brushType?i:null}})})}function AS(t,e){Si.call(this);var i=new Sg(t,e),n=new Si;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(t,e)}var TS=AS.prototype;TS.stopEffectAnimation=function(){this.childAt(1).removeAll()},TS.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=this.childAt(1),a=0;a<3;a++){var o=Jp(e,-1,-1,2,2,i);o.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var r=-a/3*t.period+t.effectOffset;o.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(r).start(),o.animateStyle(!0).when(t.period,{opacity:0}).delay(r).start(),n.add(o)}IS(n,t)},TS.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],a=0;a<n.length;a++){var o=n[a];if(e[o]!==t[o])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}IS(i,t)},TS.highlight=function(){this.trigger("emphasis")},TS.downplay=function(){this.trigger("normal")},TS.updateData=function(t,e){var i=t.hostModel;this.childAt(0).updateData(t,e);var n=this.childAt(1),a=t.getItemModel(e),o=t.getItemVisual(e,"symbol"),r=function(t){return k(t)||(t=[+t,+t]),t}(t.getItemVisual(e,"symbolSize")),s=t.getItemVisual(e,"color");n.attr("scale",r),n.traverse(function(t){t.attr({fill:s})});var l=a.getShallow("symbolOffset");if(l){var u=n.position;u[0]=xl(l[0],r[0]),u[1]=xl(l[1],r[1])}n.rotation=(a.getShallow("symbolRotate")||0)*Math.PI/180||0;var h={};if(h.showEffectOn=i.get("showEffectOn"),h.rippleScale=a.get("rippleEffect.scale"),h.brushType=a.get("rippleEffect.brushType"),h.period=1e3*a.get("rippleEffect.period"),h.effectOffset=e/t.count(),h.z=a.getShallow("z")||0,h.zlevel=a.getShallow("zlevel")||0,h.symbolType=o,h.color=s,h.rippleEffectColor=a.get("rippleEffect.color"),this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===h.showEffectOn)this._effectCfg?this.updateEffectAnimation(h):this.startEffectAnimation(h),this._effectCfg=h;else{this._effectCfg=null,this.stopEffectAnimation();var c=this.childAt(0),d=function(){c.highlight(),"render"!==h.showEffectOn&&this.startEffectAnimation(h)},f=function(){c.downplay(),"render"!==h.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",d,this).on("mouseout",f,this).on("emphasis",d,this).on("normal",f,this)}this._effectCfg=h},TS.fadeOut=function(t){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),t&&t()},w(AS,Si),hf({type:"effectScatter",init:function(){this._symbolDraw=new Ng(AS)},render:function(t,e,i){var n=t.getData(),a=this._symbolDraw;a.updateData(n),this.group.add(a.group)},updateTransform:function(t,e,i){var n=t.getData();this.group.dirty();var a=sm().reset(t);a.progress&&a.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateGroupTransform:function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=se(e.getRoamTransform()),this.group.decomposeTransform())},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(e)},dispose:function(){}}),af(rm("effectScatter","circle")),nf(sm("effectScatter"));var DS="undefined"==typeof Uint32Array?Array:Uint32Array,CS="undefined"==typeof Float64Array?Array:Float64Array;function LS(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=N(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),p([e,t[0],t[1]])}))}var kS=Wh.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(t){t.data=t.data||[],LS(t);var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),kS.superApply(this,"init",arguments)},mergeOption:function(t){if(t.data=t.data||[],LS(t),t.data){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count))}kS.superApply(this,"mergeOption",arguments)},appendData:function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=tt(this._flatCoords,e.flatCoords),this._flatCoordsOffset=tt(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},_getCoordsFromItemModel:function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},getLineCoordsCount:function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},getLineCoords:function(t,e){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*t],n=this._flatCoordsOffset[2*t+1],a=0;a<n;a++)e[a]=e[a]||[],e[a][0]=this._flatCoords[i+2*a],e[a][1]=this._flatCoords[i+2*a+1];return n}var o=this._getCoordsFromItemModel(t);for(a=0;a<o.length;a++)e[a]=e[a]||[],e[a][0]=o[a][0],e[a][1]=o[a][1];return o.length},_processFlatCoordsArray:function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),"number"!=typeof t[0])return{flatCoordsOffset:null,flatCoords:null,count:t.length};for(var i=t.length,n=new DS(i),a=new CS(i),o=0,r=0,s=0,l=0;l<i;){s++;var u=t[l++];n[r++]=o+e,n[r++]=u;for(var h=0;h<u;h++){var c=t[l++],d=t[l++];a[o++]=c,a[o++]=d}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,r),flatCoords:a,count:s}},getInitialData:function(t,e){var o=new Tf(["value"],this);return o.hasItemOption=!1,o.initData(t.data,[],function(t,e,i,n){if(t instanceof Array)return NaN;o.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[n]:a:void 0}),o},formatTooltip:function(t){var e=this.getData().getItemModel(t),i=e.get("name");if(i)return i;var n=e.get("fromName"),a=e.get("toName"),o=[];return null!=n&&o.push(n),null!=a&&o.push(a),Wl(o.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!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}}});function PS(t,e,i){Si.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}var NS=PS.prototype;function OS(t,e,i){Si.call(this),this._createPolyline(t,e,i)}NS.createLine=function(t,e,i){return new E_(t,e,i)},NS._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),a=i.get("symbol");k(n)||(n=[n,n]);var o=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==a&&(this.remove(r),(r=Jp(a,-.5,-.5,1,1,o)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",o),r.setStyle(i.getItemStyle(["color"])),r.attr("scale",n),r.setColor(o),r.attr("scale",n),this._symbolType=a,this._updateEffectAnimation(t,i,e))},NS._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var a=this,o=e.getItemLayout(i),r=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=W(t.get("delay"),function(t){return t/e.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,o),0<l&&(r=this.getLineLength(n)/l*1e3),r!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),0<n.__t&&(c=-r*n.__t),n.__t=0;var d=n.animate("",s).when(r,{__t:1}).delay(c).during(function(){a.updateSymbolPosition(n)});s||d.done(function(){a.remove(n)}),d.start()}this._period=r,this._loop=s}},NS.getLineLength=function(t){return yt(t.__p1,t.__cp1)+yt(t.__cp1,t.__p2)},NS.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]},NS.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},NS.updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,a=t.__t,o=t.position,r=fo,s=po;o[0]=r(e[0],n[0],i[0],a),o[1]=r(e[1],n[1],i[1],a);var l=s(e[0],n[0],i[0],a),u=s(e[1],n[1],i[1],a);t.rotation=-Math.atan2(u,l)-Math.PI/2,t.ignore=!1},NS.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},w(PS,Si);var ES=OS.prototype;function RS(t,e,i){PS.call(this,t,e,i),this._lastFrame=0,this._lastFramePercent=0}ES._createPolyline=function(t,e,i){var n=t.getItemLayout(e),a=new zr({shape:{points:n}});this.add(a),this._updateCommonStl(t,e,i)},ES.updateData=function(t,e,i){var n=t.hostModel;js(this.childAt(0),{shape:{points:t.getItemLayout(e)}},n,e),this._updateCommonStl(t,e,i)},ES._updateCommonStl=function(t,e,i){var n=this.childAt(0),a=t.getItemModel(e),o=t.getItemVisual(e,"color"),r=i&&i.lineStyle,s=i&&i.hoverLineStyle;i&&!t.hasItemOption||(r=a.getModel("lineStyle").getLineStyle(),s=a.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(C({strokeNoScale:!0,fill:"none",stroke:o},r)),n.hoverStyle=s,Os(this)},ES.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},w(OS,Si);var zS=RS.prototype;zS.createLine=function(t,e,i){return new OS(t,e,i)},zS.updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,a=1;a<e.length;a++){var o=e[a-1],r=e[a];n+=yt(o,r),i.push(n)}if(0!==n){for(a=0;a<i.length;a++)i[a]/=n;this._offsets=i,this._length=n}},zS.getLineLength=function(t){return this._length},zS.updateSymbolPosition=function(t){var e=t.__t,i=this._points,n=this._offsets,a=i.length;if(n){var o=this._lastFrame;if(e<this._lastFramePercent){for(r=Math.min(o+1,a-1);0<=r&&!(n[r]<=e);r--);r=Math.min(r,a-2)}else{for(var r=o;r<a&&!(n[r]>e);r++);r=Math.min(r-1,a-2)}wt(t.position,i[r],i[r+1],(e-n[r])/(n[r+1]-n[r]));var s=i[r+1][0]-i[r][0],l=i[r+1][1]-i[r][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},w(RS,PS);var BS=ds({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(var a=0;a<i.length;){var o=i[a++];if(0<o){t.moveTo(i[a++],i[a++]);for(var r=1;r<o;r++)t.lineTo(i[a++],i[a++])}}else for(a=0;a<i.length;){var s=i[a++],l=i[a++],u=i[a++],h=i[a++];if(t.moveTo(s,l),0<n){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}},findDataIndex:function(t,e){var i=this.shape,n=i.segs,a=i.curveness;if(i.polyline)for(var o=0,r=0;r<n.length;){var s=n[r++];if(0<s)for(var l=n[r++],u=n[r++],h=1;h<s;h++){if(Zo(l,u,c=n[r++],d=n[r++]))return o}o++}else for(o=0,r=0;r<n.length;){l=n[r++],u=n[r++];var c=n[r++],d=n[r++];if(0<a){if(Xo(l,u,(l+c)/2-(u-d)*a,(u+d)/2-(c-l)*a,c,d))return o}else if(Zo(l,u,c,d))return o;o++}return-1}});function VS(){this.group=new Si}var GS=VS.prototype;GS.isPersistent=function(){return!this._incremental},GS.updateData=function(t){this.group.removeAll();var e=new BS({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},GS.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),5e5<t.count()?(this._incremental||(this._incremental=new ts({silent:!0})),this.group.add(this._incremental)):this._incremental=null},GS.incrementalUpdate=function(t,e){var i=new BS;i.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(i,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=t.start,this.group.add(i))},GS.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},GS._setCommon=function(i,t,e){var n=t.hostModel;i.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),i.useStyle(n.getModel("lineStyle").getLineStyle()),i.style.strokeNoScale=!0;var a=t.getVisual("color");a&&i.setStyle("stroke",a),i.setStyle("fill"),e||(i.seriesIndex=n.seriesIndex,i.on("mousemove",function(t){i.dataIndex=null;var e=i.findDataIndex(t.offsetX,t.offsetY);0<e&&(i.dataIndex=e+i.__startIndex)}))},GS._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var FS={seriesType:"lines",plan:Jh(),reset:function(g){var m=g.coordinateSystem,v=g.get("polyline"),y=g.pipelineContext.large;return{progress:function(t,e){var i=[];if(y){var n,a=t.end-t.start;if(v){for(var o=0,r=t.start;r<t.end;r++)o+=g.getLineCoordsCount(r);n=new Float32Array(a+2*o)}else n=new Float32Array(4*a);var s=0,l=[];for(r=t.start;r<t.end;r++){var u=g.getLineCoords(r,i);v&&(n[s++]=u);for(var h=0;h<u;h++)l=m.dataToPoint(i[h],!1,l),n[s++]=l[0],n[s++]=l[1]}e.setLayout("linesPoints",n)}else for(r=t.start;r<t.end;r++){var c=e.getItemModel(r),d=(u=g.getLineCoords(r,i),[]);if(v)for(var f=0;f<u;f++)d.push(m.dataToPoint(i[f]));else{d[0]=m.dataToPoint(i[0]),d[1]=m.dataToPoint(i[1]);var p=c.get("lineStyle.curveness");+p&&(d[2]=[(d[0][0]+d[1][0])/2-(d[0][1]-d[1][1])*p,(d[0][1]+d[1][1])/2-(d[1][0]-d[0][0])*p])}e.setItemLayout(r,d)}}}}};function WS(t){return t instanceof Array||(t=[t,t]),t}hf({type:"lines",init:function(){},render:function(t,e,i){var n=t.getData(),a=this._updateLineDraw(n,t),o=t.get("zlevel"),r=t.get("effect.trailLength"),s=i.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&r&&(l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(r/10+.9,1),0)})),a.updateData(n);var u=t.get("clip",!0)&&tm(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},incrementalPrepareRender:function(t,e,i){var n=t.getData();this._updateLineDraw(n,t).incrementalPrepareUpdate(n),this._clearLayer(i),this._finished=!1},incrementalRender:function(t,e,i){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,i){var n=t.getData(),a=t.pipelineContext;if(!this._finished||a.large||a.progressiveRender)return{update:!0};var o=FS.reset(t);o.progress&&o.progress({start:0,end:n.count()},n),this._lineDraw.updateLayout(),this._clearLayer(i)},_updateLineDraw:function(t,e){var i=this._lineDraw,n=this._showEffect(e),a=!!e.get("polyline"),o=e.pipelineContext.large;return i&&n===this._hasEffet&&a===this._isPolyline&&o===this._isLargeDraw||(i&&i.remove(),i=this._lineDraw=o?new VS:new z_(a?n?RS:OS:n?PS:E_),this._hasEffet=n,this._isPolyline=a,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},_showEffect:function(t){return!!t.get("effect.show")},_clearLayer:function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},dispose:function(){}});var HS="lineStyle.opacity".split("."),ZS={seriesType:"lines",reset:function(t,e,i){var n=WS(t.get("symbol")),a=WS(t.get("symbolSize")),o=t.getData();return o.setVisual("fromSymbol",n&&n[0]),o.setVisual("toSymbol",n&&n[1]),o.setVisual("fromSymbolSize",a&&a[0]),o.setVisual("toSymbolSize",a&&a[1]),o.setVisual("opacity",t.get(HS)),{dataEach:o.hasItemOption?function(t,e){var i=t.getItemModel(e),n=WS(i.getShallow("symbol",!0)),a=WS(i.getShallow("symbolSize",!0)),o=i.get(HS);n[0]&&t.setItemVisual(e,"fromSymbol",n[0]),n[1]&&t.setItemVisual(e,"toSymbol",n[1]),a[0]&&t.setItemVisual(e,"fromSymbolSize",a[0]),a[1]&&t.setItemVisual(e,"toSymbolSize",a[1]),t.setItemVisual(e,"opacity",o)}:null}}};nf(FS),af(ZS),Wh.extend({type:"series.heatmap",getInitialData:function(t,e){return Xf(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var t=Hu.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});function US(){var t=g();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}US.prototype={update:function(t,e,i,n,a,o){var r=this._getBrush(),s=this._getGradient(t,a,"inRange"),l=this._getGradient(t,a,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=t.length;h.width=e,h.height=i;for(var f=0;f<d;++f){var p=t[f],g=p[0],m=p[1],v=n(p[2]);c.globalAlpha=v,c.drawImage(r,g-u,m-u)}if(!h.width||!h.height)return h;for(var y=c.getImageData(0,0,h.width,h.height),x=y.data,_=0,w=x.length,b=this.minOpacity,S=this.maxOpacity-b;_<w;){v=x[_+3]/256;var M=4*Math.floor(255*v);if(0<v){var I=o(v)?s:l;0<v&&(v=v*S+b),x[_++]=I[M],x[_++]=I[1+M],x[_++]=I[2+M],x[_++]=I[3+M]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=g()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},_getGradient:function(t,e,i){for(var n=this._gradientPixels,a=n[i]||(n[i]=new Uint8ClampedArray(1024)),o=[0,0,0,0],r=0,s=0;s<256;s++)e[i](s/255,!0,o),a[r++]=o[0],a[r++]=o[1],a[r++]=o[2],a[r++]=o[3];return a}},hf({type:"heatmap",render:function(i,t,e){var n;t.eachComponent("visualMap",function(e){e.eachTargetSeries(function(t){t===i&&(n=e)})}),this.group.removeAll(),this._incrementalDisplayable=null;var a=i.coordinateSystem;"cartesian2d"===a.type||"calendar"===a.type?this._renderOnCartesianAndCalendar(i,e,0,i.getData().count()):function(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}(a)&&this._renderOnGeo(a,i,n,e)},incrementalPrepareRender:function(t,e,i){this.group.removeAll()},incrementalRender:function(t,e,i,n){e.coordinateSystem&&this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)},_renderOnCartesianAndCalendar:function(t,e,i,n,a){var o,r,s=t.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");o=l.getBandWidth(),r=u.getBandWidth()}for(var h=this.group,c=t.getData(),d="emphasis.itemStyle",f="emphasis.label",p=t.getModel("itemStyle").getItemStyle(["color"]),g=t.getModel(d).getItemStyle(),m=t.getModel("label"),v=t.getModel(f),y=s.type,x="cartesian2d"===y?[c.mapDimension("x"),c.mapDimension("y"),c.mapDimension("value")]:[c.mapDimension("time"),c.mapDimension("value")],_=i;_<n;_++){var w;if("cartesian2d"===y){if(isNaN(c.get(x[2],_)))continue;var b=s.dataToPoint([c.get(x[0],_),c.get(x[1],_)]);w=new Hr({shape:{x:b[0]-o/2,y:b[1]-r/2,width:o,height:r},style:{fill:c.getItemVisual(_,"color"),opacity:c.getItemVisual(_,"opacity")}})}else{if(isNaN(c.get(x[1],_)))continue;w=new Hr({z2:1,shape:s.dataToRect([c.get(x[0],_)]).contentShape,style:{fill:c.getItemVisual(_,"color"),opacity:c.getItemVisual(_,"opacity")}})}var S=c.getItemModel(_);c.hasItemOption&&(p=S.getModel("itemStyle").getItemStyle(["color"]),g=S.getModel(d).getItemStyle(),m=S.getModel("label"),v=S.getModel(f));var M=t.getRawValue(_),I="-";M&&null!=M[2]&&(I=M[2]),Bs(p,g,m,v,{labelFetcher:t,labelDataIndex:_,defaultText:I,isRectText:!0}),w.setStyle(p),Os(w,c.hasItemOption?g:L({},g)),(w.incremental=a)&&(w.useHoverLayer=!0),h.add(w),c.setItemGraphicEl(_,w)}},_renderOnGeo:function(a,t,e,i){var n=e.targetVisuals.inRange,o=e.targetVisuals.outOfRange,r=t.getData(),s=this._hmLayer||this._hmLayer||new US;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=a.getViewRect().clone(),u=a.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,i.getWidth()),f=Math.min(l.height+l.y,i.getHeight()),p=d-h,g=f-c,m=[r.mapDimension("lng"),r.mapDimension("lat"),r.mapDimension("value")],v=r.mapArray(m,function(t,e,i){var n=a.dataToPoint([t,e]);return n[0]-=h,n[1]-=c,n.push(i),n}),y=e.getExtent(),x="visualMap.continuous"===e.type?function(t,e){var i=t[1]-t[0];return e=[(e[0]-t[0])/i,(e[1]-t[0])/i],function(t){return t>=e[0]&&t<=e[1]}}(y,e.option.range):function(e,n,a){var i=e[1]-e[0],o=(n=N(n,function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}})).length,r=0;return function(t){for(var e=r;e<o;e++){if((i=n[e].interval)[0]<=t&&t<=i[1]){r=e;break}}if(e===o)for(e=r-1;0<=e;e--){var i;if((i=n[e].interval)[0]<=t&&t<=i[1]){r=e;break}}return 0<=e&&e<o&&a[e]}}(y,e.getPieceList(),e.option.selected);s.update(v,p,g,n.color.getNormalizer(),{inRange:n.color.getColorMapper(),outOfRange:o.color.getColorMapper()},x);var _=new Yn({style:{width:p,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(_)},dispose:function(){}});var XS=Qm.extend({type:"series.pictorialBar",dependencies:["grid"],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,hoverAnimation:!1},getInitialData:function(t){return t.stack=null,XS.superApply(this,"getInitialData",arguments)}}),YS=["itemStyle","borderWidth"],jS=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],qS=new Lr;hf({type:"pictorialBar",render:function(t,e,i){var r=this.group,s=t.getData(),l=this._data,n=t.coordinateSystem,a=!!n.getBaseAxis().isHorizontal(),o=n.grid.getRect(),u={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:n,coordSysExtent:[[o.x,o.x+o.width],[o.y,o.y+o.height]],isHorizontal:a,valueDim:jS[+a],categoryDim:jS[1-a]};return s.diff(l).add(function(t){if(s.hasValue(t)){var e=nM(s,t),i=KS(s,t,e,u),n=sM(s,u,i);s.setItemGraphicEl(t,n),r.add(n),dM(n,u,i)}}).update(function(t,e){var i=l.getItemGraphicEl(e);if(s.hasValue(t)){var n=nM(s,t),a=KS(s,t,n,u),o=uM(s,a);i&&o!==i.__pictorialShapeStr&&(r.remove(i),s.setItemGraphicEl(t,null),i=null),i?function(t,e,i){var n=i.animationModel,a=i.dataIndex;js(t.__pictorialBundle,{position:i.bundlePosition.slice()},n,a),i.symbolRepeat?QS(t,e,i,!0):tM(t,e,i,!0);eM(t,i,!0),iM(t,e,i,!0)}(i,u,a):i=sM(s,u,a,!0),s.setItemGraphicEl(t,i),i.__pictorialSymbolMeta=a,r.add(i),dM(i,u,a)}else r.remove(i)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&lM(l,t,e.__pictorialSymbolMeta.animationModel,e)}).execute(),this._data=s,this.group},dispose:et,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl(function(t){lM(n,t.dataIndex,e,t)}):i.removeAll()}});function KS(t,e,i,n){var a=t.getItemLayout(e),o=i.get("symbolRepeat"),r=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:e,layout:a,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:r,symbolRepeat:o,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};!function(t,e,i,n,a){var o,r=n.valueDim,s=t.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[r.wh]<=0);if(k(s)){var c=[$S(l,s[0])-u,$S(l,s[1])-u];c[1]<c[0]&&c.reverse(),o=c[h]}else o=null!=s?$S(l,s)-u:e?n.coordSysExtent[r.index][h]-u:i[r.wh];a.boundingLength=o,e&&(a.repeatCutLength=i[r.wh]);a.pxSign=0<o?1:o<0?-1:0}(i,o,a,n,c),function(t,e,i,n,a,o,r,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=t.getItemVisual(e,"symbolSize");f=k(f)?f.slice():(null==f&&(f="100%"),[f,f]);f[c.index]=xl(f[c.index],d),f[h.index]=xl(f[h.index],n?d:Math.abs(o)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*r}(t,e,a,o,0,c.boundingLength,c.pxSign,u,n,c),function(t,e,i,n,a){var o=t.get(YS)||0;o&&(qS.attr({scale:e.slice(),rotation:i}),qS.updateTransform(),o/=qS.getLineScale(),o*=e[n.valueDim.index]);a.valueLineWidth=o}(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return k(f)&&(f=[xl(f[0],d[0]),xl(f[1],d[1])]),function(t,e,i,n,a,o,r,s,l,u,h,c){var d=h.categoryDim,f=h.valueDim,p=c.pxSign,g=Math.max(e[f.index]+s,0),m=g;if(n){var v=Math.abs(l),y=W(t.get("symbolMargin"),"15%")+"",x=!1;y.lastIndexOf("!")===y.length-1&&(x=!0,y=y.slice(0,y.length-1)),y=xl(y,e[f.index]);var _=Math.max(g+2*y,0),w=x?0:2*y,b=El(n),S=b?n:fM((v+w)/_);_=g+2*(y=(v-S*g)/2/(x?S:S-1)),w=x?0:2*y,b||"fixed"===n||(S=u?fM((Math.abs(u)+w)/_):0),m=S*_-w,c.repeatTimes=S,c.symbolMargin=y}var M=p*(m/2),I=c.pathPosition=[];I[d.index]=i[d.wh]/2,I[f.index]="start"===r?M:"end"===r?l-M:l/2,o&&(I[0]+=o[0],I[1]+=o[1]);var A=c.bundlePosition=[];A[d.index]=i[d.xy],A[f.index]=i[f.xy];var T=c.barRectShape=L({},i);T[f.wh]=p*Math.max(Math.abs(i[f.wh]),Math.abs(I[f.index]+M)),T[d.wh]=i[d.wh];var D=c.clipShape={};D[d.xy]=-i[d.xy],D[d.wh]=h.ecSize[d.wh],D[f.xy]=0,D[f.wh]=i[f.wh]}(i,d,a,o,0,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function $S(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function JS(t){var e=t.symbolPatternSize,i=Jp(t.symbolType,-e/2,-e/2,e,e,t.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function QS(t,e,a,i){var n=t.__pictorialBundle,o=a.symbolSize,r=a.valueLineWidth,s=a.pathPosition,l=e.valueDim,u=a.repeatTimes||0,h=0,c=o[e.valueDim.index]+r+2*a.symbolMargin;for(hM(t,function(t){t.__pictorialAnimationIndex=h,t.__pictorialRepeatTimes=u,h<u?cM(t,null,p(h),a,i):cM(t,null,{scale:[0,0]},a,i,function(){n.remove(t)}),rM(t,a),h++});h<u;h++){var d=JS(a);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,n.add(d);var f=p(h);cM(d,{position:f.position,scale:[0,0]},{scale:f.scale,rotation:f.rotation},a,i),d.on("mouseover",g).on("mouseout",m),rM(d,a)}function p(t){var e=s.slice(),i=a.pxSign,n=t;return("start"===a.symbolRepeatDirection?0<i:i<0)&&(n=u-1-t),e[l.index]=c*(n-u/2+.5)+s[l.index],{position:e,scale:a.symbolScale.slice(),rotation:a.rotation}}function g(){hM(t,function(t){t.trigger("emphasis")})}function m(){hM(t,function(t){t.trigger("normal")})}}function tM(t,e,i,n){var a=t.__pictorialBundle,o=t.__pictorialMainPath;o?cM(o,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(o=t.__pictorialMainPath=JS(i),a.add(o),cM(o,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),o.on("mouseover",function(){this.trigger("emphasis")}).on("mouseout",function(){this.trigger("normal")})),rM(o,i)}function eM(t,e,i){var n=L({},e.barRectShape),a=t.__pictorialBarRect;a?cM(a,null,{shape:n},e,i):(a=t.__pictorialBarRect=new Hr({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),t.add(a))}function iM(t,e,i,n){if(i.symbolClip){var a=t.__pictorialClipPath,o=L({},i.clipShape),r=e.valueDim,s=i.animationModel,l=i.dataIndex;if(a)js(a,{shape:o},s,l);else{o[r.wh]=0,a=new Hr({shape:o}),t.__pictorialBundle.setClipPath(a),t.__pictorialClipPath=a;var u={};u[r.wh]=i.clipShape[r.wh],ol[n?"updateProps":"initProps"](a,{shape:u},s,l)}}}function nM(t,e){var i=t.getItemModel(e);return i.getAnimationDelayParams=aM,i.isAnimationEnabled=oM,i}function aM(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function oM(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function rM(t,e){t.off("emphasis").off("normal");var i=e.symbolScale.slice();e.hoverAnimation&&t.on("emphasis",function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")}).on("normal",function(){this.animateTo({scale:i.slice()},400,"elasticOut")})}function sM(t,e,i,n){var a=new Si,o=new Si;return a.add(o),(a.__pictorialBundle=o).attr("position",i.bundlePosition.slice()),i.symbolRepeat?QS(a,e,i):tM(a,0,i),eM(a,i,n),iM(a,e,i,n),a.__pictorialShapeStr=uM(t,i),a.__pictorialSymbolMeta=i,a}function lM(t,e,i,n){var a=n.__pictorialBarRect;a&&(a.style.text=null);var o=[];hM(n,function(t){o.push(t)}),n.__pictorialMainPath&&o.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),E(o,function(t){js(t,{scale:[0,0]},i,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function uM(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function hM(e,i,n){E(e.__pictorialBundle.children(),function(t){t!==e.__pictorialBarRect&&i.call(n,t)})}function cM(t,e,i,n,a,o){e&&t.attr(e),n.symbolClip&&!a?i&&t.attr(i):i&&ol[a?"updateProps":"initProps"](t,i,n.animationModel,n.dataIndex,o)}function dM(t,e,i){var n=i.color,a=i.dataIndex,o=i.itemModel,r=o.getModel("itemStyle").getItemStyle(["color"]),s=o.getModel("emphasis.itemStyle").getItemStyle(),l=o.getShallow("cursor");hM(t,function(t){t.setColor(n),t.setStyle(C({fill:n,opacity:i.opacity},r)),Os(t,s),l&&(t.cursor=l),t.z2=i.z2});var u={},h=(e.valueDim.posDesc[+(0<i.boundingLength)],t.__pictorialBarRect);tv(h.style,u,o,n,e.seriesModel,a),Os(h,u)}function fM(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}nf(A(pp,"pictorialBar")),af(rm("pictorialBar","roundRect"));function pM(t,e,i,n,a){vg.call(this,t,e,i),this.type=n||"value",this.position=a||"bottom",this.orient=null}function gM(t,e,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,i),this.model=t}function mM(t,e){e=e||{};var i=t.coordinateSystem,n=t.axis,a={},o=n.position,r=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};a.position=["vertical"===r?u.vertical[o]:l[0],"horizontal"===r?u.horizontal[o]:l[3]];a.rotation=Math.PI/2*{horizontal:0,vertical:1}[r];a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],t.get("axisTick.inside")&&(a.tickDirection=-a.tickDirection),W(e.labelInside,t.get("axisLabel.inside"))&&(a.labelDirection=-a.labelDirection);var h=e.rotate;return null==h&&(h=t.get("axisLabel.rotate")),a.labelRotation="top"===o?-h:h,a.z2=1,a}pM.prototype={constructor:pM,model:null,isHorizontal:function(){var t=this.position;return"top"===t||"bottom"===t},pointToData:function(t,e){return this.coordinateSystem.pointToData(t,e)[0]},toGlobalCoord:null,toLocalCoord:null},w(pM,vg),Hu.register("single",{create:function(n,a){var o=[];return n.eachComponent("singleAxis",function(t,e){var i=new gM(t,n,a);i.name="single_"+e,i.resize(t,a),t.coordinateSystem=i,o.push(i)}),n.eachSeries(function(t){if("singleAxis"===t.get("coordinateSystem")){var e=n.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=e&&e.coordinateSystem}}),o},dimensions:(gM.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:gM,_init:function(t,e,i){var n=this.dimension,a=new pM(n,Bp(t),[0,0],t.get("type"),t.get("position")),o="category"===a.type;a.onBand=o&&t.get("boundaryGap"),a.inverse=t.get("inverse"),a.orient=t.get("orient"),(t.axis=a).model=t,(a.coordinateSystem=this)._axis=a},update:function(t,e){t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData();E(e.mapDimension(this.dimension,!0),function(t){this._axis.scale.unionExtentFromData(e,t)},this),zp(this._axis.scale,this._axis.model)}},this)},resize:function(t,e){this._rect=au({left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")},{width:e.getWidth(),height:e.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var t=this._rect,e=this._axis,i=e.isHorizontal(),n=i?[0,t.width]:[0,t.height],a=e.reverse?1:0;e.setExtent(n[a],n[1-a]),this._updateAxisTransform(e,i?t.x:t.y)},_updateAxisTransform:function(t,e){var i=t.getExtent(),n=i[0]+i[1],a=t.isHorizontal();t.toGlobalCoord=a?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord=a?function(t){return t-e}:function(t){return n-t+e}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(t){var e=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],a="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[a]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-a]=0==a?i.y+i.height/2:i.x+i.width/2,n}}).dimensions});var vM=["axisLine","axisTickLabel","axisName"],yM="splitLine",xM=Um.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var a=this.group;a.removeAll();var o=mM(t),r=new Cm(t,o);E(vM,r.add,r),a.add(r.getGroup()),t.get(yM+".show")&&this["_"+yM](t),xM.superCall(this,"render",t,e,i,n)},_splitLine:function(t){var e=t.axis;if(!e.scale.isBlank()){var i=t.getModel("splitLine"),n=i.getModel("lineStyle"),a=n.get("width"),o=n.get("color");o=o instanceof Array?o:[o];for(var r=t.coordinateSystem.getRect(),s=e.isHorizontal(),l=[],u=0,h=e.getTicksCoords({tickModel:i}),c=[],d=[],f=0;f<h.length;++f){var p=e.toGlobalCoord(h[f].coord);s?(c[0]=p,c[1]=r.y,d[0]=p,d[1]=r.y+r.height):(c[0]=r.x,c[1]=p,d[0]=r.x+r.width,d[1]=p);var g=u++%o.length;l[g]=l[g]||[],l[g].push(new Ur({subPixelOptimize:!0,shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:{lineWidth:a},silent:!0}))}for(f=0;f<l.length;++f)this.group.add(ys(l[f],{style:{stroke:o[f%o.length],lineDash:n.getLineDash(a),lineWidth:a},silent:!0}))}}}),_M=fu.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}});m(_M.prototype,Hp),mm("single",_M,function(t,e){return e.type||(e.data?"category":"value")},{left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}});function wM(t,e){var i,n=[],a=t.seriesIndex;if(null==a||!(i=e.getSeriesByIndex(a)))return{point:[]};var o=i.getData(),r=Ca(o,t);if(null==r||r<0||k(r))return{point:[]};var s=o.getItemGraphicEl(r),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(r)||[];else if(l&&l.dataToPoint)n=l.dataToPoint(o.getValues(N(l.dimensions,function(t){return o.mapDimension(t)}),r,!0))||[];else if(s){var u=s.getBoundingRect().clone();u.applyTransform(s.transform),n=[u.x+u.width/2,u.y+u.height/2]}return{point:n,el:s}}var bM=E,SM=A,MM=La();function IM(t,e,i,n,a){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var r=function(l,t){var u=t.axis,h=u.dim,c=l,d=[],f=Number.MAX_VALUE,p=-1;return bM(t.seriesModels,function(e,t){var i,n,a=e.getData().mapDimension(h,!0);if(e.getAxisTooltipData){var o=e.getAxisTooltipData(a,l,u);n=o.dataIndices,i=o.nestestValue}else{if(!(n=e.getData().indicesOfNearest(a[0],l,"category"===u.type?.5:null)).length)return;i=e.getData().get(a[0],n[0])}if(null!=i&&isFinite(i)){var r=l-i,s=Math.abs(r);s<=f&&((s<f||0<=r&&p<0)&&(f=s,p=r,c=i,d.length=0),bM(n,function(t){d.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:d,snapToValue:c}}(e,t),s=r.payloadBatch,l=r.snapToValue;s[0]&&null==a.seriesIndex&&L(a,s[0]),!n&&t.snap&&o.containData(l)&&null!=l&&(e=l),i.showPointer(t,e,s,a),i.showTooltip(t,r,l)}else i.showPointer(t,e)}function AM(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function TM(t,e,i,n){var a=i.payloadBatch,o=e.axis,r=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&a.length){var l=e.coordSys.model,u=Zm(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:r.componentIndex,axisType:r.type,axisId:r.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:a.slice()})}}function DM(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function CM(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}sf({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},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}}});var LM=La(),kM=E;function PM(t,e,i){if(!v.node){var n=e.getZr();LM(n).records||(LM(n).records={}),function(a,o){if(LM(a).initialized)return;function t(t,n){a.on(t,function(e){var i=function(i){var n={showTip:[],hideTip:[]},a=function(t){var e=n[t.type];e?e.push(t):(t.dispatchAction=a,i.dispatchAction(t))};return{dispatchAction:a,pendings:n}}(o);kM(LM(a).records,function(t){t&&n(t,e,i.dispatchAction)}),function(t,e){var i,n=t.showTip.length,a=t.hideTip.length;n?i=t.showTip[n-1]:a&&(i=t.hideTip[a-1]);i&&(i.dispatchAction=null,e.dispatchAction(i))}(i.pendings,o)})}LM(a).initialized=!0,t("click",A(OM,"click")),t("mousemove",A(OM,"mousemove")),t("globalout",NM)}(n,e),(LM(n).records[t]||(LM(n).records[t]={})).handler=i}}function NM(t,e,i){t.handler("leave",null,i)}function OM(t,e,i,n){e.handler(t,i,n)}function EM(t,e){if(!v.node){var i=e.getZr();(LM(i).records||{})[t]&&(LM(i).records[t]=null)}}var RM=lf({type:"axisPointer",render:function(t,e,i){var n=e.getComponent("tooltip"),a=t.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";PM("axisPointer",i,function(t,e,i){"none"!==a&&("leave"===t||0<=a.indexOf(t))&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){EM(e.getZr(),"axisPointer"),RM.superApply(this._model,"remove",arguments)},dispose:function(t,e){EM("axisPointer",e),RM.superApply(this._model,"dispose",arguments)}}),zM=La(),BM=D,VM=T;function GM(){}function FM(t,e,i,n){!function i(n,t){{if(z(n)&&z(t)){var a=!0;return E(t,function(t,e){a=a&&i(n[e],t)}),!!a}return n===t}}(zM(i).lastProp,n)&&(zM(i).lastProp=n,e?js(i,n,t):(i.stopAnimation(),i.attr(n)))}function WM(t,e){t[e.get("label.show")?"show":"hide"]()}function HM(t){return{position:t.position.slice(),rotation:t.rotation||0}}function ZM(t,e,i){var n=e.get("z"),a=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=a&&(t.zlevel=a),t.silent=i)})}function UM(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}function XM(t,e,i,n,a){var o=YM(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),r=i.getModel("label"),s=Vl(r.get("padding")||0),l=r.getFont(),u=un(o,l),h=a.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=a.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=a.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),function(t,e,i,n){var a=n.getWidth(),o=n.getHeight();t[0]=Math.min(t[0]+e,a)-e,t[1]=Math.min(t[1]+i,o)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,n);var g=r.get("backgroundColor");g&&"auto"!==g||(g=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:c,height:d,r:r.get("borderRadius")},position:h.slice(),style:{text:o,textFont:l,textFill:r.getTextColor(),textPosition:"inside",textPadding:s,fill:g,stroke:r.get("borderColor")||"transparent",lineWidth:r.get("borderWidth")||0,shadowBlur:r.get("shadowBlur"),shadowColor:r.get("shadowColor"),shadowOffsetX:r.get("shadowOffsetX"),shadowOffsetY:r.get("shadowOffsetY")},z2:10}}function YM(t,e,a,i,n){t=e.scale.parse(t);var o=e.scale.getLabel(t,{precision:n.precision}),r=n.formatter;if(r){var s={value:Gp(e,t),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};E(i,function(t){var e=a.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,n=e&&e.getDataParams(i);n&&s.seriesData.push(n)}),R(r)?o=r.replace("{value}",o):O(r)&&(o=r(s))}return o}function jM(t,e,i){var n=Qt();return ae(n,n,i.rotation),ne(n,n,i.position),$s([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}function qM(t,e,i,n,a,o){var r=Cm.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=a.get("label.margin"),XM(e,n,a,o,{position:jM(n.axis,t,i),align:r.textAlign,verticalAlign:r.textVerticalAlign})}function KM(t,e,i){return{x1:t[i=i||0],y1:t[1-i],x2:e[i],y2:e[1-i]}}function $M(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}function JM(t,e,i,n,a,o){return{cx:t,cy:e,r0:i,r:n,startAngle:a,endAngle:o,clockwise:!0}}Ga((GM.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,i,n){var a=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==a||this._lastStatus!==o){this._lastValue=a,this._lastStatus=o;var r=this._group,s=this._handle;if(!o||"hide"===o)return r&&r.hide(),void(s&&s.hide());r&&r.show(),s&&s.show();var l={};this.makeElOption(l,a,t,e,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(r){var c=A(FM,e,h);this.updatePointerEl(r,l,c,e),this.updateLabelEl(r,l,c,e)}else r=this._group=new Si,this.createPointerEl(r,l,t,e),this.createLabelEl(r,l,t,e),i.getZr().add(r);ZM(r,e,!0),this._renderHandle(a)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var i=e.get("animation"),n=t.axis,a="category"===n.type,o=e.get("snap");if(!o&&!a)return!1;if("auto"!==i&&null!=i)return!0===i;var r=this.animationThreshold;if(a&&n.getBandWidth()>r)return!0;if(o){var s=Wm(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1},makeElOption:function(t,e,i,n,a){},createPointerEl:function(t,e,i,n){var a=e.pointer;if(a){var o=zM(t).pointerEl=new ol[a.type](BM(e.pointer));t.add(o)}},createLabelEl:function(t,e,i,n){if(e.label){var a=zM(t).labelEl=new Hr(BM(e.label));t.add(a),WM(a,n)}},updatePointerEl:function(t,e,i){var n=zM(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var a=zM(t).labelEl;a&&(a.setStyle(e.label.style),i(a,{shape:e.label.shape,position:e.label.position}),WM(a,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,n=this._api.getZr(),a=this._handle,o=i.getModel("handle"),r=i.get("status");if(!o.get("show")||!r||"hide"===r)return a&&n.remove(a),void(this._handle=null);this._handle||(e=!0,a=this._handle=el(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Ft(t.event)},onmousedown:VM(this._onHandleDragMove,this,0,0),drift:VM(this._onHandleDragMove,this),ondragend:VM(this._onHandleDragEnd,this)}),n.add(a)),ZM(a,i,!1);a.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");k(s)||(s=[s,s]),a.attr("scale",[s[0]/2,s[1]/2]),dc(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},_moveHandleToValue:function(t,e){FM(this._axisPointerModel,!e&&this._moveAnimation,this._handle,HM(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(HM(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(HM(n)),zM(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=GM);var QM=GM.extend({makeElOption:function(t,e,i,n,a){var o=i.axis,r=o.grid,s=n.get("type"),l=tI(r,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var h=UM(n),c=eI[s](o,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}qM(e,t,qm(r.model,i),i,n,a)},getHandleTransform:function(t,e,i){var n=qm(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:jM(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var a=i.axis,o=a.grid,r=a.getGlobalExtent(!0),s=tI(o,a).getOtherAxis(a).getGlobalExtent(),l="x"===a.dim?0:1,u=t.position;u[l]+=e[l],u[l]=Math.min(r[1],u[l]),u[l]=Math.max(r[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function tI(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}var eI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:KM([e,i[0]],[e,i[1]],iI(t))}},shadow:function(t,e,i){var n=Math.max(1,t.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:$M([e-n/2,i[0]],[n,a],iI(t))}}};function iI(t){return"x"===t.dim?0:1}Um.registerAxisPointerClass("CartesianAxisPointer",QM),Jd(function(t){if(t){t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={});var e=t.axisPointer.link;e&&!k(e)&&(t.axisPointer.link=[e])}}),Qd(cd.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=Gm(t,e)}),tf({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,r=[t.x,t.y],a=t,o=t.dispatchAction||T(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){CM(r)&&(r=wM({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=CM(r),u=a.axesInfo,h=s.axesInfo,c="leave"===n||CM(r),d={},f={},p={list:[],map:{}},g={showPointer:SM(AM,f),showTooltip:SM(TM,p)};bM(s.coordSysMap,function(t,e){var o=l||t.containPoint(r);bM(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,n=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(u,t);if(!c&&o&&(!u||n)){var a=n&&n.value;null!=a||l||(a=i.pointToData(r)),null!=a&&IM(t,a,g,!1,d)}})});var m={};return bM(h,function(a,t){var o=a.linkGroup;o&&!f[t]&&bM(o.axesInfo,function(t,e){var i=f[e];if(t!==a&&i){var n=i.value;o.mapper&&(n=a.axis.scale.parse(o.mapper(n,DM(t),DM(a)))),m[a.key]=n}})}),bM(m,function(t,e){IM(h[e],t,g,!0,d)}),function(a,t,e){var o=e.axesInfo=[];bM(t,function(t,e){var i=t.axisPointerModel.option,n=a[e];n?(t.useHandle||(i.status="show"),i.value=n.value,i.seriesDataIndices=(n.payloadBatch||[]).slice()):t.useHandle||(i.status="hide"),"show"===i.status&&o.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}(f,h,d),function(t,e,i,n){if(CM(e)||!t.list.length)return n({type:"hideTip"});var a=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:t.list})}(p,r,t,o),function(t,e,i){var n=i.getZr(),a="axisPointerLastHighlights",o=MM(n)[a]||{},r=MM(n)[a]={};bM(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&bM(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var s=[],l=[];E(o,function(t,e){r[e]||l.push(t)}),E(r,function(t,e){o[e]||s.push(t)}),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}});var nI=["x","y"],aI=["width","height"],oI=GM.extend({makeElOption:function(t,e,i,n,a){var o=i.axis,r=o.coordinateSystem,s=lI(r,1-sI(o)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=UM(n),c=rI[u](o,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}qM(e,t,mM(i),i,n,a)},getHandleTransform:function(t,e,i){var n=mM(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:jM(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var a=i.axis,o=a.coordinateSystem,r=sI(a),s=lI(o,r),l=t.position;l[r]+=e[r],l[r]=Math.min(s[1],l[r]),l[r]=Math.max(s[0],l[r]);var u=lI(o,1-r),h=(u[1]+u[0])/2,c=[h,h];return c[r]=l[r],{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),rI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:KM([e,i[0]],[e,i[1]],sI(t))}},shadow:function(t,e,i){var n=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:$M([e-n/2,i[0]],[n,a],sI(t))}}};function sI(t){return t.isHorizontal()?0:1}function lI(t,e){var i=t.getRect();return[i[nI[e]],i[nI[e]]+i[aI[e]]]}Um.registerAxisPointerClass("SingleAxisPointer",oI),lf({type:"single"});var uI=Wh.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){uI.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){var e=t.length,i=Ra(t,function(t){return t[2]}),n=[];i.buckets.each(function(t,e){n.push({name:e,dataList:t})});for(var a=n.length,o=-1,r=-1,s=0;s<a;++s){var l=n[s].dataList.length;o<l&&(o=l,r=s)}for(var u=0;u<a;++u)if(u!==r)for(var h=n[u].name,c=0;c<o;++c){for(var d=n[r].dataList[c][0],f=n[u].dataList.length,p=-1,g=0;g<f;++g){if(n[u].dataList[g][0]===d){p=g;break}}-1===p&&(t[e]=[],t[e][0]=d,t[e][1]=0,t[e][2]=h,e++)}return t},getInitialData:function(t,e){for(var i=e.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0].get("type"),n=M(t.data,function(t){return void 0!==t[2]}),a=this.fixData(n||[]),o=[],r=this.nameMap=Q(),s=0,l=0;l<a.length;++l)o.push(a[l][2]),r.get(a[l][2])||(r.set(a[l][2],s),s++);var u=Wf(a,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:mf(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),h=new Tf(u,this);return h.initData(a),h},getLayerSeries:function(){for(var i=this.getData(),t=i.count(),e=[],n=0;n<t;++n)e[n]=n;var a=i.mapDimension("single"),o=Ra(e,function(t){return i.get("name",t)}),r=[];return o.buckets.each(function(t,e){t.sort(function(t,e){return i.get(a,t)-i.get(a,e)}),r.push({name:e,indices:t})}),r},getAxisTooltipData:function(t,e,i){k(t)||(t=t?[t]:[]);for(var n,a=this.getData(),o=this.getLayerSeries(),r=[],s=o.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,h=-1,c=o[l].indices.length,d=0;d<c;++d){var f=a.get(t[0],o[l].indices[d]),p=Math.abs(f-e);p<=u&&(n=f,u=p,h=o[l].indices[d])}r.push(h)}return{dataIndices:r,nestestValue:n}},formatTooltip:function(t){var e=this.getData(),i=e.getName(t),n=e.get(e.mapDimension("value"),t);return!isNaN(n)&&null!=n||(n="-"),Wl(i+" : "+n)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",color:"#000",fontSize:11},emphasis:{label:{show:!0}}}});hf({type:"themeRiver",init:function(){this._layers=[]},render:function(b,t,e){var S=b.getData(),M=this.group,I=b.getLayerSeries(),i=S.getLayout("layoutInfo"),n=i.rect,a=i.boundaryGap;function o(t){return t.name}M.attr("position",[0,n.y+a[0]]);var r=new df(this._layersSeries||[],I,o,o),A={};function s(t,e,i){var n=this._layers;if("remove"!==t){for(var a,o,r,s=[],l=[],u=I[e].indices,h=0;h<u.length;h++){var c=S.getItemLayout(u[h]),d=c.x,f=c.y0,p=c.y;s.push([d,f]),l.push([d,f+p]),a=S.getItemVisual(u[h],"color")}var g=S.getItemLayout(u[0]),m=S.getItemModel(u[h-1]),v=m.getModel("label"),y=v.get("margin");if("add"===t){var x=A[e]=new Si;o=new $g({shape:{points:s,stackedOnPoints:l,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),r=new Dr({style:{x:g.x-y,y:g.y0+g.y/2}}),x.add(o),x.add(r),M.add(x),o.setClipPath(function(t,e,i){var n=new Hr({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return qs(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}(o.getBoundingRect(),b,function(){o.removeClipPath()}))}else{x=n[i];o=x.childAt(0),r=x.childAt(1),M.add(x),A[e]=x,js(o,{shape:{points:s,stackedOnPoints:l}},b),js(r,{style:{x:g.x-y,y:g.y0+g.y/2}},b)}var _=m.getModel("emphasis.itemStyle"),w=m.getModel("itemStyle");Gs(r.style,v,{text:v.get("show")?b.getFormattedLabel(u[h-1],"normal")||S.getName(u[h-1]):null,textVerticalAlign:"middle"}),o.setStyle(L({fill:a},w.getItemStyle(["color"]))),Os(o,_.getItemStyle())}else M.remove(n[e])}r.add(T(s,this,"add")).update(T(s,this,"update")).remove(T(s,this,"remove")).execute(),this._layersSeries=I,this._layers=A},dispose:function(){}});function hI(i,t,e){if(i.count())for(var n,a=t.coordinateSystem,o=t.getLayerSeries(),r=i.mapDimension("single"),s=i.mapDimension("value"),l=N(o,function(t){return N(t.indices,function(t){var e=a.dataToPoint(i.get(r,t));return e[1]=i.get(s,t),e})}),u=function(t){for(var e=t.length,i=t[0].length,n=[],a=[],o=0,r={},s=0;s<i;++s){for(var l=0,u=0;l<e;++l)u+=t[l][s][1];o<u&&(o=u),n.push(u)}for(var h=0;h<i;++h)a[h]=(o-n[h])/2;for(var c=o=0;c<i;++c){var d=n[c]+a[c];o<d&&(o=d)}return r.y0=a,r.max=o,r}(l),h=u.y0,c=e/u.max,d=o.length,f=o[0].indices.length,p=0;p<f;++p){n=h[p]*c,i.setItemLayout(o[0].indices[p],{layerIndex:0,x:l[0][p][0],y0:n,y:l[0][p][1]*c});for(var g=1;g<d;++g)n+=l[g-1][p][1]*c,i.setItemLayout(o[g].indices[p],{layerIndex:g,x:l[g][p][0],y0:n,y:l[g][p][1]*c})}}nf(function(t,e){t.eachSeriesByType("themeRiver",function(t){var e=t.getData(),i=t.coordinateSystem,n={},a=i.getRect();n.rect=a;var o=t.get("boundaryGap"),r=i.getAxis();(n.boundaryGap=o,"horizontal"===r.orient)?(o[0]=xl(o[0],a.height),o[1]=xl(o[1],a.height),hI(e,t,a.height-o[0]-o[1])):(o[0]=xl(o[0],a.width),o[1]=xl(o[1],a.width),hI(e,t,a.width-o[0]-o[1]));e.setLayout("layoutInfo",n)})}),af(function(t){t.eachSeriesByType("themeRiver",function(a){var o=a.getData(),r=a.getRawData(),s=a.get("color"),l=Q();o.each(function(t){l.set(o.getRawIndex(t),t)}),r.each(function(t){var e=r.getName(t),i=s[(a.nameMap.get(e)-1)%s.length];r.setItemVisual(t,"color",i);var n=l.get(t);null!=n&&o.setItemVisual(n,"color",i)})})}),Qd(kv("themeRiver")),Wh.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(t,e){var i={name:t.name,children:t.data};!function i(t){var n=0;E(t.children,function(t){i(t);var e=t.value;k(e)&&(e=e[0]),n+=e});var e=t.value;k(e)&&(e=e[0]);null!=e&&!isNaN(e)||(e=n);e<0&&(e=0);k(t.value)?t.value[0]=e:t.value=e}(i);var n=t.levels||[],a={};return a.levels=n,Ky.createTree(i,this,a).data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(t){var e=Wh.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=gx(i,this),e},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0,emphasis:{}},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1,emphasis:{},highlight:{opacity:1},downplay:{opacity:.9}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},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)}});var cI="none",dI="ancestor",fI="self",pI=2,gI=4;function mI(t,e,i){Si.call(this);var n=new Pr({z2:pI});n.seriesIndex=e.seriesIndex;var a=new Dr({z2:gI,silent:t.getModel("label").get("silent")});function o(){a.ignore=a.hoverIgnore}function r(){a.ignore=a.normalIgnore}this.add(n),this.add(a),this.updateData(!0,t,"normal",e,i),this.on("emphasis",o).on("normal",r).on("mouseover",o).on("mouseout",r)}var vI=mI.prototype;vI.updateData=function(t,e,i,n,a){(this.node=e).piece=this,n=n||this._seriesModel,a=a||this._ecModel;var o=this.childAt(0);o.dataIndex=e.dataIndex;var r=e.getModel(),s=e.getLayout(),l=L({},s);l.label=null;var u=function(t,e,i){var n=t.getVisual("color"),a=t.getVisual("visualMeta");a&&0!==a.length||(n=null);var o=t.getModel("itemStyle").get("color");{if(o)return o;if(n)return n;if(0===t.depth)return i.option.color[0];var r=i.option.color.length;o=i.option.color[function(t){var e=t;for(;1<e.depth;)e=e.parentNode;return _(t.getAncestors()[0].children,e)}(t)%r]}return o}(e,0,a);!function(t,e,i){e.getData().setItemVisual(t.dataIndex,"color",i)}(e,n,u);var h,c=r.getModel("itemStyle").getItemStyle();"normal"===i?h=c:h=m(r.getModel(i+".itemStyle").getItemStyle(),c);h=C({lineJoin:"bevel",fill:h.fill||u},h),t?(o.setShape(l),o.shape.r=s.r0,js(o,{shape:{r:s.r}},n,e.dataIndex),o.useStyle(h)):"object"==typeof h.fill&&h.fill.type||"object"==typeof o.style.fill&&o.style.fill.type?(js(o,{shape:l},n),o.useStyle(h)):js(o,{shape:l,style:h},n),this._updateLabel(n,u,i);var d=r.getShallow("cursor");if(d&&o.attr("cursor",d),t){var f=n.getShallow("highlightPolicy");this._initEvents(o,e,n,f)}this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel},vI.onEmphasis=function(e){var i=this;this.node.hostTree.root.eachNode(function(t){t.piece&&(i.node===t?t.piece.updateData(!1,t,"emphasis"):!function(t,e,i){return i!==cI&&(i===fI?t===e:i===dI?t===e||t.isAncestorOf(e):t===e||t.isDescendantOf(e))}(t,i.node,e)?e!==cI&&t.piece.childAt(0).trigger("downplay"):t.piece.childAt(0).trigger("highlight"))})},vI.onNormal=function(){this.node.hostTree.root.eachNode(function(t){t.piece&&t.piece.updateData(!1,t,"normal")})},vI.onHighlight=function(){this.updateData(!1,this.node,"highlight")},vI.onDownplay=function(){this.updateData(!1,this.node,"downplay")},vI._updateLabel=function(t,e,i){var n=this.node.getModel(),a=n.getModel("label"),o="normal"===i||"emphasis"===i?a:n.getModel(i+".label"),r=n.getModel("emphasis.label"),s=W(t.getFormattedLabel(this.node.dataIndex,i,null,null,"label"),this.node.name);!1===S("show")&&(s="");var l=this.node.getLayout(),u=o.get("minAngle");null==u&&(u=a.get("minAngle")),u=u/180*Math.PI;var h=l.endAngle-l.startAngle;null!=u&&Math.abs(h)<u&&(s="");var c=this.childAt(1);Bs(c.style,c.hoverStyle||{},a,r,{defaultText:o.getShallow("show")?s:null,autoColor:e,useInsideStyle:!0});var d,f=(l.startAngle+l.endAngle)/2,p=Math.cos(f),g=Math.sin(f),m=S("position"),v=S("distance")||0,y=S("align");"outside"===m?(d=l.r+v,y=f>Math.PI/2?"right":"left"):y&&"center"!==y?"left"===y?(d=l.r0+v,f>Math.PI/2&&(y="right")):"right"===y&&(d=l.r-v,f>Math.PI/2&&(y="left")):(d=(l.r+l.r0)/2,y="center"),c.attr("style",{text:s,textAlign:y,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=d*p+l.cx,_=d*g+l.cy;c.attr("position",[x,_]);var w=S("rotate"),b=0;function S(t){var e=o.get(t);return null==e?a.get(t):e}"radial"===w?(b=-f)<-Math.PI/2&&(b+=Math.PI):"tangential"===w?(b=Math.PI/2-f)>Math.PI/2?b-=Math.PI:b<-Math.PI/2&&(b+=Math.PI):"number"==typeof w&&(b=w*Math.PI/180),c.attr("rotation",b)},vI._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");function a(){r.onEmphasis(n)}function o(){r.onNormal()}var r=this;i.isAnimationEnabled()&&t.on("mouseover",a).on("mouseout",o).on("emphasis",a).on("normal",o).on("downplay",function(){r.onDownplay()}).on("highlight",function(){r.onHighlight()})},w(mI,Si);ec.extend({type:"sunburst",init:function(){},render:function(a,o,t,e){var n=this;this.seriesModel=a,this.api=t,this.ecModel=o;var r=a.getData(),s=r.tree.root,i=a.getViewRoot(),l=this.group,u=a.get("renderLabelForZeroData"),h=[];i.eachNode(function(t){h.push(t)});var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function t(t){return t.getId()}function e(t,e){!function(t,e){u||!t||t.getValue()||(t=null);if(t!==s&&e!==s)if(e&&e.piece)t?(e.piece.updateData(!1,t,"normal",a,o),r.setItemGraphicEl(t.dataIndex,e.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(e);else if(t){var i=new mI(t,a,o);l.add(i),r.setItemGraphicEl(t.dataIndex,i)}}(null==t?null:i[t],null==e?null:n[e])}new df(n,i,t,t).add(e).update(e).remove(A(e,null)).execute()}(h,c),function(t,e){if(0<e.depth){n.virtualPiece?n.virtualPiece.updateData(!1,t,"normal",a,o):(n.virtualPiece=new mI(t,a,o),l.add(n.virtualPiece)),e.piece._onclickEvent&&e.piece.off("click",e.piece._onclickEvent);var i=function(t){n._rootToNode(e.parentNode)};e.piece._onclickEvent=i,n.virtualPiece.on("click",i)}else n.virtualPiece&&(l.remove(n.virtualPiece),n.virtualPiece=null)}(s,i),e&&e.highlight&&e.highlight.piece){var d=a.getShallow("highlightPolicy");e.highlight.piece.onEmphasis(d)}else if(e&&e.unhighlight){var f=this.virtualPiece;!f&&s.children.length&&(f=s.children[0].piece),f&&f.onNormal()}this._initEvents(),this._oldChildren=h},dispose:function(){},_initEvents:function(){function t(o){var r=!1;s.seriesModel.getViewRoot().eachNode(function(t){if(!r&&t.piece&&t.piece.childAt(0)===o.target){var e=t.getModel().get("nodeClick");if("rootToNode"===e)s._rootToNode(t);else if("link"===e){var i=t.getModel(),n=i.get("link");if(n){var a=i.get("target",!0)||"_blank";window.open(n,a)}}r=!0}})}var s=this;this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,a=t[1]-i.cy,o=Math.sqrt(n*n+a*a);return o<=i.r&&o>=i.r0}}});var yI="sunburstRootToNode";tf({type:yI,update:"updateView"},function(a,t){t.eachComponent({mainType:"series",subType:"sunburst",query:a},function(t,e){var i=dx(a,[yI],t);if(i){var n=t.getViewRoot();n&&(a.direction=px(n,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}})});var xI="sunburstHighlight";tf({type:xI,update:"updateView"},function(n,t){t.eachComponent({mainType:"series",subType:"sunburst",query:n},function(t,e){var i=dx(n,[xI],t);i&&(n.highlight=i.node)})});tf({type:"sunburstUnhighlight",update:"updateView"},function(i,t){t.eachComponent({mainType:"series",subType:"sunburst",query:i},function(t,e){i.unhighlight=!0})});var _I=Math.PI/180;function wI(t,e){if("function"==typeof e)return t.sort(e);var n="asc"===e;return t.sort(function(t,e){var i=(t.getValue()-e.getValue())*(n?1:-1);return 0==i?(t.dataIndex-e.dataIndex)*(n?-1:1):i})}function bI(o,r){return r=r||[0,0],N(["x","y"],function(t,e){var i=this.getAxis(t),n=r[e],a=o[e]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-a)-i.dataToCoord(n+a))},this)}af(A(Av,"sunburst")),nf(A(function(t,e,C,i){e.eachSeriesByType(t,function(t){var e=t.get("center"),i=t.get("radius");k(i)||(i=[0,i]),k(e)||(e=[e,e]);var n=C.getWidth(),a=C.getHeight(),h=Math.min(n,a),c=xl(e[0],n),d=xl(e[1],a),f=xl(i[0],h/2),o=xl(i[1],h/2),r=-t.get("startAngle")*_I,p=t.get("minAngle")*_I,g=t.getData().tree.root,s=t.getViewRoot(),m=s.depth,l=t.get("sort");null!=l&&!function e(t,i){var n=t.children||[];t.children=wI(n,i);n.length&&E(t.children,function(t){e(t,i)})}(s,l);var u=0;E(s.children,function(t){isNaN(t.getValue())||u++});var v=s.getValue(),y=Math.PI/(v||u)*2,x=0<s.depth,_=s.height-(x?-1:1),w=(o-f)/(_||1),b=t.get("clockwise"),S=t.get("stillShowZeroSum"),M=b?1:-1,I=function(t,e){if(t){var i=e;if(t!==g){var n=t.getValue(),a=0===v&&S?y:n*y;a<p&&(a=p),i=e+M*a;var o=t.depth-m-(x?-1:1),r=f+w*o,s=f+w*(1+o),l=t.getModel();null!=l.get("r0")&&(r=xl(l.get("r0"),h/2)),null!=l.get("r")&&(s=xl(l.get("r"),h/2)),t.setLayout({angle:a,startAngle:e,endAngle:i,clockwise:b,cx:c,cy:d,r0:r,r:s})}if(t.children&&t.children.length){var u=0;E(t.children,function(t){u+=I(t,e+u)})}return i-e}};if(x){var A=f,T=f+w,D=2*Math.PI;g.setLayout({angle:D,startAngle:r,endAngle:r+D,clockwise:b,cx:c,cy:d,r0:A,r:T})}I(s,r)})},"sunburst")),Qd(A(kv,"sunburst"));function SI(o,r){return r=r||[0,0],N([0,1],function(t){var e=r[t],i=o[t]/2,n=[],a=[];return n[t]=e-i,a[t]=e+i,n[1-t]=a[1-t]=r[1-t],Math.abs(this.dataToPoint(n)[t]-this.dataToPoint(a)[t])},this)}function MI(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,a=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-a)-i.dataToCoord(n+a))}function II(s,l){return N(["Radius","Angle"],function(t,e){var i=this["get"+t+"Axis"](),n=l[e],a=s[e]/2,o="dataTo"+t,r="category"===i.type?i.getBandWidth():Math.abs(i[o](n-a)-i[o](n+a));return"Angle"===t&&(r=r*Math.PI/180),r},this)}var AI=rs,TI=["itemStyle"],DI=["emphasis","itemStyle"],CI=["label"],LI=["emphasis","label"],kI="e\0\0",PI={cartesian2d:function(e){var t=e.grid.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:T(bI,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:T(SI,e)}}},singleAxis:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:T(MI,e)}}},polar:function(a){var o=a.getRadiusAxis(),r=a.getAngleAxis(),t=o.getExtent();return t[0]>t[1]&&t.reverse(),{coordSys:{type:"polar",cx:a.cx,cy:a.cy,r:t[1],r0:t[0]},api:{coord:T(function(t){var e=o.dataToRadius(t[0]),i=r.dataToAngle(t[1]),n=a.coordToPoint([e,i]);return n.push(e,i*Math.PI/180),n}),size:T(II,a)}}},calendar:function(i){var t=i.getRect(),e=i.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:i.getCellWidth(),cellHeight:i.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return i.dataToPoint(t,e)}}}}};function NI(t,e,i,n,a){null==i[t]||a||(e[t]=i[t],i[t]=n[t])}function OI(o,r,e,t){var i=o.get("renderItem"),n=o.coordinateSystem,a={};n&&(a=n.prepareCustoms?n.prepareCustoms():PI[n.type](n));var s,l,u,h,c,d=C({getWidth:t.getWidth,getHeight:t.getHeight,getZr:t.getZr,getDevicePixelRatio:t.getDevicePixelRatio,value:function(t,e){return null==e&&(e=s),r.get(r.getDimension(t||0),e)},style:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(TI).getItemStyle();null!=c&&(i.fill=c);var n=r.getItemVisual(e,"opacity");null!=n&&(i.opacity=n);var a=t?VI(t,u):u;return Gs(i,a,null,{autoColor:c,isRectText:!0}),i.text=a.getShallow("show")?H(o.getFormattedLabel(e,"normal"),bg(r,e)):null,t&&GI(i,t),i},styleEmphasis:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(DI).getItemStyle(),n=t?VI(t,h):h;return Gs(i,n,null,{isRectText:!0},!0),i.text=n.getShallow("show")?Z(o.getFormattedLabel(e,"emphasis"),o.getFormattedLabel(e,"normal"),bg(r,e)):null,t&&GI(i,t),i},visual:function(t,e){return null==e&&(e=s),r.getItemVisual(e,t)},barLayout:function(t){if(n.getBaseAxis){return function(t){var e=[],i=t.axis;if("category"===i.type){for(var n=i.getBandWidth(),a=0;a<t.count;a++)e.push(C({bandWidth:n,axisKey:"axis0",stackId:rp+a},t));var o=dp(e),r=[];for(a=0;a<t.count;a++){var s=o.axis0[rp+a];s.offsetCenter=s.offset+s.width/2,r.push(s)}return r}}(C({axis:n.getBaseAxis()},t))}},currentSeriesIndices:function(){return e.getCurrentSeriesIndices()},font:function(t){return Xs(t,e)}},a.api||{}),f={context:{},seriesId:o.id,seriesName:o.name,seriesIndex:o.seriesIndex,coordSys:a.coordSys,dataInsideLength:r.count(),encode:function(a){var o={};return E(a.dimensions,function(t,e){var i=a.getDimensionInfo(t);if(!i.isExtraCoord){var n=i.coordDim;(o[n]=o[n]||[])[i.coordDimIndex]=e}}),o}(o.getData())},p=!0;return function(t,e){return s=t,p=!0,i&&i(C({dataIndexInside:t,dataIndex:r.getRawIndex(t),actionType:e?e.type:null},f),d)};function g(t){null==t&&(t=s),p&&(l=r.getItemModel(t),u=l.getModel(CI),h=l.getModel(LI),c=r.getItemVisual(t,"color"),p=!1)}}function EI(t,e,i,n,a,o){return(t=RI(t,e,i,n,a,o,!0))&&o.setItemGraphicEl(e,t),t}function RI(t,e,i,n,a,o,r){var s=!i,l=(i=i||{}).type,u=i.shape,h=i.style;if(t&&(s||null!=l&&l!==t.__customGraphicType||"path"===l&&function(t){return t&&(t.hasOwnProperty("pathData")||t.hasOwnProperty("d"))}(u)&&WI(u)!==t.__customPathData||"image"===l&&HI(h,"image")&&h.image!==t.__customImagePath||"text"===l&&HI(u,"text")&&h.text!==t.__customText)&&(a.remove(t),t=null),!s){var c=!t;return function(e,t,i,n,a,o,r){var s={},l=i.style||{};if(i.shape&&(s.shape=D(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===e.type&&i.style){var u=s.style={};E(["x","y","width","height"],function(t){NI(t,u,l,e.style,o)})}if("text"===e.type&&i.style){u=s.style={};E(["x","y"],function(t){NI(t,u,l,e.style,o)}),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke)}if("group"!==e.type&&(e.useStyle(l),o)){e.style.opacity=0;var h=l.opacity;null==h&&(h=1),qs(e,{style:{opacity:h}},n,t)}o?e.attr(s):js(e,s,n,t),i.hasOwnProperty("z2")&&e.attr("z2",i.z2||0),i.hasOwnProperty("silent")&&e.attr("silent",i.silent),i.hasOwnProperty("invisible")&&e.attr("invisible",i.invisible),i.hasOwnProperty("ignore")&&e.attr("ignore",i.ignore),i.hasOwnProperty("info")&&e.attr("info",i.info);var c=i.styleEmphasis;Ds(e,c),r&&Es(e,!1!==c)}(t=t||function(t){var e,i=t.type;if("path"===i){var n=t.shape,a=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,o=WI(n);(e=gs(o,null,a,n.layout||"center")).__customPathData=o}else if("image"===i)(e=new Yn({})).__customImagePath=t.style.image;else if("text"===i)(e=new Dr({})).__customText=t.style.text;else if("group"===i)e=new Si;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');e=new(ps(i))}return e.__customGraphicType=i,e.name=t.name,e}(i),e,i,n,0,c,r),"group"===l&&function(t,e,i,n,a){var o=i.children,r=o?o.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(!r&&!l&&!u)return;if(l)return function(t){new df(t.oldChildren,t.newChildren,zI,zI,t).add(BI).update(BI).remove(FI).execute()}({oldChildren:t.children()||[],newChildren:o||[],dataIndex:e,animatableModel:n,group:t,data:a});u&&t.removeAll();for(var h=0;h<r;h++)o[h]&&RI(t.childAt(h),e,o[h],n,t,a)}(t,e,i,n,o),a.add(t),t}}function zI(t,e){var i=t&&t.name;return null!=i?i:kI+e}function BI(t,e){var i=this.context,n=null!=t?i.newChildren[t]:null;RI(null!=e?i.oldChildren[e]:null,i.dataIndex,n,i.animatableModel,i.group,i.data)}function VI(i,t){var n=new dl({},t);return E(AI,function(t,e){i.hasOwnProperty(t)&&(n.option[e]=i[t])}),n}function GI(t,e){for(var i in e)!e.hasOwnProperty(i)&&AI.hasOwnProperty(i)||(t[i]=e[i])}function FI(t){var e=this.context,i=e.oldChildren[t];i&&e.group.remove(i)}function WI(t){return t&&(t.pathData||t.d)}function HI(t,e){return t&&t.hasOwnProperty(e)}function ZI(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function UI(t,e){return e.dim+t.model.componentIndex}function XI(t,e){vg.call(this,"radius",t,e),this.type="category"}Wh.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0,clip:!1},getInitialData:function(t,e){return Xf(this.getSource(),this)},getDataParams:function(t,e,i){var n=Wh.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),ec.extend({type:"custom",_data:null,render:function(i,t,e,n){var a=this._data,o=i.getData(),r=this.group,s=OI(i,o,t,e);o.diff(a).add(function(t){EI(null,t,s(t,n),i,r,o)}).update(function(t,e){EI(a.getItemGraphicEl(e),t,s(t,n),i,r,o)}).remove(function(t){var e=a.getItemGraphicEl(t);e&&r.remove(e)}).execute();var l=i.get("clip",!0)?tm(i.coordinateSystem,!1,i):null;l?r.setClipPath(l):r.removeClipPath(),this._data=o},incrementalPrepareRender:function(t,e,i){this.group.removeAll(),this._data=null},incrementalRender:function(t,e,i,n,a){var o=e.getData(),r=OI(e,o,i,n);function s(t){t.isGroup||(t.incremental=!0,t.useHoverLayer=!0)}for(var l=t.start;l<t.end;l++){EI(null,l,r(l,a),e,this.group,o).traverse(s)}},dispose:et,filterForExposedEvent:function(t,e,i,n){var a=e.element;if(null==a||i.name===a)return!0;for(;(i=i.parent)&&i!==this.group;)if(i.name===a)return!0;return!1}}),XI.prototype={constructor:XI,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:vg.prototype.dataToCoord,radiusToData:vg.prototype.coordToData},w(XI,vg);var YI=La();function jI(t,e){e=e||[0,360],vg.call(this,"angle",t,e),this.type="category"}jI.prototype={constructor:jI,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:vg.prototype.dataToCoord,angleToData:vg.prototype.coordToData,calculateCategoryInterval:function(){var t=this.getLabelModel(),e=this.scale,i=e.getExtent(),n=e.count();if(i[1]-i[0]<1)return 0;var a=i[0],o=this.dataToCoord(a+1)-this.dataToCoord(a),r=Math.abs(o),s=un(a,t.getFont(),"center","top"),l=Math.max(s.height,7)/r;isNaN(l)&&(l=1/0);var u=Math.max(0,Math.floor(l)),h=YI(this.model),c=h.lastAutoInterval,d=h.lastTickCount;return null!=c&&null!=d&&Math.abs(c-u)<=1&&Math.abs(d-n)<=1&&u<c?u=c:(h.lastTickCount=n,h.lastAutoInterval=u),u}},w(jI,vg);function qI(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new XI,this._angleAxis=new jI,this._radiusAxis.polar=this._angleAxis.polar=this}qI.prototype={type:"polar",axisPointerEnabled:!0,constructor:qI,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),o=Math.min(a[0],a[1]),r=Math.max(a[0],a[1]);n.inverse?o=r-360:r=o+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=l<o?1:-1;l<o||r<l;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]},getArea:function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var i=t.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:t.inverse,contain:function(t,e){var i=t-this.cx,n=e-this.cy,a=i*i+n*n,o=this.r,r=this.r0;return a<=o*o&&r*r<=a}}}};var KI=fu.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});m(KI.prototype,Hp);var $I={splitNumber:5};function JI(t,e){return e.type||(e.data?"category":"value")}function QI(t,e){var i=this,n=i.getAngleAxis(),a=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),a.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){if(t.coordinateSystem===i){var e=t.getData();E(e.mapDimension("radius",!0),function(t){a.scale.unionExtentFromData(e,Uf(e,t))}),E(e.mapDimension("angle",!0),function(t){n.scale.unionExtentFromData(e,Uf(e,t))})}}),zp(n.scale,n.model),zp(a.scale,a.model),"category"===n.type&&!n.onBand){var o=n.getExtent(),r=360/n.scale.count();n.inverse?o[1]+=r:o[1]-=r,n.setExtent(o[0],o[1])}}function tA(t,e){if(t.type=e.get("type"),t.scale=Bp(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType){t.inverse^=e.get("clockwise");var i=e.get("startAngle");t.setExtent(i,i+(t.inverse?-360:360))}(e.axis=t).model=e}mm("angle",KI,JI,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),mm("radius",KI,JI,$I),sf({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}}),Hu.register("polar",{dimensions:qI.prototype.dimensions,create:function(i,s){var l=[];return i.eachComponent("polar",function(t,e){var i=new qI(e);i.update=QI;var n=i.getRadiusAxis(),a=i.getAngleAxis(),o=t.findAxisModel("radiusAxis"),r=t.findAxisModel("angleAxis");tA(n,o),tA(a,r),function(t,e,i){var n=e.get("center"),a=i.getWidth(),o=i.getHeight();t.cx=xl(n[0],a),t.cy=xl(n[1],o);var r=t.getRadiusAxis(),s=Math.min(a,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:k(l)||(l=[0,l]),l=[xl(l[0],s),xl(l[1],s)],r.inverse?r.setExtent(l[1],l[0]):r.setExtent(l[0],l[1])}(i,t,s),l.push(i),(t.coordinateSystem=i).model=t}),i.eachSeries(function(t){if("polar"===t.get("coordinateSystem")){var e=i.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=e.coordinateSystem}}),l}});var eA=["axisLine","axisLabel","axisTick","splitLine","splitArea"];function iA(t,e,i){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),a=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:a[0],y2:a[1]}}function nA(t){return t.getRadiusAxis().inverse?0:1}function aA(t){var e=t[0],i=t[t.length-1];e&&i&&Math.abs(Math.abs(e.coord-i.coord)-360)<1e-4&&t.pop()}Um.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,a=n.getRadiusAxis().getExtent(),o=i.getTicksCoords(),r=N(i.getViewLabels(),function(t){return(t=D(t)).coord=i.dataToCoord(t.tickValue),t});aA(r),aA(o),E(eA,function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,o,a,r)},this)}},_axisLine:function(t,e,i,n){var a,o=t.getModel("axisLine.lineStyle"),r=nA(e),s=r?0:1;(a=0===n[s]?new Lr({shape:{cx:e.cx,cy:e.cy,r:n[r]},style:o.getLineStyle(),z2:1,silent:!0}):new Nr({shape:{cx:e.cx,cy:e.cy,r:n[r],r0:n[s]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n){var a=t.getModel("axisTick"),o=(a.get("inside")?-1:1)*a.get("length"),r=n[nA(e)],s=N(i,function(t){return new Ur({shape:iA(e,[r,r+o],t.coord)})});this.group.add(ys(s,{style:C(a.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(c,d,t,f,e){var p=c.getCategories(!0),g=c.getModel("axisLabel"),m=g.get("margin"),v=c.get("triggerEvent");E(e,function(t,e){var i=g,n=t.tickValue,a=f[nA(d)],o=d.coordToPoint([a+m,t.coord]),r=d.cx,s=d.cy,l=Math.abs(o[0]-r)/a<.3?"center":o[0]>r?"left":"right",u=Math.abs(o[1]-s)/a<.3?"middle":o[1]>s?"top":"bottom";p&&p[n]&&p[n].textStyle&&(i=new dl(p[n].textStyle,g,g.ecModel));var h=new Dr({silent:Cm.isLabelSilent(c)});this.group.add(h),Gs(h.style,i,{x:o[0],y:o[1],textFill:i.getTextColor()||c.get("axisLine.lineStyle.color"),text:t.formattedLabel,textAlign:l,textVerticalAlign:u}),v&&(h.eventData=Cm.makeAxisEventDataBase(c),h.eventData.targetType="axisLabel",h.eventData.value=t.rawLabel)},this)},_splitLine:function(t,e,i,n){var a=t.getModel("splitLine").getModel("lineStyle"),o=a.get("color"),r=0;o=o instanceof Array?o:[o];for(var s=[],l=0;l<i.length;l++){var u=r++%o.length;s[u]=s[u]||[],s[u].push(new Ur({shape:iA(e,n,i[l].coord)}))}for(l=0;l<s.length;l++)this.group.add(ys(s[l],{style:C({stroke:o[l%o.length]},a.getLineStyle()),silent:!0,z:t.get("z")}))},_splitArea:function(t,e,i,n){if(i.length){var a=t.getModel("splitArea").getModel("areaStyle"),o=a.get("color"),r=0;o=o instanceof Array?o:[o];for(var s=[],l=Math.PI/180,u=-i[0].coord*l,h=Math.min(n[0],n[1]),c=Math.max(n[0],n[1]),d=t.get("clockwise"),f=1;f<i.length;f++){var p=r++%o.length;s[p]=s[p]||[],s[p].push(new Pr({shape:{cx:e.cx,cy:e.cy,r0:h,r:c,startAngle:u,endAngle:-i[f].coord*l,clockwise:d},silent:!0})),u=-i[f].coord*l}for(f=0;f<s.length;f++)this.group.add(ys(s[f],{style:C({fill:o[f%o.length]},a.getAreaStyle()),silent:!0}))}}});var oA=["axisLine","axisTickLabel","axisName"],rA=["splitLine","splitArea"];Um.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,a=n.getAngleAxis(),o=i.getTicksCoords(),r=a.getExtent()[0],s=i.getExtent(),l=function(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}(n,e,r),u=new Cm(e,l);E(oA,u.add,u),this.group.add(u.getGroup()),E(rA,function(t){e.get(t+".show")&&!i.scale.isBlank()&&this["_"+t](e,n,r,s,o)},this)}},_splitLine:function(t,e,i,n,a){var o=t.getModel("splitLine").getModel("lineStyle"),r=o.get("color"),s=0;r=r instanceof Array?r:[r];for(var l=[],u=0;u<a.length;u++){var h=s++%r.length;l[h]=l[h]||[],l[h].push(new Lr({shape:{cx:e.cx,cy:e.cy,r:a[u].coord},silent:!0}))}for(u=0;u<l.length;u++)this.group.add(ys(l[u],{style:C({stroke:r[u%r.length],fill:null},o.getLineStyle()),silent:!0}))},_splitArea:function(t,e,i,n,a){if(a.length){var o=t.getModel("splitArea").getModel("areaStyle"),r=o.get("color"),s=0;r=r instanceof Array?r:[r];for(var l=[],u=a[0].coord,h=1;h<a.length;h++){var c=s++%r.length;l[c]=l[c]||[],l[c].push(new Pr({shape:{cx:e.cx,cy:e.cy,r0:u,r:a[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=a[h].coord}for(h=0;h<l.length;h++)this.group.add(ys(l[h],{style:C({fill:r[h%r.length]},o.getAreaStyle()),silent:!0}))}}});var sA=GM.extend({makeElOption:function(t,e,i,n,a){var o=i.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var r,s=o.polar,l=s.getOtherAxis(o).getExtent();r=o["dataTo"+Kl(o.dim)](e);var u=n.get("type");if(u&&"none"!==u){var h=UM(n),c=lA[u](o,s,r,l,h);c.style=h,t.graphicKey=c.type,t.pointer=c}var d=n.get("label.margin");XM(t,i,n,a,function(t,e,i,n,a){var o=e.axis,r=o.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===o.dim){var d=Qt();ae(d,d,s),ne(d,d,[n.cx,n.cy]),l=$s([r,-a],d);var f=e.getModel("axisLabel").get("rotate")||0,p=Cm.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+a,r]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(e,i,0,s,d))}});var lA={line:function(t,e,i,n,a){return"angle"===t.dim?{type:"Line",shape:KM(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n,a){var o=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:JM(e.cx,e.cy,n[0],n[1],(-i-o/2)*r,(o/2-i)*r)}:{type:"Sector",shape:JM(e.cx,e.cy,i-o/2,i+o/2,0,2*Math.PI)}}};function uA(n,t){t.update="updateView",tf(t,function(t,e){var i={};return e.eachComponent({mainType:"geo",query:t},function(e){e[n](t.name),E(e.coordinateSystem.regions,function(t){i[t.name]=e.isSelected(t.name)||!1})}),{selected:i,name:t.name}})}Um.registerAxisPointerClass("PolarAxisPointer",sA),nf(A(function(t,e,i){var N={},O=function(t){var g={};E(t,function(t,e){var i=t.getData(),n=t.coordinateSystem,a=n.getBaseAxis(),o=UI(n,a),r=a.getExtent(),s="category"===a.type?a.getBandWidth():Math.abs(r[1]-r[0])/i.count(),l=g[o]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},u=l.stacks;g[o]=l;var h=ZI(t);u[h]||l.autoWidthCount++,u[h]=u[h]||{width:0,maxWidth:0};var c=xl(t.get("barWidth"),s),d=xl(t.get("barMaxWidth"),s),f=t.get("barGap"),p=t.get("barCategoryGap");c&&!u[h].width&&(c=Math.min(l.remainedWidth,c),u[h].width=c,l.remainedWidth-=c),d&&(u[h].maxWidth=d),null!=f&&(l.gap=f),null!=p&&(l.categoryGap=p)});var d={};return E(g,function(t,i){d[i]={};var e=t.stacks,n=t.bandWidth,a=xl(t.categoryGap,n),o=xl(t.gap,1),r=t.remainedWidth,s=t.autoWidthCount,l=(r-a)/(s+(s-1)*o);l=Math.max(l,0),E(e,function(t,e){var i=t.maxWidth;i&&i<l&&(i=Math.min(i,r),t.width&&(i=Math.min(i,t.width)),r-=i,t.width=i,s--)}),l=(r-a)/(s+(s-1)*o),l=Math.max(l,0);var u,h=0;E(e,function(t,e){t.width||(t.width=l),h+=(u=t).width*(1+o)}),u&&(h-=u.width*o);var c=-h/2;E(e,function(t,e){d[i][e]=d[i][e]||{offset:c,width:t.width},c+=t.width*(1+o)})}),d}(M(e.getSeriesByType(t),function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type}));e.eachSeriesByType(t,function(t){if("polar"===t.coordinateSystem.type){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),a=UI(i,n),o=ZI(t),r=O[a][o],s=r.offset,l=r.width,u=i.getOtherAxis(n),h=t.coordinateSystem.cx,c=t.coordinateSystem.cy,d=t.get("barMinHeight")||0,f=t.get("barMinAngle")||0;N[o]=N[o]||[];for(var p=e.mapDimension(u.dim),g=e.mapDimension(n.dim),m=Zf(e,p),v="radius"!==n.dim||!t.get("roundCap",!0),y=u.getExtent()[0],x=0,_=e.count();x<_;x++){var w=e.get(p,x),b=e.get(g,x);if(!isNaN(w)){var S,M,I,A,T=0<=w?"p":"n",D=y;if(m&&(N[o][b]||(N[o][b]={p:y,n:y}),D=N[o][b][T]),"radius"===u.dim){var C=u.dataToRadius(w)-y,L=n.dataToAngle(b);Math.abs(C)<d&&(C=(C<0?-1:1)*d),M=(S=D)+C,A=(I=L-s)-l,m&&(N[o][b][T]=M)}else{var k=u.dataToAngle(w,v)-y,P=n.dataToRadius(b);Math.abs(k)<f&&(k=(k<0?-1:1)*f),M=(S=P+s)+l,A=(I=D)+k,m&&(N[o][b][T]=A)}e.setItemLayout(x,{cx:h,cy:c,r0:S,r:M,startAngle:-I*Math.PI/180,endAngle:-A*Math.PI/180})}}}},this)},"bar")),lf({type:"polar"}),b(fu.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(t){fu.prototype.init.apply(this,arguments),ba(t,"label",["show"])},optionUpdated:function(){var t=this.option,i=this;t.regions=By.getFilledRegions(t.regions,t.map,t.nameMap),this._optionModelMap=S(t.regions||[],function(t,e){return e.name&&t.set(e.name,new dl(e,i)),t},Q()),this.updateSelectedMap(t.regions)},defaultOption:{zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(t){return this._optionModelMap.get(t)||new dl(null,this,this.ecModel)},getFormattedLabel:function(t,e){var i=this.getRegionModel(t).get("label"+("normal"===e?".":e+".")+"formatter"),n={name:t};return"function"==typeof i?(n.status=e,i(n)):"string"==typeof i?i.replace("{a}",null!=t?t:""):void 0},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t}}),xv),lf({type:"geo",init:function(t,e){var i=new My(e,!0);this._mapDraw=i,this.group.add(i.group)},render:function(t,e,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var a=this._mapDraw;t.get("show")?a.draw(t,e,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=t.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}}),uA("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),uA("select",{type:"geoSelect",event:"geoselected"}),uA("unSelect",{type:"geoUnSelect",event:"geounselected"});function hA(t,e,i){this._model=t}function cA(t,e,i,n){var a=i.calendarModel,o=i.seriesModel,r=a?a.coordinateSystem:o?o.coordinateSystem:null;return r===this?r[t](n):null}hA.prototype={constructor:hA,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){var e=(t=Ll(t)).getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var a=t.getDay();return{y:e,m:i,d:n,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+i+"-"+n,date:t}},getNextNDay:function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},update:function(t,e){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var i=this._rangeInfo.weeks||1,n=["width","height"],a=this._model.get("cellSize").slice(),o=this._model.getBoxLayoutParams(),r="horizontal"===this._orient?[i,7]:[7,i];E([0,1],function(t){u(a,t)&&(o[n[t]]=a[t]*r[t])});var s={width:e.getWidth(),height:e.getHeight()},l=this._rect=au(o,s);function u(t,e){return null!=t[e]&&"auto"!==t[e]}E([0,1],function(t){u(a,t)||(a[t]=l[n[t]]/r[t])}),this._sw=a[0],this._sh=a[1]},dataToPoint:function(t,e){k(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,a=i.formatedDate;if(e&&!(i.time>=n.start.time&&i.time<n.end.time+864e5))return[NaN,NaN];var o=i.day,r=this._getRangeInfo([n.start.time,a]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+r*this._sh+this._sh/2]:[this._rect.x+r*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},pointToData:function(t){var e=this.pointToDate(t);return e&&e.time},dataToRect:function(t,e){var i=this.dataToPoint(t,e);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,i=Math.floor((t[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,e-1,n):this._getDateByWeeksAndDay(e,i-1,n)},convertToPixel:A(cA,"dataToPoint"),convertFromPixel:A(cA,"pointToData"),_initRangeOption:function(){var t=this._model.get("range"),e=t;if(k(e)&&1===e.length&&(e=e[0]),/^\d{4}$/.test(e)&&(t=[e+"-01-01",e+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(e)){var i=this.getDateInfo(e),n=i.date;n.setMonth(n.getMonth()+1);var a=this.getNextNDay(n,-1);t=[i.formatedDate,a.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(e)&&(t=[e,e]);var o=this._getRangeInfo(t);return o.start.time>o.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var i=Math.floor(t[1].time/864e5)-Math.floor(t[0].time/864e5)+1,n=new Date(t[0].time),a=n.getDate(),o=t[1].date.getDate();if(n.setDate(a+i-1),n.getDate()!==o)for(var r=0<n.getTime()-t[1].time?1:-1;n.getDate()!==o&&0<(n.getTime()-t[1].time)*r;)i-=r,n.setDate(a+i-1);var s=Math.floor((i+t[0].day+6)/7),l=e?1-s:s-1;return e&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:s,nthWeek:l,fweek:t[0].day,lweek:t[1].day}},_getDateByWeeksAndDay:function(t,e,i){var n=this._getRangeInfo(i);if(t>n.weeks||0===t&&e<n.fweek||t===n.weeks&&e>n.lweek)return!1;var a=7*(t-1)-n.fweek+e,o=new Date(n.start.time);return o.setDate(n.start.d+a),this.getDateInfo(o)}},hA.dimensions=hA.prototype.dimensions,hA.getDimensionsInfo=hA.prototype.getDimensionsInfo,hA.create=function(i,n){var a=[];return i.eachComponent("calendar",function(t){var e=new hA(t,i,n);a.push(e),t.coordinateSystem=e}),i.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=a[t.get("calendarIndex")||0])}),a},Hu.register("calendar",hA);var dA=fu.extend({type:"calendar",coordinateSystem:null,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%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t,e,i,n){var a=su(t);dA.superApply(this,"init",arguments),fA(t,a)},mergeOption:function(t,e){dA.superApply(this,"mergeOption",arguments),fA(this.option,t)}});function fA(t,e){var i=t.cellSize;k(i)?1===i.length&&(i[1]=i[0]):i=t.cellSize=[i,i];var n=N([0,1],function(t){return function(t,e){return null!=t[eu[e][0]]||null!=t[eu[e][1]]&&null!=t[eu[e][2]]}(e,t)&&(i[t]="auto"),null!=i[t]&&"auto"!==i[t]});ru(t,e,{type:"box",ignoreSize:n})}var pA={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},gA={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};lf({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var a=t.coordinateSystem,o=a.getRangeInfo(),r=a.getOrient();this._renderDayRect(t,o,n),this._renderLines(t,o,r,n),this._renderYearText(t,o,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,o,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,a=t.getModel("itemStyle").getItemStyle(),o=n.getCellWidth(),r=n.getCellHeight(),s=e.start.time;s<=e.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new Hr({shape:{x:l[0],y:l[1],width:o,height:r},cursor:"default",style:a});i.add(u)}},_renderLines:function(i,t,n,a){var o=this,r=i.coordinateSystem,s=i.getModel("splitLine.lineStyle").getLineStyle(),l=i.get("splitLine.show"),e=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function d(t){o._firstDayOfMonth.push(r.getDateInfo(t)),o._firstDayPoints.push(r.dataToRect([t],!1).tl);var e=o._getLinePointsOfOneWeek(i,t,n);o._tlpoints.push(e[0]),o._blpoints.push(e[e.length-1]),l&&o._drawSplitline(e,s,a)}d(r.getNextNDay(t.end.time,1).formatedDate),l&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,e,n),s,a),l&&this._drawSplitline(o._getEdgesPoints(o._blpoints,e,n),s,a)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],a="horizontal"===i?0:1;return n[0][a]=n[0][a]-e/2,n[1][a]=n[1][a]+e/2,n},_drawSplitline:function(t,e,i){var n=new zr({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var a=[],o=0;o<7;o++){var r=n.getNextNDay(e.time,o),s=n.dataToRect([r.time],!1);a[2*r.day]=s.tl,a[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return a},_formatterLabel:function(t,e){return"string"==typeof t&&t?Xl(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n,a){e=e.slice();var o=["center","bottom"];"bottom"===n?(e[1]+=a,o=["center","top"]):"left"===n?e[0]-=a:"right"===n?(e[0]+=a,o=["center","top"]):e[1]-=a;var r=0;return"left"!==n&&"right"!==n||(r=Math.PI/2),{rotation:r,position:e,style:{textAlign:o[0],textVerticalAlign:o[1]}}},_renderYearText:function(t,e,i,n){var a=t.getModel("yearLabel");if(a.get("show")){var o=a.get("margin"),r=a.get("position");r=r||("horizontal"!==i?"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,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=a.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new Dr({z2:30});Gs(m.style,a,{text:g}),m.attr(this._yearTextPositionControl(m,c[r],i,r,o)),n.add(m)}},_monthTextPositionControl:function(t,e,i,n,a){var o="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=a,e&&(o="center"),"start"===n&&(r="bottom")):(s+=a,e&&(r="middle"),"start"===n&&(o="right")),{x:s,y:l,textAlign:o,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var n=t.getModel("monthLabel");if(n.get("show")){var a=n.get("nameMap"),o=n.get("margin"),r=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];R(a)&&(a=pA[a.toUpperCase()]||[]);var u="start"===r?0:1,h="horizontal"===e?0:1;o="start"===r?-o:o;for(var c="center"===s,d=0;d<l[u].length-1;d++){var f=l[u][d].slice(),p=this._firstDayOfMonth[d];if(c){var g=this._firstDayPoints[d];f[h]=(g[h]+l[0][d+1][h])/2}var m=n.get("formatter"),v=a[+p.m-1],y={yyyy:p.y,yy:(p.y+"").slice(2),MM:p.m,M:+p.m,nameMap:v},x=this._formatterLabel(m,y),_=new Dr({z2:30});L(Gs(_.style,n,{text:x}),this._monthTextPositionControl(f,c,e,r,o)),i.add(_)}}},_weekTextPositionControl:function(t,e,i,n,a){var o="center",r="middle",s=t[0],l=t[1],u="start"===i;return"horizontal"===e?(s=s+n+(u?1:-1)*a[0]/2,o=u?"right":"left"):(l=l+n+(u?1:-1)*a[1]/2,r=u?"bottom":"top"),{x:s,y:l,textAlign:o,textVerticalAlign:r}},_renderWeekText:function(t,e,i,n){var a=t.getModel("dayLabel");if(a.get("show")){var o=t.coordinateSystem,r=a.get("position"),s=a.get("nameMap"),l=a.get("margin"),u=o.getFirstDayOfWeek();R(s)&&(s=gA[s.toUpperCase()]||[]);var h=o.getNextNDay(e.end.time,7-e.lweek).time,c=[o.getCellWidth(),o.getCellHeight()];l=xl(l,c["horizontal"===i?0:1]),"start"===r&&(h=o.getNextNDay(e.start.time,-(7+e.fweek)).time,l=-l);for(var d=0;d<7;d++){var f,p=o.getNextNDay(h,d),g=o.dataToRect([p.time],!1).center;f=Math.abs((d+u)%7);var m=new Dr({z2:30});L(Gs(m.style,a,{text:s[f]}),this._weekTextPositionControl(g,i,r,l,c)),n.add(m)}}}});var mA={path:null,compoundPath:null,group:Si,image:Yn,text:Dr};Jd(function(t){var e=t.graphic;k(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])});var vA=sf({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(t){var e=this.option.elements;this.option.elements=null,vA.superApply(this,"mergeOption",arguments),this.option.elements=e},optionUpdated:function(t,e){var i=this.option,n=(e?i:t).elements,a=i.elements=e?[]:i.elements,o=[];this._flatten(n,o);var r=Ia(a,o);Aa(r);var s=this._elOptionsToUpdate=[];E(r,function(t,e){var i=t.option;i&&(s.push(i),function(t,e){var i=t.exist;if(e.id=t.keyInfo.id,!e.type&&i&&(e.type=i.type),null==e.parentId){var n=e.parentOption;n?e.parentId=n.id:i&&(e.parentId=i.parentId)}e.parentOption=null}(t,i),function(t,e,i){var n=L({},i),a=t[e],o=i.$action||"merge";"merge"===o?a?(m(a,n,!0),ru(a,n,{ignoreSize:!0}),lu(i,a)):t[e]=n:"replace"===o?t[e]=n:"remove"===o&&a&&(t[e]=null)}(a,e,i),function(t,e){if(!t)return;t.hv=e.hv=[_A(e,["left","right"]),_A(e,["top","bottom"])],"group"===t.type&&(null==t.width&&(t.width=e.width=0),null==t.height&&(t.height=e.height=0))}(a[e],i))},this);for(var l=a.length-1;0<=l;l--)null==a[l]?a.splice(l,1):delete a[l].$action},_flatten:function(t,i,n){E(t,function(t){if(t){n&&(t.parentOption=n),i.push(t);var e=t.children;"group"===t.type&&e&&this._flatten(e,i,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});function yA(t,e,i,n){var a=i.type,o=new(mA.hasOwnProperty(a)?mA[a]:ps(a))(i);e.add(o),n.set(t,o),o.__ecGraphicId=t}function xA(t,e){var i=t&&t.parent;i&&("group"===t.type&&t.traverse(function(t){xA(t,e)}),e.removeKey(t.__ecGraphicId),i.remove(t))}function _A(e,t){var i;return E(t,function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)}),i}lf({type:"graphic",init:function(t,e){this._elMap=Q(),this._lastGraphicModel},render:function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,i)},_updateElements:function(u){var t=u.useElOptionsToUpdate();if(t){var h=this._elMap,c=this.group;E(t,function(t){var e=t.$action,i=t.id,n=h.get(i),a=t.parentId,o=null!=a?h.get(a):c,r=t.style;"text"===t.type&&r&&(t.hv&&t.hv[1]&&(r.textVerticalAlign=r.textBaseline=null),!r.hasOwnProperty("textFill")&&r.fill&&(r.textFill=r.fill),!r.hasOwnProperty("textStroke")&&r.stroke&&(r.textStroke=r.stroke));var s=function(e){return e=L({},e),E(["id","parentId","$action","hv","bounding"].concat(tu),function(t){delete e[t]}),e}(t);e&&"merge"!==e?"replace"===e?(xA(n,h),yA(i,o,s,h)):"remove"===e&&xA(n,h):n?n.attr(s):yA(i,o,s,h);var l=h.get(i);l&&(l.__ecGraphicWidthOption=t.width,l.__ecGraphicHeightOption=t.height,function(t,e){var i=t.eventData;t.silent||t.ignore||i||(i=t.eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name});i&&(i.info=t.info)}(l,u))})}},_relocate:function(t,e){for(var i=t.option.elements,n=this.group,a=this._elMap,o=e.getWidth(),r=e.getHeight(),s=0;s<i.length;s++){var l=i[s];if((h=a.get(l.id))&&h.isGroup){var u=(c=h.parent)===n;h.__ecGraphicWidth=xl(h.__ecGraphicWidthOption,u?o:c.__ecGraphicWidth)||0,h.__ecGraphicHeight=xl(h.__ecGraphicHeightOption,u?r:c.__ecGraphicHeight)||0}}for(s=i.length-1;0<=s;s--){var h,c;l=i[s];if(h=a.get(l.id))ou(h,l,(c=h.parent)===n?{width:o,height:r}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight},null,{hv:l.hv,boundingMode:l.bounding})}},_clear:function(){var e=this._elMap;e.each(function(t){xA(t,e)}),this._elMap=Q()},dispose:function(){this._clear()}});var wA={};function bA(t,e){wA[t]=e}function SA(t){return wA[t]}var MA=sf({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){MA.superApply(this,"optionUpdated",arguments),E(this.option.feature,function(t,e){var i=SA(e);i&&m(t,i.defaultOption)})},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}}});function IA(t,e){var i=Vl(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new Hr({shape:{x:t.x-i[3],y:t.y-i[0],width:t.width+i[1]+i[3],height:t.height+i[0]+i[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1})}lf({type:"toolbox",render:function(h,c,d,s){var f=this.group;if(f.removeAll(),h.get("show")){var p=+h.get("itemSize"),l=h.get("feature")||{},u=this._features||(this._features={}),g=[];E(l,function(t,e){g.push(e)}),new df(this._featureNames||[],g).add(t).update(t).remove(A(t,null)).execute(),this._featureNames=g,function(t,e,i){var n=e.getBoxLayoutParams(),a=e.get("padding"),o={width:i.getWidth(),height:i.getHeight()},r=au(n,o,a);nu(e.get("orient"),t,e.get("itemGap"),r.width,r.height),ou(t,n,o,a)}(f,h,d),f.add(IA(f.getBoundingRect(),h)),f.eachChild(function(t){var e=t.__title,i=t.hoverStyle;if(i&&e){var n=un(e,wn(i)),a=t.position[0]+f.position[0],o=!1;t.position[1]+f.position[1]+p+n.height>d.getHeight()&&(i.textPosition="top",o=!0);var r=o?-5-n.height:p+8;a+n.width/2>d.getWidth()?(i.textPosition=["100%",r],i.textAlign="right"):a-n.width/2<0&&(i.textPosition=[0,r],i.textAlign="left")}})}function t(t,e){var i,n=g[t],a=g[e],o=new dl(l[n],h,h.ecModel);if(n&&!a){if(function(t){return 0===t.indexOf("my")}(n))i={model:o,onclick:o.option.onclick,featureName:n};else{var r=SA(n);if(!r)return;i=new r(o,c,d)}u[n]=i}else{if(!(i=u[a]))return;i.model=o,i.ecModel=c,i.api=d}n||!a?o.get("show")&&!i.unusable?(function(a,o,t){var r=a.getModel("iconStyle"),s=a.getModel("emphasis.iconStyle"),e=o.getIcons?o.getIcons():a.get("icon"),l=a.get("title")||{};if("string"==typeof e){var i=e,n=l;l={},(e={})[t]=i,l[t]=n}var u=a.iconPaths={};E(e,function(t,e){var i=el(t,{},{x:-p/2,y:-p/2,width:p,height:p});i.setStyle(r.getItemStyle()),i.hoverStyle=s.getItemStyle(),i.setStyle({text:l[e],textAlign:s.get("textAlign"),textBorderRadius:s.get("textBorderRadius"),textPadding:s.get("textPadding"),textFill:null});var n=h.getModel("tooltip");n&&n.get("show")&&i.attr("tooltip",L({content:l[e],formatter:n.get("formatter",!0)||function(){return l[e]},formatterParams:{componentType:"toolbox",name:e,title:l[e],$vars:["name","title"]},position:n.get("position",!0)||"bottom"},n.option)),Os(i),h.get("showTitle")&&(i.__title=l[e],i.on("mouseover",function(){var t=s.getItemStyle(),e="vertical"===h.get("orient")?null==h.get("right")?"right":"left":null==h.get("bottom")?"bottom":"top";i.setStyle({textFill:s.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:s.get("textBackgroundColor"),textPosition:s.get("textPosition")||e})}).on("mouseout",function(){i.setStyle({textFill:null,textBackgroundColor:null})})),i.trigger(a.get("iconStatus."+e)||"normal"),f.add(i),i.on("click",T(o.onclick,o,c,d,e)),u[e]=i})}(o,i,n),o.setIconStatus=function(t,e){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[t]=e,n[t]&&n[t].trigger(e)},i.render&&i.render(o,c,d,s)):i.remove&&i.remove(c,d):i.dispose&&i.dispose(c,d)}},updateView:function(t,e,i,n){E(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(e,i){E(this._features,function(t){t.remove&&t.remove(e,i)}),this.group.removeAll()},dispose:function(e,i){E(this._features,function(t){t.dispose&&t.dispose(e,i)})}});var AA=gc.toolbox.saveAsImage;function TA(t){this.model=t}TA.defaultOption={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:AA.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:AA.lang.slice()},TA.prototype.unusable=!v.canvasSupported,TA.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",a=i.get("type",!0)||"png",o=e.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||v.browser.ie||v.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var r=atob(o.split(",")[1]),s=r.length,l=new Uint8Array(s);s--;)l[s]=r.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+a)}else{var h=i.get("lang"),c='<body style="margin:0;"><img src="'+o+'" style="max-width:100%;" title="'+(h&&h[0]||"")+'" /></body>';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+a,d.target="_blank",d.href=o;var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},bA("saveAsImage",TA);var DA=gc.toolbox.magicType;function CA(t){this.model=t}CA.defaultOption={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",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:D(DA.title),option:{},seriesIndex:{}};var LA=CA.prototype;LA.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return E(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var kA={line:function(t,e,i,n){if("bar"===t)return m({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(t,e,i,n){if("line"===t)return m({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(t,e,i,n){if("line"===t||"bar"===t)return m({id:e,stack:"__ec_magicType_stack__"},n.get("option.stack")||{},!0)},tiled:function(t,e,i,n){if("line"===t||"bar"===t)return m({id:e,stack:""},n.get("option.tiled")||{},!0)}},PA=[["line","bar"],["stack","tiled"]];LA.onclick=function(u,t,h){var c=this.model,e=c.get("seriesIndex."+h);if(kA[h]){var d={series:[]};E(PA,function(t){0<=_(t,h)&&E(t,function(t){c.setIconStatus(t,"normal")})}),c.setIconStatus(h,"emphasis"),u.eachComponent({mainType:"series",query:null==e?null:{seriesIndex:e}},function(t){var e=t.subType,i=t.id,n=kA[h](e,i,t,c);n&&(C(n,t.option),d.series.push(n));var a=t.coordinateSystem;if(a&&"cartesian2d"===a.type&&("line"===h||"bar"===h)){var o=a.getAxesByScale("ordinal")[0];if(o){var r=o.dim+"Axis",s=u.queryComponents({mainType:r,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;d[r]=d[r]||[];for(var l=0;l<=s;l++)d[r][s]=d[r][s]||{};d[r][s].boundaryGap="bar"===h}}}),t.dispatchAction({type:"changeMagicType",currentType:h,newOption:d})}},tf({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),bA("magicType",CA);var NA=gc.toolbox.dataView,OA=new Array(60).join("-"),EA="\t";function RA(t){var e=function(t){var a={},o=[],r=[];return t.eachRawSeries(function(t){var e=t.coordinateSystem;if(!e||"cartesian2d"!==e.type&&"polar"!==e.type)o.push(t);else{var i=e.getBaseAxis();if("category"===i.type){var n=i.dim+"_"+i.index;a[n]||(a[n]={categoryAxis:i,valueAxis:e.getOtherAxis(i),series:[]},r.push({axisDim:i.dim,axisIndex:i.index})),a[n].series.push(t)}else o.push(t)}}),{seriesGroupByCategoryAxis:a,other:o,meta:r}}(t);return{value:M([function(t){var h=[];return E(t,function(t,e){var i=t.categoryAxis,n=t.valueAxis.dim,a=[" "].concat(N(t.series,function(t){return t.name})),o=[i.model.getCategories()];E(t.series,function(t){o.push(t.getRawData().mapArray(n,function(t){return t}))});for(var r=[a.join(EA)],s=0;s<o[0].length;s++){for(var l=[],u=0;u<o.length;u++)l.push(o[u][s]);r.push(l.join(EA))}h.push(r.join("\n"))}),h.join("\n\n"+OA+"\n\n")}(e.seriesGroupByCategoryAxis),function(t){return N(t,function(t){var a=t.getRawData(),o=[t.name],r=[];return a.each(a.dimensions,function(){for(var t=arguments.length,e=arguments[t-1],i=a.getName(e),n=0;n<t-1;n++)r[n]=arguments[n];o.push((i?i+EA:"")+r.join(EA))}),o.join("\n")}).join("\n\n"+OA+"\n\n")}(e.other)],function(t){return t.replace(/[\n\t\s]/g,"")}).join("\n\n"+OA+"\n\n"),meta:e.meta}}function zA(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var BA=new RegExp("["+EA+"]+","g");function VA(t,o){var e=t.split(new RegExp("\n*"+OA+"\n*","g")),r={series:[]};return E(e,function(t,e){if(function(t){if(0<=t.slice(0,t.indexOf("\n")).indexOf(EA))return!0}(t)){var i=function(t){for(var e=t.split(/\n+/g),i=[],n=N(zA(e.shift()).split(BA),function(t){return{name:t,data:[]}}),a=0;a<e.length;a++){var o=zA(e[a]).split(BA);i.push(o.shift());for(var r=0;r<o.length;r++)n[r]&&(n[r].data[a]=o[r])}return{series:n,categories:i}}(t),n=o[e],a=n.axisDim+"Axis";n&&(r[a]=r[a]||[],r[a][n.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{i=function(t){for(var e=t.split(/\n+/g),i=zA(e.shift()),n=[],a=0;a<e.length;a++){var o,r=zA(e[a]).split(BA),s="",l=!1;o=isNaN(r[0])?(l=!0,s=r[0],r=r.slice(1),n[a]={name:s,value:[]},n[a].value):n[a]=[];for(var u=0;u<r.length;u++)o.push(+r[u]);1===o.length&&(l?n[a].value=o[0]:n[a]=o[0])}return{name:i,data:n}}(t);r.series.push(i)}}),r}function GA(t){this._dom=null,this.model=t}GA.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:D(NA.title),lang:D(NA.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},GA.prototype.onclick=function(t,e){var i=e.getDom(),n=this.model;this._dom&&i.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=n.get("backgroundColor")||"#fff";var o=document.createElement("h4"),r=n.get("lang")||[];o.innerHTML=r[0]||n.get("title"),o.style.cssText="margin: 10px 20px;",o.style.color=n.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="display:block;width:100%;overflow:auto;";var u=n.get("optionToContent"),h=n.get("contentToOption"),c=RA(t);if("function"==typeof u){var d=u(e.getOption());"string"==typeof d?s.innerHTML=d:G(d)&&s.appendChild(d)}else s.appendChild(l),l.readOnly=n.get("readOnly"),l.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",l.style.color=n.get("textColor"),l.style.borderColor=n.get("textareaBorderColor"),l.style.backgroundColor=n.get("textareaColor"),l.value=c.value;var f=c.meta,p=document.createElement("div");p.style.cssText="position:absolute;bottom:0;left:0;right:0;";var g="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",m=document.createElement("div"),v=document.createElement("div");g+=";background-color:"+n.get("buttonColor"),g+=";color:"+n.get("buttonTextColor");var y=this;function x(){i.removeChild(a),y._dom=null}Gt(m,"click",x),Gt(v,"click",function(){var t;try{t="function"==typeof h?h(s,e.getOption()):VA(l.value,f)}catch(t){throw x(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),x()}),m.innerHTML=r[1],v.innerHTML=r[2],v.style.cssText=g,m.style.cssText=g,n.get("readOnly")||p.appendChild(v),p.appendChild(m),a.appendChild(o),a.appendChild(s),a.appendChild(p),s.style.height=i.clientHeight-80+"px",i.appendChild(a),this._dom=a},GA.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},GA.prototype.dispose=function(t,e){this.remove(t,e)},bA("dataView",GA),tf({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,n){var a=[];E(t.newOption.series,function(t){var e=n.getSeriesByName(t.name)[0];if(e){var i=e.get("data");a.push({name:t.name,data:function(t,n){return N(t,function(t,e){var i=n&&n[e];return z(i)&&!k(i)?(z(t)&&!k(t)&&(t=t.value),C({value:t},i)):t})}(t.data,i)})}else a.push(L({type:"scatter"},t))}),n.mergeOption(C({series:a},t.newOption))});var FA=E,WA=_,HA=A,ZA=["dataToPoint","pointToData"],UA=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function XA(t,e,i){var n=this._targetInfoList=[],a={},o=qA(e,t);FA(KA,function(t,e){i&&i.include&&!(0<=WA(i.include,e))||t(o,n,a)})}var YA=XA.prototype;function jA(t){return t[0]>t[1]&&t.reverse(),t}function qA(t,e){return Pa(t,e,{includeMainTypes:UA})}YA.setOutputRanges=function(t,e){this.matchOutputRanges(t,e,function(t,e,i){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var n=QA[t.brushType](0,i,e);t.__rangeOffset={offset:eT[t.brushType](n.values,t.range,[1,1]),xyMinMax:n.xyMinMax}}})},YA.matchOutputRanges=function(t,n,a){FA(t,function(i){var t=this.findTargetInfo(i,n);t&&!0!==t&&E(t.coordSyses,function(t){var e=QA[i.brushType](1,t,i.range);a(i,e.values,t,n)})},this)},YA.setInputRanges=function(t,a){FA(t,function(t){var e=this.findTargetInfo(t,a);if(t.range=t.range||[],e&&!0!==e){t.panelId=e.panelId;var i=QA[t.brushType](0,e.coordSys,t.coordRange),n=t.__rangeOffset;t.range=n?eT[t.brushType](i.values,n.offset,function(t,e){var i=nT(t),n=nT(e),a=[i[0]/n[0],i[1]/n[1]];return isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a}(i.xyMinMax,n.xyMinMax)):i.values}},this)},YA.makePanelOpts=function(i,n){return N(this._targetInfoList,function(t){var e=t.getPanelRect();return{panelId:t.panelId,defaultBrushType:n&&n(t),clipPath:Mb(e),isTargetByCursor:Ab(e,i,t.coordSysModel),getLinearBrushOtherExtent:Ib(e)}})},YA.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return!0===n||n&&0<=WA(n.coordSyses,e.coordinateSystem)},YA.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=qA(e,t),a=0;a<i.length;a++){var o=i[a],r=t.panelId;if(r){if(o.panelId===r)return o}else for(a=0;a<$A.length;a++)if($A[a](n,o))return o}return!0};var KA={grid:function(t,n){var a=t.xAxisModels,o=t.yAxisModels,e=t.gridModels,i=Q(),r={},s={};(a||o||e)&&(FA(a,function(t){var e=t.axis.grid.model;i.set(e.id,e),r[e.id]=!0}),FA(o,function(t){var e=t.axis.grid.model;i.set(e.id,e),s[e.id]=!0}),FA(e,function(t){i.set(t.id,t),r[t.id]=!0,s[t.id]=!0}),i.each(function(t){var e=t.coordinateSystem,i=[];FA(e.getCartesians(),function(t,e){(0<=WA(a,t.getAxis("x").model)||0<=WA(o,t.getAxis("y").model))&&i.push(t)}),n.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:i[0],coordSyses:i,getPanelRect:JA.grid,xAxisDeclared:r[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,i){FA(t.geoModels,function(t){var e=t.coordinateSystem;i.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:e,coordSyses:[e],getPanelRect:JA.geo})})}},$A=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,a=t.gridModel;return!a&&i&&(a=i.axis.grid.model),!a&&n&&(a=n.axis.grid.model),a&&a===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],JA={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Ks(t)),e}},QA={lineX:HA(tT,0),lineY:HA(tT,1),rect:function(t,e,i){var n=e[ZA[t]]([i[0][0],i[1][0]]),a=e[ZA[t]]([i[0][1],i[1][1]]),o=[jA([n[0],a[0]]),jA([n[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(i,n,t){var a=[[1/0,-1/0],[1/0,-1/0]];return{values:N(t,function(t){var e=n[ZA[i]](t);return a[0][0]=Math.min(a[0][0],e[0]),a[1][0]=Math.min(a[1][0],e[1]),a[0][1]=Math.max(a[0][1],e[0]),a[1][1]=Math.max(a[1][1],e[1]),e}),xyMinMax:a}}};function tT(t,e,i,n){var a=i.getAxis(["x","y"][t]),o=jA(N([0,1],function(t){return e?a.coordToData(a.toLocalCoord(n[t])):a.toGlobalCoord(a.dataToCoord(n[t]))})),r=[];return r[t]=o,r[1-t]=[NaN,NaN],{values:o,xyMinMax:r}}var eT={lineX:HA(iT,0),lineY:HA(iT,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,i,n){return N(t,function(t,e){return[t[0]-n[0]*i[e][0],t[1]-n[1]*i[e][1]]})}};function iT(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function nT(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var aT=E,oT="\0_ec_hist_store";function rT(t){var e=t[oT];return e=e||(t[oT]=[{}])}fu.registerSubTypeDefaulter("dataZoom",function(){return"slider"});var sT=["cartesian2d","polar","singleAxis"];var lT,uT,hT,cT,dT=(uT=["axisIndex","axis","index","id"],hT=N(lT=(lT=["x","y","z","radius","angle","single"]).slice(),Kl),cT=N(uT=(uT||[]).slice(),Kl),function(a,o){E(lT,function(t,e){for(var i={name:t,capital:hT[e]},n=0;n<uT.length;n++)i[uT[n]]=t+cT[n];a.call(o,i)})});function fT(a,o,r){return function(t){var e,i={nodes:[],records:{}};if(o(function(t){i.records[t.name]={}}),!t)return i;for(s(t,i);e=!1,a(n),e;);function n(t){!function(t,e){return 0<=_(e.nodes,t)}(t,i)&&function(t,i){var n=!1;return o(function(e){E(r(t,e)||[],function(t){i.records[e.name][t]&&(n=!0)})}),n}(t,i)&&(s(t,i),e=!0)}return i};function s(t,i){i.nodes.push(t),o(function(e){E(r(t,e)||[],function(t){i.records[e.name][t]=!0})})}}function pT(t,e,i,n){this._dimName=t,this._axisIndex=e,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i}var gT=E,mT=wl;function vT(t,e){var i=t.getAxisModel(),n=t._percentWindow,a=t._valueWindow;if(n){var o=Ml(a,[0,500]);o=Math.min(o,20);var r=e||0===n[0]&&100===n[1];i.setRange(r?null:+a[0].toFixed(o),r?null:+a[1].toFixed(o))}}pT.prototype={constructor:pT,hostedBy:function(t){return this._dataZoomModel===t},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var n=[],a=this.ecModel;return a.eachSeries(function(t){if(function(t){return 0<=_(sT,t)}(t.get("coordinateSystem"))){var e=this._dimName,i=a.queryComponents({mainType:e+"Axis",index:t.get(e+"AxisIndex"),id:t.get(e+"AxisId")})[0];this._axisIndex===(i&&i.componentIndex)&&n.push(t)}},this),n},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var t,e,i,n=this._dimName,a=this.ecModel,o=this.getAxisModel();return t="x"===n||"y"===n?(e="gridIndex","x"===n?"y":"x"):(e="polarIndex","angle"===n?"radius":"angle"),a.eachComponent(t+"Axis",function(t){(t.get(e)||0)===(o.get(e)||0)&&(i=t)}),i},getMinMaxSpan:function(){return D(this._minMaxSpan)},calculateDataWindow:function(a){var o,r=this._dataExtent,s=this.getAxisModel().axis.scale,l=this._dataZoomModel.getRangePropMode(),u=[0,100],h=[],c=[];gT(["start","end"],function(t,e){var i=a[t],n=a[t+"Value"];"percent"===l[e]?(null==i&&(i=u[e]),n=s.parse(yl(i,u,r))):(o=!0,i=yl(n=null==n?r[e]:s.parse(n),r,u)),c[e]=n,h[e]=i}),mT(c),mT(h);var d=this._minMaxSpan;function t(t,e,i,n,a){var o=a?"Span":"ValueSpan";ww(0,t,i,"all",d["min"+o],d["max"+o]);for(var r=0;r<2;r++)e[r]=yl(t[r],i,n,!0),a&&(e[r]=s.parse(e[r]))}return o?t(c,h,r,u,!1):t(h,c,u,r,!0),{valueWindow:c,percentWindow:h}},reset:function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,i){var n=[1/0,-1/0];gT(i,function(t){var i=t.getData();i&&gT(i.mapDimension(e,!0),function(t){var e=i.getApproximateExtent(t);e[0]<n[0]&&(n[0]=e[0]),e[1]>n[1]&&(n[1]=e[1])})}),n[1]<n[0]&&(n=[NaN,NaN]);return function(t,e){var i=t.getAxisModel(),n=i.getMin(!0),a="category"===i.get("type"),o=a&&i.getCategories().length;null!=n&&"dataMin"!==n&&"function"!=typeof n?e[0]=n:a&&(e[0]=0<o?0:NaN);var r=i.getMax(!0);null!=r&&"dataMax"!==r&&"function"!=typeof r?e[1]=r:a&&(e[1]=0<o?o-1:NaN);i.get("scale",!0)||(0<e[0]&&(e[0]=0),e[1]<0&&(e[1]=0))}(t,n),n}(this,this._dimName,e),function(n){var a=n._minMaxSpan={},o=n._dataZoomModel,r=n._dataExtent;gT(["min","max"],function(t){var e=o.get(t+"Span"),i=o.get(t+"ValueSpan");null!=i&&(i=n.getAxisModel().axis.scale.parse(i)),null!=i?e=yl(r[0]+i,r,[0,100],!0):null!=e&&(i=yl(e,[0,100],r,!0)-r[0]),a[t+"Span"]=e,a[t+"ValueSpan"]=i})}(this);var i=this.calculateDataWindow(t.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,vT(this)}},restore:function(t){t===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,vT(this,!0))},filterData:function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),a=t.get("filterMode"),c=this._valueWindow;"none"!==a&&gT(i,function(i){var u=i.getData(),h=u.mapDimension(n,!0);h.length&&("weakFilter"===a?u.filterSelf(function(t){for(var e,i,n,a=0;a<h.length;a++){var o=u.get(h[a],t),r=!isNaN(o),s=o<c[0],l=o>c[1];if(r&&!s&&!l)return!0;r&&(n=!0),s&&(e=!0),l&&(i=!0)}return n&&e&&i}):gT(h,function(t){if("empty"===a)i.setData(u=u.map(t,function(t){return function(t){return t>=c[0]&&t<=c[1]}(t)?t:NaN}));else{var e={};e[t]=c,u.selectRange(e)}}),gT(h,function(t){u.setApproximateExtent(c,t)}))})}}};var yT=E,xT=dT,_T=sf({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=wT(t);this.settledOption=n,this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=wT(t);m(this.option,t,!0),m(this.settledOption,e,!0),this.doInit(e)},doInit:function(t){var i=this.option;v.canvasSupported||(i.realtime=!1),this._setDefaultThrottle(t),bT(this,t);var n=this.settledOption;yT([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(i[t[0]]=n[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var r=this._axisProxies;this.eachTargetAxis(function(t,e,i,n){var a=this.dependentModels[t.axis][e],o=a.__dzAxisProxy||(a.__dzAxisProxy=new pT(t.name,e,this,n));r[t.name+"_"+e]=o},this)},_resetTarget:function(){var i=this.option,t=this._judgeAutoMode();xT(function(t){var e=t.axisIndex;i[e]=wa(i[e])},this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,i=!1;xT(function(t){null!=e[t.axisIndex]&&(i=!0)},this);var t=e.orient;return null==t&&i?"orient":i?void 0:(null==t&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var o=!0,e=this.get("orient",!0),r=this.option,t=this.dependentModels;if(o){var i="vertical"===e?"y":"x";t[i+"Axis"].length?(r[i+"AxisIndex"]=[0],o=!1):yT(t.singleAxis,function(t){o&&t.get("orient",!0)===e&&(r.singleAxisIndex=[t.componentIndex],o=!1)})}o&&xT(function(t){if(o){var e=[],i=this.dependentModels[t.axis];if(i.length&&!e.length)for(var n=0,a=i.length;n<a;n++)"category"===i[n].get("type")&&e.push(n);(r[t.axisIndex]=e).length&&(o=!1)}},this),o&&this.ecModel.eachSeries(function(a){this._isSeriesHasAllAxesTypeOf(a,"value")&&xT(function(t){var e=r[t.axisIndex],i=a.get(t.axisIndex),n=a.get(t.axisId);_(e,i=a.ecModel.queryComponents({mainType:t.axis,index:i,id:n})[0].componentIndex)<0&&e.push(i)})},this)},_autoSetOrient:function(){var e;this.eachTargetAxis(function(t){e=e||t.name},this),this.option.orient="y"===e?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(n,a){var o=!0;return xT(function(t){var e=n.get(t.axisIndex),i=this.dependentModels[t.axis][e];i&&i.get("type")===a||(o=!1)},this),o},_setDefaultThrottle:function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&0<e.animationDurationUpdate?100:20}},getFirstTargetAxisModel:function(){var i;return xT(function(t){if(null==i){var e=this.get(t.axisIndex);e.length&&(i=this.dependentModels[t.axis][e[0]])}},this),i},eachTargetAxis:function(i,n){var a=this.ecModel;xT(function(e){yT(this.get(e.axisIndex),function(t){i.call(n,e,t,this,a)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var i=this.getAxisProxy(t,e);return i&&i.getAxisModel()},setRawRange:function(e){var i=this.option,n=this.settledOption;yT([["start","startValue"],["end","endValue"]],function(t){null==e[t[0]]&&null==e[t[1]]||(i[t[0]]=n[t[0]]=e[t[0]],i[t[1]]=n[t[1]]=e[t[1]])},this),bT(this,e)},setCalculatedRange:function(e){var i=this.option;yT(["start","startValue","end","endValue"],function(t){i[t]=e[t]})},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var i in e)if(e.hasOwnProperty(i)&&e[i].hostedBy(this))return e[i];for(var i in e)if(e.hasOwnProperty(i)&&!e[i].hostedBy(this))return e[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});function wT(e){var i={};return yT(["start","end","startValue","endValue","throttle"],function(t){e.hasOwnProperty(t)&&(i[t]=e[t])}),i}function bT(t,a){var o=t._rangePropMode,r=t.get("rangeMode");yT([["start","startValue"],["end","endValue"]],function(t,e){var i=null!=a[t[0]],n=null!=a[t[1]];i&&!n?o[e]="percent":!i&&n?o[e]="value":r?o[e]=r[e]:i&&(o[e]="percent")})}var ST=Kh.extend({type:"dataZoom",render:function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},getTargetCoordInfo:function(){var t=this.dataZoomModel,a=this.ecModel,o={};return t.eachTargetAxis(function(t,e){var i=a.getComponent(t.axis,e);if(i){var n=i.getCoordSysModel();n&&function(t,e,i,n){for(var a,o=0;o<i.length;o++)if(i[o].model===t){a=i[o];break}a||i.push(a={model:t,axisModels:[],coordIndex:n});a.axisModels.push(e)}(n,i,o[n.mainType]||(o[n.mainType]=[]),n.componentIndex)}},this),o}});_T.extend({type:"dataZoom.select"}),ST.extend({type:"dataZoom.select"}),Qd({getTargetSeries:function(t){var n=Q();return t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,e,i){E(i.getAxisProxy(t.name,e).getTargetSeriesModels(),function(t){n.set(t.uid,t)})})}),n},modifyOutputEnd:!0,overallReset:function(t,n){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,e,i){i.getAxisProxy(t.name,e).reset(i,n)}),t.eachTargetAxis(function(t,e,i){i.getAxisProxy(t.name,e).filterData(i,n)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]})})}}),tf("dataZoom",function(i,t){var n=fT(T(t.eachComponent,t,"dataZoom"),dT,function(t,e){return t.get(e.axisIndex)}),a=[];t.eachComponent({mainType:"dataZoom",query:i},function(t,e){a.push.apply(a,n(t).nodes)}),E(a,function(t,e){t.setRawRange({start:i.start,end:i.end,startValue:i.startValue,endValue:i.endValue})})});var MT=gc.toolbox.dataZoom,IT=E;function AT(t,e,i){(this._brushController=new jw(i.getZr())).on("brush",T(this._onBrush,this)).mount(),this._isZoomActive}AT.defaultOption={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:D(MT.title)};var TT=AT.prototype;TT.render=function(t,e,i,n){this.model=t,this.ecModel=e,this.api=i,function(t,e,i,n,a){var o=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(o="dataZoomSelect"===n.key&&n.dataZoomSelectActive);i._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var r=new XA(CT(t.option),e,{include:["grid"]});i._brushController.setPanels(r.makePanelOpts(a,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!o&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}(t,e,this,n,i),function(t,e){t.setIconStatus("back",1<function(t){return rT(t).length}(e)?"emphasis":"normal")}(t,e)},TT.onclick=function(t,e,i){DT[i].call(this)},TT.remove=function(t,e){this._brushController.unmount()},TT.dispose=function(t,e){this._brushController.dispose()};var DT={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var n=rT(t),e=n[n.length-1];1<n.length&&n.pop();var a={};return aT(e,function(t,e){for(var i=n.length-1;0<=i;i--){if(t=n[i][e]){a[e]=t;break}}}),a}(this.ecModel))}};function CT(e){var i={};return E(["xAxisIndex","yAxisIndex"],function(t){i[t]=e[t],null==i[t]&&(i[t]="all"),!1!==i[t]&&"none"!==i[t]||(i[t]=[])}),i}TT._onBrush=function(t,e){if(e.isEnd&&t.length){var s={},l=this.ecModel;this._brushController.updateCovers([]),new XA(CT(this.model.option),l,{include:["grid"]}).matchOutputRanges(t,l,function(t,e,i){if("cartesian2d"===i.type){var n=t.brushType;"rect"===n?(a("x",i,e[0]),a("y",i,e[1])):a({lineX:"x",lineY:"y"}[n],i,e)}}),function(o,t){var r=rT(o);aT(t,function(t,e){for(var i=r.length-1;0<=i;i--){if(r[i][e])break}if(i<0){var n=o.queryComponents({mainType:"dataZoom",subType:"select",id:e})[0];if(n){var a=n.getPercentRange();r[0][e]={dataZoomId:e,start:a[0],end:a[1]}}}}),r.push(t)}(l,s),this._dispatchZoomAction(s)}function a(t,e,i){var n=e.getAxis(t),a=n.model,o=function(e,i,t){var n;return t.eachComponent({mainType:"dataZoom",subType:"select"},function(t){t.getAxisModel(e,i.componentIndex)&&(n=t)}),n}(t,a,l),r=o.findRepresentativeAxisProxy(a).getMinMaxSpan();null==r.minValueSpan&&null==r.maxValueSpan||(i=ww(0,i.slice(),n.scale.getExtent(),0,r.minValueSpan,r.maxValueSpan)),o&&(s[o.id]={dataZoomId:o.id,startValue:i[0],endValue:i[1]})}},TT._dispatchZoomAction=function(t){var i=[];IT(t,function(t,e){i.push(D(t))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},bA("dataZoom",AT),Jd(function(s){if(s){var l=s.dataZoom||(s.dataZoom=[]);k(l)||(s.dataZoom=l=[l]);var t=s.toolbox;if(t&&(k(t)&&(t=t[0]),t&&t.feature)){var e=t.feature.dataZoom;i("xAxis",e),i("yAxis",e)}}function i(n,a){if(a){var o=n+"Index",r=a[o];null==r||"all"===r||k(r)||(r=!1===r||"none"===r?[]:[r]),function(t,e){var i=s[t];k(i)||(i=i?[i]:[]);IT(i,e)}(n,function(t,e){if(null==r||"all"===r||-1!==_(r,e)){var i={type:"select",$fromToolbox:!0,filterMode:a.filterMode||"filter",id:"\0_ec_\0toolbox-dataZoom_"+n+e};i[o]=e,l.push(i)}})}}});var LT=gc.toolbox.restore;function kT(t){this.model=t}kT.defaultOption={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:LT.title},kT.prototype.onclick=function(t,e,i){!function(t){t[oT]=null}(t),e.dispatchAction({type:"restore",from:this.uid})},bA("restore",kT),tf({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")}),sf({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var PT=E,NT=Bl,OT=["","-webkit-","-moz-","-o-"];function ET(a){var o=[],t=a.get("transitionDuration"),e=a.get("backgroundColor"),i=a.getModel("textStyle"),n=a.get("padding");return t&&o.push(function(t){var e="cubic-bezier(0.23, 1, 0.32, 1)",i="left "+t+"s "+e+",top "+t+"s "+e;return N(OT,function(t){return t+"transition:"+i}).join(";")}(t)),e&&(v.canvasSupported?o.push("background-Color:"+e):(o.push("background-Color:#"+Be(e)),o.push("filter:alpha(opacity=70)"))),PT(["width","color","radius"],function(t){var e="border-"+t,i=NT(e),n=a.get(i);null!=n&&o.push(e+":"+n+("color"===t?"":"px"))}),o.push(function(i){var n=[],t=i.get("fontSize"),e=i.getTextColor();return e&&n.push("color:"+e),n.push("font:"+i.getFont()),t&&n.push("line-height:"+Math.round(3*t/2)+"px"),PT(["decoration","align"],function(t){var e=i.get(t);e&&n.push("text-"+t+":"+e)}),n.join(";")}(i)),null!=n&&o.push("padding:"+Vl(n).join("px ")+"px"),o.join(";")+";"}function RT(i,t){if(v.wxa)return null;var e=document.createElement("div"),n=this._zr=t.getZr();this.el=e,this._x=t.getWidth()/2,this._y=t.getHeight()/2,i.appendChild(e),this._container=i,this._show=!1,this._hideTimeout;var a=this;e.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},e.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=n.handler;Vt(i,t,!0),e.dispatch("mousemove",t)}},e.onmouseleave=function(){a._enterable&&a._show&&a.hideLater(a._hideDelay),a._inContent=!1}}function zT(t){this._zr=t.getZr(),this._show=!1,this._hideTimeout}RT.prototype={constructor:RT,_enterable:!0,update:function(){var t=this._container,e=t.currentStyle||document.defaultView.getComputedStyle(t),i=t.style;"absolute"!==i.position&&"absolute"!==e.position&&(i.position="relative")},show:function(t){clearTimeout(this._hideTimeout);var e=this.el;e.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+ET(t)+";left:"+this._x+"px;top:"+this._y+"px;"+(t.get("extraCssText")||""),e.style.display=e.innerHTML?"block":"none",e.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(t){this.el.innerHTML=null==t?"":t},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el;return[t.clientWidth,t.clientHeight]},moveTo:function(t,e){var i,n=this._zr;n&&n.painter&&(i=n.painter.getViewportRootOffset())&&(t+=i.offsetLeft,e+=i.offsetTop);var a=this.el.style;a.left=t+"px",a.top=e+"px",this._x=t,this._y=e},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(T(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var t=this.el.clientWidth,e=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(this.el);i&&(t+=parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),e+=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:t,height:e}}},zT.prototype={constructor:zT,_enterable:!0,update:function(){},show:function(t){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(t,e,i){this.el&&this._zr.remove(this.el);for(var n={},a=t,o="{marker",r=a.indexOf(o);0<=r;){var s=a.indexOf("|}"),l=a.substr(r+o.length,s-r-o.length);-1<l.indexOf("sub")?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:e[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:e[l]},r=(a=a.substr(s+1)).indexOf("{marker")}this.el=new Dr({style:{rich:n,text:t,textLineHeight:20,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding")},z:i.get("z")}),this._zr.add(this.el);var u=this;this.el.on("mouseover",function(){u._enterable&&(clearTimeout(u._hideTimeout),u._show=!0),u._inContent=!0}),this.el.on("mouseout",function(){u._enterable&&u._show&&u.hideLater(u._hideDelay),u._inContent=!1})},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el.getBoundingRect();return[t.width,t.height]},moveTo:function(t,e){this.el&&this.el.attr("position",[t,e])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(T(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var t=this.getSize();return{width:t[0],height:t[1]}}};var BT=T,VT=E,GT=xl,FT=new Hr({shape:{x:-1,y:-1,width:2,height:2}});function WT(t){for(var e=t.pop();t.length;){var i=t.pop();i&&(dl.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),e=new dl(i,e,e.ecModel))}return e}function HT(t,e){return t.dispatchAction||T(e.dispatchAction,e)}function ZT(t){return"center"===t||"middle"===t}lf({type:"tooltip",init:function(t,e){if(!v.node){var i,n=t.getComponent("tooltip").get("renderMode");this._renderMode=Ea(n),"html"===this._renderMode?(i=new RT(e.getDom(),e),this._newLine="<br/>"):(i=new zT(e),this._newLine="\n"),this._tooltipContent=i}},render:function(t,e,i){if(!v.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var n=this._tooltipModel.get("triggerOn");PM("itemTooltip",this._api,BT(function(t,e,i){"none"!==n&&(0<=n.indexOf(t)?this._tryShow(e,i):"leave"===t&&this._hide(i))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){i.isDisposed()||n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!v.node){var a=HT(n,i);this._ticket="";var o=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var r=FT;r.position=[n.x,n.y],r.update(),r.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:r},a)}else if(o)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},a);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var s=wM(n,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el,event:{}},a)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},a))}},manuallyHideTip:function(t,e,i,n){var a=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(HT(n,i))},_manuallyAxisShowTip:function(t,e,i,n){var a=n.seriesIndex,o=n.dataIndex,r=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=a&&null!=o&&null!=r){var s=e.getSeriesByIndex(a);if(s)if("axis"===(t=WT([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:o,position:n.position}),!0}},_tryShow:function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=T(e,this),clearTimeout(this._showTimout),0<i?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var d=this._ecModel,i=this._tooltipModel,n=[e.offsetX,e.offsetY],a=[],f=[],o=WT([e.tooltipOption,i]),p=this._renderMode,r=this._newLine,g={};VT(t,function(t){VT(t.dataByAxis,function(s){var l=d.getComponent(s.axisDim+"Axis",s.axisIndex),u=s.value,h=[];if(l&&null!=u){var c=YM(u,l.axis,d,s.seriesDataIndices,s.valueLabelOpt);E(s.seriesDataIndices,function(t){var e=d.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,n=e&&e.getDataParams(i);if(n.axisDim=s.axisDim,n.axisIndex=s.axisIndex,n.axisType=s.axisType,n.axisId=s.axisId,n.axisValue=Gp(l.axis,u),n.axisValueLabel=c,n){f.push(n);var a,o=e.formatTooltip(i,!0,null,p);if(z(o)){a=o.html;var r=o.markers;m(g,r)}else a=o;h.push(a)}});var t=c;"html"!==p?a.push(h.join(r)):a.push((t?Wl(t)+r:"")+h.join(r))}})},this),a.reverse(),a=a.join(this._newLine+this._newLine);var s=e.position;this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(o,s,n[0],n[1],this._tooltipContent,f):this._showTooltipContent(o,a,f,Math.random(),n[0],n[1],s,void 0,g)})},_showSeriesItemTooltip:function(t,e,i){var n=this._ecModel,a=e.seriesIndex,o=n.getSeriesByIndex(a),r=e.dataModel||o,s=e.dataIndex,l=e.dataType,u=r.getData(),h=WT([u.getItemModel(s),r,o&&(o.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=r.getDataParams(s,l),g=r.formatTooltip(s,!1,l,this._renderMode);f=z(g)?(d=g.html,g.markers):(d=g,null);var m="item_"+r.name+"_"+s;this._showOrMove(h,function(){this._showTooltipContent(h,d,p,m,t.offsetX,t.offsetY,t.position,t.target,f)}),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:a,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){n={content:n,formatter:n}}var a=new dl(n,this._tooltipModel,this._ecModel),o=a.get("content"),r=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,o,a.get("formatterParams")||{},r,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(i,t,n,e,a,o,r,s,l){if(this._ticket="",i.get("showContent")&&i.get("show")){var u=this._tooltipContent,h=i.get("formatter");r=r||i.get("position");var c=t;if(h&&"string"==typeof h)c=Ul(h,n,!0);else if("function"==typeof h){var d=BT(function(t,e){t===this._ticket&&(u.setContent(e,l,i),this._updatePosition(i,r,a,o,u,n,s))},this);this._ticket=e,c=h(n,e,d)}u.setContent(c,l,i),u.show(i),this._updatePosition(i,r,a,o,u,n,s)}},_updatePosition:function(t,e,i,n,a,o,r){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=a.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=r&&r.getBoundingRect().clone();if(r&&d.applyTransform(r.transform),"function"==typeof e&&(e=e([i,n],o,a.el,d,{viewSize:[s,l],contentSize:u.slice()})),k(e))i=GT(e[0],s),n=GT(e[1],l);else if(z(e)){e.width=u[0],e.height=u[1];var f=au(e,{width:s,height:l});i=f.x,n=f.y,c=h=null}else if("string"==typeof e&&r){i=(p=function(t,e,i){var n=i[0],a=i[1],o=0,r=0,s=e.width,l=e.height;switch(t){case"inside":o=e.x+s/2-n/2,r=e.y+l/2-a/2;break;case"top":o=e.x+s/2-n/2,r=e.y-a-5;break;case"bottom":o=e.x+s/2-n/2,r=e.y+l+5;break;case"left":o=e.x-n-5,r=e.y+l/2-a/2;break;case"right":o=e.x+s+5,r=e.y+l/2-a/2}return[o,r]}(e,d,u))[0],n=p[1]}else{var p;i=(p=function(t,e,i,n,a,o,r){var s=i.getOuterSize(),l=s.width,u=s.height;null!=o&&(n<t+l+o?t-=l+o:t+=o);null!=r&&(a<e+u+r?e-=u+r:e+=r);return[t,e]}(i,n,a,s,l,h?null:20,c?null:20))[0],n=p[1]}h&&(i-=ZT(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=ZT(c)?u[1]/2:"bottom"===c?u[1]:0),t.get("confine")&&(i=(p=function(t,e,i,n,a){var o=i.getOuterSize(),r=o.width,s=o.height;return t=Math.min(t+r,n)-r,e=Math.min(e+s,a)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(i,n,a,s,l))[0],n=p[1]);a.moveTo(i,n)},_updateContentNotChangedOnAxis:function(n){var t=this._lastDataByCoordSys,r=!!t&&t.length===n.length;return r&&VT(t,function(t,e){var i=t.dataByAxis||{},o=(n[e]||{}).dataByAxis||[];(r&=i.length===o.length)&&VT(i,function(t,e){var i=o[e]||{},n=t.seriesDataIndices||[],a=i.seriesDataIndices||[];(r&=t.value===i.value&&t.axisType===i.axisType&&t.axisId===i.axisId&&n.length===a.length)&&VT(n,function(t,e){var i=a[e];r&=t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex})})}),this._lastDataByCoordSys=n,!!r},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){v.node||(this._tooltipContent.hide(),EM("itemTooltip",e))}}),tf({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),tf({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){});var UT=["rect","polygon","keep","clear"];var XT=E;function YT(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function jT(t,e,o){var i={};return XT(e,function(n){var a=i[n]=function(){function t(){}return t.prototype.__hidden=t.prototype,new t}();XT(t[n],function(t,e){if(Bx.isValidType(e)){var i={type:e,visual:t};o&&o(i,n),a[e]=new Bx(i),"opacity"===e&&((i=D(i)).type="colorAlpha",a.__hidden.__alphaForOpacity=new Bx(i))}})}),i}function qT(e,i,t){var n;E(t,function(t){i.hasOwnProperty(t)&&YT(i[t])&&(n=!0)}),n&&E(t,function(t){i.hasOwnProperty(t)&&YT(i[t])?e[t]=D(i[t]):delete e[t]})}var KT={lineX:$T(0),lineY:$T(1),rect:{point:function(t,e,i){return t&&i.boundingRect.contain(t[0],t[1])},rect:function(t,e,i){return t&&i.boundingRect.intersect(t)}},polygon:{point:function(t,e,i){return t&&i.boundingRect.contain(t[0],t[1])&&ng(i.range,t[0],t[1])},rect:function(t,e,i){var n=i.range;if(!t||n.length<=1)return!1;var a=t.x,o=t.y,r=t.width,s=t.height,l=n[0];return!!(ng(n,a,o)||ng(n,a+r,o)||ng(n,a,o+s)||ng(n,a+r,o+s)||bi.create(t).contain(l[0],l[1])||il(a,o,a+r,o,n)||il(a,o,a,o+s,n)||il(a+r,o,a+r,o+s,n)||il(a,o+s,a+r,o+s,n))||void 0}}};function $T(o){var r=["x","y"],s=["width","height"];return{point:function(t,e,i){if(t){var n=i.range;return JT(t[o],n)}},rect:function(t,e,i){if(t){var n=i.range,a=[t[r[o]],t[r[o]]+t[s[o]]];return a[1]<a[0]&&a.reverse(),JT(a[0],n)||JT(a[1],n)||JT(n[0],a)||JT(n[1],a)}}}}function JT(t,e){return e[0]<=t&&t<=e[1]}var QT=["inBrush","outOfBrush"],tD="__ecBrushSelect",eD="__ecInBrushSelectEvent",iD=cd.VISUAL.BRUSH;function nD(t,e){if(!t.isDisposed()){var i=t.getZr();i[eD]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[eD]=!1}}function aD(t,e,i,n){for(var a=0,o=e.length;a<o;a++){var r=e[a];if(t[r.brushType](n,i,r.selectors,r))return!0}}function oD(t){var r=t.brushSelector;if(R(r)){var e=[];return E(KT,function(o,t){e[t]=function(t,e,i,n){var a=e.getItemLayout(t);return o[r](a,i,n)}}),e}if(O(r)){var i={};return E(KT,function(t,e){i[e]=r}),i}return r}nf(iD,function(e,t,i){e.eachComponent({mainType:"brush"},function(t){i&&"takeGlobalCursor"===i.type&&t.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1}),(t.brushTargetManager=new XA(t.option,e)).setInputRanges(t.areas,e)})}),af(iD,function(p,t,e){var a,g,m=[];p.eachComponent({mainType:"brush"},function(o,t){var s={brushId:o.id,brushIndex:t,brushName:o.name,areas:D(o.areas),selected:[]};m.push(s);var e=o.option,i=e.brushLink,n=[],l=[],u=[],h=0;t||(a=e.throttleType,g=e.throttleDelay);var r=N(o.areas,function(t){return function(i){var n=i.selectors={};return E(KT[i.brushType],function(e,t){n[t]=function(t){return e(t,n,i)}}),i}(C({boundingRect:rD[t.brushType](t)},t))}),c=jT(o.option,QT,function(t){t.mappingMethod="fixed"});function d(t){return"all"===i||n[t]}function f(t){return!!t.length}k(i)&&E(i,function(t){n[t]=1}),p.eachSeries(function(t,e){var i=u[e]=[];"parallel"===t.subType?function(t,e){var i=t.coordinateSystem;h|=i.hasAxisBrushed(),d(e)&&i.eachActiveState(t.getData(),function(t,e){"active"===t&&(l[e]=1)})}(t,e):function(e,t,i){var n=oD(e);if(!n||function(t,e){var i=t.option.seriesIndex;return null!=i&&"all"!==i&&(k(i)?_(i,e)<0:e!==i)}(o,t))return;if(E(r,function(t){n[t.brushType]&&o.brushTargetManager.controlSeries(t,e,p)&&i.push(t),h|=f(i)}),d(t)&&f(i)){var a=e.getData();a.each(function(t){aD(n,i,a,t)&&(l[t]=1)})}}(t,e,i)}),p.eachSeries(function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};s.selected.push(i);var n=oD(t),a=u[e],o=t.getData(),r=d(e)?function(t){return l[t]?(i.dataIndex.push(o.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return aD(n,a,o,t)?(i.dataIndex.push(o.getRawIndex(t)),"inBrush"):"outOfBrush"};(d(e)?h:f(a))&&function(t,u,h,c,d,f){var p,g={};function m(t){return h.getItemVisual(p,t)}function v(t,e){h.setItemVisual(p,t,e)}function e(t,e){p=null==f?t:e;var i=h.getRawDataItem(p);if(!i||!1!==i.visualMap)for(var n=c.call(d,t),a=u[n],o=g[n],r=0,s=o.length;r<s;r++){var l=o[r];a[l]&&a[l].applyVisual(t,m,v)}}E(t,function(t){var e=Bx.prepareVisualTypes(u[t]);g[t]=e}),null==f?h.each(e):h.each([f],e)}(QT,c,o,r)})}),function(t,e,i,n,a){if(!a)return;var o=t.getZr();if(o[eD])return;o[tD]||(o[tD]=nD);dc(o,tD,i,e)(t,n)}(t,a,g,m,e)});var rD={lineX:et,lineY:et,rect:function(t){return sD(t.range)},polygon:function(t){for(var e,i=t.range,n=0,a=i.length;n<a;n++){e=e||[[1/0,-1/0],[1/0,-1/0]];var o=i[n];o[0]<e[0][0]&&(e[0][0]=o[0]),o[0]>e[0][1]&&(e[0][1]=o[0]),o[1]<e[1][0]&&(e[1][0]=o[1]),o[1]>e[1][1]&&(e[1][1]=o[1])}return e&&sD(e)}};function sD(t){return new bi(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var lD=["#ddd"];sf({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;e||qT(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:lD},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(t){t&&(this.areas=N(t,function(t){return uD(this.option,t)},this))},setBrushOption:function(t){this.brushOption=uD(this.option,t),this.brushType=this.brushOption.brushType}});function uD(t,e){return m({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new dl(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}function hD(t,e,i,n){n&&n.$from===t.id||this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())}lf({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new jw(e.getZr())).on("brush",T(this._onBrush,this)).mount()},render:function(t){return this.model=t,hD.apply(this,arguments)},updateTransform:hD,updateView:hD,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),e.isEnd&&!e.removeOnClick||this.api.dispatchAction({type:"brush",brushId:i,areas:D(t),$from:i}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:D(t),$from:i})}}),tf({type:"brush",event:"brush"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),tf({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),tf({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var cD=gc.toolbox.brush;function dD(t,e,i){this.model=t,this.ecModel=e,this.api=i,this._brushType,this._brushMode}dD.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],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:D(cD.title)};var fD=dD.prototype;fD.render=fD.updateView=function(e,t,i){var n,a,o;t.eachComponent({mainType:"brush"},function(t){n=t.brushType,a=t.brushOption.brushMode||"single",o|=t.areas.length}),this._brushType=n,this._brushMode=a,E(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===a:"clear"===t?o:t===n)?"emphasis":"normal")})},fD.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return E(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},fD.onclick=function(t,e,i){var n=this._brushType,a=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===a?"single":"multiple":a}})},bA("brush",dD),Jd(function(t,e){var i=t&&t.brush;if(k(i)||(i=i?[i]:[]),i.length){var n=[];E(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var a=t&&t.toolbox;k(a)&&(a=a[0]),a||(a={feature:{}},t.toolbox=[a]);var o=a.feature||(a.feature={}),r=o.brush||(o.brush={}),s=r.type||(r.type=[]);s.push.apply(s,n),function(i){var e={};E(i,function(t){e[t]=1}),i.length=0,E(e,function(t,e){i.push(e)})}(s),e&&!s.length&&s.push.apply(s,UT)}}),sf({type:"title",layoutMode:{type:"box",ignoreSize:!0},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:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),lf({type:"title",render:function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,a=t.getModel("textStyle"),o=t.getModel("subtextStyle"),r=t.get("textAlign"),s=H(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Dr({style:Gs({},a,{text:t.get("text"),textFill:a.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Dr({style:Gs({},o,{text:h,textFill:o.getTextColor(),y:u.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),f=t.get("sublink"),p=t.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",function(){window.open(d,"_"+t.get("target"))}),f&&c.on("click",function(){window.open(f,"_"+t.get("subtarget"))}),l.eventData=c.eventData=p?{componentType:"title",componentIndex:t.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=au(m,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));r||("middle"===(r=t.get("left")||t.get("right"))&&(r="center"),"right"===r?v.x+=v.width:"center"===r&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:r,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var x=v.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var w=new Hr({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});n.add(w)}}});function pD(t){var e=t.itemStyle||(t.itemStyle={}),i=e.emphasis||(e.emphasis={}),n=t.label||t.label||{},a=n.normal||(n.normal={}),o={normal:1,emphasis:1};E(n,function(t,e){o[e]||gD(a,e)||(a[e]=t)}),i.label&&!gD(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function gD(t,e){return t.hasOwnProperty(e)}fu.registerSubTypeDefaulter("timeline",function(){return"slider"}),tf({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),C({currentIndex:i.option.currentIndex},t)}),tf({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var mD=fu.extend({type:"timeline",layoutMode:"box",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:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){mD.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],i=t.axisType,a=this._names=[];if("category"===i){var o=[];E(e,function(t,e){var i,n=Ma(t);z(t)?(i=D(t)).value=e:i=e,o.push(i),R(n)||null!=n&&!isNaN(n)||(n=""),a.push(n+"")}),e=o}var n={category:"ordinal",time:"time"}[i]||"number";(this._data=new Tf([{name:"value",type:n}],this)).initData(e,a)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});b(mD.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,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:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),Th);function vD(t,e,i,n){vg.call(this,t,e,i),this.type=n||"value",this.model=null}var yD=Kh.extend({type:"timeline"});vD.prototype={constructor:vD,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},w(vD,vg);var xD=T,_D=E,wD=Math.PI;function bD(t,e,i,n,a,o){var r=e.get("color");a?(a.setColor(r),i.add(a),o&&o.onUpdate(a)):((a=Jp(t.get("symbol"),-1,-1,2,2,r)).setStyle("strokeNoScale",!0),i.add(a),o&&o.onCreate(a));var s=e.getItemStyle(["color","symbol","symbolSize"]);a.setStyle(s),n=m({rectHover:!0,z2:100},n,!0);var l=t.get("symbolSize");(l=l instanceof Array?l.slice():[+l,+l])[0]/=2,l[1]/=2,n.scale=l;var u=t.get("symbolOffset");if(u){var h=n.position=n.position||[0,0];h[0]+=xl(u[0],l[0]),h[1]+=xl(u[1],l[1])}var c=t.get("symbolRotate");return n.rotation=(c||0)*Math.PI/180||0,a.attr(n),a.updateTransform(),a}function SD(t,e,i,n,a){if(!t.dragging){var o=n.getModel("checkpointStyle"),r=i.dataToCoord(n.getData().get(["value"],e));a||!o.get("animation",!0)?t.attr({position:[r,0]}):(t.stopAnimation(!0),t.animateTo({position:[r,0]},o.get("animationDuration",!0),o.get("animationEasing",!0)))}}yD.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var a=this._layout(e,i),o=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(a,e);e.formatTooltip=function(t){return Wl(s.scale.getLabel(t))},_D(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](a,o,s,e)},this),this._renderAxisLabel(a,r,s,e),this._position(a,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.position"),n=t.get("orient"),a=function(t,e){return au(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e);null==i||"auto"===i?i="horizontal"===n?a.y+a.height/2<e.getHeight()/2?"-":"+":a.x+a.width/2<e.getWidth()/2?"+":"-":isNaN(i)&&(i={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[n][i]);var o,r,s,l,u={horizontal:"center",vertical:0<=i||"+"===i?"left":"right"},h={horizontal:0<=i||"+"===i?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:wD/2},d="vertical"===n?a.height:a.width,f=t.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=t.get("label.rotate")||0;y=y*wD/180;var x=f.get("position",!0),_=p&&f.get("showPlayBtn",!0),w=p&&f.get("showPrevBtn",!0),b=p&&f.get("showNextBtn",!0),S=0,M=d;return"left"===x||"bottom"===x?(_&&(o=[0,0],S+=v),w&&(r=[S,0],S+=v)):(_&&(o=[M-g,0],M-=v),w&&(r=[0,0],S+=v)),b&&(s=[M-g,0],M-=v),l=[S,M],t.get("inverse")&&l.reverse(),{viewRect:a,mainLength:d,orient:n,rotation:c[n],labelRotation:y,labelPosOpt:i,labelAlign:t.get("label.align")||u[n],labelBaseline:t.get("label.verticalAlign")||t.get("label.baseline")||h[n],playPosition:o,prevBtnPosition:r,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(t,e){var i=this._mainGroup,n=this._labelGroup,a=t.viewRect;if("vertical"===t.orient){var o=Qt(),r=a.x,s=a.y+a.height;ne(o,o,[-r,-s]),ae(o,o,-wD/2),ne(o,o,[r,s]),(a=a.clone()).applyTransform(o)}var l=m(a),u=m(i.getBoundingRect()),h=m(n.getBoundingRect()),c=i.position,d=n.position;d[0]=c[0]=l[0][0];var f,p=t.labelPosOpt;isNaN(p)?(v(c,u,l,1,f="+"===p?0:1),v(d,h,l,1,1-f)):(v(c,u,l,1,f=0<=p?0:1),d[1]=c[1]+p);function g(t){var e=t.position;t.origin=[l[0][0]-e[0],l[1][0]-e[1]]}function m(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function v(t,e,i,n,a){t[n]+=i[n][a]-e[n][a]}i.attr("position",c),n.attr("position",d),i.rotation=n.rotation=t.rotation,g(i),g(n)},_createAxis:function(t,e){var i=e.getData(),n=e.get("axisType"),a=Bp(e,n);a.getTicks=function(){return i.mapArray(["value"],function(t){return t})};var o=i.getDataExtent("value");a.setExtent(o[0],o[1]),a.niceTicks();var r=new vD("value",a,t.axisExtent,n);return r.model=e,r},_createGroup:function(t){var e=this["_"+t]=new Si;return this.group.add(e),e},_renderAxisLine:function(t,e,i,n){var a=i.getExtent();n.get("lineStyle.show")&&e.add(new Ur({shape:{x1:a[0],y1:0,x2:a[1],y2:0},style:L({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,s,l,u){var h=u.getData(),e=l.scale.getTicks();_D(e,function(t){var e=l.dataToCoord(t),i=h.getItemModel(t),n=i.getModel("itemStyle"),a=i.getModel("emphasis.itemStyle"),o={position:[e,0],onclick:xD(this._changeTimeline,this,t)},r=bD(i,n,s,o);Os(r,a.getItemStyle()),i.get("tooltip")?(r.dataIndex=t,r.dataModel=u):r.dataIndex=r.dataModel=null},this)},_renderAxisLabel:function(s,l,u,t){if(u.getLabelModel().get("show")){var h=t.getData(),e=u.getViewLabels();_D(e,function(t){var e=t.tickValue,i=h.getItemModel(e),n=i.getModel("label"),a=i.getModel("emphasis.label"),o=u.dataToCoord(t.tickValue),r=new Dr({position:[o,0],rotation:s.labelRotation-s.rotation,onclick:xD(this._changeTimeline,this,e),silent:!1});Gs(r.style,n,{text:t.formattedLabel,textAlign:s.labelAlign,textVerticalAlign:s.labelBaseline}),l.add(r),Os(r,Gs({},a))},this)}},_renderControl:function(t,o,e,r){var s=t.controlSize,l=t.rotation,u=r.getModel("controlStyle").getItemStyle(),h=r.getModel("emphasis.controlStyle").getItemStyle(),c=[0,-s/2,s,s],i=r.getPlayState(),n=r.get("inverse",!0);function a(t,e,i,n){if(t){var a=function(t,e,i,n){return gs(t.get(e).replace(/^path:\/\//,""),D(n||{}),new bi(i[0],i[1],i[2],i[3]),"center")}(r,e,c,{position:t,origin:[s/2,0],rotation:n?-l:0,rectHover:!0,style:u,onclick:i});o.add(a),Os(a,h)}}a(t.nextBtnPosition,"controlStyle.nextIcon",xD(this._changeTimeline,this,n?"-":"+")),a(t.prevBtnPosition,"controlStyle.prevIcon",xD(this._changeTimeline,this,n?"+":"-")),a(t.playPosition,"controlStyle."+(i?"stopIcon":"playIcon"),xD(this._handlePlayClick,this,!i),!0)},_renderCurrentPointer:function(t,e,i,n){var a=n.getData(),o=n.getCurrentIndex(),r=a.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=xD(s._handlePointerDrag,s),t.ondragend=xD(s._handlePointerDragend,s),SD(t,o,i,n,!0)},onUpdate:function(t){SD(t,o,i,n)}};this._currentPointer=bD(r,r,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var i=this._toAxisCoord(t)[0],n=wl(this._axis.getExtent().slice());i>n[1]&&(i=n[1]),i<n[0]&&(i=n[0]),this._currentPointer.position[0]=i,this._currentPointer.dirty();var a=this._findNearestTick(i),o=this.model;(e||a!==o.getCurrentIndex()&&o.get("realtime"))&&this._changeTimeline(a)},_doPlayStop:function(){this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(xD(function(){var t=this.model;this._changeTimeline(t.getCurrentIndex()+(t.get("rewind",!0)?-1:1))},this),this.model.get("playInterval")))},_toAxisCoord:function(t){return $s(t,this._mainGroup.getLocalTransform(),!0)},_findNearestTick:function(a){var o,t=this.model.getData(),r=1/0,s=this._axis;return t.each(["value"],function(t,e){var i=s.dataToCoord(t),n=Math.abs(i-a);n<r&&(r=n,o=e)}),o},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_changeTimeline:function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})}}),Jd(function(t){var e=t&&t.timeline;k(e)||(e=e?[e]:[]),E(e,function(t){t&&function(t){var e=t.type,i={number:"value",time:"time"};i[e]&&(t.axisType=i[e],delete t.type);if(pD(t),gD(t,"controlPosition")){var n=t.controlStyle||(t.controlStyle={});gD(n,"position")||(n.position=t.controlPosition),"none"!==n.position||gD(n,"show")||(n.show=!1,delete n.position),delete t.controlPosition}E(t.data||[],function(t){z(t)&&!k(t)&&(!gD(t,"value")&&gD(t,"name")&&(t.value=t.name),pD(t))})}(t)})});var MD=zl,ID=Wl;function AD(t){ba(t,"label",["show"])}var TD=sf({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,i){this.mergeDefaultAndTheme(t,i),this._mergeOption(t,i,!1,!0)},isAnimationEnabled:function(){if(v.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e){this._mergeOption(t,e,!1,!1)},_mergeOption:function(t,n,e,a){var o=this.constructor,r=this.mainType+"Model";e||n.eachSeries(function(t){var e=t.get(this.mainType,!0),i=t[r];e&&e.data?(i?i._mergeOption(e,n,!0):(a&&AD(e),E(e.data,function(t){t instanceof Array?(AD(t[0]),AD(t[1])):AD(t)}),L(i=new o(e,this,n),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),i.__hostSeries=t),t[r]=i):t[r]=null},this)},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=k(i)?N(i,MD).join(", "):MD(i),a=e.getName(t),o=ID(this.name);return null==i&&!a||(o+="<br />"),a&&(o+=ID(a),null!=i&&(o+=" : ")),null!=i&&(o+=ID(n)),o},getData:function(){return this._data},setData:function(t){this._data=t}});b(TD,Th),TD.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var DD=_;function CD(t,e,i,n,a,o){var r=[],s=Zf(e,n)?e.getCalculationInfo("stackResultDimension"):n,l=RD(e,s,t),u=e.indicesOfNearest(s,l)[0];r[a]=e.get(i,u),r[o]=e.get(n,u);var h=bl(e.get(n,u));return 0<=(h=Math.min(h,20))&&(r[o]=+r[o].toFixed(h)),r}var LD=A,kD={min:LD(CD,"min"),max:LD(CD,"max"),average:LD(CD,"average")};function PD(t,e){var i=t.getData(),n=t.coordinateSystem;if(e&&!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!k(e.coord)&&n){var a=n.dimensions,o=ND(e,i,n,t);if((e=D(e)).type&&kD[e.type]&&o.baseAxis&&o.valueAxis){var r=DD(a,o.baseAxis.dim),s=DD(a,o.valueAxis.dim);e.coord=kD[e.type](i,o.baseDataDim,o.valueDataDim,r,s),e.value=e.coord[s]}else{for(var l=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],u=0;u<2;u++)kD[l[u]]&&(l[u]=RD(i,i.mapDimension(a[u]),l[u]));e.coord=l}}return e}function ND(t,e,i,n){var a={};return null!=t.valueIndex||null!=t.valueDim?(a.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,a.valueAxis=i.getAxis(function(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var a=0;a<n.length;a++){var o=i.getDimensionInfo(n[a]);if(o.name===e)return o.coordDim}}(n,a.valueDataDim)),a.baseAxis=i.getOtherAxis(a.valueAxis),a.baseDataDim=e.mapDimension(a.baseAxis.dim)):(a.baseAxis=n.getBaseAxis(),a.valueAxis=i.getOtherAxis(a.baseAxis),a.baseDataDim=e.mapDimension(a.baseAxis.dim),a.valueDataDim=e.mapDimension(a.valueAxis.dim)),a}function OD(t,e){return!(t&&t.containData&&e.coord&&!function(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}(e))||t.containData(e.coord)}function ED(t,e,i,n){return n<2?t.coord&&t.coord[n]:t.value}function RD(t,e,i){if("average"!==i)return"median"===i?t.getMedian(e):t.getDataExtent(e,!0)["max"===i?1:0];var n=0,a=0;return t.each(e,function(t,e){isNaN(t)||(n+=t,a++)}),n/a}var zD=lf({type:"marker",init:function(){this.markerGroupMap=Q()},render:function(t,i,n){var e=this.markerGroupMap;e.each(function(t){t.__keep=!1});var a=this.type+"Model";i.eachSeries(function(t){var e=t[a];e&&this.renderSeries(t,e,i,n)},this),e.each(function(t){t.__keep||this.group.remove(t.group)},this)},renderSeries:function(){}});function BD(s,l,u){var h=l.coordinateSystem;s.each(function(t){var e,i=s.getItemModel(t),n=xl(i.get("x"),u.getWidth()),a=xl(i.get("y"),u.getHeight());if(isNaN(n)||isNaN(a)){if(l.getMarkerPosition)e=l.getMarkerPosition(s.getValues(s.dimensions,t));else if(h){var o=s.get(h.dimensions[0],t),r=s.get(h.dimensions[1],t);e=h.dataToPoint([o,r])}}else e=[n,a];isNaN(n)||(e[0]=n),isNaN(a)||(e[1]=a),s.setItemLayout(t,e)})}zD.extend({type:"markPoint",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markPointModel;e&&(BD(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,l,e,i){var n=t.coordinateSystem,a=t.id,u=t.getData(),o=this.markerGroupMap,r=o.get(a)||o.set(a,new Ng),h=function(t,e,i){var n;n=t?N(t&&t.dimensions,function(t){return C({name:t},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{})}):[{name:"value",type:"float"}];var a=new Tf(n,i),o=N(i.get("data"),A(PD,e));t&&(o=M(o,A(OD,t)));return a.initData(o,null,t?ED:function(t){return t.value}),a}(n,t,l);l.setData(h),BD(l.getData(),t,i),h.each(function(t){var e=h.getItemModel(t),i=e.getShallow("symbol"),n=e.getShallow("symbolSize"),a=O(i),o=O(n);if(a||o){var r=l.getRawValue(t),s=l.getDataParams(t);a&&(i=i(r,s)),o&&(n=n(r,s))}h.setItemVisual(t,{symbol:i,symbolSize:n,color:e.get("itemStyle.color")||u.getVisual("color")})}),r.updateData(h),this.group.add(r.group),h.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=l})}),r.__keep=!0,r.group.silent=l.get("silent")||t.get("silent")}}),Jd(function(t){t.markPoint=t.markPoint||{}}),TD.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end"},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});function VD(t,e,i,n){var a=t.getData(),o=n.type;if(!k(n)&&("min"===o||"max"===o||"average"===o||"median"===o||null!=n.xAxis||null!=n.yAxis)){var r,s;if(null!=n.yAxis||null!=n.xAxis)r=e.getAxis(null!=n.yAxis?"y":"x"),s=W(n.yAxis,n.xAxis);else{var l=ND(n,a,e,t);r=l.valueAxis,s=RD(a,Uf(a,l.valueDataDim),o)}var u="x"===r.dim?0:1,h=1-u,c=D(n),d={};c.type=null,c.coord=[],d.coord=[],c.coord[h]=-1/0,d.coord[h]=1/0;var f=i.get("precision");0<=f&&"number"==typeof s&&(s=+s.toFixed(Math.min(f,20))),c.coord[u]=d.coord[u]=s,n=[c,d,{type:o,valueIndex:n.valueIndex,value:s}]}return(n=[PD(t,n[0]),PD(t,n[1]),L({},n[2])])[2].type=n[2].type||"",m(n[2],n[0]),m(n[2],n[1]),n}function GD(t){return!isNaN(t)&&!isFinite(t)}function FD(t,e,i,n){var a=1-t,o=n.dimensions[t];return GD(e[a])&&GD(i[a])&&e[t]===i[t]&&n.getAxis(o).containData(e[t])}function WD(t,e){if("cartesian2d"===t.type){var i=e[0].coord,n=e[1].coord;if(i&&n&&(FD(1,i,n,t)||FD(0,i,n,t)))return!0}return OD(t,e[0])&&OD(t,e[1])}function HD(t,e,i,n,a){var o,r=n.coordinateSystem,s=t.getItemModel(e),l=xl(s.get("x"),a.getWidth()),u=xl(s.get("y"),a.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)o=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=r.dimensions,c=t.get(h[0],e),d=t.get(h[1],e);o=r.dataToPoint([c,d])}if("cartesian2d"===r.type){var f=r.getAxis("x"),p=r.getAxis("y");h=r.dimensions;GD(t.get(h[0],e))?o[0]=f.toGlobalCoord(f.getExtent()[i?0:1]):GD(t.get(h[1],e))&&(o[1]=p.toGlobalCoord(p.getExtent()[i?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}zD.extend({type:"markLine",updateTransform:function(t,e,o){e.eachSeries(function(e){var t=e.markLineModel;if(t){var i=t.getData(),n=t.__from,a=t.__to;n.each(function(t){HD(n,t,!0,e,o),HD(a,t,!1,e,o)}),i.each(function(t){i.setItemLayout(t,[n.getItemLayout(t),a.getItemLayout(t)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},renderSeries:function(a,i,t,o){var e=a.coordinateSystem,n=a.id,r=a.getData(),s=this.markerGroupMap,l=s.get(n)||s.set(n,new z_);this.group.add(l.group);var u=function(t,e,i){var n;n=t?N(t&&t.dimensions,function(t){return C({name:t},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{})}):[{name:"value",type:"float"}];var a=new Tf(n,i),o=new Tf(n,i),r=new Tf([],i),s=N(i.get("data"),A(VD,e,t,i));t&&(s=M(s,A(WD,t)));var l=t?ED:function(t){return t.value};return a.initData(N(s,function(t){return t[0]}),null,l),o.initData(N(s,function(t){return t[1]}),null,l),r.initData(N(s,function(t){return t[2]})),r.hasItemOption=!0,{from:a,to:o,line:r}}(e,a,i),h=u.from,c=u.to,d=u.line;i.__from=h,i.__to=c,i.setData(d);var f=i.get("symbol"),p=i.get("symbolSize");function g(t,e,i){var n=t.getItemModel(e);HD(t,e,i,a,o),t.setItemVisual(e,{symbolSize:n.get("symbolSize")||p[i?0:1],symbol:n.get("symbol",!0)||f[i?0:1],color:n.get("itemStyle.color")||r.getVisual("color")})}k(f)||(f=[f,f]),"number"==typeof p&&(p=[p,p]),u.from.each(function(t){g(h,t,!0),g(c,t,!1)}),d.each(function(t){var e=d.getItemModel(t).get("lineStyle.color");d.setItemVisual(t,{color:e||h.getItemVisual(t,"color")}),d.setItemLayout(t,[h.getItemLayout(t),c.getItemLayout(t)]),d.setItemVisual(t,{fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolSize:c.getItemVisual(t,"symbolSize"),toSymbol:c.getItemVisual(t,"symbol")})}),l.updateData(d),u.line.eachItemGraphicEl(function(t,e){t.traverse(function(t){t.dataModel=i})}),l.__keep=!0,l.group.silent=i.get("silent")||a.get("silent")}}),Jd(function(t){t.markLine=t.markLine||{}}),TD.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});function ZD(t,e,i,n){var a=PD(t,n[0]),o=PD(t,n[1]),r=W,s=a.coord,l=o.coord;s[0]=r(s[0],-1/0),s[1]=r(s[1],-1/0),l[0]=r(l[0],1/0),l[1]=r(l[1],1/0);var u=p([{},a,o]);return u.coord=[a.coord,o.coord],u.x0=a.x,u.y0=a.y,u.x1=o.x,u.y1=o.y,u}function UD(t){return!isNaN(t)&&!isFinite(t)}function XD(t,e,i){var n=1-t;return UD(e[n])&&UD(i[n])}function YD(t,e){var i=e.coord[0],n=e.coord[1];return!("cartesian2d"!==t.type||!i||!n||!XD(1,i,n)&&!XD(0,i,n))||(OD(t,{coord:i,x:e.x0,y:e.y0})||OD(t,{coord:n,x:e.x1,y:e.y1}))}function jD(t,e,i,n,a){var o,r=n.coordinateSystem,s=t.getItemModel(e),l=xl(s.get(i[0]),a.getWidth()),u=xl(s.get(i[1]),a.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)o=n.getMarkerPosition(t.getValues(i,e));else{var h=[f=t.get(i[0],e),p=t.get(i[1],e)];r.clampData&&r.clampData(h,h),o=r.dataToPoint(h,!0)}if("cartesian2d"===r.type){var c=r.getAxis("x"),d=r.getAxis("y"),f=t.get(i[0],e),p=t.get(i[1],e);UD(f)?o[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):UD(p)&&(o[1]=d.toGlobalCoord(d.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var qD=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];zD.extend({type:"markArea",updateTransform:function(t,e,a){e.eachSeries(function(i){var t=i.markAreaModel;if(t){var n=t.getData();n.each(function(e){var t=N(qD,function(t){return jD(n,e,t,i,a)});n.setItemLayout(e,t),n.getItemGraphicEl(e).setShape("points",t)})}},this)},renderSeries:function(i,r,t,n){var e=i.coordinateSystem,a=i.id,o=i.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,{group:new Si});this.group.add(l.group),l.__keep=!0;var u=function(t,i,e){var n,a;a=t?(n=N(t&&t.dimensions,function(t){var e=i.getData();return C({name:t},e.getDimensionInfo(e.mapDimension(t))||{})}),new Tf(N(["x0","y0","x1","y1"],function(t,e){return{name:t,type:n[e%2].type}}),e)):new Tf(n=[{name:"value",type:"float"}],e);var o=N(e.get("data"),A(ZD,i,t,e));t&&(o=M(o,A(YD,t)));var r=t?function(t,e,i,n){return t.coord[Math.floor(n/2)][n%2]}:function(t){return t.value};return a.initData(o,null,r),a.hasItemOption=!0,a}(e,i,r);r.setData(u),u.each(function(e){u.setItemLayout(e,N(qD,function(t){return jD(u,e,t,i,n)})),u.setItemVisual(e,{color:o.getVisual("color")})}),u.diff(l.__data).add(function(t){var e=new Rr({shape:{points:u.getItemLayout(t)}});u.setItemGraphicEl(t,e),l.group.add(e)}).update(function(t,e){var i=l.__data.getItemGraphicEl(e);js(i,{shape:{points:u.getItemLayout(t)}},r,t),l.group.add(i),u.setItemGraphicEl(t,i)}).remove(function(t){var e=l.__data.getItemGraphicEl(t);l.group.remove(e)}).execute(),u.eachItemGraphicEl(function(t,e){var i=u.getItemModel(e),n=i.getModel("label"),a=i.getModel("emphasis.label"),o=u.getItemVisual(e,"color");t.useStyle(C(i.getModel("itemStyle").getItemStyle(),{fill:Ze(o,.4),stroke:o})),t.hoverStyle=i.getModel("emphasis.itemStyle").getItemStyle(),Bs(t.style,t.hoverStyle,n,a,{labelFetcher:r,labelDataIndex:e,defaultText:u.getName(e)||"",isRectText:!0,autoColor:o}),Os(t,{}),t.dataModel=r}),l.__data=u,l.group.silent=r.get("silent")||i.get("silent")}}),Jd(function(t){t.markArea=t.markArea||{}});var KD=gc.legend.selector,$D={all:{type:"all",title:D(KD.all)},inverse:{type:"inverse",title:D(KD.inverse)}},JD=sf({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},mergeOption:function(t){JD.superCall(this,"mergeOption",t),this._updateSelector(t)},_updateSelector:function(t){var i=t.selector;!0===i&&(i=t.selector=["all","inverse"]),k(i)&&E(i,function(t,e){R(t)&&(t={type:t}),i[e]=m(t,$D[t.type])})},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i<t.length;i++){var n=t[i].get("name");if(this.isSelected(n)){this.select(n),e=!0;break}}e||this.select(t[0].get("name"))}},_updateData:function(o){var r=[],s=[];o.eachRawSeries(function(t){var e,i=t.name;if(s.push(i),t.legendDataProvider){var n=t.legendDataProvider(),a=n.mapArray(n.getName);o.isSeriesFiltered(t)||(s=s.concat(a)),a.length?r=r.concat(a):e=!0}else e=!0;e&&Ta(t)&&r.push(t.name)}),this._availableNames=s;var t=N(this.get("data")||r,function(t){return"string"!=typeof t&&"number"!=typeof t||(t={name:t}),new dl(t,this,this.ecModel)},this);this._data=t},getData:function(){return this._data},select:function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&E(this._data,function(t){e[t.get("name")]=!1});e[t]=!0},unSelect:function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},toggleSelected:function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},allSelect:function(){var t=this._data,e=this.option.selected;E(t,function(t){e[t.get("name",!0)]=!0})},inverseSelect:function(){var t=this._data,i=this.option.selected;E(t,function(t){var e=t.get("name",!0);i.hasOwnProperty(e)||(i[e]=!0),i[e]=!i[e]})},isSelected:function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&0<=_(this._availableNames,t)},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},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,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},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}}});function QD(t,e,i){var a,o={},r="toggleSelected"===t;return i.eachComponent("legend",function(n){r&&null!=a?n[a?"select":"unSelect"](e.name):"allSelect"===t||"inverseSelect"===t?n[t]():(n[t](e.name),a=n.isSelected(e.name)),E(n.getData(),function(t){var e=t.get("name");if("\n"!==e&&""!==e){var i=n.isSelected(e);o.hasOwnProperty(e)?o[e]=o[e]&&i:o[e]=i}})}),"allSelect"===t||"inverseSelect"===t?{selected:o}:{name:e.name,selected:o}}tf("legendToggleSelect","legendselectchanged",A(QD,"toggleSelected")),tf("legendAllSelect","legendselectall",A(QD,"allSelect")),tf("legendInverseSelect","legendinverseselect",A(QD,"inverseSelect")),tf("legendSelect","legendselected",A(QD,"select")),tf("legendUnSelect","legendunselected",A(QD,"unSelect"));var tC=A,eC=E,iC=Si,nC=lf({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new iC),this._backgroundEl,this.group.add(this._selectorGroup=new iC),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var a=t.get("align"),o=t.get("orient");a&&"auto"!==a||(a="right"===t.get("left")&&"vertical"===o?"right":"left");var r=t.get("selector",!0),s=t.get("selectorPosition",!0);!r||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(a,t,e,i,r,o,s);var l=t.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},h=t.get("padding"),c=au(l,u,h),d=this.layoutInner(t,a,c,n,r,s),f=au(C({width:d.width,height:d.height},l),u,h);this.group.attr("position",[f.x-d.x,f.y-d.y]),this.group.add(this._backgroundEl=IA(d,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(u,h,c,d,t,e,i){var f=this.getContentGroup(),p=Q(),g=h.get("selectedMode"),m=[];c.eachRawSeries(function(t){t.get("legendHoverLink")||m.push(t.id)}),eC(h.getData(),function(o,r){var s=o.get("name");if(this.newlineDisabled||""!==s&&"\n"!==s){var t=c.getSeriesByName(s)[0];if(!p.get(s))if(t){var e=t.getData(),i=e.getVisual("color"),n=e.getVisual("borderColor");"function"==typeof i&&(i=i(t.getDataParams(0))),"function"==typeof n&&(n=n(t.getDataParams(0)));var a=e.getVisual("legendSymbol")||"roundRect",l=e.getVisual("symbol");this._createItem(s,r,o,h,a,l,u,i,n,g).on("click",tC(oC,s,d)).on("mouseover",tC(rC,t.name,null,d,m)).on("mouseout",tC(sC,t.name,null,d,m)),p.set(s,!0)}else c.eachRawSeries(function(t){if(!p.get(s)&&t.legendDataProvider){var e=t.legendDataProvider(),i=e.indexOfName(s);if(i<0)return;var n=e.getItemVisual(i,"color"),a=e.getItemVisual(i,"borderColor");this._createItem(s,r,o,h,"roundRect",null,u,n,a,g).on("click",tC(oC,s,d)).on("mouseover",tC(rC,null,s,d,m)).on("mouseout",tC(sC,null,s,d,m)),p.set(s,!0)}},this)}else f.add(new iC({newline:!0}))},this),t&&this._createSelector(t,h,d,e,i)},_createSelector:function(t,o,r,e,i){var s=this.getSelectorGroup();eC(t,function(t){!function(t){var e=t.type,i=new Dr({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){r.dispatchAction({type:"all"===e?"legendAllSelect":"legendInverseSelect"})}});s.add(i);var n=o.getModel("selectorLabel"),a=o.getModel("emphasis.selectorLabel");Bs(i.style,i.hoverStyle={},n,a,{defaultText:t.title,isRectText:!1}),Os(i)}(t)})},_createItem:function(t,e,i,n,a,o,r,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.get("inactiveBorderColor"),p=n.get("symbolKeepAspect"),g=n.getModel("itemStyle"),m=n.isSelected(t),v=new iC,y=i.getModel("textStyle"),x=i.get("icon"),_=i.getModel("tooltip"),w=_.parentModel,b=Jp(a=x||a,0,0,h,c,m?s:d,null==p||p);if(v.add(aC(b,a,g,l,f,m)),!x&&o&&(o!==a||"none"===o)){var S=.8*c;"none"===o&&(o="circle");var M=Jp(o,(h-S)/2,(c-S)/2,S,S,m?s:d,null==p||p);v.add(aC(M,o,g,l,f,m))}var I="left"===r?h+5:-5,A=r,T=n.get("formatter"),D=t;"string"==typeof T&&T?D=T.replace("{name}",null!=t?t:""):"function"==typeof T&&(D=T(t)),v.add(new Dr({style:Gs({},y,{text:D,x:I,y:c/2,textFill:m?y.getTextColor():d,textAlign:A,textVerticalAlign:"middle"})}));var C=new Hr({shape:v.getBoundingRect(),invisible:!0,tooltip:_.get("show")?L({content:t,formatter:w.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:t,$vars:["name"]}},_.option):null});return v.add(C),v.eachChild(function(t){t.silent=!0}),C.silent=!u,this.getContentGroup().add(v),Os(v),v.__legendDataIndex=e,v},layoutInner:function(t,e,i,n,a,o){var r=this.getContentGroup(),s=this.getSelectorGroup();nu(t.get("orient"),r,t.get("itemGap"),i.width,i.height);var l=r.getBoundingRect(),u=[-l.x,-l.y];if(a){nu("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),f=t.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===o?c[f]+=l[p]+d:u[f]+=h[p]+d,c[1-f]+=l[g]/2-h[g]/2,s.attr("position",c),r.attr("position",u);var v={x:0,y:0};return v[p]=l[p]+d+h[p],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-f]),v}return r.attr("position",u),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function aC(t,e,i,n,a,o){var r;return"line"!==e&&e.indexOf("empty")<0?(r=i.getItemStyle(),t.style.stroke=n,o||(r.stroke=a)):r=i.getItemStyle(["borderWidth","borderColor"]),t.setStyle(r)}function oC(t,e){e.dispatchAction({type:"legendToggleSelect",name:t})}function rC(t,e,i,n){var a=i.getZr().storage.getDisplayList()[0];a&&a.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function sC(t,e,i,n){var a=i.getZr().storage.getDisplayList()[0];a&&a.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}Qd(cd.PROCESSOR.SERIES_FILTER,function(t){var i=t.findComponents({mainType:"legend"});i&&i.length&&t.filterSeries(function(t){for(var e=0;e<i.length;e++)if(!i[e].isSelected(t.name))return!1;return!0})}),fu.registerSubTypeDefaulter("legend",function(){return"plain"});var lC=JD.extend({type:"legend.scroll",setScrollDataIndex:function(t){this.option.scrollDataIndex=t},defaultOption:{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800},init:function(t,e,i,n){var a=su(t);lC.superCall(this,"init",t,e,i,n),uC(this,t,a)},mergeOption:function(t,e){lC.superCall(this,"mergeOption",t,e),uC(this,this.option,t)}});function uC(t,e,i){var n=[1,1];n[t.getOrient().index]=0,ru(e,i,{type:"box",ignoreSize:n})}var hC=Si,cC=["width","height"],dC=["x","y"],fC=nC.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){fC.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new hC),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new hC),this._showController},resetInner:function(){fC.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(t,a,e,o,i,n,r){var s=this;fC.superCall(this,"renderInner",t,a,e,o,i,n,r);var l=this._controllerGroup,u=a.get("pageIconSize",!0);k(u)||(u=[u,u]),c("pagePrev",0);var h=a.getModel("pageTextStyle");function c(t,e){var i=t+"DataIndex",n=el(a.get("pageIcons",!0)[a.getOrient().name][e],{onclick:T(s._pageGo,s,i,a,o)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});n.name=t,l.add(n)}l.add(new Dr({name:"pageText",style:{textFill:h.getTextColor(),font:h.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),c("pageNext",1)},layoutInner:function(t,e,i,n,a,o){var r=this.getSelectorGroup(),s=t.getOrient().index,l=cC[s],u=dC[s],h=cC[1-s],c=dC[1-s];a&&nu("horizontal",r,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),f=r.getBoundingRect(),p=[-f.x,-f.y],g=D(i);a&&(g[l]=i[l]-f[l]-d);var m=this._layoutContentAndController(t,n,g,s,l,h,c);if(a){if("end"===o)p[s]+=m[l]+d;else{var v=f[l]+d;p[s]-=v,m[u]-=v}m[l]+=f[l]+d,p[1-s]+=m[c]+m[h]/2-f[h]/2,m[h]=Math.max(m[h],f[h]),m[c]=Math.min(m[c],f[c]+p[1-s]),r.attr("position",p)}return m},_layoutContentAndController:function(t,e,i,n,a,o,r){var s=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;nu(t.get("orient"),s,t.get("itemGap"),n?i.width:null,n?null:i.height),nu("horizontal",u,t.get("pageButtonItemGap",!0));var h=s.getBoundingRect(),c=u.getBoundingRect(),d=this._showController=h[a]>i[a],f=[-h.x,-h.y];e||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=H(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[n]+=i[a]-c[a]:p[n]+=c[a]+m);g[1-n]+=h[o]/2-c[o]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[a]=d?i[a]:h[a],v[o]=Math.max(h[o],c[o]),v[r]=Math.min(0,c[r]+g[1-n]),l.__rectSize=i[a],d){var y={x:0,y:0};y[a]=Math.max(i[a]-c[a]-m,0),y[o]=v[o],l.setClipPath(new Hr({shape:y})),l.__rectSize=y[a]}else u.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&js(s,{position:x.contentPosition},d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(n,a){var o=this._controllerGroup;E(["pagePrev","pageNext"],function(t){var e=null!=a[t+"DataIndex"],i=o.childOfName(t);i&&(i.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),i.cursor=e?"pointer":"default")});var t=o.childOfName("pageText"),e=n.get("pageFormatter"),i=a.pageIndex,r=null!=i?i+1:0,s=a.pageCount;t&&e&&t.setStyle("text",R(e)?e.replace("{current}",r).replace("{total}",s):e({current:r,total:s}))},_getPageInfo:function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,a=t.getOrient().index,o=cC[a],r=dC[a],s=this._findTargetItemIndex(e),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[a]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;-1<=p;--p)(v=y(l[p]))&&x(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(t){if(t){var e=t.getBoundingRect(),i=e[r]+t.position[a];return{s:i,e:i+e[o],i:t.__legendDataIndex}}}function x(t,e){return t.e>=e&&t.s<=e+n}},_findTargetItemIndex:function(n){var a,o,t=this.getContentGroup();return this._showController&&t.eachChild(function(t,e){var i=t.__legendDataIndex;null==o&&null!=i&&(o=e),i===n&&(a=e)}),null!=a?a:o}});tf("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})});_T.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var pC=Hr,gC=yl,mC=wl,vC=T,yC=E,xC="horizontal",_C="vertical",wC=["line","bar","candlestick","scatter"],bC=ST.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,i,n){bC.superApply(this,"render",arguments),dc(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){bC.superApply(this,"remove",arguments),fc(this,"_dispatchZoomAction")},dispose:function(){bC.superApply(this,"dispose",arguments),fc(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new Si;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},a=this._orient===xC?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},o=su(t.option);E(["right","top","width","height"],function(t){"ph"===o[t]&&(o[t]=a[t])});var r=au(o,n,t.padding);this._location={x:r.x,y:r.y},this._size=[r.width,r.height],this._orient===_C&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),a=n&&n.get("inverse"),o=this._displayables.barGroup,r=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(i!==xC||a?i===xC&&a?{scale:r?[-1,1]:[-1,-1]}:i!==_C||a?{scale:r?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:r?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:r?[1,1]:[1,-1]});var s=t.getBoundingRect([o]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.barGroup;i.add(new pC({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),i.add(new pC({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:T(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,i=t.series,n=i.getRawData(),a=i.getShadowDim?i.getShadowDim():t.otherDim;if(null!=a){var o=n.getDataExtent(a),r=.3*(o[1]-o[0]);o=[o[0]-r,o[1]+r];var s,l=[0,e[1]],u=[0,e[0]],h=[[e[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/e[0]);n.each([a],function(t,e){if(0<p&&e%p)f+=d;else{var i=null==t||isNaN(t)||""===t,n=i?0:gC(t,o,l,!0);i&&!s&&e?(h.push([h[h.length-1][0],0]),c.push([c[c.length-1][0],0])):!i&&s&&(h.push([f,0]),c.push([f,0])),h.push([f,n]),c.push([f,n]),f+=d,s=i}});var g=this.dataZoomModel;this._displayables.barGroup.add(new Rr({shape:{points:h},style:C({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new zr({shape:{points:c},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,s=t.get("showDataShadow");if(!1!==s){var l,u=this.ecModel;return t.eachTargetAxis(function(o,r){E(t.getAxisProxy(o.name,r).getTargetSeriesModels(),function(t){if(!(l||!0!==s&&_(wC,t.get("type"))<0)){var e,i=u.getComponent(o.axis,r).axis,n=function(t){return{x:"y",y:"x",radius:"angle",angle:"radius"}[t]}(o.name),a=t.coordinateSystem;null!=n&&a.getOtherAxis&&(e=a.getOtherAxis(i).inverse),n=t.getData().mapDimension(n),l={thisAxis:i,series:t,thisDim:o.name,otherDim:n,otherAxisInverse:e}}},this)},this),l}},_renderHandle:function(){var t=this._displayables,o=t.handles=[],r=t.handleLabels=[],s=this._displayables.barGroup,e=this._size,l=this.dataZoomModel;s.add(t.filler=new pC({draggable:!0,cursor:SC(this._orient),drift:vC(this._onDragMove,this,"all"),onmousemove:function(t){Ft(t.event)},ondragstart:vC(this._showDataInfo,this,!0),ondragend:vC(this._onDragEnd,this),onmouseover:vC(this._showDataInfo,this,!0),onmouseout:vC(this._showDataInfo,this,!1),style:{fill:l.get("fillerColor"),textPosition:"inside"}})),s.add(new pC({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),yC([0,1],function(t){var e=el(l.get("handleIcon"),{cursor:SC(this._orient),draggable:!0,drift:vC(this._onDragMove,this,t),onmousemove:function(t){Ft(t.event)},ondragend:vC(this._onDragEnd,this),onmouseover:vC(this._showDataInfo,this,!0),onmouseout:vC(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),i=e.getBoundingRect();this._handleHeight=xl(l.get("handleSize"),this._size[1]),this._handleWidth=i.width/i.height*this._handleHeight,e.setStyle(l.getModel("handleStyle").getItemStyle());var n=l.get("handleColor");null!=n&&(e.style.fill=n),s.add(o[t]=e);var a=l.textStyleModel;this.group.add(r[t]=new Dr({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:a.getTextColor(),textFont:a.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[gC(t[0],[0,100],e,!0),gC(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var i=this.dataZoomModel,n=this._handleEnds,a=this._getViewExtent(),o=i.findRepresentativeAxisProxy().getMinMaxSpan(),r=[0,100];ww(e,n,a,i.get("zoomLock")?"all":t,null!=o.minSpan?gC(o.minSpan,r,a,!0):null,null!=o.maxSpan?gC(o.maxSpan,r,a,!0):null);var s=this._range,l=this._range=mC([gC(n[0],a,r,!0),gC(n[1],a,r,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(t){var n=this._displayables,a=this._handleEnds,e=mC(a.slice()),o=this._size;yC([0,1],function(t){var e=n.handles[t],i=this._handleHeight;e.attr({scale:[i/2,i/2],position:[a[t],o[1]/2-i/2]})},this),n.filler.setShape({x:e[0],y:0,width:e[1]-e[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){var e=this.dataZoomModel,o=this._displayables,r=o.handleLabels,s=this._orient,l=["",""];if(e.get("showDetail")){var i=e.findRepresentativeAxisProxy();if(i){var n=i.getAxisModel().axis,a=this._range,u=t?i.calculateDataWindow({start:a[0],end:a[1]}).valueWindow:i.getDataValueWindow();l=[this._formatLabel(u[0],n),this._formatLabel(u[1],n)]}}var h=mC(this._handleEnds.slice());function c(t){var e=Ks(o.handles[t].parent,this.group),i=Js(0===t?"right":"left",e),n=this._handleWidth/2+5,a=$s([h[t]+(0===t?-n:n),this._size[1]/2],e);r[t].setStyle({x:a[0],y:a[1],textVerticalAlign:s===xC?"middle":i,textAlign:s===xC?i:"center",text:l[t]})}c.call(this,0),c.call(this,1)},_formatLabel:function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),a=i.get("labelPrecision");null!=a&&"auto"!==a||(a=e.getPixelPrecision());var o=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(a,20));return O(n)?n(t,o):R(n)?n.replace("{value}",o):o},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,i){this._dragging=!0;var n=$s([e,i],this._displayables.barGroup.getLocalTransform(),!0),a=this._updateInterval(t,n[0]),o=this.dataZoomModel.get("realtime");this._updateView(!o),a&&o&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),this.dataZoomModel.get("realtime")||this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,i=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,a=(n[0]+n[1])/2,o=this._updateInterval("all",i[0]-a);this._updateView(),o&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var i;if(yC(this.getTargetCoordInfo(),function(t){if(!i&&t.length){var e=t[0].model.coordinateSystem;i=e.getRect&&e.getRect()}}),!i){var t=this.api.getWidth(),e=this.api.getHeight();i={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return i}});function SC(t){return"vertical"===t?"ns-resize":"ew-resize"}_T.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var MC="\0_ec_dataZoom_roams";function IC(t,n){var e=TC(t),a=n.dataZoomId,o=n.coordId;E(e,function(t,e){var i=t.dataZoomInfos;i[a]&&_(n.allCoordIds,o)<0&&(delete i[a],t.count--)}),DC(e);var i=e[o];i||((i=e[o]={coordId:o,dataZoomInfos:{},count:0}).controller=function(t,r){var e=new uy(t.getZr());return E(["pan","zoom","scrollMove"],function(o){e.on(o,function(n){var a=[];E(r.dataZoomInfos,function(t){if(n.isAvailableBehavior(t.dataZoomModel.option)){var e=(t.getRange||{})[o],i=e&&e(r.controller,n);!t.dataZoomModel.get("disabled",!0)&&i&&a.push({dataZoomId:t.dataZoomId,start:i[0],end:i[1]})}}),a.length&&r.dispatchAction(a)})}),e}(t,i),i.dispatchAction=A(CC,t)),i.dataZoomInfos[a]||i.count++,i.dataZoomInfos[a]=n;var r=function(t){var n,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;return E(t,function(t){var e=t.dataZoomModel,i=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");a["type_"+n]<a["type_"+i]&&(n=i),o&=e.get("preventDefaultMouseMove",!0)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}}}(i.dataZoomInfos);i.controller.enable(r.controlType,r.opt),i.controller.setPointerChecker(n.containsPoint),dc(i,"dispatchAction",n.dataZoomModel.get("throttle",!0),"fixRate")}function AC(t){return t.type+"\0_"+t.id}function TC(t){var e=t.getZr();return e[MC]||(e[MC]={})}function DC(i){E(i,function(t,e){t.count||(t.controller.dispose(),delete i[e])})}function CC(t,e){t.dispatchAction({type:"dataZoom",batch:e})}var LC=T,kC=ST.extend({type:"dataZoom.inside",init:function(t,e){this._range},render:function(r,t,s,e){kC.superApply(this,"render",arguments),this._range=r.getPercentRange(),E(this.getTargetCoordInfo(),function(t,a){var o=N(t,function(t){return AC(t.model)});E(t,function(e){var n=e.model,i={};E(["pan","zoom","scrollMove"],function(t){i[t]=LC(PC[t],this,e,a)},this),IC(s,{coordId:AC(n),allCoordIds:o,containsPoint:function(t,e,i){return n.coordinateSystem.containPoint([e,i])},dataZoomId:r.id,dataZoomModel:r,getRange:i})},this)},this)},dispose:function(){!function(t,i){var e=TC(t);E(e,function(t){t.controller.dispose();var e=t.dataZoomInfos;e[i]&&(delete e[i],t.count--)}),DC(e)}(this.api,this.dataZoomModel.id),kC.superApply(this,"dispose",arguments),this._range=null}}),PC={zoom:function(t,e,i,n){var a=this._range,o=a.slice(),r=t.axisModels[0];if(r){var s=EC[e](null,[n.originX,n.originY],r,i,t),l=(0<s.signal?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/n.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return ww(0,o,[0,100],0,h.minSpan,h.maxSpan),this._range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}},pan:NC(function(t,e,i,n,a,o){var r=EC[n]([o.oldX,o.oldY],[o.newX,o.newY],e,a,i);return r.signal*(t[1]-t[0])*r.pixel/r.pixelLength}),scrollMove:NC(function(t,e,i,n,a,o){return EC[n]([0,0],[o.scrollDelta,o.scrollDelta],e,a,i).signal*(t[1]-t[0])*o.scrollDelta})};function NC(l){return function(t,e,i,n){var a=this._range,o=a.slice(),r=t.axisModels[0];if(r){var s=l(o,r,t,e,i,n);return ww(s,o,[0,100],"all"),this._range=o,a[0]!==o[0]||a[1]!==o[1]?o:void 0}}}function OC(t){var e=t&&t.visualMap;k(e)||(e=e?[e]:[]),RC(e,function(t){if(t){zC(t,"splitList")&&!zC(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&k(e)&&RC(e,function(t){z(t)&&(zC(t,"start")&&!zC(t,"min")&&(t.min=t.start),zC(t,"end")&&!zC(t,"max")&&(t.max=t.end))})}})}var EC={grid:function(t,e,i,n,a){var o=i.axis,r={},s=a.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=o.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=o.inverse?-1:1),r},polar:function(t,e,i,n,a){var o=i.axis,r={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(r.pixel=e[0]-t[0],r.pixelLength=l[1]-l[0],r.pixelStart=l[0],r.signal=o.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=u[1]-u[0],r.pixelStart=u[0],r.signal=o.inverse?-1:1),r},singleAxis:function(t,e,i,n,a){var o=i.axis,r=a.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=o.inverse?-1:1),s}},RC=E;function zC(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}fu.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?0<t.pieces.length:0<t.splitNumber)&&!t.calculable?"piecewise":"continuous"});var BC=cd.VISUAL.COMPONENT;function VC(t,e,i,n){for(var a=e.targetVisuals[n],o=Bx.prepareVisualTypes(a),r={color:t.getData().getVisual("color")},s=0,l=o.length;s<l;s++){var u=o[s],h=a["opacity"===u?"__alphaForOpacity":u];h&&h.applyVisual(i,c,d)}return r.color;function c(t){return r[t]}function d(t,e){r[t]=e}}af(BC,{createOnAllSeries:!0,reset:function(i,t){var n=[];return t.eachComponent("visualMap",function(t){var e=i.pipelineContext;!t.isTargetSeries(i)||e&&e.large||n.push(function(t,f,p,g){var m={};return E(t,function(t){var e=Bx.prepareVisualTypes(f[t]);m[t]=e}),{progress:function(t,i){function e(t){return i.getItemVisual(a,t)}function n(t,e){i.setItemVisual(a,t,e)}var a;for(null!=g&&(g=i.getDimension(g));null!=(a=t.next());){var o=i.getRawDataItem(a);if(!o||!1!==o.visualMap)for(var r=null!=g?i.get(g,a,!0):a,s=p(r),l=f[s],u=m[s],h=0,c=u.length;h<c;h++){var d=u[h];l[d]&&l[d].applyVisual(r,e,n)}}}}}(t.stateList,t.targetVisuals,T(t.getValueState,t),t.getDataDimension(i.getData())))}),n}}),af(BC,{createOnAllSeries:!0,reset:function(a,t){var o=a.getData(),r=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(a)){var e=t.getVisualMeta(T(VC,null,a,t))||{stops:[],outerColors:[]},i=t.getDataDimension(o),n=o.getDimensionInfo(i);null!=n&&(e.dimension=n.index,r.push(e))}}),a.getData().setVisual("visualMeta",r)}});var GC=function(t,e,i){var n=D((FC[t]||{})[e]);return i&&k(n)?n[n.length-1]:n},FC={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]}},WC=Bx.mapVisual,HC=Bx.eachVisual,ZC=k,UC=E,XC=wl,YC=yl,jC=sf({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,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,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,i)},optionUpdated:function(t,e){var i=this.option;v.canvasSupported||(i.realtime=!1),e||qT(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=T(t,this),this.controllerVisuals=jT(this.option.controller,e,t),this.targetVisuals=jT(this.option.target,e,t)},getTargetSeriesIndices:function(){var t=this.option.seriesIndex,i=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,e){i.push(e)}):i=wa(t),i},eachTargetSeries:function(e,i){E(this.getTargetSeriesIndices(),function(t){e.call(i,this.ecModel.getSeriesByIndex(t))},this)},isTargetSeries:function(e){var i=!1;return this.eachTargetSeries(function(t){t===e&&(i=!0)}),i},formatValueText:function(t,e,i){var n,a,o=this.option,r=o.precision,s=this.dataBound,l=o.formatter;return i=i||["<",">"],k(t)&&(t=t.slice(),n=!0),a=e?t:n?[u(t[0]),u(t[1])]:u(t),R(l)?l.replace("{value}",n?a[0]:a).replace("{value2}",n?a[1]:a):O(l)?n?l(t[0],t[1]):l(t):n?t[0]===s[0]?i[0]+" "+a[1]:t[1]===s[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a;function u(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(r,20))}},resetExtent:function(){var t=this.option,e=XC([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,a=n.length-1;0<=a;a--){var o=n[a];if(!t.getDimensionInfo(o).isCalculationCoord)return o}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),a=e.controller||(e.controller={});m(n,i),m(a,i);var u=this.isCategory();function o(n){ZC(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")},UC(this.stateList,function(t){var e=n[t];if(R(e)){var i=GC(e,"active",u);i?(n[t]={},n[t][e]=i):delete n[t]}},this)}o.call(this,n),o.call(this,a),function(t,e,i){var n=t[e],a=t[i];n&&!a&&(a=t[i]={},UC(n,function(t,e){if(Bx.isValidType(e)){var i=GC(e,"inactive",u);null!=i&&(a[e]=i,"color"!==e||a.hasOwnProperty("opacity")||a.hasOwnProperty("colorAlpha")||(a.opacity=[0,0]))}}))}.call(this,n,"inRange","outOfRange"),function(o){var r=(o.inRange||{}).symbol||(o.outOfRange||{}).symbol,s=(o.inRange||{}).symbolSize||(o.outOfRange||{}).symbolSize,l=this.get("inactiveColor");UC(this.stateList,function(t){var e=this.itemSize,i=o[t];null==(i=i||(o[t]={color:u?l:[l]})).symbol&&(i.symbol=r&&D(r)||(u?"roundRect":["roundRect"])),null==i.symbolSize&&(i.symbolSize=s&&D(s)||(u?e[0]:[e[0],e[0]])),i.symbol=WC(i.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var n=i.symbolSize;if(null!=n){var a=-1/0;HC(n,function(t){a<t&&(a=t)}),i.symbolSize=WC(n,function(t){return YC(t,[0,a],[0,e[0]],!0)})}},this)}.call(this,a)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:et,getValueState:et,getVisualMeta:et}),qC=[20,140],KC=jC.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(t,e){KC.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){KC.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),null!=t[0]&&!isNaN(t[0])||(t[0]=qC[0]),null!=t[1]&&!isNaN(t[1])||(t[1]=qC[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):k(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){jC.prototype.completeVisualOption.apply(this,arguments),E(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=wl((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},getValueState:function(t){var e=this.option.range,i=this.getExtent();return(e[0]<=i[0]||e[0]<=t)&&(e[1]>=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(n){var a=[];return this.eachTargetSeries(function(t){var i=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){n[0]<=t&&t<=n[1]&&i.push(e)},this),a.push({seriesId:t.id,dataIndex:i})},this),a},getVisualMeta:function(i){var t=$C(this,"outOfRange",this.getExtent()),e=$C(this,"inRange",this.option.range.slice()),n=[];function a(t,e){n.push({value:t,color:i(t,e)})}for(var o=0,r=0,s=e.length,l=t.length;r<l&&(!e.length||t[r]<=e[0]);r++)t[r]<e[o]&&a(t[r],"outOfRange");for(var u=1;o<s;o++,u=0)u&&n.length&&a(e[o],"outOfRange"),a(e[o],"inRange");for(u=1;r<l;r++)(!e.length||e[e.length-1]<t[r])&&(u&&(n.length&&a(n[n.length-1].value,"outOfRange"),u=0),a(t[r],"outOfRange"));var h=n.length;return{stops:n,outerColors:[h?n[0].color:"transparent",h?n[h-1].color:"transparent"]}}});function $C(t,e,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,a=i[0],o=[],r=0;r<=200&&a<i[1];r++)o.push(a),a+=n;return o.push(i[1]),o}var JC=lf({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(t,e){this.ecModel=t,this.api=e,this.visualMapModel},render:function(t,e,i,n){!1!==(this.visualMapModel=t).get("show")?this.doRender.apply(this,arguments):this.group.removeAll()},renderBackground:function(t){var e=this.visualMapModel,i=Vl(e.get("padding")||0),n=t.getBoundingRect();t.add(new Hr({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},getControllerVisual:function(i,n,a){var t=(a=a||{}).forceState,e=this.visualMapModel,o={};if("symbol"===n&&(o.symbol=e.get("itemSymbol")),"color"===n){var r=e.get("contentColor");o.color=r}function s(t){return o[t]}function l(t,e){o[t]=e}var u=e.controllerVisuals[t||e.getValueState(i)];return E(Bx.prepareVisualTypes(u),function(t){var e=u[t];a.convertOpacityToAlpha&&"opacity"===t&&(t="colorAlpha",e=u.__alphaForOpacity),Bx.dependsOn(t,n)&&e&&e.applyVisual(i,s,l)}),o[n]},positionGroup:function(t){var e=this.visualMapModel,i=this.api;ou(t,e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:et});function QC(t,e,i){var n=t.option,a=n.align;if(null!=a&&"auto"!==a)return a;for(var o={width:e.getWidth(),height:e.getHeight()},r="horizontal"===n.orient?1:0,s=[["left","right","width"],["top","bottom","height"]],l=s[r],u=[0,null,10],h={},c=0;c<3;c++)h[s[1-r][c]]=u[c],h[l[c]]=2===c?i[0]:n[l[c]];var d=[["x","width",3],["y","height",0]][r],f=au(h,o,n.padding);return l[(f.margin[d[2]]||0)+f[d[0]]+.5*f[d[1]]<.5*o[d[1]]?0:1]}function tL(t,e){return E(t||[],function(t){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")}),t}var eL=yl,iL=E,nL=Math.min,aL=Math.max,oL=JC.extend({type:"visualMap.continuous",init:function(){oL.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(t,e,i,n){n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},_buildView:function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var i=t.get("text");this._renderEndsText(e,i,0),this._renderEndsText(e,i,1),this._updateView(!0),this.renderBackground(e),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},_renderEndsText:function(t,e,i){if(e){var n=e[1-i];n=null!=n?n+"":"";var a=this.visualMapModel,o=a.get("textGap"),r=a.itemSize,s=this._shapes.barGroup,l=this._applyTransform([r[0]/2,0===i?-o:r[1]+o],s),u=this._applyTransform(0===i?"bottom":"top",s),h=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new Dr({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===h?"middle":u,textAlign:"horizontal"===h?u:"center",text:n,textFont:c.getFont(),textFill:c.getTextColor()}}))}},_renderBar:function(t){var e=this.visualMapModel,i=this._shapes,n=e.itemSize,a=this._orient,o=this._useHandle,r=QC(e,this.api,n),s=i.barGroup=this._createBarGroup(r);s.add(i.outOfRange=rL()),s.add(i.inRange=rL(null,o?lL(this._orient):null,T(this._dragHandle,this,"all",!1),T(this._dragHandle,this,"all",!0)));var l=e.textStyleModel.getTextRect("国"),u=aL(l.width,l.height);o&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(s,0,n,u,a,r),this._createHandle(s,1,n,u,a,r)),this._createIndicator(s,n,u,a),t.add(s)},_createHandle:function(t,e,i,n,a){var o=T(this._dragHandle,this,e,!1),r=T(this._dragHandle,this,e,!0),s=rL(function(t,e){return 0===t?[[0,0],[e,0],[e,-e]]:[[0,0],[e,0],[e,e]]}(e,n),lL(this._orient),o,r);s.position[0]=i[0],t.add(s);var l=this.visualMapModel.textStyleModel,u=new Dr({draggable:!0,drift:o,onmousemove:function(t){Ft(t.event)},ondragend:r,style:{x:0,y:0,text:"",textFont:l.getFont(),textFill:l.getTextColor()}});this.group.add(u);var h=["horizontal"===a?n/2:1.5*n,"horizontal"===a?0===e?-1.5*n:1.5*n:0===e?-n/2:n/2],c=this._shapes;c.handleThumbs[e]=s,c.handleLabelPoints[e]=h,c.handleLabels[e]=u},_createIndicator:function(t,e,i,n){var a=rL([[0,0]],"move");a.position[0]=e[0],a.attr({invisible:!0,silent:!0}),t.add(a);var o=this.visualMapModel.textStyleModel,r=new Dr({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:o.getFont(),textFill:o.getTextColor()}});this.group.add(r);var s=["horizontal"===n?i/2:9,0],l=this._shapes;l.indicator=a,l.indicatorLabel=r,l.indicatorLabelPoint=s},_dragHandle:function(t,e,i,n){if(this._useHandle){if(this._dragging=!e,!e){var a=this._applyTransform([i,n],this._shapes.barGroup,!0);this._updateInterval(t,a[1]),this._updateView()}e===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?this._hovering||this._clearHoverLinkToSeries():sL(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},_resetInterval:function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),i=t.getExtent(),n=[0,t.itemSize[1]];this._handleEnds=[eL(e[0],i,n,!0),eL(e[1],i,n,!0)]},_updateInterval:function(t,e){e=e||0;var i=this.visualMapModel,n=this._handleEnds,a=[0,i.itemSize[1]];ww(e,n,a,t,0);var o=i.getExtent();this._dataInterval=[eL(n[0],a,o,!0),eL(n[1],a,o,!0)]},_updateView:function(t){var e=this.visualMapModel,i=e.getExtent(),n=this._shapes,a=[0,e.itemSize[1]],o=t?a:this._handleEnds,r=this._createBarVisual(this._dataInterval,i,o,"inRange"),s=this._createBarVisual(i,i,a,"outOfRange");n.inRange.setStyle({fill:r.barColor,opacity:r.opacity}).setShape("points",r.barPoints),n.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(o,r)},_createBarVisual:function(t,e,i,n){var a={forceState:n,convertOpacityToAlpha:!0},o=this._makeColorGradient(t,a),r=[this.getControllerVisual(t[0],"symbolSize",a),this.getControllerVisual(t[1],"symbolSize",a)],s=this._createBarPoints(i,r);return{barColor:new Jr(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},_makeColorGradient:function(t,e){var i=[],n=(t[1]-t[0])/100;i.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var a=1;a<100;a++){var o=t[0]+n*a;if(o>t[1])break;i.push({color:this.getControllerVisual(o,"color",e),offset:a/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new Si("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(n,a){if(this._useHandle){var o=this._shapes,r=this.visualMapModel,s=o.handleThumbs,l=o.handleLabels;iL([0,1],function(t){var e=s[t];e.setStyle("fill",a.handlesColor[t]),e.position[1]=n[t];var i=$s(o.handleLabelPoints[t],Ks(e,this.group));l[t].setStyle({x:i[0],y:i[1],text:r.formatValueText(this._dataInterval[t]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===t?"bottom":"top":"left",o.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var a=this.visualMapModel,o=a.getExtent(),r=a.itemSize,s=[0,r[1]],l=eL(t,o,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(t,e,i,n){return t?[[0,-nL(e,aL(i,0))],[6,0],[0,nL(e,aL(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,r[1]));var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=$s(u.indicatorLabelPoint,Ks(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+a.formatValueText(e),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var n=this;this._shapes.barGroup.on("mousemove",function(t){if(n._hovering=!0,!n._dragging){var e=n.visualMapModel.itemSize,i=n._applyTransform([t.offsetX,t.offsetY],n._shapes.barGroup,!0,!0);i[1]=nL(aL(0,i[1]),e[1]),n._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=e[0])}}).on("mouseout",function(){n._hovering=!1,n._dragging||n._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var a=[0,n[1]],o=i.getExtent();t=nL(aL(a[0],t),a[1]);var r=function(t,e,i){var n=6,a=t.get("hoverLinkDataSize");a&&(n=eL(a,e,i,!0)/2);return n}(i,o,a),s=[t-r,t+r],l=eL(t,a,o,!0),u=[eL(s[0],a,o,!0),eL(s[1],a,o,!0)];s[0]<a[0]&&(u[0]=-1/0),a[1]<s[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",r):u[1]===1/0?this._showIndicator(l,u[0],"> ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||sL(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=function(t,e){var i={},n={};return a(t||[],i),a(e||[],n,i),[o(i),o(n)];function a(t,e,i){for(var n=0,a=t.length;n<a;n++)for(var o=t[n].seriesId,r=wa(t[n].dataIndex),s=i&&i[o],l=0,u=r.length;l<u;l++){var h=r[l];s&&s[h]?s[h]=null:(e[o]||(e[o]={}))[h]=1}}function o(t,e){var i=[];for(var n in t)if(t.hasOwnProperty(n)&&null!=t[n])if(e)i.push(+n);else{var a=o(t[n],!0);a.length&&i.push({seriesId:n,dataIndex:a})}return i}}(h,c);this._dispatchHighDown("downplay",tL(d[0],i)),this._dispatchHighDown("highlight",tL(d[1],i))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=e.dataIndex){var n=this.ecModel.getSeriesByIndex(e.seriesIndex);if(i.isTargetSeries(n)){var a=n.getData(e.dataType),o=a.get(i.getDataDimension(a),e.dataIndex,!0);isNaN(o)||this._showIndicator(o,o)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",tL(t,this.visualMapModel)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,i,n){var a=Ks(e,n?null:this.group);return ol[k(t)?"applyTransform":"transformDirection"](t,a,i)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function rL(t,e,i,n){return new Rr({shape:{points:t},draggable:!!i,cursor:e,drift:i,onmousemove:function(t){Ft(t.event)},ondragend:n})}function sL(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function lL(t){return"vertical"===t?"ns-resize":"ew-resize"}tf({type:"selectDataRange",event:"dataRangeSelected",update:"update"},function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})}),Jd(OC);var uL=jC.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){uL.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();hL[this._mode].call(this),this._resetSelected(t,e);var n=this.option.categories;this.resetVisual(function(t,e){"categories"===i?(t.mappingMethod="category",t.categories=D(n)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=N(this._pieceList,function(t){t=D(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){var n=this.option,i={},t=Bx.listVisualTypes(),a=this.isCategory();function o(t,e,i){return t&&t[e]&&(z(t[e])?t[e].hasOwnProperty(i):t[e]===i)}E(n.pieces,function(e){E(t,function(t){e.hasOwnProperty(t)&&(i[t]=1)})}),E(i,function(t,e){var i=0;E(this.stateList,function(t){i|=o(n,t,e)||o(n.target,t,e)},this),i||E(this.stateList,function(t){(n[t]||(n[t]={}))[e]=GC(e,"inRange"===t?"active":"inactive",a)})},this),jC.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var i=this.option,n=this._pieceList,a=(e?i:t).selected||{};if(i.selected=a,E(n,function(t,e){var i=this.getSelectedMapKey(t);a.hasOwnProperty(i)||(a[i]=!0)},this),"single"===i.selectedMode){var o=!1;E(n,function(t,e){var i=this.getSelectedMapKey(t);a[i]&&(o?a[i]=!1:o=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&0<t.pieces.length?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=D(t)},getValueState:function(t){var e=Bx.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(n){var a=[];return this.eachTargetSeries(function(t){var i=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){Bx.findPieceIndex(t,this._pieceList)===n&&i.push(e)},this),a.push({seriesId:t.id,dataIndex:i})},this),a},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return e},getVisualMeta:function(a){if(!this.isCategory()){var o=[],r=[],s=this,t=this._pieceList.slice();if(t.length){var e=t[0].interval[0];e!==-1/0&&t.unshift({interval:[-1/0,e]}),(e=t[t.length-1].interval[1])!==1/0&&t.push({interval:[e,1/0]})}else t.push({interval:[-1/0,1/0]});var i=-1/0;return E(t,function(t){var e=t.interval;e&&(e[0]>i&&n([i,e[0]],"outOfRange"),n(e.slice()),i=e[1])},this),{stops:o,outerColors:r}}function n(t,e){var i=s.getRepresentValue({interval:t});e=e||s.getValueState(i);var n=a(i,e);t[0]===-1/0?r[0]=n:t[1]===1/0?r[1]=n:o.push({value:t[0],color:n},{value:t[1],color:n})}}}),hL={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),a=t.splitNumber;a=Math.max(parseInt(a,10),1),t.splitNumber=a;for(var o=(n[1]-n[0])/a;+o.toFixed(i)!==o&&i<5;)i++;t.precision=i,o=+o.toFixed(i);var r=0;t.minOpen&&e.push({index:r++,interval:[-1/0,n[0]],close:[0,0]});for(var s=n[0],l=r+a;r<l;s+=o){var u=r===a-1?n[1]:s+o;e.push({index:r++,interval:[s,u],close:[1,1]})}t.maxOpen&&e.push({index:r++,interval:[n[1],1/0],close:[0,0]}),Ol(e),E(e,function(t){t.text=this.formatValueText(t.interval)},this)},categories:function(){var t=this.option;E(t.categories,function(t){this._pieceList.push({text:this.formatValueText(t,!0),value:t})},this),cL(t,this._pieceList)},pieces:function(){var t=this.option,d=this._pieceList;E(t.pieces,function(t,e){z(t)||(t={value:t});var i={text:"",index:e};if(null!=t.label&&(i.text=t.label),t.hasOwnProperty("value")){var n=i.value=t.value;i.interval=[n,n],i.close=[1,1]}else{for(var a=i.interval=[],o=i.close=[0,0],r=[1,0,1],s=[-1/0,1/0],l=[],u=0;u<2;u++){for(var h=[["gte","gt","min"],["lte","lt","max"]][u],c=0;c<3&&null==a[u];c++)a[u]=t[h[c]],o[u]=r[c],l[u]=2===c;null==a[u]&&(a[u]=s[u])}l[0]&&a[1]===1/0&&(o[0]=0),l[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(i.value=a[0])}i.visual=Bx.retrieveVisuals(t),d.push(i)},this),cL(t,d),Ol(d),E(d,function(t){var e=t.close,i=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};function cL(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}JC.extend({type:"visualMap.piecewise",doRender:function(){var o=this.group;o.removeAll();var r=this.visualMapModel,s=r.get("textGap"),t=r.textStyleModel,l=t.getFont(),u=t.getTextColor(),h=this._getItemAlign(),c=r.itemSize,e=this._getViewData(),i=e.endsText,d=W(r.get("showLabel",!0),!i);i&&this._renderEndsText(o,i[0],c,d,h),E(e.viewPieceList,function(t){var e=t.piece,i=new Si;i.onclick=T(this._onItemClick,this,e),this._enableHoverLink(i,t.indexInModelPieceList);var n=r.getRepresentValue(e);if(this._createItemSymbol(i,n,[0,0,c[0],c[1]]),d){var a=this.visualMapModel.getValueState(n);i.add(new Dr({style:{x:"right"===h?-s:c[0]+s,y:c[1]/2,text:e.text,textVerticalAlign:"middle",textAlign:h,textFont:l,textFill:u,opacity:"outOfRange"===a?.5:1}}))}o.add(i)},this),i&&this._renderEndsText(o,i[1],c,d,h),nu(r.get("orient"),o,r.get("itemGap")),this.renderBackground(o),this.positionGroup(o)},_enableHoverLink:function(t,i){function e(t){var e=this.visualMapModel;e.option.hoverLink&&this.api.dispatchAction({type:t,batch:tL(e.findTargetDataIndices(i),e)})}t.on("mouseover",T(e,this,"highlight")).on("mouseout",T(e,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return QC(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,a){if(e){var o=new Si,r=this.visualMapModel.textStyleModel;o.add(new Dr({style:{x:n?"right"===a?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?a:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(o)}},_getViewData:function(){var t=this.visualMapModel,e=N(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),a=t.get("inverse");return("horizontal"===n?a:!a)?e.reverse():i=i&&i.slice().reverse(),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(Jp(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,i=e.option,n=D(i.selected),a=e.getSelectedMapKey(t);"single"===i.selectedMode?(n[a]=!0,E(n,function(t,e){n[e]=e===a})):n[a]=!n[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}});Jd(OC);var dL,fL="urn:schemas-microsoft-com:vml",pL="undefined"==typeof window?null:window,gL=!1,mL=pL&&pL.document;function vL(t){return dL(t)}if(mL&&!v.canvasSupported)try{mL.namespaces.zrvml||mL.namespaces.add("zrvml",fL),dL=function(t){return mL.createElement("<zrvml:"+t+' class="zrvml">')}}catch(t){dL=function(t){return mL.createElement("<"+t+' xmlns="'+fL+'" class="zrvml">')}}var yL,xL=Ho.CMD,_L=Math.round,wL=Math.sqrt,bL=Math.abs,SL=Math.cos,ML=Math.sin,IL=Math.max;if(!v.canvasSupported){var AL=",",TL="progid:DXImageTransform.Microsoft",DL=21600,CL=DL/2,LL=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=DL+","+DL,t.coordorigin="0,0"},kL=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},PL=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},NL=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},OL=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},EL=Fn,RL=function(t,e,i){var n=Ee(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=kL(n[0],n[1],n[2]),t.opacity=i*n[3])},zL=function(t,e,i,n){var a="fill"===e,o=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(a||!a&&i.lineWidth)?(t[a?"filled":"stroked"]="true",i[e]instanceof jr&&NL(t,o),o=o||vL(e),a?function(t,e,i){var n,a,o=e.fill;if(null!=o)if(o instanceof jr){var r,s=0,l=[0,0],u=0,h=1,c=i.getBoundingRect(),d=c.width,f=c.height;if("linear"===o.type){r="gradient";var p=i.transform,g=[o.x*d,o.y*f],m=[o.x2*d,o.y2*f];p&&(bt(g,g,p),bt(m,m,p));var v=m[0]-g[0],y=m[1]-g[1];(s=180*Math.atan2(v,y)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{r="gradientradial";g=[o.x*d,o.y*f],p=i.transform;var x=i.scale,_=d,w=f;l=[(g[0]-c.x)/_,(g[1]-c.y)/w],p&&bt(g,g,p),_/=x[0]*DL,w/=x[1]*DL;var b=IL(_,w);u=0/b,h=2*o.r/b-u}var S=o.colorStops.slice();S.sort(function(t,e){return t.offset-e.offset});for(var M=S.length,I=[],A=[],T=0;T<M;T++){var D=S[T],C=(n=D.color,void 0,a=Ee(n),[kL(a[0],a[1],a[2]),a[3]]);A.push(D.offset*h+u+" "+C[0]),0!==T&&T!==M-1||I.push(C)}if(2<=M){var L=I[0][0],k=I[1][0],P=I[0][1]*e.opacity,N=I[1][1]*e.opacity;t.type=r,t.method="none",t.focus="100%",t.angle=s,t.color=L,t.color2=k,t.colors=A.join(","),t.opacity=N,t.opacity2=P}"radial"===r&&(t.focusposition=l.join(","))}else RL(t,o,e.opacity)}(o,i,n):function(t,e){e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof jr||RL(t,e.stroke,e.opacity)}(o,i),PL(t,o)):(t[a?"filled":"stroked"]="false",NL(t,o))},BL=[[],[],[]];hr.prototype.brushVML=function(t){var e=this.style,i=this._vmlEl;i||(i=vL("shape"),LL(i),this._vmlEl=i),zL(i,"fill",e,this),zL(i,"stroke",e,this);var n=this.transform,a=null!=n,o=i.getElementsByTagName("stroke")[0];if(o){var r=e.lineWidth;if(a&&!e.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];r*=wL(bL(s))}o.weight=r+"px"}var l=this.path||(this.path=new Ho);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(t,e){var i,n,a,o,r,s,l=xL.M,u=xL.C,h=xL.L,c=xL.A,d=xL.Q,f=[],p=t.data,g=t.len();for(o=0;o<g;){switch(n="",i=0,a=p[o++]){case l:n=" m ",i=1,r=p[o++],s=p[o++],BL[0][0]=r,BL[0][1]=s;break;case h:n=" l ",i=1,r=p[o++],s=p[o++],BL[0][0]=r,BL[0][1]=s;break;case d:case u:n=" c ",i=3;var m,v,y=p[o++],x=p[o++],_=p[o++],w=p[o++];a===d?(_=((m=_)+2*y)/3,w=((v=w)+2*x)/3,y=(r+2*y)/3,x=(s+2*x)/3):(m=p[o++],v=p[o++]),BL[0][0]=y,BL[0][1]=x,BL[1][0]=_,BL[1][1]=w,r=BL[2][0]=m,s=BL[2][1]=v;break;case c:var b=0,S=0,M=1,I=1,A=0;e&&(b=e[4],S=e[5],M=wL(e[0]*e[0]+e[1]*e[1]),I=wL(e[2]*e[2]+e[3]*e[3]),A=Math.atan2(-e[1]/I,e[0]/M));var T=p[o++],D=p[o++],C=p[o++],L=p[o++],k=p[o++]+A,P=p[o++]+k+A;o++;var N=p[o++],O=T+SL(k)*C,E=D+ML(k)*L,R=(y=T+SL(P)*C,x=D+ML(P)*L,N?" wa ":" at ");Math.abs(O-y)<1e-4&&(.01<Math.abs(P-k)?N&&(O+=.0125):Math.abs(E-D)<1e-4?N&&O<T||!N&&T<O?x-=.0125:x+=.0125:N&&E<D||!N&&D<E?y+=.0125:y-=.0125),f.push(R,_L(((T-C)*M+b)*DL-CL),AL,_L(((D-L)*I+S)*DL-CL),AL,_L(((T+C)*M+b)*DL-CL),AL,_L(((D+L)*I+S)*DL-CL),AL,_L((O*M+b)*DL-CL),AL,_L((E*I+S)*DL-CL),AL,_L((y*M+b)*DL-CL),AL,_L((x*I+S)*DL-CL)),r=y,s=x;break;case xL.R:var z=BL[0],B=BL[1];z[0]=p[o++],z[1]=p[o++],B[0]=z[0]+p[o++],B[1]=z[1]+p[o++],e&&(bt(z,z,e),bt(B,B,e)),z[0]=_L(z[0]*DL-CL),B[0]=_L(B[0]*DL-CL),z[1]=_L(z[1]*DL-CL),B[1]=_L(B[1]*DL-CL),f.push(" m ",z[0],AL,z[1]," l ",B[0],AL,z[1]," l ",B[0],AL,B[1]," l ",z[0],AL,B[1]);break;case xL.Z:f.push(" x ")}if(0<i){f.push(n);for(var V=0;V<i;V++){var G=BL[V];e&&bt(G,G,e),f.push(_L(G[0]*DL-CL),AL,_L(G[1]*DL-CL),V<i-1?AL:"")}}}return f.join("")}(l,this.transform),i.style.zIndex=OL(this.zlevel,this.z,this.z2),PL(t,i),null!=e.text?this.drawRectText(t,this.getBoundingRect()):this.removeRectText(t)},hr.prototype.onRemove=function(t){NL(t,this._vmlEl),this.removeRectText(t)},hr.prototype.onAdd=function(t){PL(t,this._vmlEl),this.appendRectText(t)};Yn.prototype.brushVML=function(t){var e,i,n=this.style,a=n.image;if(function(t){return"object"==typeof t&&t.tagName&&"IMG"===t.tagName.toUpperCase()}(a)){var o=a.src;if(o===this._imageSrc)e=this._imageWidth,i=this._imageHeight;else{var r=a.runtimeStyle,s=r.width,l=r.height;r.width="auto",r.height="auto",e=a.width,i=a.height,r.width=s,r.height=l,this._imageSrc=o,this._imageWidth=e,this._imageHeight=i}a=o}else a===this._imageSrc&&(e=this._imageWidth,i=this._imageHeight);if(a){var u=n.x||0,h=n.y||0,c=n.width,d=n.height,f=n.sWidth,p=n.sHeight,g=n.sx||0,m=n.sy||0,v=f&&p,y=this._vmlEl;y||(y=mL.createElement("div"),LL(y),this._vmlEl=y);var x,_=y.style,w=!1,b=1,S=1;if(this.transform&&(x=this.transform,b=wL(x[0]*x[0]+x[1]*x[1]),S=wL(x[2]*x[2]+x[3]*x[3]),w=x[1]||x[2]),w){var M=[u,h],I=[u+c,h],A=[u,h+d],T=[u+c,h+d];bt(M,M,x),bt(I,I,x),bt(A,A,x),bt(T,T,x);var D=IL(M[0],I[0],A[0],T[0]),C=IL(M[1],I[1],A[1],T[1]),L=[];L.push("M11=",x[0]/b,AL,"M12=",x[2]/S,AL,"M21=",x[1]/b,AL,"M22=",x[3]/S,AL,"Dx=",_L(u*b+x[4]),AL,"Dy=",_L(h*S+x[5])),_.padding="0 "+_L(D)+"px "+_L(C)+"px 0",_.filter=TL+".Matrix("+L.join("")+", SizingMethod=clip)"}else x&&(u=u*b+x[4],h=h*S+x[5]),_.filter="",_.left=_L(u)+"px",_.top=_L(h)+"px";var k=this._imageEl,P=this._cropEl;k||(k=mL.createElement("div"),this._imageEl=k);var N=k.style;if(v){if(e&&i)N.width=_L(b*e*c/f)+"px",N.height=_L(S*i*d/p)+"px";else{var O=new Image,E=this;O.onload=function(){O.onload=null,e=O.width,i=O.height,N.width=_L(b*e*c/f)+"px",N.height=_L(S*i*d/p)+"px",E._imageWidth=e,E._imageHeight=i,E._imageSrc=a},O.src=a}P||((P=mL.createElement("div")).style.overflow="hidden",this._cropEl=P);var R=P.style;R.width=_L((c+g*c/f)*b),R.height=_L((d+m*d/p)*S),R.filter=TL+".Matrix(Dx="+-g*c/f*b+",Dy="+-m*d/p*S+")",P.parentNode||y.appendChild(P),k.parentNode!==P&&P.appendChild(k)}else N.width=_L(b*c)+"px",N.height=_L(S*d)+"px",y.appendChild(k),P&&P.parentNode&&(y.removeChild(P),this._cropEl=null);var z="",B=n.opacity;B<1&&(z+=".Alpha(opacity="+_L(100*B)+") "),z+=TL+".AlphaImageLoader(src="+a+", SizingMethod=scale)",N.filter=z,y.style.zIndex=OL(this.zlevel,this.z,this.z2),PL(t,y),null!=n.text&&this.drawRectText(t,this.getBoundingRect())}},Yn.prototype.onRemove=function(t){NL(t,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(t)},Yn.prototype.onAdd=function(t){PL(t,this._vmlEl),this.appendRectText(t)};var VL,GL="normal",FL={},WL=0,HL=document.createElement("div");yL=function(t,e){var i=mL;VL||((VL=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",mL.body.appendChild(VL));try{VL.style.font=e}catch(t){}return VL.innerHTML="",VL.appendChild(i.createTextNode(t)),{width:VL.offsetWidth}},sn["measureText"]=yL;for(var ZL=new bi,UL=function(t,e,i,n){var a=this.style;this.__dirty&&Cn(a);var o=a.text;if(null!=o&&(o+=""),o){if(a.rich){var r=xn(o,a);o=[];for(var s=0;s<r.lines.length;s++){for(var l=r.lines[s].tokens,u=[],h=0;h<l.length;h++)u.push(l[h].text);o.push(u.join(""))}o=o.join("\n")}var c,d,f=a.textAlign,p=a.textVerticalAlign,g=function(t){var e=FL[t];if(!e){100<WL&&(WL=0,FL={});var i,n=HL.style;try{n.font=t,i=n.fontFamily.split(",")[0]}catch(t){}e={style:n.fontStyle||GL,variant:n.fontVariant||GL,weight:n.fontWeight||GL,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},FL[t]=e,WL++}return e}(a.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||un(o,m,f,p,a.textPadding,a.textLineHeight);var v=this.transform;if(v&&!n&&(ZL.copy(e),ZL.applyTransform(v),e=ZL),n)c=e.x,d=e.y;else{var y=a.textPosition;if(y instanceof Array)c=e.x+EL(y[0],e.width),d=e.y+EL(y[1],e.height),f=f||"left";else{var x=this.calculateTextPosition?this.calculateTextPosition({},a,e):dn({},a,e);c=x.x,d=x.y,f=f||x.textAlign,p=p||x.textVerticalAlign}}c=hn(c,i.width,f),d=cn(d,i.height,p),d+=i.height/2;var _,w,b,S=vL,M=this._textVmlEl;M?w=(_=(b=M.firstChild).nextSibling).nextSibling:(M=S("line"),_=S("path"),w=S("textpath"),b=S("skew"),w.style["v-text-align"]="left",LL(M),_.textpathok=!0,w.on=!0,M.from="0 0",M.to="1000 0.05",PL(M,b),PL(M,_),PL(M,w),this._textVmlEl=M);var I=[c,d],A=M.style;v&&n?(bt(I,I,v),b.on=!0,b.matrix=v[0].toFixed(3)+AL+v[2].toFixed(3)+AL+v[1].toFixed(3)+AL+v[3].toFixed(3)+",0,0",b.offset=(_L(I[0])||0)+","+(_L(I[1])||0),b.origin="0 0",A.left="0px",A.top="0px"):(b.on=!1,A.left=_L(c)+"px",A.top=_L(d)+"px"),w.string=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")}(o);try{w.style.font=m}catch(t){}zL(M,"fill",{fill:a.textFill,opacity:a.opacity},this),zL(M,"stroke",{stroke:a.textStroke,opacity:a.opacity,lineDash:a.lineDash||null},this),M.style.zIndex=OL(this.zlevel,this.z,this.z2),PL(t,M)}},XL=function(t){NL(t,this._textVmlEl),this._textVmlEl=null},YL=function(t){PL(t,this._textVmlEl)},jL=[Zn,Xn,Yn,hr,Dr],qL=0;qL<jL.length;qL++){var KL=jL[qL].prototype;KL.drawRectText=UL,KL.removeRectText=XL,KL.appendRectText=YL}Dr.prototype.brushVML=function(t){var e=this.style;null!=e.text?this.drawRectText(t,{x:e.x||0,y:e.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(t)},Dr.prototype.onRemove=function(t){this.removeRectText(t)},Dr.prototype.onAdd=function(t){this.appendRectText(t)}}function $L(t){return parseInt(t,10)}function JL(t,e){!function(){if(!gL&&mL){gL=!0;var t=mL.styleSheets;t.length<31?mL.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}(),this.root=t,this.storage=e;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var a=e.delFromStorage,o=e.addToStorage;e.delFromStorage=function(t){a.call(e,t),t&&t.onRemove&&t.onRemove(n)},e.addToStorage=function(t){t.onAdd&&t.onAdd(n),o.call(e,t)},this._firstPaint=!0}JL.prototype={constructor:JL,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0,!0);this._paintList(t)},_paintList:function(t){for(var e=this._vmlRoot,i=0;i<t.length;i++){var n=t[i];n.invisible||n.ignore?(n.__alreadyNotVisible||n.onRemove(e),n.__alreadyNotVisible=!0):(n.__alreadyNotVisible&&n.onAdd(e),n.__alreadyNotVisible=!1,n.__dirty&&(n.beforeBrush&&n.beforeBrush(),(n.brushVML||n.brush).call(n,e),n.afterBrush&&n.afterBrush())),n.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(e),this._firstPaint=!1)},resize:function(t,e){t=null==t?this._getWidth():t,e=null==e?this._getHeight():e;if(this._width!==t||this._height!==e){this._width=t,this._height=e;var i=this._vmlViewport.style;i.width=t+"px",i.height=e+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var t=this.root,e=t.currentStyle;return(t.clientWidth||$L(e.width))-$L(e.paddingLeft)-$L(e.paddingRight)|0},_getHeight:function(){var t=this.root,e=t.currentStyle;return(t.clientHeight||$L(e.height))-$L(e.paddingTop)-$L(e.paddingBottom)|0}},E(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){JL.prototype[t]=function(t){return function(){ci('In IE8.0 VML mode painter not support method "'+t+'"')}}(t)}),pa("vml",JL);function QL(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}var tk=Ho.CMD,ek=Array.prototype.join,ik="none",nk=Math.round,ak=Math.sin,ok=Math.cos,rk=Math.PI,sk=2*Math.PI,lk=180/rk,uk=1e-4;function hk(t){return nk(1e4*t)/1e4}function ck(t){return t<uk&&-uk<t}function dk(t,e){e&&fk(t,"transform","matrix("+ek.call(e,",")+")")}function fk(t,e,i){i&&("linear"===i.type||"radial"===i.type)||t.setAttribute(e,i)}function pk(t,e,i,n){if(function(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==ik}(e,i)){var a=i?e.textFill:e.fill;fk(t,"fill",a="transparent"===a?ik:a),fk(t,"fill-opacity",null!=e.fillOpacity?e.fillOpacity*e.opacity:e.opacity)}else fk(t,"fill",ik);if(function(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==ik}(e,i)){var o=i?e.textStroke:e.stroke;fk(t,"stroke",o="transparent"===o?ik:o),fk(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?n.getLineScale():1)),fk(t,"paint-order",i?"stroke":"fill"),fk(t,"stroke-opacity",null!=e.strokeOpacity?e.strokeOpacity:e.opacity),e.lineDash?(fk(t,"stroke-dasharray",e.lineDash.join(",")),fk(t,"stroke-dashoffset",nk(e.lineDashOffset||0))):fk(t,"stroke-dasharray",""),e.lineCap&&fk(t,"stroke-linecap",e.lineCap),e.lineJoin&&fk(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&fk(t,"stroke-miterlimit",e.miterLimit)}else fk(t,"stroke",ik)}var gk={};gk.brush=function(t){var e=t.style,i=t.__svgEl;i||(i=QL("path"),t.__svgEl=i),t.path||t.createPathProxy();var n=t.path;if(t.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,t.buildPath(n,t.shape),t.__dirtyPath=!1;var a=function(t){for(var e=[],i=t.data,n=t.len(),a=0;a<n;){var o="",r=0;switch(i[a++]){case tk.M:o="M",r=2;break;case tk.L:o="L",r=2;break;case tk.Q:o="Q",r=4;break;case tk.C:o="C",r=6;break;case tk.A:var s=i[a++],l=i[a++],u=i[a++],h=i[a++],c=i[a++],d=i[a++],f=i[a++],p=i[a++],g=Math.abs(d),m=ck(g-sk)||(p?sk<=d:sk<=-d),v=0<d?d%sk:d%sk+sk,y=!1;y=!!m||!ck(g)&&rk<=v==!!p;var x=hk(s+u*ok(c)),_=hk(l+h*ak(c));m&&(d=p?sk-1e-4:1e-4-sk,y=!0,9===a&&e.push("M",x,_));var w=hk(s+u*ok(c+d)),b=hk(l+h*ak(c+d));e.push("A",hk(u),hk(h),nk(f*lk),+y,+p,w,b);break;case tk.Z:o="Z";break;case tk.R:w=hk(i[a++]),b=hk(i[a++]);var S=hk(i[a++]),M=hk(i[a++]);e.push("M",w,b,"L",w+S,b,"L",w+S,b+M,"L",w,b+M,"L",w,b)}o&&e.push(o);for(var I=0;I<r;I++)e.push(hk(i[a++]))}return e.join(" ")}(n);a.indexOf("NaN")<0&&fk(i,"d",a)}pk(i,e,!1,t),dk(i,t.transform),null!=e.text&&bk(t,t.getBoundingRect())};var mk={brush:function(t){var e=t.style,i=e.image;i instanceof HTMLImageElement&&(i=i.src);if(i){var n=e.x||0,a=e.y||0,o=e.width,r=e.height,s=t.__svgEl;s||(s=QL("image"),t.__svgEl=s),i!==t.__imageSrc&&(function(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}(s,"href",i),t.__imageSrc=i),fk(s,"width",o),fk(s,"height",r),fk(s,"x",n),fk(s,"y",a),dk(s,t.transform),null!=e.text&&bk(t,t.getBoundingRect())}}},vk={},yk=new bi,xk={},_k=[],wk={left:"start",right:"end",center:"middle",middle:"middle"},bk=function(t,e){var i=t.style,n=t.transform,a=t instanceof Dr||i.transformText;t.__dirty&&Cn(i);var o=i.text;if(null!=o&&(o+=""),Hn(o,i)){null==o&&(o=""),!a&&n&&(yk.copy(e),yk.applyTransform(n),e=yk);var r=t.__textSvgEl;r||(r=QL("text"),t.__textSvgEl=r);var s=r.style,l=i.font||rn,u=r.__computedFont;l!==r.__styleFont&&(s.font=r.__styleFont=l,u=r.__computedFont=s.font);var h=i.textPadding,c=i.textLineHeight,d=t.__textCotentBlock;d&&!t.__dirtyText||(d=t.__textCotentBlock=yn(o,u,h,c,i.truncate));var f=d.outerHeight,p=d.lineHeight;zn(xk,t,i,e);var g=xk.baseX,m=xk.baseY,v=xk.textAlign||"left",y=xk.textVerticalAlign;!function(t,e,i,n,a,o,r){te(_k),e&&i&&ee(_k,i);var s=n.textRotation;if(a&&s){var l=n.textOrigin;"center"===l?(o=a.width/2+a.x,r=a.height/2+a.y):l&&(o=l[0]+a.x,r=l[1]+a.y),_k[4]-=o,_k[5]-=r,ae(_k,_k,s),_k[4]+=o,_k[5]+=r}dk(t,_k)}(r,a,n,i,e,g,m);var x=g,_=cn(m,f,y);h&&(x=function(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}(g,v,h),_+=h[0]),_+=p/2,pk(r,i,!0,t);var w=d.canCacheByTextString,b=t.__tspanList||(t.__tspanList=[]),S=b.length;if(w&&t.__canCacheByTextString&&t.__text===o){if(t.__dirtyText&&S)for(var M=0;M<S;++M)Sk(b[M],v,x,_+M*p)}else{t.__text=o,t.__canCacheByTextString=w;var I=d.lines,A=I.length;for(M=0;M<A;M++){var T=b[M],D=I[M];T?T.__zrText!==D&&(T.innerHTML="",T.appendChild(document.createTextNode(D))):(T=b[M]=QL("tspan"),r.appendChild(T),T.appendChild(document.createTextNode(D))),Sk(T,v,x,_+M*p)}if(A<S){for(;M<S;M++)r.removeChild(b[M]);b.length=A}}}};function Sk(t,e,i,n){fk(t,"dominant-baseline","middle"),fk(t,"text-anchor",wk[e]),fk(t,"x",i),fk(t,"y",n)}function Mk(){}function Ik(t,e){for(var i=0,n=e.length,a=0,o=0;i<n;i++){var r=e[i];if(r.removed){for(s=[],l=o;l<o+r.count;l++)s.push(l);r.indices=s,o+=r.count}else{for(var s=[],l=a;l<a+r.count;l++)s.push(l);r.indices=s,a+=r.count,r.added||(o+=r.count)}}return e}vk.drawRectText=bk,vk.brush=function(t){null!=t.style.text&&bk(t,!1)},Mk.prototype={diff:function(l,u,t){t=t||function(t,e){return t===e},this.equals=t;var h=this;l=l.slice();var c=(u=u.slice()).length,d=l.length,f=1,e=c+d,p=[{newPos:-1,components:[]}],i=this.extractCommon(p[0],u,l,0);if(p[0].newPos+1>=c&&d<=i+1){for(var n=[],a=0;a<u.length;a++)n.push(a);return[{indices:n,count:u.length}]}function o(){for(var t=-1*f;t<=f;t+=2){var e,i=p[t-1],n=p[t+1],a=(n?n.newPos:0)-t;i&&(p[t-1]=void 0);var o=i&&i.newPos+1<c,r=n&&0<=a&&a<d;if(o||r){if(!o||r&&i.newPos<n.newPos?(e={newPos:(s=n).newPos,components:s.components.slice(0)},h.pushComponent(e.components,void 0,!0)):((e=i).newPos++,h.pushComponent(e.components,!0,void 0)),a=h.extractCommon(e,u,l,t),e.newPos+1>=c&&d<=a+1)return Ik(h,e.components,u,l);p[t]=e}else p[t]=void 0}var s;f++}for(;f<=e;){var r=o();if(r)return r}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var a=e.length,o=i.length,r=t.newPos,s=r-n,l=0;r+1<a&&s+1<o&&this.equals(e[r+1],i[s+1]);)r++,s++,l++;return l&&t.components.push({count:l}),t.newPos=r,s},tokenize:function(t){return t.slice()},join:function(t){return t.slice()}};var Ak=new Mk;function Tk(t,e,i,n,a){this._zrId=t,this._svgRoot=e,this._tagNames="string"==typeof i?[i]:i,this._markLabel=n,this._domName=a||"_dom",this.nextId=0}function Dk(t,e){Tk.call(this,t,e,["linearGradient","radialGradient"],"__gradient_in_use__")}function Ck(t,e){Tk.call(this,t,e,"clipPath","__clippath_in_use__")}function Lk(t,e){Tk.call(this,t,e,["filter"],"__filter_in_use__","_shadowDom")}function kk(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY||t.textShadowBlur||t.textShadowOffsetX||t.textShadowOffsetY)}function Pk(t){return parseInt(t,10)}function Nk(t,e){return e&&t&&e.parentNode!==t}function Ok(t,e,i){if(Nk(t,e)&&i){var n=i.nextSibling;n?t.insertBefore(e,n):t.appendChild(e)}}function Ek(t,e){if(Nk(t,e)){var i=t.firstChild;i?t.insertBefore(e,i):t.appendChild(e)}}function Rk(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)}function zk(t){return t.__textSvgEl}function Bk(t){return t.__svgEl}Tk.prototype.createElement=QL,Tk.prototype.getDefs=function(t){var e=this._svgRoot,n=this._svgRoot.getElementsByTagName("defs");return 0===n.length?t?((n=e.insertBefore(this.createElement("defs"),e.firstChild)).contains||(n.contains=function(t){var e=n.children;if(!e)return!1;for(var i=e.length-1;0<=i;--i)if(e[i]===t)return!0;return!1}),n):null:n[0]},Tk.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var n=this.add(t);n&&(t[this._domName]=n)}}},Tk.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},Tk.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},Tk.prototype.getDoms=function(){var i=this.getDefs(!1);if(!i)return[];var n=[];return E(this._tagNames,function(t){var e=i.getElementsByTagName(t);n=n.concat([].slice.call(e))}),n},Tk.prototype.markAllUnused=function(){var t=this.getDoms(),e=this;E(t,function(t){t[e._markLabel]="0"})},Tk.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},Tk.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;E(t,function(t){"1"!==t[i._markLabel]&&e.removeChild(t)})}},Tk.prototype.getSvgProxy=function(t){return t instanceof hr?gk:t instanceof Yn?mk:t instanceof Dr?vk:gk},Tk.prototype.getTextSvgElement=function(t){return t.__textSvgEl},Tk.prototype.getSvgElement=function(t){return t.__svgEl},w(Dk,Tk),Dk.prototype.addWithoutUpdate=function(o,r){if(r&&r.style){var s=this;E(["fill","stroke"],function(t){if(r.style[t]&&("linear"===r.style[t].type||"radial"===r.style[t].type)){var e,i=r.style[t],n=s.getDefs(!0);i._dom?(e=i._dom,n.contains(i._dom)||s.addDom(e)):e=s.add(i),s.markUsed(r);var a=e.getAttribute("id");o.setAttribute(t,"url(#"+a+")")}})}},Dk.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return ci("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},Dk.prototype.update=function(i){var n=this;Tk.prototype.update.call(this,i,function(){var t=i.type,e=i._dom.tagName;"linear"===t&&"linearGradient"===e||"radial"===t&&"radialGradient"===e?n.updateDom(i,i._dom):(n.removeDom(i),n.add(i))})},Dk.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void ci("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,n=0,a=i.length;n<a;++n){var o=this.createElement("stop");o.setAttribute("offset",100*i[n].offset+"%");var r=i[n].color;if(r.indexOf(!1)){var s=Ee(r)[3],l=Be(r);o.setAttribute("stop-color","#"+l),o.setAttribute("stop-opacity",s)}else o.setAttribute("stop-color",i[n].color);e.appendChild(o)}t._dom=e},Dk.prototype.markUsed=function(t){if(t.style){var e=t.style.fill;e&&e._dom&&Tk.prototype.markUsed.call(this,e._dom),(e=t.style.stroke)&&e._dom&&Tk.prototype.markUsed.call(this,e._dom)}},w(Ck,Tk),Ck.prototype.update=function(t){var e=this.getSvgElement(t);e&&this.updateDom(e,t.__clipPaths,!1);var i=this.getTextSvgElement(t);i&&this.updateDom(i,t.__clipPaths,!0),this.markUsed(t)},Ck.prototype.updateDom=function(t,e,i){if(e&&0<e.length){var n,a,o=this.getDefs(!0),r=e[0],s=i?"_textDom":"_dom";r[s]?(a=r[s].getAttribute("id"),n=r[s],o.contains(n)||o.appendChild(n)):(a="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",a),o.appendChild(n),r[s]=n);var l=this.getSvgProxy(r);if(r.transform&&r.parent.invTransform&&!i){var u=Array.prototype.slice.call(r.transform);ie(r.transform,r.parent.invTransform,r.transform),l.brush(r),r.transform=u}else l.brush(r);var h=this.getSvgElement(r);n.innerHTML="",n.appendChild(h.cloneNode()),t.setAttribute("clip-path","url(#"+a+")"),1<e.length&&this.updateDom(n,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},Ck.prototype.markUsed=function(t){var e=this;t.__clipPaths&&E(t.__clipPaths,function(t){t._dom&&Tk.prototype.markUsed.call(e,t._dom),t._textDom&&Tk.prototype.markUsed.call(e,t._textDom)})},w(Lk,Tk),Lk.prototype.addWithoutUpdate=function(t,e){if(e&&kk(e.style)){var i;if(e._shadowDom)i=e._shadowDom,this.getDefs(!0).contains(e._shadowDom)||this.addDom(i);else i=this.add(e);this.markUsed(e);var n=i.getAttribute("id");t.style.filter="url(#"+n+")"}},Lk.prototype.add=function(t){var e=this.createElement("filter");return t._shadowDomId=t._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+t._shadowDomId),this.updateDom(t,e),this.addDom(e),e},Lk.prototype.update=function(t,e){if(kk(e.style)){var i=this;Tk.prototype.update.call(this,e,function(){i.updateDom(e,e._shadowDom)})}else this.remove(t,e)},Lk.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(t),t.style.filter="")},Lk.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,a,o,r,s=t.style,l=t.scale&&t.scale[0]||1,u=t.scale&&t.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,a=s.shadowOffsetY||0,o=s.shadowBlur,r=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);n=s.textShadowOffsetX||0,a=s.textShadowOffsetY||0,o=s.textShadowBlur,r=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",a/u),i.setAttribute("flood-color",r);var h=o/2/l+" "+o/2/u;i.setAttribute("stdDeviation",h),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(o/2*200)+"%"),e.setAttribute("height",Math.ceil(o/2*200)+"%"),e.appendChild(i),t._shadowDom=e},Lk.prototype.markUsed=function(t){t._shadowDom&&Tk.prototype.markUsed.call(this,t._shadowDom)};function Vk(t,e,i,n){this.root=t,this.storage=e,this._opts=i=L({},i||{});var a=QL("svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),a.setAttribute("baseProfile","full"),a.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new Dk(n,a),this.clipPathManager=new Ck(n,a),this.shadowManager=new Lk(n,a);var o=document.createElement("div");o.style.cssText="overflow:hidden;position:relative",this._svgRoot=a,this._viewport=o,t.appendChild(o),o.appendChild(a),this.resize(i.width,i.height),this._visibleList=[]}Vk.prototype={constructor:Vk,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i,n=this._svgRoot,a=this._visibleList,o=t.length,r=[];for(e=0;e<o;e++){var s=t[e],l=(i=s)instanceof hr?gk:i instanceof Yn?mk:i instanceof Dr?vk:gk,u=Bk(s)||zk(s);s.invisible||(s.__dirty&&(l&&l.brush(s),this.clipPathManager.update(s),s.style&&(this.gradientManager.update(s.style.fill),this.gradientManager.update(s.style.stroke),this.shadowManager.update(u,s)),s.__dirty=!1),r.push(s))}var h,c=function(t,e,i){return Ak.diff(t,e,i)}(a,r);for(e=0;e<c.length;e++){if((p=c[e]).removed)for(var d=0;d<p.count;d++){u=Bk(s=a[p.indices[d]]);var f=zk(s);Rk(n,u),Rk(n,f)}}for(e=0;e<c.length;e++){var p;if((p=c[e]).added)for(d=0;d<p.count;d++){u=Bk(s=r[p.indices[d]]),f=zk(s);h?Ok(n,u,h):Ek(n,u),u?Ok(n,f,u):h?Ok(n,f,h):Ek(n,f),Ok(n,f,u),h=f||u||h,this.gradientManager.addWithoutUpdate(u||f,s),this.shadowManager.addWithoutUpdate(u||f,s),this.clipPathManager.markUsed(s)}else if(!p.removed)for(d=0;d<p.count;d++){h=zk(s=r[p.indices[d]])||Bk(s)||h;u=Bk(s),f=zk(s);this.gradientManager.markUsed(s),this.gradientManager.addWithoutUpdate(u||f,s),this.shadowManager.markUsed(s),this.shadowManager.addWithoutUpdate(u||f,s),this.clipPathManager.markUsed(s)}}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=r},_getDefs:function(t){var n,e=this._svgRoot;return 0!==(n=this._svgRoot.getElementsByTagName("defs")).length?n[0]:t?((n=e.insertBefore(QL("defs"),e.firstChild)).contains||(n.contains=function(t){var e=n.children;if(!e)return!1;for(var i=e.length-1;0<=i;--i)if(e[i]===t)return!0;return!1}),n):null},resize:function(t,e){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var a=i.style;a.width=t+"px",a.height=e+"px";var o=this._svgRoot;o.setAttribute("width",t),o.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],n=["clientWidth","clientHeight"][t],a=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var r=this.root,s=document.defaultView.getComputedStyle(r);return(r[n]||Pk(s[i])||Pk(r.style[i]))-(Pk(s[a])||0)-(Pk(s[o])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},E(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){Vk.prototype[t]=function(t){return function(){ci('In SVG mode painter not support method "'+t+'"')}}(t)}),pa("svg",Vk),t.version="4.5.0",t.dependencies={zrender:"4.1.2"},t.PRIORITY=cd,t.init=function(t,e,i){var n=Kd(t);if(n)return n;var a=new vd(t,e,i);return a.id="ec_"+Ud++,Hd[a.id]=a,Oa(t,Yd,a.id),function(n){var a="__connectUpdateStatus";function o(t,e){for(var i=0;i<t.length;i++){t[i][a]=e}}sd(Rd,function(t,e){n._messageCenter.on(e,function(t){if(Zd[n.group]&&0!==n[a]){if(t&&t.escapeConnect)return;var e=n.makeActionFromEvent(t),i=[];sd(Hd,function(t){t!==n&&t.group===n.group&&i.push(t)}),o(i,0),sd(i,function(t){1!==t[a]&&t.dispatchAction(e)}),o(i,2)}})})}(a),a},t.connect=function(e){if(k(e)){var t=e;e=null,sd(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+Xd++,sd(t,function(t){t.group=e})}return Zd[e]=!0,e},t.disConnect=jd,t.disconnect=qd,t.dispose=function(t){"string"==typeof t?t=Hd[t]:t instanceof vd||(t=Kd(t)),t instanceof vd&&!t.isDisposed()&&t.dispose()},t.getInstanceByDom=Kd,t.getInstanceById=function(t){return Hd[t]},t.registerTheme=$d,t.registerPreprocessor=Jd,t.registerProcessor=Qd,t.registerPostUpdate=function(t){Vd.push(t)},t.registerAction=tf,t.registerCoordinateSystem=ef,t.getCoordinateSystemDimensions=function(t){var e=Hu.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},t.registerLayout=nf,t.registerVisual=af,t.registerLoading=rf,t.extendComponentModel=sf,t.extendComponentView=lf,t.extendSeriesModel=uf,t.extendChartView=hf,t.setCanvasCreator=function(t){f("createCanvas",t)},t.registerMap=function(t,e,i){ad.registerMap(t,e,i)},t.getMap=function(t){var e=ad.retrieveMap(t);return e&&e[0]&&{geoJson:e[0].geoJSON,specialAreas:e[0].specialAreas}},t.dataTool={},t.zrender=ma,t.number=Rl,t.format=Jl,t.throttle=cc,t.helper=tg,t.matrix=le,t.vector=It,t.color=Xe,t.parseGeoJSON=rg,t.parseGeoJson=xg,t.util=_g,t.graphic=wg,t.List=Tf,t.Model=dl,t.Axis=vg,t.env=v}); |
| New file |
| | |
| | | /* |
| | | Highcharts JS v6.2.0 (2018-10-17) |
| | | |
| | | (c) 2009-2016 Torstein Honsi |
| | | |
| | | License: www.highcharts.com/license |
| | | */ |
| | | (function(S,K){"object"===typeof module&&module.exports?module.exports=S.document?K(S):K:"function"===typeof define&&define.amd?define(function(){return K(S)}):S.Highcharts=K(S)})("undefined"!==typeof window?window:this,function(S){var K=function(){var a="undefined"===typeof S?window:S,C=a.document,F=a.navigator&&a.navigator.userAgent||"",I=C&&C.createElementNS&&!!C.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,n=/(edge|msie|trident)/i.test(F)&&!a.opera,f=-1!==F.indexOf("Firefox"), |
| | | e=-1!==F.indexOf("Chrome"),u=f&&4>parseInt(F.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts",version:"6.2.0",deg2rad:2*Math.PI/360,doc:C,hasBidiBug:u,hasTouch:C&&void 0!==C.documentElement.ontouchstart,isMS:n,isWebKit:-1!==F.indexOf("AppleWebKit"),isFirefox:f,isChrome:e,isSafari:!e&&-1!==F.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(F),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:I,win:a,marginNames:["plotTop", |
| | | "marginRight","marginBottom","plotLeft"],noop:function(){},charts:[]}}();(function(a){a.timers=[];var C=a.charts,F=a.doc,I=a.win;a.error=function(n,f){n=a.isNumber(n)?"Highcharts error #"+n+": www.highcharts.com/errors/"+n:n;if(f)throw Error(n);I.console&&console.log(n)};a.Fx=function(a,f,e){this.options=f;this.elem=a;this.prop=e};a.Fx.prototype={dSetter:function(){var a=this.paths[0],f=this.paths[1],e=[],u=this.now,x=a.length,t;if(1===u)e=this.toD;else if(x===f.length&&1>u)for(;x--;)t=parseFloat(a[x]), |
| | | e[x]=isNaN(t)?f[x]:u*parseFloat(f[x]-t)+t;else e=f;this.elem.attr("d",e,null,!0)},update:function(){var a=this.elem,f=this.prop,e=this.now,u=this.options.step;if(this[f+"Setter"])this[f+"Setter"]();else a.attr?a.element&&a.attr(f,e,null,!0):a.style[f]=e+this.unit;u&&u.call(a,e,this)},run:function(n,f,e){var u=this,x=u.options,t=function(a){return t.stopped?!1:u.step(a)},w=I.requestAnimationFrame||function(a){setTimeout(a,13)},y=function(){for(var c=0;c<a.timers.length;c++)a.timers[c]()||a.timers.splice(c--, |
| | | 1);a.timers.length&&w(y)};n!==f||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=n,this.end=f,this.unit=e,this.now=this.start,this.pos=0,t.elem=this.elem,t.prop=this.prop,t()&&1===a.timers.push(t)&&w(y)):(delete x.curAnim[this.prop],x.complete&&0===a.keys(x.curAnim).length&&x.complete.call(this.elem))},step:function(n){var f=+new Date,e,u=this.options,x=this.elem,t=u.complete,w=u.duration,y=u.curAnim;x.attr&&!x.element?n=!1:n||f>=w+this.startTime?(this.now=this.end,this.pos= |
| | | 1,this.update(),e=y[this.prop]=!0,a.objectEach(y,function(a){!0!==a&&(e=!1)}),e&&t&&t.call(x),n=!1):(this.pos=u.easing((f-this.startTime)/w),this.now=this.start+(this.end-this.start)*this.pos,this.update(),n=!0);return n},initPath:function(n,f,e){function u(a){var b,k;for(d=a.length;d--;)b="M"===a[d]||"L"===a[d],k=/[a-zA-Z]/.test(a[d+3]),b&&k&&a.splice(d+1,0,a[d+1],a[d+2],a[d+1],a[d+2])}function x(a,h){for(;a.length<k;){a[0]=h[k-a.length];var c=a.slice(0,p);[].splice.apply(a,[0,0].concat(c));b&&(c= |
| | | a.slice(a.length-p),[].splice.apply(a,[a.length,0].concat(c)),d--)}a[0]="M"}function t(a,d){for(var c=(k-a.length)/p;0<c&&c--;)q=a.slice().splice(a.length/v-p,p*v),q[0]=d[k-p-c*p],h&&(q[p-6]=q[p-2],q[p-5]=q[p-1]),[].splice.apply(a,[a.length/v,0].concat(q)),b&&c--}f=f||"";var w,y=n.startX,c=n.endX,h=-1<f.indexOf("C"),p=h?7:3,k,q,d;f=f.split(" ");e=e.slice();var b=n.isArea,v=b?2:1,J;h&&(u(f),u(e));if(y&&c){for(d=0;d<y.length;d++)if(y[d]===c[0]){w=d;break}else if(y[0]===c[c.length-y.length+d]){w=d;J= |
| | | !0;break}void 0===w&&(f=[])}f.length&&a.isNumber(w)&&(k=e.length+w*v*p,J?(x(f,e),t(e,f)):(x(e,f),t(f,e)));return[f,e]},fillSetter:function(){a.Fx.prototype.strokeSetter.apply(this,arguments)},strokeSetter:function(){this.elem.attr(this.prop,a.color(this.start).tweenTo(a.color(this.end),this.pos),null,!0)}};a.merge=function(){var n,f=arguments,e,u={},x=function(e,n){"object"!==typeof e&&(e={});a.objectEach(n,function(y,c){!a.isObject(y,!0)||a.isClass(y)||a.isDOMElement(y)?e[c]=n[c]:e[c]=x(e[c]||{}, |
| | | y)});return e};!0===f[0]&&(u=f[1],f=Array.prototype.slice.call(f,2));e=f.length;for(n=0;n<e;n++)u=x(u,f[n]);return u};a.pInt=function(a,f){return parseInt(a,f||10)};a.isString=function(a){return"string"===typeof a};a.isArray=function(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a};a.isObject=function(n,f){return!!n&&"object"===typeof n&&(!f||!a.isArray(n))};a.isDOMElement=function(n){return a.isObject(n)&&"number"===typeof n.nodeType};a.isClass=function(n){var f= |
| | | n&&n.constructor;return!(!a.isObject(n,!0)||a.isDOMElement(n)||!f||!f.name||"Object"===f.name)};a.isNumber=function(a){return"number"===typeof a&&!isNaN(a)&&Infinity>a&&-Infinity<a};a.erase=function(a,f){for(var e=a.length;e--;)if(a[e]===f){a.splice(e,1);break}};a.defined=function(a){return void 0!==a&&null!==a};a.attr=function(n,f,e){var u;a.isString(f)?a.defined(e)?n.setAttribute(f,e):n&&n.getAttribute&&((u=n.getAttribute(f))||"class"!==f||(u=n.getAttribute(f+"Name"))):a.defined(f)&&a.isObject(f)&& |
| | | a.objectEach(f,function(a,e){n.setAttribute(e,a)});return u};a.splat=function(n){return a.isArray(n)?n:[n]};a.syncTimeout=function(a,f,e){if(f)return setTimeout(a,f,e);a.call(0,e)};a.clearTimeout=function(n){a.defined(n)&&clearTimeout(n)};a.extend=function(a,f){var e;a||(a={});for(e in f)a[e]=f[e];return a};a.pick=function(){var a=arguments,f,e,u=a.length;for(f=0;f<u;f++)if(e=a[f],void 0!==e&&null!==e)return e};a.css=function(n,f){a.isMS&&!a.svg&&f&&void 0!==f.opacity&&(f.filter="alpha(opacity\x3d"+ |
| | | 100*f.opacity+")");a.extend(n.style,f)};a.createElement=function(n,f,e,u,x){n=F.createElement(n);var t=a.css;f&&a.extend(n,f);x&&t(n,{padding:0,border:"none",margin:0});e&&t(n,e);u&&u.appendChild(n);return n};a.extendClass=function(n,f){var e=function(){};e.prototype=new n;a.extend(e.prototype,f);return e};a.pad=function(a,f,e){return Array((f||2)+1-String(a).replace("-","").length).join(e||0)+a};a.relativeLength=function(a,f,e){return/%$/.test(a)?f*parseFloat(a)/100+(e||0):parseFloat(a)};a.wrap= |
| | | function(a,f,e){var n=a[f];a[f]=function(){var a=Array.prototype.slice.call(arguments),t=arguments,w=this;w.proceed=function(){n.apply(w,arguments.length?arguments:t)};a.unshift(n);a=e.apply(this,a);w.proceed=null;return a}};a.datePropsToTimestamps=function(n){a.objectEach(n,function(f,e){a.isObject(f)&&"function"===typeof f.getTime?n[e]=f.getTime():(a.isObject(f)||a.isArray(f))&&a.datePropsToTimestamps(f)})};a.formatSingle=function(n,f,e){var u=/\.([0-9])/,x=a.defaultOptions.lang;/f$/.test(n)?(e= |
| | | (e=n.match(u))?e[1]:-1,null!==f&&(f=a.numberFormat(f,e,x.decimalPoint,-1<n.indexOf(",")?x.thousandsSep:""))):f=(e||a.time).dateFormat(n,f);return f};a.format=function(n,f,e){for(var u="{",x=!1,t,w,y,c,h=[],p;n;){u=n.indexOf(u);if(-1===u)break;t=n.slice(0,u);if(x){t=t.split(":");w=t.shift().split(".");c=w.length;p=f;for(y=0;y<c;y++)p&&(p=p[w[y]]);t.length&&(p=a.formatSingle(t.join(":"),p,e));h.push(p)}else h.push(t);n=n.slice(u+1);u=(x=!x)?"}":"{"}h.push(n);return h.join("")};a.getMagnitude=function(a){return Math.pow(10, |
| | | Math.floor(Math.log(a)/Math.LN10))};a.normalizeTickInterval=function(n,f,e,u,x){var t,w=n;e=a.pick(e,1);t=n/e;f||(f=x?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===u&&(1===e?f=a.grep(f,function(a){return 0===a%1}):.1>=e&&(f=[1/e])));for(u=0;u<f.length&&!(w=f[u],x&&w*e>=n||!x&&t<=(f[u]+(f[u+1]||f[u]))/2);u++);return w=a.correctFloat(w*e,-Math.round(Math.log(.001)/Math.LN10))};a.stableSort=function(a,f){var e=a.length,n,x;for(x=0;x<e;x++)a[x].safeI=x;a.sort(function(a,e){n=f(a,e);return 0===n? |
| | | a.safeI-e.safeI:n});for(x=0;x<e;x++)delete a[x].safeI};a.arrayMin=function(a){for(var f=a.length,e=a[0];f--;)a[f]<e&&(e=a[f]);return e};a.arrayMax=function(a){for(var f=a.length,e=a[0];f--;)a[f]>e&&(e=a[f]);return e};a.destroyObjectProperties=function(n,f){a.objectEach(n,function(a,u){a&&a!==f&&a.destroy&&a.destroy();delete n[u]})};a.discardElement=function(n){var f=a.garbageBin;f||(f=a.createElement("div"));n&&f.appendChild(n);f.innerHTML=""};a.correctFloat=function(a,f){return parseFloat(a.toPrecision(f|| |
| | | 14))};a.setAnimation=function(n,f){f.renderer.globalAnimation=a.pick(n,f.options.chart.animation,!0)};a.animObject=function(n){return a.isObject(n)?a.merge(n):{duration:n?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(n,f,e,u){n=+n||0;f=+f;var x=a.defaultOptions.lang,t=(n.toString().split(".")[1]||"").split("e")[0].length,w,y,c=n.toString().split("e");-1===f?f=Math.min(t,20):a.isNumber(f)?f&&c[1]&&0>c[1]&& |
| | | (w=f+ +c[1],0<=w?(c[0]=(+c[0]).toExponential(w).split("e")[0],f=w):(c[0]=c[0].split(".")[0]||0,n=20>f?(c[0]*Math.pow(10,c[1])).toFixed(f):0,c[1]=0)):f=2;y=(Math.abs(c[1]?c[0]:n)+Math.pow(10,-Math.max(f,t)-1)).toFixed(f);t=String(a.pInt(y));w=3<t.length?t.length%3:0;e=a.pick(e,x.decimalPoint);u=a.pick(u,x.thousandsSep);n=(0>n?"-":"")+(w?t.substr(0,w)+u:"");n+=t.substr(w).replace(/(\d{3})(?=\d)/g,"$1"+u);f&&(n+=e+y.slice(-f));c[1]&&0!==+n&&(n+="e"+c[1]);return n};Math.easeInOutSine=function(a){return-.5* |
| | | (Math.cos(Math.PI*a)-1)};a.getStyle=function(n,f,e){if("width"===f)return Math.max(0,Math.min(n.offsetWidth,n.scrollWidth)-a.getStyle(n,"padding-left")-a.getStyle(n,"padding-right"));if("height"===f)return Math.max(0,Math.min(n.offsetHeight,n.scrollHeight)-a.getStyle(n,"padding-top")-a.getStyle(n,"padding-bottom"));I.getComputedStyle||a.error(27,!0);if(n=I.getComputedStyle(n,void 0))n=n.getPropertyValue(f),a.pick(e,"opacity"!==f)&&(n=a.pInt(n));return n};a.inArray=function(n,f,e){return(a.indexOfPolyfill|| |
| | | Array.prototype.indexOf).call(f,n,e)};a.grep=function(n,f){return(a.filterPolyfill||Array.prototype.filter).call(n,f)};a.find=Array.prototype.find?function(a,f){return a.find(f)}:function(a,f){var e,u=a.length;for(e=0;e<u;e++)if(f(a[e],e))return a[e]};a.some=function(n,f,e){return(a.somePolyfill||Array.prototype.some).call(n,f,e)};a.map=function(a,f){for(var e=[],u=0,x=a.length;u<x;u++)e[u]=f.call(a[u],a[u],u,a);return e};a.keys=function(n){return(a.keysPolyfill||Object.keys).call(void 0,n)};a.reduce= |
| | | function(n,f,e){return(a.reducePolyfill||Array.prototype.reduce).apply(n,2<arguments.length?[f,e]:[f])};a.offset=function(a){var f=F.documentElement;a=a.parentElement||a.parentNode?a.getBoundingClientRect():{top:0,left:0};return{top:a.top+(I.pageYOffset||f.scrollTop)-(f.clientTop||0),left:a.left+(I.pageXOffset||f.scrollLeft)-(f.clientLeft||0)}};a.stop=function(n,f){for(var e=a.timers.length;e--;)a.timers[e].elem!==n||f&&f!==a.timers[e].prop||(a.timers[e].stopped=!0)};a.each=function(n,f,e){return(a.forEachPolyfill|| |
| | | Array.prototype.forEach).call(n,f,e)};a.objectEach=function(a,f,e){for(var u in a)a.hasOwnProperty(u)&&f.call(e||a[u],a[u],u,a)};a.addEvent=function(n,f,e,u){var x,t=n.addEventListener||a.addEventListenerPolyfill;x="function"===typeof n&&n.prototype?n.prototype.protoEvents=n.prototype.protoEvents||{}:n.hcEvents=n.hcEvents||{};a.Point&&n instanceof a.Point&&n.series&&n.series.chart&&(n.series.chart.runTrackerClick=!0);t&&t.call(n,f,e,!1);x[f]||(x[f]=[]);x[f].push(e);u&&a.isNumber(u.order)&&(e.order= |
| | | u.order,x[f].sort(function(a,e){return a.order-e.order}));return function(){a.removeEvent(n,f,e)}};a.removeEvent=function(n,f,e){function u(e,c){var h=n.removeEventListener||a.removeEventListenerPolyfill;h&&h.call(n,e,c,!1)}function x(e){var c,h;n.nodeName&&(f?(c={},c[f]=!0):c=e,a.objectEach(c,function(a,k){if(e[k])for(h=e[k].length;h--;)u(k,e[k][h])}))}var t,w;a.each(["protoEvents","hcEvents"],function(y){var c=n[y];c&&(f?(t=c[f]||[],e?(w=a.inArray(e,t),-1<w&&(t.splice(w,1),c[f]=t),u(f,e)):(x(c), |
| | | c[f]=[])):(x(c),n[y]={}))})};a.fireEvent=function(n,f,e,u){var x,t,w,y,c;e=e||{};F.createEvent&&(n.dispatchEvent||n.fireEvent)?(x=F.createEvent("Events"),x.initEvent(f,!0,!0),a.extend(x,e),n.dispatchEvent?n.dispatchEvent(x):n.fireEvent(f,x)):a.each(["protoEvents","hcEvents"],function(h){if(n[h])for(t=n[h][f]||[],w=t.length,e.target||a.extend(e,{preventDefault:function(){e.defaultPrevented=!0},target:n,type:f}),y=0;y<w;y++)(c=t[y])&&!1===c.call(n,e)&&e.preventDefault()});u&&!e.defaultPrevented&&u.call(n, |
| | | e)};a.animate=function(n,f,e){var u,x="",t,w,y;a.isObject(e)||(y=arguments,e={duration:y[2],easing:y[3],complete:y[4]});a.isNumber(e.duration)||(e.duration=400);e.easing="function"===typeof e.easing?e.easing:Math[e.easing]||Math.easeInOutSine;e.curAnim=a.merge(f);a.objectEach(f,function(c,h){a.stop(n,h);w=new a.Fx(n,e,h);t=null;"d"===h?(w.paths=w.initPath(n,n.d,f.d),w.toD=f.d,u=0,t=1):n.attr?u=n.attr(h):(u=parseFloat(a.getStyle(n,h))||0,"opacity"!==h&&(x="px"));t||(t=c);t&&t.match&&t.match("px")&& |
| | | (t=t.replace(/px/g,""));w.run(u,t,x)})};a.seriesType=function(n,f,e,u,x){var t=a.getOptions(),w=a.seriesTypes;t.plotOptions[n]=a.merge(t.plotOptions[f],e);w[n]=a.extendClass(w[f]||function(){},u);w[n].prototype.type=n;x&&(w[n].prototype.pointClass=a.extendClass(a.Point,x));return w[n]};a.uniqueKey=function(){var a=Math.random().toString(36).substring(2,9),f=0;return function(){return"highcharts-"+a+"-"+f++}}();I.jQuery&&(I.jQuery.fn.highcharts=function(){var n=[].slice.call(arguments);if(this[0])return n[0]? |
| | | (new (a[a.isString(n[0])?n.shift():"Chart"])(this[0],n[0],n[1]),this):C[a.attr(this[0],"data-highcharts-chart")]})})(K);(function(a){var C=a.each,F=a.isNumber,I=a.map,n=a.merge,f=a.pInt;a.Color=function(e){if(!(this instanceof a.Color))return new a.Color(e);this.init(e)};a.Color.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[f(a[1]),f(a[2]),f(a[3]),parseFloat(a[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/, |
| | | parse:function(a){return[f(a[1]),f(a[2]),f(a[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(e){var f,x,t,w;if((this.input=e=this.names[e&&e.toLowerCase?e.toLowerCase():""]||e)&&e.stops)this.stops=I(e.stops,function(e){return new a.Color(e[1])});else if(e&&e.charAt&&"#"===e.charAt()&&(f=e.length,e=parseInt(e.substr(1),16),7===f?x=[(e&16711680)>>16,(e&65280)>>8,e&255,1]:4===f&&(x=[(e&3840)>>4|(e&3840)>>8,(e&240)>>4|e&240,(e&15)<<4|e&15,1])),!x)for(t=this.parsers.length;t--&&!x;)w=this.parsers[t], |
| | | (f=w.regex.exec(e))&&(x=w.parse(f));this.rgba=x||[]},get:function(a){var e=this.input,f=this.rgba,t;this.stops?(t=n(e),t.stops=[].concat(t.stops),C(this.stops,function(e,y){t.stops[y]=[t.stops[y][0],e.get(a)]})):t=f&&F(f[0])?"rgb"===a||!a&&1===f[3]?"rgb("+f[0]+","+f[1]+","+f[2]+")":"a"===a?f[3]:"rgba("+f.join(",")+")":e;return t},brighten:function(a){var e,x=this.rgba;if(this.stops)C(this.stops,function(e){e.brighten(a)});else if(F(a)&&0!==a)for(e=0;3>e;e++)x[e]+=f(255*a),0>x[e]&&(x[e]=0),255<x[e]&& |
| | | (x[e]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this},tweenTo:function(a,f){var e=this.rgba,t=a.rgba;t.length&&e&&e.length?(a=1!==t[3]||1!==e[3],f=(a?"rgba(":"rgb(")+Math.round(t[0]+(e[0]-t[0])*(1-f))+","+Math.round(t[1]+(e[1]-t[1])*(1-f))+","+Math.round(t[2]+(e[2]-t[2])*(1-f))+(a?","+(t[3]+(e[3]-t[3])*(1-f)):"")+")"):f=a.input||"none";return f}};a.color=function(e){return new a.Color(e)}})(K);(function(a){var C,F,I=a.addEvent,n=a.animate,f=a.attr,e=a.charts,u=a.color,x=a.css, |
| | | t=a.createElement,w=a.defined,y=a.deg2rad,c=a.destroyObjectProperties,h=a.doc,p=a.each,k=a.extend,q=a.erase,d=a.grep,b=a.hasTouch,v=a.inArray,J=a.isArray,l=a.isFirefox,L=a.isMS,B=a.isObject,D=a.isString,m=a.isWebKit,G=a.merge,A=a.noop,N=a.objectEach,E=a.pick,g=a.pInt,r=a.removeEvent,M=a.stop,O=a.svg,H=a.SVG_NS,R=a.symbolSizes,Q=a.win;C=a.SVGElement=function(){return this};k(C.prototype,{opacity:1,SVG_NS:H,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textAlign textDecoration textOverflow textOutline cursor".split(" "), |
| | | init:function(a,g){this.element="span"===g?t(g):h.createElementNS(this.SVG_NS,g);this.renderer=a},animate:function(z,g,r){g=a.animObject(E(g,this.renderer.globalAnimation,!0));0!==g.duration?(r&&(g.complete=r),n(this,z,g)):(this.attr(z,null,r),g.step&&g.step.call(this));return this},complexColor:function(z,g,r){var b=this.renderer,k,m,d,H,c,h,q,A,v,P,l,O=[],M;a.fireEvent(this.renderer,"complexColor",{args:arguments},function(){z.radialGradient?m="radialGradient":z.linearGradient&&(m="linearGradient"); |
| | | m&&(d=z[m],c=b.gradients,q=z.stops,P=r.radialReference,J(d)&&(z[m]=d={x1:d[0],y1:d[1],x2:d[2],y2:d[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===m&&P&&!w(d.gradientUnits)&&(H=d,d=G(d,b.getRadialAttr(P,H),{gradientUnits:"userSpaceOnUse"})),N(d,function(a,z){"id"!==z&&O.push(z,a)}),N(q,function(a){O.push(a)}),O=O.join(","),c[O]?l=c[O].attr("id"):(d.id=l=a.uniqueKey(),c[O]=h=b.createElement(m).attr(d).add(b.defs),h.radAttr=H,h.stops=[],p(q,function(z){0===z[1].indexOf("rgba")?(k=a.color(z[1]), |
| | | A=k.get("rgb"),v=k.get("a")):(A=z[1],v=1);z=b.createElement("stop").attr({offset:z[0],"stop-color":A,"stop-opacity":v}).add(h);h.stops.push(z)})),M="url("+b.url+"#"+l+")",r.setAttribute(g,M),r.gradient=O,z.toString=function(){return M})})},applyTextOutline:function(z){var g=this.element,r,b,d,m,k;-1!==z.indexOf("contrast")&&(z=z.replace(/contrast/g,this.renderer.getContrast(g.style.fill)));z=z.split(" ");b=z[z.length-1];if((d=z[0])&&"none"!==d&&a.svg){this.fakeTS=!0;z=[].slice.call(g.getElementsByTagName("tspan")); |
| | | this.ySetter=this.xSetter;d=d.replace(/(^[\d\.]+)(.*?)$/g,function(a,z,g){return 2*z+g});for(k=z.length;k--;)r=z[k],"highcharts-text-outline"===r.getAttribute("class")&&q(z,g.removeChild(r));m=g.firstChild;p(z,function(a,z){0===z&&(a.setAttribute("x",g.getAttribute("x")),z=g.getAttribute("y"),a.setAttribute("y",z||0),null===z&&g.setAttribute("y",0));a=a.cloneNode(1);f(a,{"class":"highcharts-text-outline",fill:b,stroke:b,"stroke-width":d,"stroke-linejoin":"round"});g.insertBefore(a,m)})}},attr:function(a, |
| | | g,r,b){var z,d=this.element,m,k=this,c,H;"string"===typeof a&&void 0!==g&&(z=a,a={},a[z]=g);"string"===typeof a?k=(this[a+"Getter"]||this._defaultGetter).call(this,a,d):(N(a,function(z,g){c=!1;b||M(this,g);this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)$/.test(g)&&(m||(this.symbolAttr(a),m=!0),c=!0);!this.rotation||"x"!==g&&"y"!==g||(this.doTransform=!0);c||(H=this[g+"Setter"]||this._defaultSetter,H.call(this,z,g,d),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(g)&& |
| | | this.updateShadows(g,z,H))},this),this.afterSetters());r&&r.call(this);return k},afterSetters:function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},updateShadows:function(a,g,r){for(var z=this.shadows,d=z.length;d--;)r.call(z[d],"height"===a?Math.max(g-(z[d].cutHeight||0),0):"d"===a?this.d:g,a,z[d])},addClass:function(a,g){var z=this.attr("class")||"";-1===z.indexOf(a)&&(g||(a=(z+(z?" ":"")+a).replace(" "," ")),this.attr("class",a));return this},hasClass:function(a){return-1!== |
| | | v(a,(this.attr("class")||"").split(" "))},removeClass:function(a){return this.attr("class",(this.attr("class")||"").replace(a,""))},symbolAttr:function(a){var z=this;p("x y r start end width height innerR anchorX anchorY".split(" "),function(g){z[g]=E(a[g],z[g])});z.attr({d:z.renderer.symbols[z.symbolName](z.x,z.y,z.width,z.height,z)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a,g){var z;g=g||a.strokeWidth||0;z=Math.round(g)%2/2; |
| | | a.x=Math.floor(a.x||this.x||0)+z;a.y=Math.floor(a.y||this.y||0)+z;a.width=Math.floor((a.width||this.width||0)-2*z);a.height=Math.floor((a.height||this.height||0)-2*z);w(a.strokeWidth)&&(a.strokeWidth=g);return a},css:function(a){var z=this.styles,r={},d=this.element,b,m="",c,H=!z,h=["textOutline","textOverflow","width"];a&&a.color&&(a.fill=a.color);z&&N(a,function(a,g){a!==z[g]&&(r[g]=a,H=!0)});H&&(z&&(a=k(z,r)),a&&(null===a.width||"auto"===a.width?delete this.textWidth:"text"===d.nodeName.toLowerCase()&& |
| | | a.width&&(b=this.textWidth=g(a.width))),this.styles=a,b&&!O&&this.renderer.forExport&&delete a.width,d.namespaceURI===this.SVG_NS?(c=function(a,z){return"-"+z.toLowerCase()},N(a,function(a,z){-1===v(z,h)&&(m+=z.replace(/([A-Z])/g,c)+":"+a+";")}),m&&f(d,"style",m)):x(d,a),this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),a&&a.textOutline&&this.applyTextOutline(a.textOutline)));return this},strokeWidth:function(){return this["stroke-width"]||0},on:function(a,g){var z=this,r= |
| | | z.element;b&&"click"===a?(r.ontouchstart=function(a){z.touchEventFired=Date.now();a.preventDefault();g.call(r,a)},r.onclick=function(a){(-1===Q.navigator.userAgent.indexOf("Android")||1100<Date.now()-(z.touchEventFired||0))&&g.call(r,a)}):r["on"+a]=g;return this},setRadialReference:function(a){var z=this.renderer.gradients[this.element.gradient];this.element.radialReference=a;z&&z.radAttr&&z.animate(this.renderer.getRadialAttr(a,z.radAttr));return this},translate:function(a,g){return this.attr({translateX:a, |
| | | translateY:g})},invert:function(a){this.inverted=a;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,g=this.translateY||0,r=this.scaleX,d=this.scaleY,b=this.inverted,m=this.rotation,k=this.matrix,c=this.element;b&&(a+=this.width,g+=this.height);a=["translate("+a+","+g+")"];w(k)&&a.push("matrix("+k.join(",")+")");b?a.push("rotate(90) scale(-1,1)"):m&&a.push("rotate("+m+" "+E(this.rotationOriginX,c.getAttribute("x"),0)+" "+E(this.rotationOriginY,c.getAttribute("y")|| |
| | | 0)+")");(w(r)||w(d))&&a.push("scale("+E(r,1)+" "+E(d,1)+")");a.length&&c.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,g,r){var z,d,b,m,k={};d=this.renderer;b=d.alignedObjects;var c,H;if(a){if(this.alignOptions=a,this.alignByTranslate=g,!r||D(r))this.alignTo=z=r||"renderer",q(b,this),b.push(this),r=null}else a=this.alignOptions,g=this.alignByTranslate,z=this.alignTo;r=E(r,d[z],d);z=a.align;d=a.verticalAlign;b= |
| | | (r.x||0)+(a.x||0);m=(r.y||0)+(a.y||0);"right"===z?c=1:"center"===z&&(c=2);c&&(b+=(r.width-(a.width||0))/c);k[g?"translateX":"x"]=Math.round(b);"bottom"===d?H=1:"middle"===d&&(H=2);H&&(m+=(r.height-(a.height||0))/H);k[g?"translateY":"y"]=Math.round(m);this[this.placed?"animate":"attr"](k);this.placed=!0;this.alignAttr=k;return this},getBBox:function(a,g){var z,r=this.renderer,d,b=this.element,m=this.styles,c,H=this.textStr,h,q=r.cache,A=r.cacheKeys,v=b.namespaceURI===this.SVG_NS,l;g=E(g,this.rotation); |
| | | d=g*y;c=m&&m.fontSize;w(H)&&(l=H.toString(),-1===l.indexOf("\x3c")&&(l=l.replace(/[0-9]/g,"0")),l+=["",g||0,c,this.textWidth,m&&m.textOverflow].join());l&&!a&&(z=q[l]);if(!z){if(v||r.forExport){try{(h=this.fakeTS&&function(a){p(b.querySelectorAll(".highcharts-text-outline"),function(g){g.style.display=a})})&&h("none"),z=b.getBBox?k({},b.getBBox()):{width:b.offsetWidth,height:b.offsetHeight},h&&h("")}catch(X){}if(!z||0>z.width)z={width:0,height:0}}else z=this.htmlGetBBox();r.isSVG&&(a=z.width,r=z.height, |
| | | v&&(z.height=r={"11px,17":14,"13px,20":16}[m&&m.fontSize+","+Math.round(r)]||r),g&&(z.width=Math.abs(r*Math.sin(d))+Math.abs(a*Math.cos(d)),z.height=Math.abs(r*Math.cos(d))+Math.abs(a*Math.sin(d))));if(l&&0<z.height){for(;250<A.length;)delete q[A.shift()];q[l]||A.push(l);q[l]=z}}return z},show:function(a){return this.attr({visibility:a?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var g=this;g.animate({opacity:0},{duration:a||150,complete:function(){g.attr({y:-9999})}})}, |
| | | add:function(a){var g=this.renderer,z=this.element,r;a&&(this.parentGroup=a);this.parentInverted=a&&a.inverted;void 0!==this.textStr&&g.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)r=this.zIndexSetter();r||(a?a.element:g.box).appendChild(z);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var g=a.parentNode;g&&g.removeChild(a)},destroy:function(){var a=this,g=a.element||{},r=a.renderer.isSVG&&"SPAN"===g.nodeName&&a.parentGroup,d=g.ownerSVGElement,b=a.clipPath;g.onclick= |
| | | g.onmouseout=g.onmouseover=g.onmousemove=g.point=null;M(a);b&&d&&(p(d.querySelectorAll("[clip-path],[CLIP-PATH]"),function(a){var g=a.getAttribute("clip-path"),z=b.element.id;(-1<g.indexOf("(#"+z+")")||-1<g.indexOf('("#'+z+'")'))&&a.removeAttribute("clip-path")}),a.clipPath=b.destroy());if(a.stops){for(d=0;d<a.stops.length;d++)a.stops[d]=a.stops[d].destroy();a.stops=null}a.safeRemoveChild(g);for(a.destroyShadows();r&&r.div&&0===r.div.childNodes.length;)g=r.parentGroup,a.safeRemoveChild(r.div),delete r.div, |
| | | r=g;a.alignTo&&q(a.renderer.alignedObjects,a);N(a,function(g,z){delete a[z]});return null},shadow:function(a,g,r){var z=[],d,b,m=this.element,k,c,H,h;if(!a)this.destroyShadows();else if(!this.shadows){c=E(a.width,3);H=(a.opacity||.15)/c;h=this.parentInverted?"(-1,-1)":"("+E(a.offsetX,1)+", "+E(a.offsetY,1)+")";for(d=1;d<=c;d++)b=m.cloneNode(0),k=2*c+1-2*d,f(b,{stroke:a.color||"#000000","stroke-opacity":H*d,"stroke-width":k,transform:"translate"+h,fill:"none"}),b.setAttribute("class",(b.getAttribute("class")|| |
| | | "")+" highcharts-shadow"),r&&(f(b,"height",Math.max(f(b,"height")-k,0)),b.cutHeight=k),g?g.element.appendChild(b):m.parentNode&&m.parentNode.insertBefore(b,m),z.push(b);this.shadows=z}return this},destroyShadows:function(){p(this.shadows||[],function(a){this.safeRemoveChild(a)},this);this.shadows=void 0},xGetter:function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)},_defaultGetter:function(a){a=E(this[a+"Value"],this[a],this.element?this.element.getAttribute(a): |
| | | null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,g,r){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");this[g]!==a&&(r.setAttribute(g,a),this[g]=a)},dashstyleSetter:function(a){var r,z=this["stroke-width"];"inherit"===z&&(z=1);if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/, |
| | | "").split(",");for(r=a.length;r--;)a[r]=g(a[r])*z;a=a.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.alignValue=a;this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,g,r){this[g]=a;r.setAttribute(g,a)},titleSetter:function(a){var g=this.element.getElementsByTagName("title")[0];g||(g=h.createElementNS(this.SVG_NS,"title"),this.element.appendChild(g));g.firstChild&&g.removeChild(g.firstChild); |
| | | g.appendChild(h.createTextNode(String(E(a),"").replace(/<[^>]*>/g,"").replace(/</g,"\x3c").replace(/>/g,"\x3e")))},textSetter:function(a){a!==this.textStr&&(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,g,r){"string"===typeof a?r.setAttribute(g,a):a&&this.complexColor(a,g,r)},visibilitySetter:function(a,g,r){"inherit"===a?r.removeAttribute(g):this[g]!==a&&r.setAttribute(g,a);this[g]=a},zIndexSetter:function(a,r){var z=this.renderer,d=this.parentGroup, |
| | | b=(d||z).element||z.box,m,k=this.element,c,H,z=b===z.box;m=this.added;var h;w(a)?(k.setAttribute("data-z-index",a),a=+a,this[r]===a&&(m=!1)):w(this[r])&&k.removeAttribute("data-z-index");this[r]=a;if(m){(a=this.zIndex)&&d&&(d.handleZ=!0);r=b.childNodes;for(h=r.length-1;0<=h&&!c;h--)if(d=r[h],m=d.getAttribute("data-z-index"),H=!w(m),d!==k)if(0>a&&H&&!z&&!h)b.insertBefore(k,r[h]),c=!0;else if(g(m)<=a||H&&(!w(a)||0<=a))b.insertBefore(k,r[h+1]||null),c=!0;c||(b.insertBefore(k,r[z?3:0]||null),c=!0)}return c}, |
| | | _defaultSetter:function(a,g,r){r.setAttribute(g,a)}});C.prototype.yGetter=C.prototype.xGetter;C.prototype.translateXSetter=C.prototype.translateYSetter=C.prototype.rotationSetter=C.prototype.verticalAlignSetter=C.prototype.rotationOriginXSetter=C.prototype.rotationOriginYSetter=C.prototype.scaleXSetter=C.prototype.scaleYSetter=C.prototype.matrixSetter=function(a,g){this[g]=a;this.doTransform=!0};C.prototype["stroke-widthSetter"]=C.prototype.strokeSetter=function(a,g,r){this[g]=a;this.stroke&&this["stroke-width"]? |
| | | (C.prototype.fillSetter.call(this,this.stroke,"stroke",r),r.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===g&&0===a&&this.hasStroke&&(r.removeAttribute("stroke"),this.hasStroke=!1)};F=a.SVGRenderer=function(){this.init.apply(this,arguments)};k(F.prototype,{Element:C,SVG_NS:H,init:function(a,g,r,d,b,k){var z;d=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"}).css(this.getStyle(d));z=d.element;a.appendChild(z);f(a,"dir","ltr");-1===a.innerHTML.indexOf("xmlns")&& |
| | | f(z,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=z;this.boxWrapper=d;this.alignedObjects=[];this.url=(l||m)&&h.getElementsByTagName("base").length?Q.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(h.createTextNode("Created with Highcharts 6.2.0"));this.defs=this.createElement("defs").add();this.allowHTML=k;this.forExport=b;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(g, |
| | | r,!1);var c;l&&a.getBoundingClientRect&&(g=function(){x(a,{left:0,top:0});c=a.getBoundingClientRect();x(a,{left:Math.ceil(c.left)-c.left+"px",top:Math.ceil(c.top)-c.top+"px"})},g(),this.unSubPixelFix=I(Q,"resize",g))},getStyle:function(a){return this.style=k({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},setStyle:function(a){this.boxWrapper.css(this.getStyle(a))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a= |
| | | this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();c(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null},createElement:function(a){var g=new this.Element;g.init(this,a);return g},draw:A,getRadialAttr:function(a,g){return{cx:a[0]-a[2]/2+g.cx*a[2],cy:a[1]-a[2]/2+g.cy*a[2],r:g.r*a[2]}},truncate:function(a,g,r,d,b,m,k){var z=this,c=a.rotation,H,q=d?1:0,A=(r||d).length,v=A,p=[],l=function(a){g.firstChild&& |
| | | g.removeChild(g.firstChild);a&&g.appendChild(h.createTextNode(a))},O=function(m,c){c=c||m;if(void 0===p[c])if(g.getSubStringLength)try{p[c]=b+g.getSubStringLength(0,d?c+1:c)}catch(Y){}else z.getSpanWidth&&(l(k(r||d,m)),p[c]=b+z.getSpanWidth(a,g));return p[c]},G,M;a.rotation=0;G=O(g.textContent.length);if(M=b+G>m){for(;q<=A;)v=Math.ceil((q+A)/2),d&&(H=k(d,v)),G=O(v,H&&H.length-1),q===A?q=A+1:G>m?A=v-1:q=v;0===A?l(""):r&&A===r.length-1||l(H||k(r||d,v))}d&&d.splice(0,v);a.actualWidth=G;a.rotation=c; |
| | | return M},escapes:{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;","'":"\x26#39;",'"':"\x26quot;"},buildText:function(a){var r=a.element,b=this,m=b.forExport,c=E(a.textStr,"").toString(),z=-1!==c.indexOf("\x3c"),k=r.childNodes,q,A=f(r,"x"),l=a.styles,G=a.textWidth,M=l&&l.lineHeight,e=l&&l.textOutline,B=l&&"ellipsis"===l.textOverflow,R=l&&"nowrap"===l.whiteSpace,y=l&&l.fontSize,t,D,J=k.length,l=G&&!a.added&&this.box,w=function(a){var d;d=/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:y|| |
| | | b.style.fontSize||12;return M?g(M):b.fontMetrics(d,a.getAttribute("style")?a:r).h},Q=function(a,g){N(b.escapes,function(r,d){g&&-1!==v(r,g)||(a=a.toString().replace(new RegExp(r,"g"),d))});return a},u=function(a,g){var r;r=a.indexOf("\x3c");a=a.substring(r,a.indexOf("\x3e")-r);r=a.indexOf(g+"\x3d");if(-1!==r&&(r=r+g.length+1,g=a.charAt(r),'"'===g||"'"===g))return a=a.substring(r+1),a.substring(0,a.indexOf(g))};t=[c,B,R,M,e,y,G].join();if(t!==a.textCache){for(a.textCache=t;J--;)r.removeChild(k[J]); |
| | | z||e||B||G||-1!==c.indexOf(" ")?(l&&l.appendChild(r),c=z?c.replace(/<(b|strong)>/g,'\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g,'\x3cspan style\x3d"font-style:italic"\x3e').replace(/<a/g,"\x3cspan").replace(/<\/(b|strong|i|em|a)>/g,"\x3c/span\x3e").split(/<br.*?>/g):[c],c=d(c,function(a){return""!==a}),p(c,function(g,d){var c,z=0,k=0;g=g.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||\x3cspan").replace(/<\/span>/g,"\x3c/span\x3e|||");c=g.split("|||");p(c,function(g){if(""!==g||1=== |
| | | c.length){var v={},l=h.createElementNS(b.SVG_NS,"tspan"),p,M;(p=u(g,"class"))&&f(l,"class",p);if(p=u(g,"style"))p=p.replace(/(;| |^)color([ :])/,"$1fill$2"),f(l,"style",p);(M=u(g,"href"))&&!m&&(f(l,"onclick",'location.href\x3d"'+M+'"'),f(l,"class","highcharts-anchor"),x(l,{cursor:"pointer"}));g=Q(g.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ");if(" "!==g){l.appendChild(h.createTextNode(g));z?v.dx=0:d&&null!==A&&(v.x=A);f(l,v);r.appendChild(l);!z&&D&&(!O&&m&&x(l,{display:"block"}),f(l,"dy",w(l)));if(G){var e= |
| | | g.replace(/([^\^])-/g,"$1- ").split(" "),v=!R&&(1<c.length||d||1<e.length);M=0;var t=w(l);if(B)q=b.truncate(a,l,g,void 0,0,Math.max(0,G-parseInt(y||12,10)),function(a,g){return a.substring(0,g)+"\u2026"});else if(v)for(;e.length;)e.length&&!R&&0<M&&(l=h.createElementNS(H,"tspan"),f(l,{dy:t,x:A}),p&&f(l,"style",p),l.appendChild(h.createTextNode(e.join(" ").replace(/- /g,"-"))),r.appendChild(l)),b.truncate(a,l,null,e,0===M?k:0,G,function(a,g){return e.slice(0,g).join(" ").replace(/- /g,"-")}),k=a.actualWidth, |
| | | M++}z++}}});D=D||r.childNodes.length}),B&&q&&a.attr("title",Q(a.textStr,["\x26lt;","\x26gt;"])),l&&l.removeChild(r),e&&a.applyTextOutline&&a.applyTextOutline(e)):r.appendChild(h.createTextNode(Q(c)))}},getContrast:function(a){a=u(a).rgba;a[0]*=1;a[1]*=1.2;a[2]*=.5;return 459<a[0]+a[1]+a[2]?"#000000":"#FFFFFF"},button:function(a,g,r,d,b,c,m,H,h){var z=this.label(a,g,r,h,null,null,null,null,"button"),q=0;z.attr(G({padding:8,r:2},b));var A,v,l,p;b=G({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1, |
| | | style:{color:"#333333",cursor:"pointer",fontWeight:"normal"}},b);A=b.style;delete b.style;c=G(b,{fill:"#e6e6e6"},c);v=c.style;delete c.style;m=G(b,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},m);l=m.style;delete m.style;H=G(b,{style:{color:"#cccccc"}},H);p=H.style;delete H.style;I(z.element,L?"mouseover":"mouseenter",function(){3!==q&&z.setState(1)});I(z.element,L?"mouseout":"mouseleave",function(){3!==q&&z.setState(q)});z.setState=function(a){1!==a&&(z.state=q=a);z.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+ |
| | | ["normal","hover","pressed","disabled"][a||0]);z.attr([b,c,m,H][a||0]).css([A,v,l,p][a||0])};z.attr(b).css(k({cursor:"default"},A));return z.on("click",function(a){3!==q&&d.call(z,a)})},crispLine:function(a,g){a[1]===a[4]&&(a[1]=a[4]=Math.round(a[1])-g%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+g%2/2);return a},path:function(a){var g={fill:"none"};J(a)?g.d=a:B(a)&&k(g,a);return this.createElement("path").attr(g)},circle:function(a,g,r){a=B(a)?a:{x:a,y:g,r:r};g=this.createElement("circle");g.xSetter= |
| | | g.ySetter=function(a,g,r){r.setAttribute("c"+g,a)};return g.attr(a)},arc:function(a,g,r,d,b,c){B(a)?(d=a,g=d.y,r=d.r,a=d.x):d={innerR:d,start:b,end:c};a=this.symbol("arc",a,g,r,r,d);a.r=r;return a},rect:function(a,g,r,d,b,c){b=B(a)?a.r:b;var m=this.createElement("rect");a=B(a)?a:void 0===a?{}:{x:a,y:g,width:Math.max(r,0),height:Math.max(d,0)};void 0!==c&&(a.strokeWidth=c,a=m.crisp(a));a.fill="none";b&&(a.r=b);m.rSetter=function(a,g,r){f(r,{rx:a,ry:a})};return m.attr(a)},setSize:function(a,g,r){var d= |
| | | this.alignedObjects,b=d.length;this.width=a;this.height=g;for(this.boxWrapper.animate({width:a,height:g},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:E(r,!0)?void 0:0});b--;)d[b].align()},g:function(a){var g=this.createElement("g");return a?g.attr({"class":"highcharts-"+a}):g},image:function(a,g,r,d,b,c){var m={preserveAspectRatio:"none"},H,h=function(a,g){a.setAttributeNS?a.setAttributeNS("http://www.w3.org/1999/xlink","href",g):a.setAttribute("hc-svg-href", |
| | | g)},q=function(g){h(H.element,a);c.call(H,g)};1<arguments.length&&k(m,{x:g,y:r,width:d,height:b});H=this.createElement("image").attr(m);c?(h(H.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw\x3d\x3d"),m=new Q.Image,I(m,"load",q),m.src=a,m.complete&&q({})):h(H.element,a);return H},symbol:function(a,g,r,d,b,c){var m=this,H,q=/^url\((.*?)\)$/,A=q.test(a),v=!A&&(this.symbols[a]?a:"circle"),z=v&&this.symbols[v],l=w(g)&&z&&z.call(this.symbols,Math.round(g),Math.round(r), |
| | | d,b,c),G,M;z?(H=this.path(l),H.attr("fill","none"),k(H,{symbolName:v,x:g,y:r,width:d,height:b}),c&&k(H,c)):A&&(G=a.match(q)[1],H=this.image(G),H.imgwidth=E(R[G]&&R[G].width,c&&c.width),H.imgheight=E(R[G]&&R[G].height,c&&c.height),M=function(){H.attr({width:H.width,height:H.height})},p(["width","height"],function(a){H[a+"Setter"]=function(a,g){var r={},d=this["img"+g],b="width"===g?"translateX":"translateY";this[g]=a;w(d)&&(this.element&&this.element.setAttribute(g,d),this.alignByTranslate||(r[b]= |
| | | ((this[g]||0)-d)/2,this.attr(r)))}}),w(g)&&H.attr({x:g,y:r}),H.isImg=!0,w(H.imgwidth)&&w(H.imgheight)?M():(H.attr({width:0,height:0}),t("img",{onload:function(){var a=e[m.chartIndex];0===this.width&&(x(this,{position:"absolute",top:"-999em"}),h.body.appendChild(this));R[G]={width:this.width,height:this.height};H.imgwidth=this.width;H.imgheight=this.height;H.element&&M();this.parentNode&&this.parentNode.removeChild(this);m.imgCount--;if(!m.imgCount&&a&&a.onload)a.onload()},src:G}),this.imgCount++)); |
| | | return H},symbols:{circle:function(a,g,r,d){return this.arc(a+r/2,g+d/2,r/2,d/2,{start:0,end:2*Math.PI,open:!1})},square:function(a,g,r,d){return["M",a,g,"L",a+r,g,a+r,g+d,a,g+d,"Z"]},triangle:function(a,g,r,d){return["M",a+r/2,g,"L",a+r,g+d,a,g+d,"Z"]},"triangle-down":function(a,g,r,d){return["M",a,g,"L",a+r,g,a+r/2,g+d,"Z"]},diamond:function(a,g,r,d){return["M",a+r/2,g,"L",a+r,g+d/2,a+r/2,g+d,a,g+d/2,"Z"]},arc:function(a,g,r,d,b){var c=b.start,m=b.r||r,H=b.r||d||r,k=b.end-.001;r=b.innerR;d=E(b.open, |
| | | .001>Math.abs(b.end-b.start-2*Math.PI));var h=Math.cos(c),q=Math.sin(c),A=Math.cos(k),k=Math.sin(k);b=.001>b.end-c-Math.PI?0:1;m=["M",a+m*h,g+H*q,"A",m,H,0,b,1,a+m*A,g+H*k];w(r)&&m.push(d?"M":"L",a+r*A,g+r*k,"A",r,r,0,b,0,a+r*h,g+r*q);m.push(d?"":"Z");return m},callout:function(a,g,r,d,b){var c=Math.min(b&&b.r||0,r,d),m=c+6,H=b&&b.anchorX;b=b&&b.anchorY;var k;k=["M",a+c,g,"L",a+r-c,g,"C",a+r,g,a+r,g,a+r,g+c,"L",a+r,g+d-c,"C",a+r,g+d,a+r,g+d,a+r-c,g+d,"L",a+c,g+d,"C",a,g+d,a,g+d,a,g+d-c,"L",a,g+c, |
| | | "C",a,g,a,g,a+c,g];H&&H>r?b>g+m&&b<g+d-m?k.splice(13,3,"L",a+r,b-6,a+r+6,b,a+r,b+6,a+r,g+d-c):k.splice(13,3,"L",a+r,d/2,H,b,a+r,d/2,a+r,g+d-c):H&&0>H?b>g+m&&b<g+d-m?k.splice(33,3,"L",a,b+6,a-6,b,a,b-6,a,g+c):k.splice(33,3,"L",a,d/2,H,b,a,d/2,a,g+c):b&&b>d&&H>a+m&&H<a+r-m?k.splice(23,3,"L",H+6,g+d,H,g+d+6,H-6,g+d,a+c,g+d):b&&0>b&&H>a+m&&H<a+r-m&&k.splice(3,3,"L",H-6,g,H,g-6,H+6,g,r-c,g);return k}},clipRect:function(g,r,d,b){var c=a.uniqueKey(),m=this.createElement("clipPath").attr({id:c}).add(this.defs); |
| | | g=this.rect(g,r,d,b,0).add(m);g.id=c;g.clipPath=m;g.count=0;return g},text:function(a,g,r,d){var b={};if(d&&(this.allowHTML||!this.forExport))return this.html(a,g,r);b.x=Math.round(g||0);r&&(b.y=Math.round(r));w(a)&&(b.text=a);a=this.createElement("text").attr(b);d||(a.xSetter=function(a,g,r){var d=r.getElementsByTagName("tspan"),b,c=r.getAttribute(g),m;for(m=0;m<d.length;m++)b=d[m],b.getAttribute(g)===c&&b.setAttribute(g,a);r.setAttribute(g,a)});return a},fontMetrics:function(a,r){a=a||r&&r.style&& |
| | | r.style.fontSize||this.style&&this.style.fontSize;a=/px/.test(a)?g(a):/em/.test(a)?parseFloat(a)*(r?this.fontMetrics(null,r.parentNode).f:16):12;r=24>a?a+3:Math.round(1.2*a);return{h:r,b:Math.round(.8*r),f:a}},rotCorr:function(a,g,r){var d=a;g&&r&&(d=Math.max(d*Math.cos(g*y),4));return{x:-a/3*Math.sin(g*y),y:d}},label:function(g,d,b,c,m,H,h,q,A){var v=this,l=v.g("button"!==A&&"label"),M=l.text=v.text("",0,0,h).attr({zIndex:1}),O,z,e=0,B=3,R=0,f,y,t,D,J,E={},N,x,Q=/^url\((.*?)\)$/.test(c),u=Q,L,n, |
| | | P,T;A&&l.addClass("highcharts-"+A);u=Q;L=function(){return(N||0)%2/2};n=function(){var a=M.element.style,g={};z=(void 0===f||void 0===y||J)&&w(M.textStr)&&M.getBBox();l.width=(f||z.width||0)+2*B+R;l.height=(y||z.height||0)+2*B;x=B+v.fontMetrics(a&&a.fontSize,M).b;u&&(O||(l.box=O=v.symbols[c]||Q?v.symbol(c):v.rect(),O.addClass(("button"===A?"":"highcharts-label-box")+(A?" highcharts-"+A+"-box":"")),O.add(l),a=L(),g.x=a,g.y=(q?-x:0)+a),g.width=Math.round(l.width),g.height=Math.round(l.height),O.attr(k(g, |
| | | E)),E={})};P=function(){var a=R+B,g;g=q?0:x;w(f)&&z&&("center"===J||"right"===J)&&(a+={center:.5,right:1}[J]*(f-z.width));if(a!==M.x||g!==M.y)M.attr("x",a),M.hasBoxWidthChanged&&(z=M.getBBox(!0),n()),void 0!==g&&M.attr("y",g);M.x=a;M.y=g};T=function(a,g){O?O.attr(a,g):E[a]=g};l.onAdd=function(){M.add(l);l.attr({text:g||0===g?g:"",x:d,y:b});O&&w(m)&&l.attr({anchorX:m,anchorY:H})};l.widthSetter=function(g){f=a.isNumber(g)?g:null};l.heightSetter=function(a){y=a};l["text-alignSetter"]=function(a){J=a}; |
| | | l.paddingSetter=function(a){w(a)&&a!==B&&(B=l.padding=a,P())};l.paddingLeftSetter=function(a){w(a)&&a!==R&&(R=a,P())};l.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==e&&(e=a,z&&l.attr({x:t}))};l.textSetter=function(a){void 0!==a&&M.textSetter(a);n();P()};l["stroke-widthSetter"]=function(a,g){a&&(u=!0);N=this["stroke-width"]=a;T(g,a)};l.strokeSetter=l.fillSetter=l.rSetter=function(a,g){"r"!==g&&("fill"===g&&a&&(u=!0),l[g]=a);T(g,a)};l.anchorXSetter=function(a,g){m=l.anchorX=a;T(g,Math.round(a)- |
| | | L()-t)};l.anchorYSetter=function(a,g){H=l.anchorY=a;T(g,a-D)};l.xSetter=function(a){l.x=a;e&&(a-=e*((f||z.width)+2*B),l["forceAnimate:x"]=!0);t=Math.round(a);l.attr("translateX",t)};l.ySetter=function(a){D=l.y=Math.round(a);l.attr("translateY",D)};var V=l.css;return k(l,{css:function(a){if(a){var g={};a=G(a);p(l.textProps,function(r){void 0!==a[r]&&(g[r]=a[r],delete a[r])});M.css(g);"width"in g&&n()}return V.call(l,a)},getBBox:function(){return{width:z.width+2*B,height:z.height+2*B,x:z.x-B,y:z.y- |
| | | B}},shadow:function(a){a&&(n(),O&&O.shadow(a));return l},destroy:function(){r(l.element,"mouseenter");r(l.element,"mouseleave");M&&(M=M.destroy());O&&(O=O.destroy());C.prototype.destroy.call(l);l=v=n=P=T=null}})}});a.Renderer=F})(K);(function(a){var C=a.attr,F=a.createElement,I=a.css,n=a.defined,f=a.each,e=a.extend,u=a.isFirefox,x=a.isMS,t=a.isWebKit,w=a.pick,y=a.pInt,c=a.SVGRenderer,h=a.win,p=a.wrap;e(a.SVGElement.prototype,{htmlCss:function(a){var c="SPAN"===this.element.tagName&&a&&"width"in a, |
| | | d=w(c&&a.width,void 0);c&&(delete a.width,this.textWidth=d,this.htmlUpdateTransform());a&&"ellipsis"===a.textOverflow&&(a.whiteSpace="nowrap",a.overflow="hidden");this.styles=e(this.styles,a);I(this.element,a);return this},htmlGetBBox:function(){var a=this.element;return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,c=this.element,d=this.translateX||0,b=this.translateY||0,h=this.x||0,p=this.y||0,l=this.textAlign|| |
| | | "left",e={left:0,center:.5,right:1}[l],B=this.styles,t=B&&B.whiteSpace;I(c,{marginLeft:d,marginTop:b});this.shadows&&f(this.shadows,function(a){I(a,{marginLeft:d+1,marginTop:b+1})});this.inverted&&f(c.childNodes,function(d){a.invertChild(d,c)});if("SPAN"===c.tagName){var B=this.rotation,m=this.textWidth&&y(this.textWidth),G=[B,l,c.innerHTML,this.textWidth,this.textAlign].join(),A;(A=m!==this.oldTextWidth)&&!(A=m>this.oldTextWidth)&&((A=this.textPxLength)||(I(c,{width:"",whiteSpace:t||"nowrap"}),A= |
| | | c.offsetWidth),A=A>m);A&&/[ \-]/.test(c.textContent||c.innerText)?(I(c,{width:m+"px",display:"block",whiteSpace:t||"normal"}),this.oldTextWidth=m,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1;G!==this.cTT&&(t=a.fontMetrics(c.style.fontSize).b,!n(B)||B===(this.oldRotation||0)&&l===this.oldAlign||this.setSpanRotation(B,e,t),this.getSpanCorrection(!n(B)&&this.textPxLength||c.offsetWidth,t,e,B,l));I(c,{left:h+(this.xCorr||0)+"px",top:p+(this.yCorr||0)+"px"});this.cTT=G;this.oldRotation=B;this.oldAlign= |
| | | l}}else this.alignOnAdd=!0},setSpanRotation:function(a,c,d){var b={},k=this.renderer.getTransformKey();b[k]=b.transform="rotate("+a+"deg)";b[k+(u?"Origin":"-origin")]=b.transformOrigin=100*c+"% "+d+"px";I(this.element,b)},getSpanCorrection:function(a,c,d){this.xCorr=-a*d;this.yCorr=-c}});e(c.prototype,{getTransformKey:function(){return x&&!/Edge/.test(h.navigator.userAgent)?"-ms-transform":t?"-webkit-transform":u?"MozTransform":h.opera?"-o-transform":""},html:function(a,c,d){var b=this.createElement("span"), |
| | | k=b.element,h=b.renderer,l=h.isSVG,q=function(a,d){f(["opacity","visibility"],function(b){p(a,b+"Setter",function(a,b,c,m){a.call(this,b,c,m);d[c]=b})});a.addedSetters=!0};b.textSetter=function(a){a!==k.innerHTML&&delete this.bBox;this.textStr=a;k.innerHTML=w(a,"");b.doTransform=!0};l&&q(b,b.element.style);b.xSetter=b.ySetter=b.alignSetter=b.rotationSetter=function(a,d){"align"===d&&(d="textAlign");b[d]=a;b.doTransform=!0};b.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform= |
| | | !1)};b.attr({text:a,x:Math.round(c),y:Math.round(d)}).css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize,position:"absolute"});k.style.whiteSpace="nowrap";b.css=b.htmlCss;l&&(b.add=function(a){var d,c=h.box.parentNode,l=[];if(this.parentGroup=a){if(d=a.div,!d){for(;a;)l.push(a),a=a.parentGroup;f(l.reverse(),function(a){function m(g,d){a[d]=g;"translateX"===d?k.left=g+"px":k.top=g+"px";a.doTransform=!0}var k,g=C(a.element,"class");g&&(g={className:g});d=a.div=a.div||F("div",g,{position:"absolute", |
| | | left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},d||c);k=d.style;e(a,{classSetter:function(a){return function(g){this.element.setAttribute("class",g);a.className=g}}(d),on:function(){l[0].div&&b.on.apply({element:l[0].div},arguments);return a},translateXSetter:m,translateYSetter:m});a.addedSetters||q(a,k)})}}else d=c;d.appendChild(k);b.added=!0;b.alignOnAdd&&b.htmlUpdateTransform();return b});return b}})})(K); |
| | | (function(a){var C=a.defined,F=a.each,I=a.extend,n=a.merge,f=a.pick,e=a.timeUnits,u=a.win;a.Time=function(a){this.update(a,!1)};a.Time.prototype={defaultOptions:{},update:function(a){var e=f(a&&a.useUTC,!0),w=this;this.options=a=n(!0,this.options||{},a);this.Date=a.Date||u.Date;this.timezoneOffset=(this.useUTC=e)&&a.timezoneOffset;this.getTimezoneOffset=this.timezoneOffsetFunction();(this.variableTimezone=!(e&&!a.getTimezoneOffset&&!a.timezone))||this.timezoneOffset?(this.get=function(a,c){var h= |
| | | c.getTime(),p=h-w.getTimezoneOffset(c);c.setTime(p);a=c["getUTC"+a]();c.setTime(h);return a},this.set=function(a,c,h){var p;if("Milliseconds"===a||"Seconds"===a||"Minutes"===a&&0===c.getTimezoneOffset()%60)c["set"+a](h);else p=w.getTimezoneOffset(c),p=c.getTime()-p,c.setTime(p),c["setUTC"+a](h),a=w.getTimezoneOffset(c),p=c.getTime()+a,c.setTime(p)}):e?(this.get=function(a,c){return c["getUTC"+a]()},this.set=function(a,c,h){return c["setUTC"+a](h)}):(this.get=function(a,c){return c["get"+a]()},this.set= |
| | | function(a,c,h){return c["set"+a](h)})},makeTime:function(e,t,w,y,c,h){var p,k,q;this.useUTC?(p=this.Date.UTC.apply(0,arguments),k=this.getTimezoneOffset(p),p+=k,q=this.getTimezoneOffset(p),k!==q?p+=q-k:k-36E5!==this.getTimezoneOffset(p-36E5)||a.isSafari||(p-=36E5)):p=(new this.Date(e,t,f(w,1),f(y,0),f(c,0),f(h,0))).getTime();return p},timezoneOffsetFunction:function(){var e=this,f=this.options,w=u.moment;if(!this.useUTC)return function(a){return 6E4*(new Date(a)).getTimezoneOffset()};if(f.timezone){if(w)return function(a){return 6E4* |
| | | -w.tz(a,f.timezone).utcOffset()};a.error(25)}return this.useUTC&&f.getTimezoneOffset?function(a){return 6E4*f.getTimezoneOffset(a)}:function(){return 6E4*(e.timezoneOffset||0)}},dateFormat:function(e,f,w){if(!a.defined(f)||isNaN(f))return a.defaultOptions.lang.invalidDate||"";e=a.pick(e,"%Y-%m-%d %H:%M:%S");var t=this,c=new this.Date(f),h=this.get("Hours",c),p=this.get("Day",c),k=this.get("Date",c),q=this.get("Month",c),d=this.get("FullYear",c),b=a.defaultOptions.lang,v=b.weekdays,J=b.shortWeekdays, |
| | | l=a.pad,c=a.extend({a:J?J[p]:v[p].substr(0,3),A:v[p],d:l(k),e:l(k,2," "),w:p,b:b.shortMonths[q],B:b.months[q],m:l(q+1),o:q+1,y:d.toString().substr(2,2),Y:d,H:l(h),k:h,I:l(h%12||12),l:h%12||12,M:l(t.get("Minutes",c)),p:12>h?"AM":"PM",P:12>h?"am":"pm",S:l(c.getSeconds()),L:l(Math.floor(f%1E3),3)},a.dateFormats);a.objectEach(c,function(a,d){for(;-1!==e.indexOf("%"+d);)e=e.replace("%"+d,"function"===typeof a?a.call(t,f):a)});return w?e.substr(0,1).toUpperCase()+e.substr(1):e},resolveDTLFormat:function(e){return a.isObject(e, |
| | | !0)?e:(e=a.splat(e),{main:e[0],from:e[1],to:e[2]})},getTimeTicks:function(a,t,w,y){var c=this,h=[],p,k={},q;p=new c.Date(t);var d=a.unitRange,b=a.count||1,v;y=f(y,1);if(C(t)){c.set("Milliseconds",p,d>=e.second?0:b*Math.floor(c.get("Milliseconds",p)/b));d>=e.second&&c.set("Seconds",p,d>=e.minute?0:b*Math.floor(c.get("Seconds",p)/b));d>=e.minute&&c.set("Minutes",p,d>=e.hour?0:b*Math.floor(c.get("Minutes",p)/b));d>=e.hour&&c.set("Hours",p,d>=e.day?0:b*Math.floor(c.get("Hours",p)/b));d>=e.day&&c.set("Date", |
| | | p,d>=e.month?1:b*Math.floor(c.get("Date",p)/b));d>=e.month&&(c.set("Month",p,d>=e.year?0:b*Math.floor(c.get("Month",p)/b)),q=c.get("FullYear",p));d>=e.year&&c.set("FullYear",p,q-q%b);d===e.week&&(q=c.get("Day",p),c.set("Date",p,c.get("Date",p)-q+y+(q<y?-7:0)));q=c.get("FullYear",p);y=c.get("Month",p);var J=c.get("Date",p),l=c.get("Hours",p);t=p.getTime();c.variableTimezone&&(v=w-t>4*e.month||c.getTimezoneOffset(t)!==c.getTimezoneOffset(w));t=p.getTime();for(p=1;t<w;)h.push(t),t=d===e.year?c.makeTime(q+ |
| | | p*b,0):d===e.month?c.makeTime(q,y+p*b):!v||d!==e.day&&d!==e.week?v&&d===e.hour&&1<b?c.makeTime(q,y,J,l+p*b):t+d*b:c.makeTime(q,y,J+p*b*(d===e.day?1:7)),p++;h.push(t);d<=e.hour&&1E4>h.length&&F(h,function(a){0===a%18E5&&"000000000"===c.dateFormat("%H%M%S%L",a)&&(k[a]="day")})}h.info=I(a,{higherRanks:k,totalRange:d*b});return h}}})(K);(function(a){var C=a.color,F=a.merge;a.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle", |
| | | "diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:a.Time.prototype.defaultOptions, |
| | | chart:{borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal", |
| | | labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold", |
| | | position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:a.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:a.isTouchDevice?25:10,backgroundColor:C("#f7f7f7").setOpacity(.85).get(),borderWidth:1,headerFormat:'\x3cspan style\x3d"font-size: 10px"\x3e{point.key}\x3c/span\x3e\x3cbr/\x3e', |
| | | pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e',shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};a.setOptions=function(C){a.defaultOptions=F(!0,a.defaultOptions,C); |
| | | a.time.update(F(a.defaultOptions.global,a.defaultOptions.time),!1);return a.defaultOptions};a.getOptions=function(){return a.defaultOptions};a.defaultPlotOptions=a.defaultOptions.plotOptions;a.time=new a.Time(F(a.defaultOptions.global,a.defaultOptions.time));a.dateFormat=function(C,n,f){return a.time.dateFormat(C,n,f)}})(K);(function(a){var C=a.correctFloat,F=a.defined,I=a.destroyObjectProperties,n=a.fireEvent,f=a.isNumber,e=a.merge,u=a.pick,x=a.deg2rad;a.Tick=function(a,e,f,c,h){this.axis=a;this.pos= |
| | | e;this.type=f||"";this.isNewLabel=this.isNew=!0;this.parameters=h||{};this.tickmarkOffset=this.parameters.tickmarkOffset;this.options=this.parameters.options;f||c||this.addLabel()};a.Tick.prototype={addLabel:function(){var f=this,w=f.axis,y=w.options,c=w.chart,h=w.categories,p=w.names,k=f.pos,q=u(f.options&&f.options.labels,y.labels),d=w.tickPositions,b=k===d[0],v=k===d[d.length-1],h=this.parameters.category||(h?u(h[k],p[k],k):k),J=f.label,d=d.info,l,n,B,D;w.isDatetimeAxis&&d&&(n=c.time.resolveDTLFormat(y.dateTimeLabelFormats[!y.grid&& |
| | | d.higherRanks[k]||d.unitName]),l=n.main);f.isFirst=b;f.isLast=v;f.formatCtx={axis:w,chart:c,isFirst:b,isLast:v,dateTimeLabelFormat:l,tickPositionInfo:d,value:w.isLog?C(w.lin2log(h)):h,pos:k};y=w.labelFormatter.call(f.formatCtx,this.formatCtx);if(D=n&&n.list)f.shortenLabel=function(){for(B=0;B<D.length;B++)if(J.attr({text:w.labelFormatter.call(a.extend(f.formatCtx,{dateTimeLabelFormat:D[B]}))}),J.getBBox().width<w.getSlotWidth(f)-2*u(q.padding,5))return;J.attr({text:""})};if(F(J))J&&J.textStr!==y&& |
| | | (!J.textWidth||q.style&&q.style.width||J.styles.width||J.css({width:null}),J.attr({text:y}));else{if(f.label=J=F(y)&&q.enabled?c.renderer.text(y,0,0,q.useHTML).css(e(q.style)).add(w.labelGroup):null)J.textPxLength=J.getBBox().width;f.rotation=0}},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(a){var e=this.axis,f=e.options.labels,c=a.x,h=e.chart.chartWidth,p=e.chart.spacing,k=u(e.labelLeft,Math.min(e.pos,p[3])),p=u(e.labelRight, |
| | | Math.max(e.isRadial?0:e.pos+e.len,h-p[1])),q=this.label,d=this.rotation,b={left:0,center:.5,right:1}[e.labelAlign||q.attr("align")],v=q.getBBox().width,J=e.getSlotWidth(this),l=J,t=1,B,D={};if(d||"justify"!==u(f.overflow,"justify"))0>d&&c-b*v<k?B=Math.round(c/Math.cos(d*x)-k):0<d&&c+b*v>p&&(B=Math.round((h-c)/Math.cos(d*x)));else if(h=c+(1-b)*v,c-b*v<k?l=a.x+l*(1-b)-k:h>p&&(l=p-a.x+l*b,t=-1),l=Math.min(J,l),l<J&&"center"===e.labelAlign&&(a.x+=t*(J-l-b*(J-Math.min(v,l)))),v>l||e.autoRotation&&(q.styles|| |
| | | {}).width)B=l;B&&(this.shortenLabel?this.shortenLabel():(D.width=B,(f.style||{}).textOverflow||(D.textOverflow="ellipsis"),q.css(D)))},getPosition:function(e,f,y,c){var h=this.axis,p=h.chart,k=c&&p.oldChartHeight||p.chartHeight;e={x:e?a.correctFloat(h.translate(f+y,null,null,c)+h.transB):h.left+h.offset+(h.opposite?(c&&p.oldChartWidth||p.chartWidth)-h.right-h.left:0),y:e?k-h.bottom+h.offset-(h.opposite?h.height:0):a.correctFloat(k-h.translate(f+y,null,null,c)-h.transB)};n(this,"afterGetPosition", |
| | | {pos:e});return e},getLabelPosition:function(a,e,f,c,h,p,k,q){var d=this.axis,b=d.transA,v=d.reversed,J=d.staggerLines,l=d.tickRotCorr||{x:0,y:0},t=h.y,B=c||d.reserveSpaceDefault?0:-d.labelOffset*("center"===d.labelAlign?.5:1),D={};F(t)||(t=0===d.side?f.rotation?-8:-f.getBBox().height:2===d.side?l.y+8:Math.cos(f.rotation*x)*(l.y-f.getBBox(!1,0).height/2));a=a+h.x+B+l.x-(p&&c?p*b*(v?-1:1):0);e=e+t-(p&&!c?p*b*(v?1:-1):0);J&&(f=k/(q||1)%J,d.opposite&&(f=J-f-1),e+=d.labelOffset/J*f);D.x=a;D.y=Math.round(e); |
| | | n(this,"afterGetLabelPosition",{pos:D});return D},getMarkPath:function(a,e,f,c,h,p){return p.crispLine(["M",a,e,"L",a+(h?0:-f),e+(h?f:0)],c)},renderGridLine:function(a,e,f){var c=this.axis,h=c.options,p=this.gridLine,k={},q=this.pos,d=this.type,b=u(this.tickmarkOffset,c.tickmarkOffset),v=c.chart.renderer,J=d?d+"Grid":"grid",l=h[J+"LineWidth"],t=h[J+"LineColor"],h=h[J+"LineDashStyle"];p||(k.stroke=t,k["stroke-width"]=l,h&&(k.dashstyle=h),d||(k.zIndex=1),a&&(e=0),this.gridLine=p=v.path().attr(k).addClass("highcharts-"+ |
| | | (d?d+"-":"")+"grid-line").add(c.gridGroup));if(p&&(f=c.getPlotLinePath(q+b,p.strokeWidth()*f,a,"pass")))p[a||this.isNew?"attr":"animate"]({d:f,opacity:e})},renderMark:function(a,e,f){var c=this.axis,h=c.options,p=c.chart.renderer,k=this.type,q=k?k+"Tick":"tick",d=c.tickSize(q),b=this.mark,v=!b,J=a.x;a=a.y;var l=u(h[q+"Width"],!k&&c.isXAxis?1:0),h=h[q+"Color"];d&&(c.opposite&&(d[0]=-d[0]),v&&(this.mark=b=p.path().addClass("highcharts-"+(k?k+"-":"")+"tick").add(c.axisGroup),b.attr({stroke:h,"stroke-width":l})), |
| | | b[v?"attr":"animate"]({d:this.getMarkPath(J,a,d[0],b.strokeWidth()*f,c.horiz,p),opacity:e}))},renderLabel:function(a,e,y,c){var h=this.axis,p=h.horiz,k=h.options,q=this.label,d=k.labels,b=d.step,h=u(this.tickmarkOffset,h.tickmarkOffset),v=!0,J=a.x;a=a.y;q&&f(J)&&(q.xy=a=this.getLabelPosition(J,a,q,p,d,h,c,b),this.isFirst&&!this.isLast&&!u(k.showFirstLabel,1)||this.isLast&&!this.isFirst&&!u(k.showLastLabel,1)?v=!1:!p||d.step||d.rotation||e||0===y||this.handleOverflow(a),b&&c%b&&(v=!1),v&&f(a.y)?(a.opacity= |
| | | y,q[this.isNewLabel?"attr":"animate"](a),this.isNewLabel=!1):(q.attr("y",-9999),this.isNewLabel=!0))},render:function(e,f,y){var c=this.axis,h=c.horiz,p=this.pos,k=u(this.tickmarkOffset,c.tickmarkOffset),p=this.getPosition(h,p,k,f),k=p.x,q=p.y,c=h&&k===c.pos+c.len||!h&&q===c.pos?-1:1;y=u(y,1);this.isActive=!0;this.renderGridLine(f,y,c);this.renderMark(p,y,c);this.renderLabel(p,f,y,e);this.isNew=!1;a.fireEvent(this,"afterRender")},destroy:function(){I(this,this.axis)}}})(K);var W=function(a){var C= |
| | | a.addEvent,F=a.animObject,I=a.arrayMax,n=a.arrayMin,f=a.color,e=a.correctFloat,u=a.defaultOptions,x=a.defined,t=a.deg2rad,w=a.destroyObjectProperties,y=a.each,c=a.extend,h=a.fireEvent,p=a.format,k=a.getMagnitude,q=a.grep,d=a.inArray,b=a.isArray,v=a.isNumber,J=a.isString,l=a.merge,L=a.normalizeTickInterval,B=a.objectEach,D=a.pick,m=a.removeEvent,G=a.splat,A=a.syncTimeout,N=a.Tick,E=function(){this.init.apply(this,arguments)};a.extend(E.prototype,{defaultOptions:{dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L", |
| | | range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,labels:{enabled:!0,indentation:10,x:0,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",minPadding:.01,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle", |
| | | style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{allowOverlap:!1,enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold", |
| | | textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(a,r){var g=r.isX,b=this;b.chart=a;b.horiz=a.inverted&&!b.isZAxis?!g:g;b.isXAxis=g;b.coll=b.coll||(g?"xAxis":"yAxis");h(this,"init",{userOptions:r});b.opposite= |
| | | r.opposite;b.side=r.side||(b.horiz?b.opposite?0:2:b.opposite?1:3);b.setOptions(r);var c=this.options,m=c.type;b.labelFormatter=c.labels.formatter||b.defaultLabelFormatter;b.userOptions=r;b.minPixelPadding=0;b.reversed=c.reversed;b.visible=!1!==c.visible;b.zoomEnabled=!1!==c.zoomEnabled;b.hasNames="category"===m||!0===c.categories;b.categories=c.categories||b.hasNames;b.names||(b.names=[],b.names.keys={});b.plotLinesAndBandsGroups={};b.isLog="logarithmic"===m;b.isDatetimeAxis="datetime"===m;b.positiveValuesOnly= |
| | | b.isLog&&!b.allowNegativeLog;b.isLinked=x(c.linkedTo);b.ticks={};b.labelEdge=[];b.minorTicks={};b.plotLinesAndBands=[];b.alternateBands={};b.len=0;b.minRange=b.userMinRange=c.minRange||c.maxZoom;b.range=c.range;b.offset=c.offset||0;b.stacks={};b.oldStacks={};b.stacksTouched=0;b.max=null;b.min=null;b.crosshair=D(c.crosshair,G(a.options.tooltip.crosshairs)[g?0:1],!1);r=b.options.events;-1===d(b,a.axes)&&(g?a.axes.splice(a.xAxis.length,0,b):a.axes.push(b),a[b.coll].push(b));b.series=b.series||[];a.inverted&& |
| | | !b.isZAxis&&g&&void 0===b.reversed&&(b.reversed=!0);B(r,function(a,g){C(b,g,a)});b.lin2log=c.linearToLogConverter||b.lin2log;b.isLog&&(b.val2lin=b.log2lin,b.lin2val=b.lin2log);h(this,"afterInit")},setOptions:function(a){this.options=l(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],l(u[this.coll],a));h(this,"afterSetOptions",{userOptions:a})},defaultLabelFormatter:function(){var g= |
| | | this.axis,r=this.value,b=g.chart.time,d=g.categories,c=this.dateTimeLabelFormat,m=u.lang,k=m.numericSymbols,m=m.numericSymbolMagnitude||1E3,h=k&&k.length,l,q=g.options.labels.format,g=g.isLog?Math.abs(r):g.tickInterval;if(q)l=p(q,this,b);else if(d)l=r;else if(c)l=b.dateFormat(c,r);else if(h&&1E3<=g)for(;h--&&void 0===l;)b=Math.pow(m,h+1),g>=b&&0===10*r%b&&null!==k[h]&&0!==r&&(l=a.numberFormat(r/b,-1)+k[h]);void 0===l&&(l=1E4<=Math.abs(r)?a.numberFormat(r,-1):a.numberFormat(r,-1,void 0,""));return l}, |
| | | getSeriesExtremes:function(){var a=this,r=a.chart;h(this,"getSeriesExtremes",null,function(){a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();y(a.series,function(g){if(g.visible||!r.options.chart.ignoreHiddenSeries){var b=g.options,d=b.threshold,c;a.hasVisibleSeries=!0;a.positiveValuesOnly&&0>=d&&(d=null);if(a.isXAxis)b=g.xData,b.length&&(g=n(b),c=I(b),v(g)||g instanceof Date||(b=q(b,v),g=n(b),c=I(b)),b.length&&(a.dataMin=Math.min(D(a.dataMin, |
| | | b[0],g),g),a.dataMax=Math.max(D(a.dataMax,b[0],c),c)));else if(g.getExtremes(),c=g.dataMax,g=g.dataMin,x(g)&&x(c)&&(a.dataMin=Math.min(D(a.dataMin,g),g),a.dataMax=Math.max(D(a.dataMax,c),c)),x(d)&&(a.threshold=d),!b.softThreshold||a.positiveValuesOnly)a.softThreshold=!1}})});h(this,"afterGetSeriesExtremes")},translate:function(a,r,b,d,c,m){var g=this.linkedParent||this,k=1,H=0,l=d?g.oldTransA:g.transA;d=d?g.oldMin:g.min;var h=g.minPixelPadding;c=(g.isOrdinal||g.isBroken||g.isLog&&c)&&g.lin2val;l|| |
| | | (l=g.transA);b&&(k*=-1,H=g.len);g.reversed&&(k*=-1,H-=k*(g.sector||g.len));r?(a=(a*k+H-h)/l+d,c&&(a=g.lin2val(a))):(c&&(a=g.val2lin(a)),a=v(d)?k*(a-d)*l+H+k*h+(v(m)?l*m:0):void 0);return a},toPixels:function(a,r){return this.translate(a,!1,!this.horiz,null,!0)+(r?0:this.pos)},toValue:function(a,r){return this.translate(a-(r?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,r,b,d,c){var g=this.chart,m=this.left,k=this.top,H,l,h=b&&g.oldChartHeight||g.chartHeight,q=b&&g.oldChartWidth|| |
| | | g.chartWidth,A;H=this.transB;var e=function(a,g,r){if("pass"!==d&&a<g||a>r)d?a=Math.min(Math.max(g,a),r):A=!0;return a};c=D(c,this.translate(a,null,null,b));c=Math.min(Math.max(-1E5,c),1E5);a=b=Math.round(c+H);H=l=Math.round(h-c-H);v(c)?this.horiz?(H=k,l=h-this.bottom,a=b=e(a,m,m+this.width)):(a=m,b=q-this.right,H=l=e(H,k,k+this.height)):(A=!0,d=!1);return A&&!d?null:g.renderer.crispLine(["M",a,H,"L",b,l],r||1)},getLinearTickPositions:function(a,r,b){var g,d=e(Math.floor(r/a)*a);b=e(Math.ceil(b/a)* |
| | | a);var c=[],m;e(d+a)===d&&(m=20);if(this.single)return[r];for(r=d;r<=b;){c.push(r);r=e(r+a,m);if(r===g)break;g=r}return c},getMinorTickInterval:function(){var a=this.options;return!0===a.minorTicks?D(a.minorTickInterval,"auto"):!1===a.minorTicks?null:a.minorTickInterval},getMinorTickPositions:function(){var a=this,r=a.options,b=a.tickPositions,d=a.minorTickInterval,c=[],m=a.pointRangePadding||0,k=a.min-m,m=a.max+m,l=m-k;if(l&&l/d<a.len/3)if(a.isLog)y(this.paddedTicks,function(g,r,b){r&&c.push.apply(c, |
| | | a.getLogTickPositions(d,b[r-1],b[r],!0))});else if(a.isDatetimeAxis&&"auto"===this.getMinorTickInterval())c=c.concat(a.getTimeTicks(a.normalizeTimeTickInterval(d),k,m,r.startOfWeek));else for(r=k+(b[0]-k)%d;r<=m&&r!==c[0];r+=d)c.push(r);0!==c.length&&a.trimTicks(c);return c},adjustForMinRange:function(){var a=this.options,r=this.min,b=this.max,d,c,m,k,l,h,q,v;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(x(a.min)||x(a.max)?this.minRange=null:(y(this.series,function(a){h=a.xData;for(k=q=a.xIncrement? |
| | | 1:h.length-1;0<k;k--)if(l=h[k]-h[k-1],void 0===m||l<m)m=l}),this.minRange=Math.min(5*m,this.dataMax-this.dataMin)));b-r<this.minRange&&(c=this.dataMax-this.dataMin>=this.minRange,v=this.minRange,d=(v-b+r)/2,d=[r-d,D(a.min,r-d)],c&&(d[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin),r=I(d),b=[r+v,D(a.max,r+v)],c&&(b[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax),b=n(b),b-r<v&&(d[0]=b-v,d[1]=D(a.min,b-v),r=I(d)));this.min=r;this.max=b},getClosest:function(){var a;this.categories?a=1:y(this.series, |
| | | function(g){var r=g.closestPointRange,b=g.visible||!g.chart.options.chart.ignoreHiddenSeries;!g.noSharedTooltip&&x(r)&&b&&(a=x(a)?Math.min(a,r):r)});return a},nameToX:function(a){var g=b(this.categories),c=g?this.categories:this.names,m=a.options.x,k;a.series.requireSorting=!1;x(m)||(m=!1===this.options.uniqueNames?a.series.autoIncrement():g?d(a.name,c):D(c.keys[a.name],-1));-1===m?g||(k=c.length):k=m;void 0!==k&&(this.names[k]=a.name,this.names.keys[a.name]=k);return k},updateNames:function(){var g= |
| | | this,r=this.names;0<r.length&&(y(a.keys(r.keys),function(a){delete r.keys[a]}),r.length=0,this.minRange=this.userMinRange,y(this.series||[],function(a){a.xIncrement=null;if(!a.points||a.isDirtyData)a.processData(),a.generatePoints();y(a.points,function(r,b){var d;r.options&&(d=g.nameToX(r),void 0!==d&&d!==r.x&&(r.x=d,a.xData[b]=d))})}))},setAxisTranslation:function(a){var g=this,b=g.max-g.min,d=g.axisPointRange||0,c,m=0,k=0,l=g.linkedParent,q=!!g.categories,v=g.transA,A=g.isXAxis;if(A||q||d)c=g.getClosest(), |
| | | l?(m=l.minPointOffset,k=l.pointRangePadding):y(g.series,function(a){var b=q?1:A?D(a.options.pointRange,c,0):g.axisPointRange||0;a=a.options.pointPlacement;d=Math.max(d,b);g.single||(m=Math.max(m,J(a)?0:b/2),k=Math.max(k,"on"===a?0:b))}),l=g.ordinalSlope&&c?g.ordinalSlope/c:1,g.minPointOffset=m*=l,g.pointRangePadding=k*=l,g.pointRange=Math.min(d,b),A&&(g.closestPointRange=c);a&&(g.oldTransA=v);g.translationSlope=g.transA=v=g.staticScale||g.len/(b+k||1);g.transB=g.horiz?g.left:g.bottom;g.minPixelPadding= |
| | | v*m;h(this,"afterSetAxisTranslation")},minFromRange:function(){return this.max-this.range},setTickInterval:function(g){var b=this,d=b.chart,c=b.options,m=b.isLog,l=b.isDatetimeAxis,q=b.isXAxis,A=b.isLinked,p=c.maxPadding,f=c.minPadding,G=c.tickInterval,B=c.tickPixelInterval,J=b.categories,E=v(b.threshold)?b.threshold:null,N=b.softThreshold,w,t,u,n;l||J||A||this.getTickAmount();u=D(b.userMin,c.min);n=D(b.userMax,c.max);A?(b.linkedParent=d[b.coll][c.linkedTo],d=b.linkedParent.getExtremes(),b.min=D(d.min, |
| | | d.dataMin),b.max=D(d.max,d.dataMax),c.type!==b.linkedParent.options.type&&a.error(11,1)):(!N&&x(E)&&(b.dataMin>=E?(w=E,f=0):b.dataMax<=E&&(t=E,p=0)),b.min=D(u,w,b.dataMin),b.max=D(n,t,b.dataMax));m&&(b.positiveValuesOnly&&!g&&0>=Math.min(b.min,D(b.dataMin,b.min))&&a.error(10,1),b.min=e(b.log2lin(b.min),15),b.max=e(b.log2lin(b.max),15));b.range&&x(b.max)&&(b.userMin=b.min=u=Math.max(b.dataMin,b.minFromRange()),b.userMax=n=b.max,b.range=null);h(b,"foundExtremes");b.beforePadding&&b.beforePadding(); |
| | | b.adjustForMinRange();!(J||b.axisPointRange||b.usePercentage||A)&&x(b.min)&&x(b.max)&&(d=b.max-b.min)&&(!x(u)&&f&&(b.min-=d*f),!x(n)&&p&&(b.max+=d*p));v(c.softMin)&&!v(b.userMin)&&(b.min=Math.min(b.min,c.softMin));v(c.softMax)&&!v(b.userMax)&&(b.max=Math.max(b.max,c.softMax));v(c.floor)&&(b.min=Math.max(b.min,c.floor));v(c.ceiling)&&(b.max=Math.min(b.max,c.ceiling));N&&x(b.dataMin)&&(E=E||0,!x(u)&&b.min<E&&b.dataMin>=E?b.min=E:!x(n)&&b.max>E&&b.dataMax<=E&&(b.max=E));b.tickInterval=b.min===b.max|| |
| | | void 0===b.min||void 0===b.max?1:A&&!G&&B===b.linkedParent.options.tickPixelInterval?G=b.linkedParent.tickInterval:D(G,this.tickAmount?(b.max-b.min)/Math.max(this.tickAmount-1,1):void 0,J?1:(b.max-b.min)*B/Math.max(b.len,B));q&&!g&&y(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();b.postProcessTickInterval&&(b.tickInterval=b.postProcessTickInterval(b.tickInterval));b.pointRange&&!G&&(b.tickInterval= |
| | | Math.max(b.pointRange,b.tickInterval));g=D(c.minTickInterval,b.isDatetimeAxis&&b.closestPointRange);!G&&b.tickInterval<g&&(b.tickInterval=g);l||m||G||(b.tickInterval=L(b.tickInterval,null,k(b.tickInterval),D(c.allowDecimals,!(.5<b.tickInterval&&5>b.tickInterval&&1E3<b.max&&9999>b.max)),!!this.tickAmount));this.tickAmount||(b.tickInterval=b.unsquish());this.setTickPositions()},setTickPositions:function(){var g=this.options,b,d=g.tickPositions;b=this.getMinorTickInterval();var c=g.tickPositioner,m= |
| | | g.startOnTick,k=g.endOnTick;this.tickmarkOffset=this.categories&&"between"===g.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===b&&this.tickInterval?this.tickInterval/5:b;this.single=this.min===this.max&&x(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==g.allowDecimals);this.tickPositions=b=d&&d.slice();!b&&(!this.ordinalPositions&&(this.max-this.min)/this.tickInterval>Math.max(2*this.len,200)?(b=[this.min,this.max],a.error(19)):b=this.isDatetimeAxis? |
| | | this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,g.units),this.min,this.max,g.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()],b[0]===b[1]&&(b.length=1)),this.tickPositions=b,c&&(c=c.apply(this,[this.min,this.max])))&&(this.tickPositions=b=c);this.paddedTicks=b.slice(0);this.trimTicks(b,m,k);this.isLinked|| |
| | | (this.single&&2>b.length&&(this.min-=.5,this.max+=.5),d||c||this.adjustTickAmount());h(this,"afterSetTickPositions")},trimTicks:function(a,b,d){var g=a[0],c=a[a.length-1],m=this.minPointOffset||0;if(!this.isLinked){if(b&&-Infinity!==g)this.min=g;else for(;this.min-m>a[0];)a.shift();if(d)this.max=c;else for(;this.max+m<a[a.length-1];)a.pop();0===a.length&&x(g)&&!this.options.tickPositions&&a.push((c+g)/2)}},alignToOthers:function(){var a={},b,d=this.options;!1===this.chart.options.chart.alignTicks|| |
| | | !1===d.alignTicks||!1===d.startOnTick||!1===d.endOnTick||this.isLog||y(this.chart[this.coll],function(g){var d=g.options,d=[g.horiz?d.left:d.top,d.width,d.height,d.pane].join();g.series.length&&(a[d]?b=!0:a[d]=1)});return b},getTickAmount:function(){var a=this.options,b=a.tickAmount,d=a.tickPixelInterval;!x(a.tickInterval)&&this.len<d&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(b=2);!b&&this.alignToOthers()&&(b=Math.ceil(this.len/d)+1);4>b&&(this.finalTickAmt=b,b=5);this.tickAmount= |
| | | b},adjustTickAmount:function(){var a=this.tickInterval,b=this.tickPositions,d=this.tickAmount,c=this.finalTickAmt,m=b&&b.length,k=D(this.threshold,this.softThreshold?0:null);if(this.hasData()){if(m<d){for(;b.length<d;)b.length%2||this.min===k?b.push(e(b[b.length-1]+a)):b.unshift(e(b[0]-a));this.transA*=(m-1)/(d-1);this.min=b[0];this.max=b[b.length-1]}else m>d&&(this.tickInterval*=2,this.setTickPositions());if(x(c)){for(a=d=b.length;a--;)(3===c&&1===a%2||2>=c&&0<a&&a<d-1)&&b.splice(a,1);this.finalTickAmt= |
| | | void 0}}},setScale:function(){var a,b;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();b=this.len!==this.oldAxisLength;y(this.series,function(b){if(b.isDirtyData||b.isDirty||b.xAxis.isDirty)a=!0});b||a||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.resetStacks&&this.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax= |
| | | this.userMax,this.isDirty||(this.isDirty=b||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks();h(this,"afterSetScale")},setExtremes:function(a,b,d,m,k){var g=this,r=g.chart;d=D(d,!0);y(g.series,function(a){delete a.kdTree});k=c(k,{min:a,max:b});h(g,"setExtremes",k,function(){g.userMin=a;g.userMax=b;g.eventArgs=k;d&&r.redraw(m)})},zoom:function(a,b){var g=this.dataMin,d=this.dataMax,c=this.options,m=Math.min(g,D(c.min,g)),c=Math.max(d,D(c.max,d));if(a!==this.min|| |
| | | b!==this.max)this.allowZoomOutside||(x(g)&&(a<m&&(a=m),a>c&&(a=c)),x(d)&&(b<m&&(b=m),b>c&&(b=c))),this.displayBtn=void 0!==a||void 0!==b,this.setExtremes(a,b,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var b=this.chart,d=this.options,c=d.offsets||[0,0,0,0],m=this.horiz,k=this.width=Math.round(a.relativeLength(D(d.width,b.plotWidth-c[3]+c[1]),b.plotWidth)),l=this.height=Math.round(a.relativeLength(D(d.height,b.plotHeight-c[0]+c[2]),b.plotHeight)),h=this.top=Math.round(a.relativeLength(D(d.top, |
| | | b.plotTop+c[0]),b.plotHeight,b.plotTop)),d=this.left=Math.round(a.relativeLength(D(d.left,b.plotLeft+c[3]),b.plotWidth,b.plotLeft));this.bottom=b.chartHeight-l-h;this.right=b.chartWidth-k-d;this.len=Math.max(m?k:l,0);this.pos=m?d:h},getExtremes:function(){var a=this.isLog;return{min:a?e(this.lin2log(this.min)):this.min,max:a?e(this.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,g=b?this.lin2log(this.min): |
| | | this.min,b=b?this.lin2log(this.max):this.max;null===a||-Infinity===a?a=g:Infinity===a?a=b:g>a?a=g:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(D(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"left":"center"},tickSize:function(a){var b=this.options,g=b[a+"Length"],d=D(b[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(d&&g)return"inside"===b[a+"Position"]&&(g=-g),[g,d]},labelMetrics:function(){var a=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&& |
| | | this.options.labels.style.fontSize,this.ticks[a]&&this.ticks[a].label)},unsquish:function(){var a=this.options.labels,b=this.horiz,d=this.tickInterval,c=d,m=this.len/(((this.categories?1:0)+this.max-this.min)/d),k,l=a.rotation,h=this.labelMetrics(),q,v=Number.MAX_VALUE,A,p=function(a){a/=m||1;a=1<a?Math.ceil(a):1;return e(a*d)};b?(A=!a.staggerLines&&!a.step&&(x(l)?[l]:m<D(a.autoRotationLimit,80)&&a.autoRotation))&&y(A,function(a){var b;if(a===l||a&&-90<=a&&90>=a)q=p(Math.abs(h.h/Math.sin(t*a))),b= |
| | | q+Math.abs(a/360),b<v&&(v=b,k=a,c=q)}):a.step||(c=p(h.h));this.autoRotation=A;this.labelRotation=D(k,l);return c},getSlotWidth:function(a){var b=this.chart,g=this.horiz,d=this.options.labels,c=Math.max(this.tickPositions.length-(this.categories?0:1),1),m=b.margin[3];return a&&a.slotWidth||g&&2>(d.step||0)&&!d.rotation&&(this.staggerLines||1)*this.len/c||!g&&(d.style&&parseInt(d.style.width,10)||m&&m-b.spacing[3]||.33*b.chartWidth)},renderUnsquish:function(){var a=this.chart,b=a.renderer,d=this.tickPositions, |
| | | c=this.ticks,m=this.options.labels,k=m&&m.style||{},l=this.horiz,h=this.getSlotWidth(),q=Math.max(1,Math.round(h-2*(m.padding||5))),v={},A=this.labelMetrics(),e=m.style&&m.style.textOverflow,p,f,G=0,B;J(m.rotation)||(v.rotation=m.rotation||0);y(d,function(a){(a=c[a])&&a.label&&a.label.textPxLength>G&&(G=a.label.textPxLength)});this.maxLabelLength=G;if(this.autoRotation)G>q&&G>A.h?v.rotation=this.labelRotation:this.labelRotation=0;else if(h&&(p=q,!e))for(f="clip",q=d.length;!l&&q--;)if(B=d[q],B=c[B].label)B.styles&& |
| | | "ellipsis"===B.styles.textOverflow?B.css({textOverflow:"clip"}):B.textPxLength>h&&B.css({width:h+"px"}),B.getBBox().height>this.len/d.length-(A.h-A.f)&&(B.specificTextOverflow="ellipsis");v.rotation&&(p=G>.5*a.chartHeight?.33*a.chartHeight:G,e||(f="ellipsis"));if(this.labelAlign=m.align||this.autoLabelAlign(this.labelRotation))v.align=this.labelAlign;y(d,function(a){var b=(a=c[a])&&a.label,g=k.width,d={};b&&(b.attr(v),a.shortenLabel?a.shortenLabel():p&&!g&&"nowrap"!==k.whiteSpace&&(p<b.textPxLength|| |
| | | "SPAN"===b.element.tagName)?(d.width=p,e||(d.textOverflow=b.specificTextOverflow||f),b.css(d)):b.styles&&b.styles.width&&!d.width&&!g&&b.css({width:null}),delete b.specificTextOverflow,a.rotation=v.rotation)},this);this.tickRotCorr=b.rotCorr(A.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||x(this.min)&&x(this.max)&&this.tickPositions&&0<this.tickPositions.length},addTitle:function(a){var b=this.chart.renderer,g=this.horiz,d=this.opposite,c=this.options.title, |
| | | m;this.axisTitle||((m=c.textAlign)||(m=(g?{low:"left",middle:"center",high:"right"}:{low:d?"right":"left",middle:"center",high:d?"left":"right"})[c.align]),this.axisTitle=b.text(c.text,0,0,c.useHTML).attr({zIndex:7,rotation:c.rotation||0,align:m}).addClass("highcharts-axis-title").css(l(c.style)).add(this.axisGroup),this.axisTitle.isNew=!0);c.style.width||this.isRadial||this.axisTitle.css({width:this.len});this.axisTitle[a?"show":"hide"](!0)},generateTick:function(a){var b=this.ticks;b[a]?b[a].addLabel(): |
| | | b[a]=new N(this,a)},getOffset:function(){var a=this,b=a.chart,d=b.renderer,c=a.options,m=a.tickPositions,k=a.ticks,l=a.horiz,q=a.side,v=b.inverted&&!a.isZAxis?[1,0,3,2][q]:q,A,e,p=0,G,f=0,J=c.title,E=c.labels,N=0,w=b.axisOffset,b=b.clipOffset,t=[-1,1,1,-1][q],u=c.className,n=a.axisParent;A=a.hasData();a.showAxis=e=A||D(c.showEmpty,!0);a.staggerLines=a.horiz&&E.staggerLines;a.axisGroup||(a.gridGroup=d.g("grid").attr({zIndex:c.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+ |
| | | (u||"")).add(n),a.axisGroup=d.g("axis").attr({zIndex:c.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(u||"")).add(n),a.labelGroup=d.g("axis-labels").attr({zIndex:E.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(u||"")).add(n));A||a.isLinked?(y(m,function(b,g){a.generateTick(b,g)}),a.renderUnsquish(),a.reserveSpaceDefault=0===q||2===q||{1:"left",3:"right"}[q]===a.labelAlign,D(E.reserveSpace,"center"===a.labelAlign?!0:null,a.reserveSpaceDefault)&&y(m,function(a){N= |
| | | Math.max(k[a].getLabelSize(),N)}),a.staggerLines&&(N*=a.staggerLines),a.labelOffset=N*(a.opposite?-1:1)):B(k,function(a,b){a.destroy();delete k[b]});J&&J.text&&!1!==J.enabled&&(a.addTitle(e),e&&!1!==J.reserveSpace&&(a.titleOffset=p=a.axisTitle.getBBox()[l?"height":"width"],G=J.offset,f=x(G)?0:D(J.margin,l?5:10)));a.renderLine();a.offset=t*D(c.offset,w[q]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};d=0===q?-a.labelMetrics().h:2===q?a.tickRotCorr.y:0;f=Math.abs(N)+f;N&&(f=f-d+t*(l?D(E.y,a.tickRotCorr.y+ |
| | | 8*t):E.x));a.axisTitleMargin=D(G,f);a.getMaxLabelDimensions&&(a.maxLabelDimensions=a.getMaxLabelDimensions(k,m));l=this.tickSize("tick");w[q]=Math.max(w[q],a.axisTitleMargin+p+t*a.offset,f,A&&m.length&&l?l[0]+t*a.offset:0);c=c.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);b[v]=Math.max(b[v],c);h(this,"afterGetOffset")},getLinePath:function(a){var b=this.chart,g=this.opposite,d=this.offset,c=this.horiz,m=this.left+(g?this.width:0)+d,d=b.chartHeight-this.bottom-(g?this.height:0)+d;g&&(a*=-1);return b.renderer.crispLine(["M", |
| | | c?this.left:m,c?d:this.top,"L",c?b.chartWidth-this.right:m,c?d:b.chartHeight-this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz,b=this.left,d=this.top,c=this.len,m=this.options.title,k=a?b:d,l=this.opposite,h=this.offset,q=m.x||0,v=m.y||0,A=this.axisTitle,e= |
| | | this.chart.renderer.fontMetrics(m.style&&m.style.fontSize,A),A=Math.max(A.getBBox(null,0).height-e.h-1,0),c={low:k+(a?0:c),middle:k+c/2,high:k+(a?c:0)}[m.align],b=(a?d+this.height:b)+(a?1:-1)*(l?-1:1)*this.axisTitleMargin+[-A,A,e.f,-A][this.side];return{x:a?c+q:b+(l?this.width:0)+h+q,y:a?b+v-(l?this.height:0)+h:c+v}},renderMinorTick:function(a){var b=this.chart.hasRendered&&v(this.oldMin),d=this.minorTicks;d[a]||(d[a]=new N(this,a,"minor"));b&&d[a].isNew&&d[a].render(null,!0);d[a].render(null,!1, |
| | | 1)},renderTick:function(a,b){var d=this.isLinked,g=this.ticks,c=this.chart.hasRendered&&v(this.oldMin);if(!d||a>=this.min&&a<=this.max)g[a]||(g[a]=new N(this,a)),c&&g[a].isNew&&g[a].render(b,!0,-1),g[a].render(b)},render:function(){var b=this,d=b.chart,c=b.options,m=b.isLog,k=b.isLinked,l=b.tickPositions,q=b.axisTitle,e=b.ticks,p=b.minorTicks,f=b.alternateBands,G=c.stackLabels,J=c.alternateGridColor,E=b.tickmarkOffset,D=b.axisLine,t=b.showAxis,w=F(d.renderer.globalAnimation),u,n;b.labelEdge.length= |
| | | 0;b.overlap=!1;y([e,p,f],function(a){B(a,function(a){a.isActive=!1})});if(b.hasData()||k)b.minorTickInterval&&!b.categories&&y(b.getMinorTickPositions(),function(a){b.renderMinorTick(a)}),l.length&&(y(l,function(a,d){b.renderTick(a,d)}),E&&(0===b.min||b.single)&&(e[-1]||(e[-1]=new N(b,-1,null,!0)),e[-1].render(-1))),J&&y(l,function(c,g){n=void 0!==l[g+1]?l[g+1]+E:b.max-E;0===g%2&&c<b.max&&n<=b.max+(d.polar?-E:E)&&(f[c]||(f[c]=new a.PlotLineOrBand(b)),u=c+E,f[c].options={from:m?b.lin2log(u):u,to:m? |
| | | b.lin2log(n):n,color:J},f[c].render(),f[c].isActive=!0)}),b._addedPlotLB||(y((c.plotLines||[]).concat(c.plotBands||[]),function(a){b.addPlotBandOrLine(a)}),b._addedPlotLB=!0);y([e,p,f],function(a){var b,c=[],g=w.duration;B(a,function(a,b){a.isActive||(a.render(b,!1,0),a.isActive=!1,c.push(b))});A(function(){for(b=c.length;b--;)a[c[b]]&&!a[c[b]].isActive&&(a[c[b]].destroy(),delete a[c[b]])},a!==f&&d.hasRendered&&g?g:0)});D&&(D[D.isPlaced?"animate":"attr"]({d:this.getLinePath(D.strokeWidth())}),D.isPlaced= |
| | | !0,D[t?"show":"hide"](!0));q&&t&&(c=b.getTitlePosition(),v(c.y)?(q[q.isNew?"attr":"animate"](c),q.isNew=!1):(q.attr("y",-9999),q.isNew=!0));G&&G.enabled&&b.renderStackTotals();b.isDirty=!1;h(this,"afterRender")},redraw:function(){this.visible&&(this.render(),y(this.plotLinesAndBands,function(a){a.render()}));y(this.series,function(a){a.isDirty=!0})},keepProps:"extKey hcEvents names series userMax userMin".split(" "),destroy:function(a){var b=this,c=b.stacks,g=b.plotLinesAndBands,k;h(this,"destroy", |
| | | {keepEvents:a});a||m(b);B(c,function(a,b){w(a);c[b]=null});y([b.ticks,b.minorTicks,b.alternateBands],function(a){w(a)});if(g)for(a=g.length;a--;)g[a].destroy();y("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross scrollbar".split(" "),function(a){b[a]&&(b[a]=b[a].destroy())});for(k in b.plotLinesAndBandsGroups)b.plotLinesAndBandsGroups[k]=b.plotLinesAndBandsGroups[k].destroy();B(b,function(a,c){-1===d(c,b.keepProps)&&delete b[c]})},drawCrosshair:function(a,b){var d,c=this.crosshair, |
| | | g=D(c.snap,!0),m,k=this.cross;h(this,"drawCrosshair",{e:a,point:b});a||(a=this.cross&&this.cross.e);if(this.crosshair&&!1!==(x(b)||!g)){g?x(b)&&(m=D(b.crosshairPos,this.isXAxis?b.plotX:this.len-b.plotY)):m=a&&(this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos);x(m)&&(d=this.getPlotLinePath(b&&(this.isXAxis?b.x:D(b.stackY,b.y)),null,null,null,m)||null);if(!x(d)){this.hideCrosshair();return}g=this.categories&&!this.isRadial;k||(this.cross=k=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+ |
| | | (g?"category ":"thin ")+c.className).attr({zIndex:D(c.zIndex,2)}).add(),k.attr({stroke:c.color||(g?f("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":D(c.width,1)}).css({"pointer-events":"none"}),c.dashStyle&&k.attr({dashstyle:c.dashStyle}));k.show().attr({d:d});g&&!c.width&&k.attr({"stroke-width":this.transA});this.cross.e=a}else this.hideCrosshair();h(this,"afterDrawCrosshair",{e:a,point:b})},hideCrosshair:function(){this.cross&&this.cross.hide()}});return a.Axis=E}(K);(function(a){var C= |
| | | a.Axis,F=a.getMagnitude,I=a.normalizeTickInterval,n=a.timeUnits;C.prototype.getTimeTicks=function(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)};C.prototype.normalizeTimeTickInterval=function(a,e){var f=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];e=f[f.length-1];var x=n[e[0]],t=e[1],w;for(w=0;w<f.length&&!(e=f[w],x=n[e[0]], |
| | | t=e[1],f[w+1]&&a<=(x*t[t.length-1]+n[f[w+1][0]])/2);w++);x===n.year&&a<5*x&&(t=[1,2,5]);a=I(a/x,t,"year"===e[0]?Math.max(F(a/x),1):1);return{unitRange:x,count:a,unitName:e[0]}}})(K);(function(a){var C=a.Axis,F=a.getMagnitude,I=a.map,n=a.normalizeTickInterval,f=a.pick;C.prototype.getLogTickPositions=function(a,u,x,t){var e=this.options,y=this.len,c=[];t||(this._minorAutoInterval=null);if(.5<=a)a=Math.round(a),c=this.getLinearTickPositions(a,u,x);else if(.08<=a)for(var y=Math.floor(u),h,p,k,q,d,e=.3< |
| | | a?[1,2,4]:.15<a?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];y<x+1&&!d;y++)for(p=e.length,h=0;h<p&&!d;h++)k=this.log2lin(this.lin2log(y)*e[h]),k>u&&(!t||q<=x)&&void 0!==q&&c.push(q),q>x&&(d=!0),q=k;else u=this.lin2log(u),x=this.lin2log(x),a=t?this.getMinorTickInterval():e.tickInterval,a=f("auto"===a?null:a,this._minorAutoInterval,e.tickPixelInterval/(t?5:1)*(x-u)/((t?y/this.tickPositions.length:y)||1)),a=n(a,null,F(a)),c=I(this.getLinearTickPositions(a,u,x),this.log2lin),t||(this._minorAutoInterval=a/5);t||(this.tickInterval= |
| | | a);return c};C.prototype.log2lin=function(a){return Math.log(a)/Math.LN10};C.prototype.lin2log=function(a){return Math.pow(10,a)}})(K);(function(a,C){var F=a.arrayMax,I=a.arrayMin,n=a.defined,f=a.destroyObjectProperties,e=a.each,u=a.erase,x=a.merge,t=a.pick;a.PlotLineOrBand=function(a,e){this.axis=a;e&&(this.options=e,this.id=e.id)};a.PlotLineOrBand.prototype={render:function(){a.fireEvent(this,"render");var e=this,f=e.axis,c=f.horiz,h=e.options,p=h.label,k=e.label,q=h.to,d=h.from,b=h.value,v=n(d)&& |
| | | n(q),J=n(b),l=e.svgElem,u=!l,B=[],D=h.color,m=t(h.zIndex,0),G=h.events,B={"class":"highcharts-plot-"+(v?"band ":"line ")+(h.className||"")},A={},N=f.chart.renderer,E=v?"bands":"lines";f.isLog&&(d=f.log2lin(d),q=f.log2lin(q),b=f.log2lin(b));J?(B.stroke=D,B["stroke-width"]=h.width,h.dashStyle&&(B.dashstyle=h.dashStyle)):v&&(D&&(B.fill=D),h.borderWidth&&(B.stroke=h.borderColor,B["stroke-width"]=h.borderWidth));A.zIndex=m;E+="-"+m;(D=f.plotLinesAndBandsGroups[E])||(f.plotLinesAndBandsGroups[E]=D=N.g("plot-"+ |
| | | E).attr(A).add());u&&(e.svgElem=l=N.path().attr(B).add(D));if(J)B=f.getPlotLinePath(b,l.strokeWidth());else if(v)B=f.getPlotBandPath(d,q,h);else return;u&&B&&B.length?(l.attr({d:B}),G&&a.objectEach(G,function(a,b){l.on(b,function(a){G[b].apply(e,[a])})})):l&&(B?(l.show(),l.animate({d:B})):(l.hide(),k&&(e.label=k=k.destroy())));p&&n(p.text)&&B&&B.length&&0<f.width&&0<f.height&&!B.isFlat?(p=x({align:c&&v&&"center",x:c?!v&&4:10,verticalAlign:!c&&v&&"middle",y:c?v?16:10:v?6:-4,rotation:c&&!v&&90},p), |
| | | this.renderLabel(p,B,v,m)):k&&k.hide();return e},renderLabel:function(a,e,c,h){var p=this.label,k=this.axis.chart.renderer;p||(p={align:a.textAlign||a.align,rotation:a.rotation,"class":"highcharts-plot-"+(c?"band":"line")+"-label "+(a.className||"")},p.zIndex=h,this.label=p=k.text(a.text,0,0,a.useHTML).attr(p).add(),p.css(a.style));h=e.xBounds||[e[1],e[4],c?e[6]:e[1]];e=e.yBounds||[e[2],e[5],c?e[7]:e[2]];c=I(h);k=I(e);p.align(a,!1,{x:c,y:k,width:F(h)-c,height:F(e)-k});p.show()},destroy:function(){u(this.axis.plotLinesAndBands, |
| | | this);delete this.axis;f(this)}};a.extend(C.prototype,{getPlotBandPath:function(a,e){var c=this.getPlotLinePath(e,null,null,!0),h=this.getPlotLinePath(a,null,null,!0),p=[],k=this.horiz,q=1,d;a=a<this.min&&e<this.min||a>this.max&&e>this.max;if(h&&c)for(a&&(d=h.toString()===c.toString(),q=0),a=0;a<h.length;a+=6)k&&c[a+1]===h[a+1]?(c[a+1]+=q,c[a+4]+=q):k||c[a+2]!==h[a+2]||(c[a+2]+=q,c[a+5]+=q),p.push("M",h[a+1],h[a+2],"L",h[a+4],h[a+5],c[a+4],c[a+5],c[a+1],c[a+2],"z"),p.isFlat=d;return p},addPlotBand:function(a){return this.addPlotBandOrLine(a, |
| | | "plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(e,f){var c=(new a.PlotLineOrBand(this,e)).render(),h=this.userOptions;c&&(f&&(h[f]=h[f]||[],h[f].push(e)),this.plotLinesAndBands.push(c));return c},removePlotBandOrLine:function(a){for(var f=this.plotLinesAndBands,c=this.options,h=this.userOptions,p=f.length;p--;)f[p].id===a&&f[p].destroy();e([c.plotLines||[],h.plotLines||[],c.plotBands||[],h.plotBands||[]],function(c){for(p=c.length;p--;)c[p].id=== |
| | | a&&u(c,c[p])})},removePlotBand:function(a){this.removePlotBandOrLine(a)},removePlotLine:function(a){this.removePlotBandOrLine(a)}})})(K,W);(function(a){var C=a.doc,F=a.each,I=a.extend,n=a.format,f=a.isNumber,e=a.map,u=a.merge,x=a.pick,t=a.splat,w=a.syncTimeout,y=a.timeUnits;a.Tooltip=function(){this.init.apply(this,arguments)};a.Tooltip.prototype={init:function(a,h){this.chart=a;this.options=h;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=h.split&&!a.inverted;this.shared=h.shared|| |
| | | this.split;this.outside=h.outside&&!this.split},cleanSplit:function(a){F(this.chart.series,function(c){var h=c&&c.tt;h&&(!h.isActive||a?c.tt=h.destroy():h.isActive=!1)})},getLabel:function(){var c=this.chart.renderer,h=this.options,e;this.label||(this.outside&&(this.container=e=a.doc.createElement("div"),e.className="highcharts-tooltip-container",a.css(e,{position:"absolute",top:"1px",pointerEvents:h.style&&h.style.pointerEvents}),a.doc.body.appendChild(e),this.renderer=c=new a.Renderer(e,0,0)),this.split? |
| | | this.label=c.g("tooltip"):(this.label=c.label("",0,0,h.shape||"callout",null,null,h.useHTML,null,"tooltip").attr({padding:h.padding,r:h.borderRadius}),this.label.attr({fill:h.backgroundColor,"stroke-width":h.borderWidth}).css(h.style).shadow(h.shadow)),this.outside&&(this.label.attr({x:this.distance,y:this.distance}),this.label.xSetter=function(a){e.style.left=a+"px"},this.label.ySetter=function(a){e.style.top=a+"px"}),this.label.attr({zIndex:8}).add());return this.label},update:function(a){this.destroy(); |
| | | u(!0,this.chart.options.tooltip.userOptions,a);this.init(this.chart,u(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());this.renderer&&(this.renderer=this.renderer.destroy(),a.discardElement(this.container));a.clearTimeout(this.hideTimer);a.clearTimeout(this.tooltipTimeout)},move:function(c,h,e,k){var q=this,d=q.now,b=!1!==q.options.animation&&!q.isHidden&&(1<Math.abs(c-d.x)||1<Math.abs(h- |
| | | d.y)),v=q.followPointer||1<q.len;I(d,{x:b?(2*d.x+c)/3:c,y:b?(d.y+h)/2:h,anchorX:v?void 0:b?(2*d.anchorX+e)/3:e,anchorY:v?void 0:b?(d.anchorY+k)/2:k});q.getLabel().attr(d);b&&(a.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){q&&q.move(c,h,e,k)},32))},hide:function(c){var h=this;a.clearTimeout(this.hideTimer);c=x(c,this.options.hideDelay,500);this.isHidden||(this.hideTimer=w(function(){h.getLabel()[c?"fadeOut":"hide"]();h.isHidden=!0},c))},getAnchor:function(a,h){var c= |
| | | this.chart,k=c.pointer,q=c.inverted,d=c.plotTop,b=c.plotLeft,v=0,f=0,l,n;a=t(a);this.followPointer&&h?(void 0===h.chartX&&(h=k.normalize(h)),a=[h.chartX-c.plotLeft,h.chartY-d]):a[0].tooltipPos?a=a[0].tooltipPos:(F(a,function(a){l=a.series.yAxis;n=a.series.xAxis;v+=a.plotX+(!q&&n?n.left-b:0);f+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!q&&l?l.top-d:0)}),v/=a.length,f/=a.length,a=[q?c.plotWidth-f:v,this.shared&&!q&&1<a.length&&h?h.chartY-d:q?c.plotHeight-v:f]);return e(a,Math.round)},getPosition:function(a, |
| | | h,e){var c=this.chart,q=this.distance,d={},b=c.inverted&&e.h||0,v,f=this.outside,l=f?C.documentElement.clientWidth-2*q:c.chartWidth,p=f?Math.max(C.body.scrollHeight,C.documentElement.scrollHeight,C.body.offsetHeight,C.documentElement.offsetHeight,C.documentElement.clientHeight):c.chartHeight,B=c.pointer.chartPosition,D=["y",p,h,(f?B.top-q:0)+e.plotY+c.plotTop,f?0:c.plotTop,f?p:c.plotTop+c.plotHeight],m=["x",l,a,(f?B.left-q:0)+e.plotX+c.plotLeft,f?0:c.plotLeft,f?l:c.plotLeft+c.plotWidth],G=!this.followPointer&& |
| | | x(e.ttBelow,!c.inverted===!!e.negative),A=function(a,c,g,m,k,l){var h=g<m-q,v=m+q+g<c,A=m-q-g;m+=q;if(G&&v)d[a]=m;else if(!G&&h)d[a]=A;else if(h)d[a]=Math.min(l-g,0>A-b?A:A-b);else if(v)d[a]=Math.max(k,m+b+g>c?m:m+b);else return!1},N=function(a,b,c,g){var m;g<q||g>b-q?m=!1:d[a]=g<c/2?1:g>b-c/2?b-c-2:g-c/2;return m},E=function(a){var b=D;D=m;m=b;v=a},g=function(){!1!==A.apply(0,D)?!1!==N.apply(0,m)||v||(E(!0),g()):v?d.x=d.y=0:(E(!0),g())};(c.inverted||1<this.len)&&E();g();return d},defaultFormatter:function(a){var c= |
| | | this.points||t(this),e;e=[a.tooltipFooterHeaderFormatter(c[0])];e=e.concat(a.bodyFormatter(c));e.push(a.tooltipFooterHeaderFormatter(c[0],!0));return e},refresh:function(c,h){var e,k=this.options,q,d=c,b,v={},f=[];e=k.formatter||this.defaultFormatter;var v=this.shared,l;k.enabled&&(a.clearTimeout(this.hideTimer),this.followPointer=t(d)[0].series.tooltipOptions.followPointer,b=this.getAnchor(d,h),h=b[0],q=b[1],!v||d.series&&d.series.noSharedTooltip?v=d.getLabelConfig():(F(d,function(a){a.setState("hover"); |
| | | f.push(a.getLabelConfig())}),v={x:d[0].category,y:d[0].y},v.points=f,d=d[0]),this.len=f.length,v=e.call(v,this),l=d.series,this.distance=x(l.tooltipOptions.distance,16),!1===v?this.hide():(e=this.getLabel(),this.isHidden&&e.attr({opacity:1}).show(),this.split?this.renderSplit(v,t(c)):(k.style.width||e.css({width:this.chart.spacingBox.width}),e.attr({text:v&&v.join?v.join(""):v}),e.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+x(d.colorIndex,l.colorIndex)),e.attr({stroke:k.borderColor|| |
| | | d.color||l.color||"#666666"}),this.updatePosition({plotX:h,plotY:q,negative:d.negative,ttBelow:d.ttBelow,h:b[2]||0})),this.isHidden=!1))},renderSplit:function(c,h){var e=this,k=[],q=this.chart,d=q.renderer,b=!0,v=this.options,f=0,l,t=this.getLabel(),B=q.plotTop;a.isString(c)&&(c=[!1,c]);F(c.slice(0,h.length+1),function(a,c){if(!1!==a){c=h[c-1]||{isHeader:!0,plotX:h[0].plotX};var m=c.series||e,A=m.tt,p=c.series||{},E="highcharts-color-"+x(c.colorIndex,p.colorIndex,"none");A||(m.tt=A=d.label(null,null, |
| | | null,"callout",null,null,v.useHTML).addClass("highcharts-tooltip-box "+E+(c.isHeader?" highcharts-tooltip-header":"")).attr({padding:v.padding,r:v.borderRadius,fill:v.backgroundColor,stroke:v.borderColor||c.color||p.color||"#333333","stroke-width":v.borderWidth}).add(t));A.isActive=!0;A.attr({text:a});A.css(v.style).shadow(v.shadow);a=A.getBBox();p=a.width+A.strokeWidth();c.isHeader?(f=a.height,q.xAxis[0].opposite&&(l=!0,B-=f),p=Math.max(0,Math.min(c.plotX+q.plotLeft-p/2,q.chartWidth+(q.scrollablePixels? |
| | | q.scrollablePixels-q.marginRight:0)-p))):p=c.plotX+q.plotLeft-x(v.distance,16)-p;0>p&&(b=!1);a=(c.series&&c.series.yAxis&&c.series.yAxis.pos)+(c.plotY||0);a-=B;c.isHeader&&(a=l?-f:q.plotHeight+f);k.push({target:a,rank:c.isHeader?1:0,size:m.tt.getBBox().height+1,point:c,x:p,tt:A})}});this.cleanSplit();a.distribute(k,q.plotHeight+f);F(k,function(a){var c=a.point,d=c.series;a.tt.attr({visibility:void 0===a.pos?"hidden":"inherit",x:b||c.isHeader?a.x:c.plotX+q.plotLeft+x(v.distance,16),y:a.pos+B,anchorX:c.isHeader? |
| | | c.plotX+q.plotLeft:c.plotX+d.xAxis.pos,anchorY:c.isHeader?q.plotTop+q.plotHeight/2:c.plotY+d.yAxis.pos})})},updatePosition:function(a){var c=this.chart,e=this.getLabel(),k=(this.options.positioner||this.getPosition).call(this,e.width,e.height,a),q=a.plotX+c.plotLeft;a=a.plotY+c.plotTop;var d;this.outside&&(d=(this.options.borderWidth||0)+2*this.distance,this.renderer.setSize(e.width+d,e.height+d,!1),q+=c.pointer.chartPosition.left-k.x,a+=c.pointer.chartPosition.top-k.y);this.move(Math.round(k.x), |
| | | Math.round(k.y||0),q,a)},getDateFormat:function(a,h,e,k){var c=this.chart.time,d=c.dateFormat("%m-%d %H:%M:%S.%L",h),b,v,f={millisecond:15,second:12,minute:9,hour:6,day:3},l="millisecond";for(v in y){if(a===y.week&&+c.dateFormat("%w",h)===e&&"00:00:00.000"===d.substr(6)){v="week";break}if(y[v]>a){v=l;break}if(f[v]&&d.substr(f[v])!=="01-01 00:00:00.000".substr(f[v]))break;"week"!==v&&(l=v)}v&&(b=c.resolveDTLFormat(k[v]).main);return b},getXDateFormat:function(a,h,e){h=h.dateTimeLabelFormats;var c= |
| | | e&&e.closestPointRange;return(c?this.getDateFormat(c,a.x,e.options.startOfWeek,h):h.day)||h.year},tooltipFooterHeaderFormatter:function(a,h){h=h?"footer":"header";var c=a.series,k=c.tooltipOptions,e=k.xDateFormat,d=c.xAxis,b=d&&"datetime"===d.options.type&&f(a.key),v=k[h+"Format"];b&&!e&&(e=this.getXDateFormat(a,k,d));b&&e&&F(a.point&&a.point.tooltipDateKeys||["key"],function(a){v=v.replace("{point."+a+"}","{point."+a+":"+e+"}")});return n(v,{point:a,series:c},this.chart.time)},bodyFormatter:function(a){return e(a, |
| | | function(a){var c=a.series.tooltipOptions;return(c[(a.point.formatPrefix||"point")+"Formatter"]||a.point.tooltipFormatter).call(a.point,c[(a.point.formatPrefix||"point")+"Format"])})}}})(K);(function(a){var C=a.addEvent,F=a.attr,I=a.charts,n=a.color,f=a.css,e=a.defined,u=a.each,x=a.extend,t=a.find,w=a.fireEvent,y=a.isNumber,c=a.isObject,h=a.offset,p=a.pick,k=a.splat,q=a.Tooltip;a.Pointer=function(a,b){this.init(a,b)};a.Pointer.prototype={init:function(a,b){this.options=b;this.chart=a;this.runChartClick= |
| | | b.chart.events&&!!b.chart.events.click;this.pinchDown=[];this.lastValidTouch={};q&&(a.tooltip=new q(a,b.tooltip),this.followTouchMove=p(b.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(a){var b=this.chart,c=b.options.chart,d=c.zoomType||"",b=b.inverted;/touch/.test(a.type)&&(d=p(c.pinchType,d));this.zoomX=a=/x/.test(d);this.zoomY=d=/y/.test(d);this.zoomHor=a&&!b||d&&b;this.zoomVert=d&&!b||a&&b;this.hasZoom=a||d},normalize:function(a,b){var c;c=a.touches?a.touches.length?a.touches.item(0): |
| | | a.changedTouches[0]:a;b||(this.chartPosition=b=h(this.chart.container));return x(a,{chartX:Math.round(c.pageX-b.left),chartY:Math.round(c.pageY-b.top)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};u(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},findNearestKDPoint:function(a,b,k){var d;u(a,function(a){var l=!(a.noSharedTooltip&&b)&&0>a.options.findNearestPointBy.indexOf("y");a=a.searchPoint(k,l);if((l=c(a, |
| | | !0))&&!(l=!c(d,!0)))var l=d.distX-a.distX,e=d.dist-a.dist,h=(a.series.group&&a.series.group.zIndex)-(d.series.group&&d.series.group.zIndex),l=0<(0!==l&&b?l:0!==e?e:0!==h?h:d.series.index>a.series.index?-1:1);l&&(d=a)});return d},getPointFromEvent:function(a){a=a.target;for(var b;a&&!b;)b=a.point,a=a.parentNode;return b},getChartCoordinatesFromPoint:function(a,b){var c=a.series,d=c.xAxis,c=c.yAxis,k=p(a.clientX,a.plotX),e=a.shapeArgs;if(d&&c)return b?{chartX:d.len+d.pos-k,chartY:c.len+c.pos-a.plotY}: |
| | | {chartX:k+d.pos,chartY:a.plotY+c.pos};if(e&&e.x&&e.y)return{chartX:e.x,chartY:e.y}},getHoverData:function(d,b,k,e,l,h,q){var v,m=[],f=q&&q.isBoosting;e=!(!e||!d);q=b&&!b.stickyTracking?[b]:a.grep(k,function(a){return a.visible&&!(!l&&a.directTouch)&&p(a.options.enableMouseTracking,!0)&&a.stickyTracking});b=(v=e?d:this.findNearestKDPoint(q,l,h))&&v.series;v&&(l&&!b.noSharedTooltip?(q=a.grep(k,function(a){return a.visible&&!(!l&&a.directTouch)&&p(a.options.enableMouseTracking,!0)&&!a.noSharedTooltip}), |
| | | u(q,function(a){var b=t(a.points,function(a){return a.x===v.x&&!a.isNull});c(b)&&(f&&(b=a.getPoint(b)),m.push(b))})):m.push(v));return{hoverPoint:v,hoverSeries:b,hoverPoints:m}},runPointActions:function(c,b){var d=this.chart,k=d.tooltip&&d.tooltip.options.enabled?d.tooltip:void 0,l=k?k.shared:!1,e=b||d.hoverPoint,h=e&&e.series||d.hoverSeries,h=this.getHoverData(e,h,d.series,"touchmove"!==c.type&&(!!b||h&&h.directTouch&&this.isDirectTouch),l,c,{isBoosting:d.isBoosting}),q,e=h.hoverPoint;q=h.hoverPoints; |
| | | b=(h=h.hoverSeries)&&h.tooltipOptions.followPointer;l=l&&h&&!h.noSharedTooltip;if(e&&(e!==d.hoverPoint||k&&k.isHidden)){u(d.hoverPoints||[],function(b){-1===a.inArray(b,q)&&b.setState()});u(q||[],function(a){a.setState("hover")});if(d.hoverSeries!==h)h.onMouseOver();d.hoverPoint&&d.hoverPoint.firePointEvent("mouseOut");if(!e.series)return;e.firePointEvent("mouseOver");d.hoverPoints=q;d.hoverPoint=e;k&&k.refresh(l?q:e,c)}else b&&k&&!k.isHidden&&(e=k.getAnchor([{}],c),k.updatePosition({plotX:e[0],plotY:e[1]})); |
| | | this.unDocMouseMove||(this.unDocMouseMove=C(d.container.ownerDocument,"mousemove",function(b){var c=I[a.hoverChartIndex];if(c)c.pointer.onDocumentMouseMove(b)}));u(d.axes,function(b){var d=p(b.crosshair.snap,!0),m=d?a.find(q,function(a){return a.series[b.coll]===b}):void 0;m||!d?b.drawCrosshair(c,m):b.hideCrosshair()})},reset:function(a,b){var c=this.chart,d=c.hoverSeries,l=c.hoverPoint,e=c.hoverPoints,h=c.tooltip,q=h&&h.shared?e:l;a&&q&&u(k(q),function(b){b.series.isCartesian&&void 0===b.plotX&& |
| | | (a=!1)});if(a)h&&q&&(h.refresh(q),h.shared&&e?u(e,function(a){a.setState(a.state,!0);a.series.isCartesian&&(a.series.xAxis.crosshair&&a.series.xAxis.drawCrosshair(null,a),a.series.yAxis.crosshair&&a.series.yAxis.drawCrosshair(null,a))}):l&&(l.setState(l.state,!0),u(c.axes,function(a){a.crosshair&&a.drawCrosshair(null,l)})));else{if(l)l.onMouseOut();e&&u(e,function(a){a.setState()});if(d)d.onMouseOut();h&&h.hide(b);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());u(c.axes,function(a){a.hideCrosshair()}); |
| | | this.hoverX=c.hoverPoints=c.hoverPoint=null}},scaleGroups:function(a,b){var c=this.chart,d;u(c.series,function(k){d=a||k.getPlotBox();k.xAxis&&k.xAxis.zoomEnabled&&k.group&&(k.group.attr(d),k.markerGroup&&(k.markerGroup.attr(d),k.markerGroup.clip(b?c.clipRect:null)),k.dataLabelsGroup&&k.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var b= |
| | | this.chart,c=b.options.chart,d=a.chartX,k=a.chartY,e=this.zoomHor,h=this.zoomVert,q=b.plotLeft,m=b.plotTop,f=b.plotWidth,A=b.plotHeight,p,E=this.selectionMarker,g=this.mouseDownX,r=this.mouseDownY,t=c.panKey&&a[c.panKey+"Key"];E&&E.touch||(d<q?d=q:d>q+f&&(d=q+f),k<m?k=m:k>m+A&&(k=m+A),this.hasDragged=Math.sqrt(Math.pow(g-d,2)+Math.pow(r-k,2)),10<this.hasDragged&&(p=b.isInsidePlot(g-q,r-m),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&p&&!t&&!E&&(this.selectionMarker=E=b.renderer.rect(q,m,e?1:f, |
| | | h?1:A,0).attr({fill:c.selectionMarkerFill||n("#335cad").setOpacity(.25).get(),"class":"highcharts-selection-marker",zIndex:7}).add()),E&&e&&(d-=g,E.attr({width:Math.abs(d),x:(0<d?0:d)+g})),E&&h&&(d=k-r,E.attr({height:Math.abs(d),y:(0<d?0:d)+r})),p&&!E&&c.panning&&b.pan(a,c.panning)))},drop:function(a){var b=this,c=this.chart,d=this.hasPinched;if(this.selectionMarker){var k={originalEvent:a,xAxis:[],yAxis:[]},h=this.selectionMarker,q=h.attr?h.attr("x"):h.x,p=h.attr?h.attr("y"):h.y,m=h.attr?h.attr("width"): |
| | | h.width,G=h.attr?h.attr("height"):h.height,A;if(this.hasDragged||d)u(c.axes,function(c){if(c.zoomEnabled&&e(c.min)&&(d||b[{xAxis:"zoomX",yAxis:"zoomY"}[c.coll]])){var h=c.horiz,g="touchend"===a.type?c.minPixelPadding:0,l=c.toValue((h?q:p)+g),h=c.toValue((h?q+m:p+G)-g);k[c.coll].push({axis:c,min:Math.min(l,h),max:Math.max(l,h)});A=!0}}),A&&w(c,"selection",k,function(a){c.zoom(x(a,d?{animation:!1}:null))});y(c.index)&&(this.selectionMarker=this.selectionMarker.destroy());d&&this.scaleGroups()}c&&y(c.index)&& |
| | | (f(c.container,{cursor:c._cursor}),c.cancelClick=10<this.hasDragged,c.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);2!==a.button&&(this.zoomOption(a),a.preventDefault&&a.preventDefault(),this.dragStart(a))},onDocumentMouseUp:function(c){I[a.hoverChartIndex]&&I[a.hoverChartIndex].pointer.drop(c)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition;a=this.normalize(a,c);!c||this.inClass(a.target,"highcharts-tracker")|| |
| | | b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)||this.reset()},onContainerMouseLeave:function(c){var b=I[a.hoverChartIndex];b&&(c.relatedTarget||c.toElement)&&(b.pointer.reset(),b.pointer.chartPosition=null)},onContainerMouseMove:function(c){var b=this.chart;e(a.hoverChartIndex)&&I[a.hoverChartIndex]&&I[a.hoverChartIndex].mouseIsDown||(a.hoverChartIndex=b.index);c=this.normalize(c);c.returnValue=!1;"mousedown"===b.mouseIsDown&&this.drag(c);!this.inClass(c.target,"highcharts-tracker")&&!b.isInsidePlot(c.chartX- |
| | | b.plotLeft,c.chartY-b.plotTop)||b.openMenu||this.runPointActions(c)},inClass:function(a,b){for(var c;a;){if(c=F(a,"class")){if(-1!==c.indexOf(b))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;a=a.relatedTarget||a.toElement;this.isDirectTouch=!1;if(!(!b||!a||b.stickyTracking||this.inClass(a,"highcharts-tooltip")||this.inClass(a,"highcharts-series-"+b.index)&&this.inClass(a,"highcharts-tracker")))b.onMouseOut()}, |
| | | onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,k=b.plotTop;a=this.normalize(a);b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(w(c.series,"click",x(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(x(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-k)&&w(b,"click",a)))},setDOMEvents:function(){var c=this,b=c.chart.container,k=b.ownerDocument;b.onmousedown=function(a){c.onContainerMouseDown(a)};b.onmousemove=function(a){c.onContainerMouseMove(a)}; |
| | | b.onclick=function(a){c.onContainerClick(a)};this.unbindContainerMouseLeave=C(b,"mouseleave",c.onContainerMouseLeave);a.unbindDocumentMouseUp||(a.unbindDocumentMouseUp=C(k,"mouseup",c.onDocumentMouseUp));a.hasTouch&&(b.ontouchstart=function(a){c.onContainerTouchStart(a)},b.ontouchmove=function(a){c.onContainerTouchMove(a)},a.unbindDocumentTouchEnd||(a.unbindDocumentTouchEnd=C(k,"touchend",c.onDocumentTouchEnd)))},destroy:function(){var c=this;c.unDocMouseMove&&c.unDocMouseMove();this.unbindContainerMouseLeave(); |
| | | a.chartCount||(a.unbindDocumentMouseUp&&(a.unbindDocumentMouseUp=a.unbindDocumentMouseUp()),a.unbindDocumentTouchEnd&&(a.unbindDocumentTouchEnd=a.unbindDocumentTouchEnd()));clearInterval(c.tooltipTimeout);a.objectEach(c,function(a,d){c[d]=null})}}})(K);(function(a){var C=a.charts,F=a.each,I=a.extend,n=a.map,f=a.noop,e=a.pick;I(a.Pointer.prototype,{pinchTranslate:function(a,e,f,n,y,c){this.zoomHor&&this.pinchTranslateDirection(!0,a,e,f,n,y,c);this.zoomVert&&this.pinchTranslateDirection(!1,a,e,f,n, |
| | | y,c)},pinchTranslateDirection:function(a,e,f,n,y,c,h,p){var k=this.chart,q=a?"x":"y",d=a?"X":"Y",b="chart"+d,v=a?"width":"height",t=k["plot"+(a?"Left":"Top")],l,u,B=p||1,D=k.inverted,m=k.bounds[a?"h":"v"],G=1===e.length,A=e[0][b],N=f[0][b],E=!G&&e[1][b],g=!G&&f[1][b],r;f=function(){!G&&20<Math.abs(A-E)&&(B=p||Math.abs(N-g)/Math.abs(A-E));u=(t-N)/B+A;l=k["plot"+(a?"Width":"Height")]/B};f();e=u;e<m.min?(e=m.min,r=!0):e+l>m.max&&(e=m.max-l,r=!0);r?(N-=.8*(N-h[q][0]),G||(g-=.8*(g-h[q][1])),f()):h[q]= |
| | | [N,g];D||(c[q]=u-t,c[v]=l);c=D?1/B:B;y[v]=l;y[q]=e;n[D?a?"scaleY":"scaleX":"scale"+d]=B;n["translate"+d]=c*t+(N-c*A)},pinch:function(a){var u=this,t=u.chart,w=u.pinchDown,y=a.touches,c=y.length,h=u.lastValidTouch,p=u.hasZoom,k=u.selectionMarker,q={},d=1===c&&(u.inClass(a.target,"highcharts-tracker")&&t.runTrackerClick||u.runChartClick),b={};1<c&&(u.initiated=!0);p&&u.initiated&&!d&&a.preventDefault();n(y,function(a){return u.normalize(a)});"touchstart"===a.type?(F(y,function(a,b){w[b]={chartX:a.chartX, |
| | | chartY:a.chartY}}),h.x=[w[0].chartX,w[1]&&w[1].chartX],h.y=[w[0].chartY,w[1]&&w[1].chartY],F(t.axes,function(a){if(a.zoomEnabled){var b=t.bounds[a.horiz?"h":"v"],c=a.minPixelPadding,d=a.toPixels(e(a.options.min,a.dataMin)),k=a.toPixels(e(a.options.max,a.dataMax)),h=Math.max(d,k);b.min=Math.min(a.pos,Math.min(d,k)-c);b.max=Math.max(a.pos+a.len,h+c)}}),u.res=!0):u.followTouchMove&&1===c?this.runPointActions(u.normalize(a)):w.length&&(k||(u.selectionMarker=k=I({destroy:f,touch:!0},t.plotBox)),u.pinchTranslate(w, |
| | | y,q,k,b,h),u.hasPinched=p,u.scaleGroups(q,b),u.res&&(u.res=!1,this.reset(!1,0)))},touch:function(f,n){var t=this.chart,u,y;if(t.index!==a.hoverChartIndex)this.onContainerMouseLeave({relatedTarget:!0});a.hoverChartIndex=t.index;1===f.touches.length?(f=this.normalize(f),(y=t.isInsidePlot(f.chartX-t.plotLeft,f.chartY-t.plotTop))&&!t.openMenu?(n&&this.runPointActions(f),"touchmove"===f.type&&(n=this.pinchDown,u=n[0]?4<=Math.sqrt(Math.pow(n[0].chartX-f.chartX,2)+Math.pow(n[0].chartY-f.chartY,2)):!1),e(u, |
| | | !0)&&this.pinch(f)):n&&this.reset()):2===f.touches.length&&this.pinch(f)},onContainerTouchStart:function(a){this.zoomOption(a);this.touch(a,!0)},onContainerTouchMove:function(a){this.touch(a)},onDocumentTouchEnd:function(e){C[a.hoverChartIndex]&&C[a.hoverChartIndex].pointer.drop(e)}})})(K);(function(a){var C=a.addEvent,F=a.charts,I=a.css,n=a.doc,f=a.extend,e=a.noop,u=a.Pointer,x=a.removeEvent,t=a.win,w=a.wrap;if(!a.hasTouch&&(t.PointerEvent||t.MSPointerEvent)){var y={},c=!!t.PointerEvent,h=function(){var c= |
| | | [];c.item=function(a){return this[a]};a.objectEach(y,function(a){c.push({pageX:a.pageX,pageY:a.pageY,target:a.target})});return c},p=function(c,q,d,b){"touch"!==c.pointerType&&c.pointerType!==c.MSPOINTER_TYPE_TOUCH||!F[a.hoverChartIndex]||(b(c),b=F[a.hoverChartIndex].pointer,b[q]({type:d,target:c.currentTarget,preventDefault:e,touches:h()}))};f(u.prototype,{onContainerPointerDown:function(a){p(a,"onContainerTouchStart","touchstart",function(a){y[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})}, |
| | | onContainerPointerMove:function(a){p(a,"onContainerTouchMove","touchmove",function(a){y[a.pointerId]={pageX:a.pageX,pageY:a.pageY};y[a.pointerId].target||(y[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){p(a,"onDocumentTouchEnd","touchend",function(a){delete y[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,c?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,c?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(n,c? |
| | | "pointerup":"MSPointerUp",this.onDocumentPointerUp)}});w(u.prototype,"init",function(a,c,d){a.call(this,c,d);this.hasZoom&&I(c.container,{"-ms-touch-action":"none","touch-action":"none"})});w(u.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(C)});w(u.prototype,"destroy",function(a){this.batchMSEvents(x);a.call(this)})}})(K);(function(a){var C=a.addEvent,F=a.css,I=a.discardElement,n=a.defined,f=a.each,e=a.fireEvent,u=a.isFirefox,x=a.marginNames, |
| | | t=a.merge,w=a.pick,y=a.setAnimation,c=a.stableSort,h=a.win,p=a.wrap;a.Legend=function(a,c){this.init(a,c)};a.Legend.prototype={init:function(a,c){this.chart=a;this.setOptions(c);c.enabled&&(this.render(),C(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=C(this.chart,"render",function(){this.legend.proximatePositions();this.legend.positionItems()}):this.unchartrender&&this.unchartrender())},setOptions:function(a){var c=w(a.padding,8);this.options= |
| | | a;this.itemStyle=a.itemStyle;this.itemHiddenStyle=t(this.itemStyle,a.itemHiddenStyle);this.itemMarginTop=a.itemMarginTop||0;this.padding=c;this.initialItemY=c-5;this.symbolWidth=w(a.symbolWidth,16);this.pages=[];this.proximate="proximate"===a.layout&&!this.chart.inverted},update:function(a,c){var d=this.chart;this.setOptions(t(!0,this.options,a));this.destroy();d.isDirtyLegend=d.isDirtyBox=!0;w(c,!0)&&d.redraw();e(this,"afterUpdate")},colorizeItem:function(a,c){a.legendGroup[c?"removeClass":"addClass"]("highcharts-legend-item-hidden"); |
| | | var d=this.options,b=a.legendItem,k=a.legendLine,h=a.legendSymbol,l=this.itemHiddenStyle.color,d=c?d.itemStyle.color:l,q=c?a.color||l:l,f=a.options&&a.options.marker,p={fill:q};b&&b.css({fill:d,color:d});k&&k.attr({stroke:q});h&&(f&&h.isMarker&&(p=a.pointAttribs(),c||(p.stroke=p.fill=l)),h.attr(p));e(this,"afterColorizeItem",{item:a,visible:c})},positionItems:function(){f(this.allItems,this.positionItem,this);this.chart.isResizing||this.positionCheckboxes()},positionItem:function(a){var c=this.options, |
| | | d=c.symbolPadding,c=!c.rtl,b=a._legendItemPos,e=b[0],b=b[1],h=a.checkbox;if((a=a.legendGroup)&&a.element)a[n(a.translateY)?"animate":"attr"]({translateX:c?e:this.legendWidth-e-2*d-4,translateY:b});h&&(h.x=e,h.y=b)},destroyItem:function(a){var c=a.checkbox;f(["legendItem","legendLine","legendSymbol","legendGroup"],function(c){a[c]&&(a[c]=a[c].destroy())});c&&I(a.checkbox)},destroy:function(){function a(a){this[a]&&(this[a]=this[a].destroy())}f(this.getAllItems(),function(c){f(["legendItem","legendGroup"], |
| | | a,c)});f("clipRect up down pager nav box title group".split(" "),a,this);this.display=null},positionCheckboxes:function(){var a=this.group&&this.group.alignAttr,c,d=this.clipHeight||this.legendHeight,b=this.titleHeight;a&&(c=a.translateY,f(this.allItems,function(e){var h=e.checkbox,k;h&&(k=c+b+h.y+(this.scrollOffset||0)+3,F(h,{left:a.translateX+e.checkboxOffset+h.x-20+"px",top:k+"px",display:this.proximate||k>c-6&&k<c+d-6?"":"none"}))},this))},renderTitle:function(){var a=this.options,c=this.padding, |
| | | d=a.title,b=0;d.text&&(this.title||(this.title=this.chart.renderer.label(d.text,c-3,c-4,null,null,null,a.useHTML,null,"legend-title").attr({zIndex:1}).css(d.style).add(this.group)),a=this.title.getBBox(),b=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:b}));this.titleHeight=b},setText:function(c){var h=this.options;c.legendItem.attr({text:h.labelFormat?a.format(h.labelFormat,c,this.chart.time):h.labelFormatter.call(c)})},renderItem:function(a){var c=this.chart,d=c.renderer,b= |
| | | this.options,h=this.symbolWidth,e=b.symbolPadding,l=this.itemStyle,k=this.itemHiddenStyle,f="horizontal"===b.layout?w(b.itemDistance,20):0,p=!b.rtl,m=a.legendItem,G=!a.series,A=!G&&a.series.drawLegendSymbol?a.series:a,n=A.options,n=this.createCheckboxForItem&&n&&n.showCheckbox,f=h+e+f+(n?20:0),E=b.useHTML,g=a.options.className;m||(a.legendGroup=d.g("legend-item").addClass("highcharts-"+A.type+"-series highcharts-color-"+a.colorIndex+(g?" "+g:"")+(G?" highcharts-series-"+a.index:"")).attr({zIndex:1}).add(this.scrollGroup), |
| | | a.legendItem=m=d.text("",p?h+e:-e,this.baseline||0,E).css(t(a.visible?l:k)).attr({align:p?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(h=l.fontSize,this.fontMetrics=d.fontMetrics(h,m),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,m.attr("y",this.baseline)),this.symbolHeight=b.symbolHeight||this.fontMetrics.f,A.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,m,E),n&&this.createCheckboxForItem(a));this.colorizeItem(a,a.visible);l.width||m.css({width:(b.itemWidth|| |
| | | b.width||c.spacingBox.width)-f});this.setText(a);c=m.getBBox();a.itemWidth=a.checkboxOffset=b.itemWidth||a.legendItemWidth||c.width+f;this.maxItemWidth=Math.max(this.maxItemWidth,a.itemWidth);this.totalItemWidth+=a.itemWidth;this.itemHeight=a.itemHeight=Math.round(a.legendItemHeight||c.height||this.symbolHeight)},layoutItem:function(a){var c=this.options,d=this.padding,b="horizontal"===c.layout,h=a.itemHeight,e=c.itemMarginBottom||0,l=this.itemMarginTop,k=b?w(c.itemDistance,20):0,f=c.width,p=f||this.chart.spacingBox.width- |
| | | 2*d-c.x,c=c.alignColumns&&this.totalItemWidth>p?this.maxItemWidth:a.itemWidth;b&&this.itemX-d+c>p&&(this.itemX=d,this.itemY+=l+this.lastLineHeight+e,this.lastLineHeight=0);this.lastItemY=l+this.itemY+e;this.lastLineHeight=Math.max(h,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];b?this.itemX+=c:(this.itemY+=l+h+e,this.lastLineHeight=h);this.offsetWidth=f||Math.max((b?this.itemX-d-(a.checkbox?0:k):c)+d,this.offsetWidth)},getAllItems:function(){var a=[];f(this.chart.series,function(c){var d= |
| | | c&&c.options;c&&w(d.showInLegend,n(d.linkedTo)?!1:void 0,!0)&&(a=a.concat(c.legendItems||("point"===d.legendType?c.data:c)))});e(this,"afterGetAllItems",{allItems:a});return a},getAlignment:function(){var a=this.options;return this.proximate?a.align.charAt(0)+"tv":a.floating?"":a.align.charAt(0)+a.verticalAlign.charAt(0)+a.layout.charAt(0)},adjustMargins:function(a,c){var d=this.chart,b=this.options,h=this.getAlignment();h&&f([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(e, |
| | | l){e.test(h)&&!n(a[l])&&(d[x[l]]=Math.max(d[x[l]],d.legend[(l+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][l]*b[l%2?"x":"y"]+w(b.margin,12)+c[l]+(0===l&&void 0!==d.options.title.margin?d.titleOffset+d.options.title.margin:0)))})},proximatePositions:function(){var c=this.chart,h=[],d="left"===this.options.align;f(this.allItems,function(b){var e,k;e=d;b.xAxis&&b.points&&(b.xAxis.options.reversed&&(e=!e),e=a.find(e?b.points:b.points.slice(0).reverse(),function(b){return a.isNumber(b.plotY)}),k=b.legendGroup.getBBox().height, |
| | | h.push({target:b.visible?(e?e.plotY:b.xAxis.height)-.3*k:c.plotHeight,size:k,item:b}))},this);a.distribute(h,c.plotHeight);f(h,function(a){a.item._legendItemPos[1]=c.plotTop-c.spacing[0]+a.pos})},render:function(){var a=this.chart,h=a.renderer,d=this.group,b,e,p,l=this.box,n=this.options,B=this.padding;this.itemX=B;this.itemY=this.initialItemY;this.lastItemY=this.offsetWidth=0;d||(this.group=d=h.g("legend").attr({zIndex:7}).add(),this.contentGroup=h.g().attr({zIndex:1}).add(d),this.scrollGroup=h.g().add(this.contentGroup)); |
| | | this.renderTitle();b=this.getAllItems();c(b,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});n.reversed&&b.reverse();this.allItems=b;this.display=e=!!b.length;this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0;f(b,this.renderItem,this);f(b,this.layoutItem,this);b=(n.width||this.offsetWidth)+B;p=this.lastItemY+this.lastLineHeight+this.titleHeight;p=this.handleOverflow(p);p+=B;l||(this.box=l=h.rect().addClass("highcharts-legend-box").attr({r:n.borderRadius}).add(d), |
| | | l.isNew=!0);l.attr({stroke:n.borderColor,"stroke-width":n.borderWidth||0,fill:n.backgroundColor||"none"}).shadow(n.shadow);0<b&&0<p&&(l[l.isNew?"attr":"animate"](l.crisp.call({},{x:0,y:0,width:b,height:p},l.strokeWidth())),l.isNew=!1);l[e?"show":"hide"]();this.legendWidth=b;this.legendHeight=p;e&&(h=a.spacingBox,/(lth|ct|rth)/.test(this.getAlignment())&&(h=t(h,{y:h.y+a.titleOffset+a.options.title.margin})),d.align(t(n,{width:b,height:p,verticalAlign:this.proximate?"top":n.verticalAlign}),!0,h));this.proximate|| |
| | | this.positionItems()},handleOverflow:function(a){var c=this,d=this.chart,b=d.renderer,h=this.options,e=h.y,l=this.padding,d=d.spacingBox.height+("top"===h.verticalAlign?-e:e)-l,e=h.maxHeight,k,p=this.clipRect,n=h.navigation,m=w(n.animation,!0),G=n.arrowSize||12,A=this.nav,t=this.pages,E,g=this.allItems,r=function(a){"number"===typeof a?p.attr({height:a}):p&&(c.clipRect=p.destroy(),c.contentGroup.clip());c.contentGroup.div&&(c.contentGroup.div.style.clip=a?"rect("+l+"px,9999px,"+(l+a)+"px,0)":"auto")}; |
| | | "horizontal"!==h.layout||"middle"===h.verticalAlign||h.floating||(d/=2);e&&(d=Math.min(d,e));t.length=0;a>d&&!1!==n.enabled?(this.clipHeight=k=Math.max(d-20-this.titleHeight-l,0),this.currentPage=w(this.currentPage,1),this.fullHeight=a,f(g,function(a,b){var c=a._legendItemPos[1],d=Math.round(a.legendItem.getBBox().height),m=t.length;if(!m||c-t[m-1]>k&&(E||c)!==t[m-1])t.push(E||c),m++;a.pageIx=m-1;E&&(g[b-1].pageIx=m-1);b===g.length-1&&c+d-t[m-1]>k&&(t.push(c),a.pageIx=m);c!==E&&(E=c)}),p||(p=c.clipRect= |
| | | b.clipRect(0,l,9999,0),c.contentGroup.clip(p)),r(k),A||(this.nav=A=b.g().attr({zIndex:1}).add(this.group),this.up=b.symbol("triangle",0,0,G,G).on("click",function(){c.scroll(-1,m)}).add(A),this.pager=b.text("",15,10).addClass("highcharts-legend-navigation").css(n.style).add(A),this.down=b.symbol("triangle-down",0,0,G,G).on("click",function(){c.scroll(1,m)}).add(A)),c.scroll(0),a=d):A&&(r(),this.nav=A.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,c){var d= |
| | | this.pages,b=d.length;a=this.currentPage+a;var h=this.clipHeight,e=this.options.navigation,l=this.pager,f=this.padding;a>b&&(a=b);0<a&&(void 0!==c&&y(c,this.chart),this.nav.attr({translateX:f,translateY:h+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({"class":1===a?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),l.attr({text:a+"/"+b}),this.down.attr({x:18+this.pager.getBBox().width,"class":a===b?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}), |
| | | this.up.attr({fill:1===a?e.inactiveColor:e.activeColor}).css({cursor:1===a?"default":"pointer"}),this.down.attr({fill:a===b?e.inactiveColor:e.activeColor}).css({cursor:a===b?"default":"pointer"}),this.scrollOffset=-d[a-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=a,this.positionCheckboxes())}};a.LegendSymbolMixin={drawRectangle:function(a,c){var d=a.symbolHeight,b=a.options.squareSymbol;c.legendSymbol=this.chart.renderer.rect(b?(a.symbolWidth-d)/2: |
| | | 0,a.baseline-d+1,b?d:a.symbolWidth,d,w(a.options.symbolRadius,d/2)).addClass("highcharts-point").attr({zIndex:3}).add(c.legendGroup)},drawLineMarker:function(a){var c=this.options,d=c.marker,b=a.symbolWidth,h=a.symbolHeight,e=h/2,l=this.chart.renderer,f=this.legendGroup;a=a.baseline-Math.round(.3*a.fontMetrics.b);var k;k={"stroke-width":c.lineWidth||0};c.dashStyle&&(k.dashstyle=c.dashStyle);this.legendLine=l.path(["M",0,a,"L",b,a]).addClass("highcharts-graph").attr(k).add(f);d&&!1!==d.enabled&&b&& |
| | | (c=Math.min(w(d.radius,e),e),0===this.symbol.indexOf("url")&&(d=t(d,{width:h,height:h}),c=0),this.legendSymbol=d=l.symbol(this.symbol,b/2-c,a-c,2*c,2*c,d).addClass("highcharts-point").add(f),d.isMarker=!0)}};(/Trident\/7\.0/.test(h.navigator.userAgent)||u)&&p(a.Legend.prototype,"positionItem",function(a,c){var d=this,b=function(){c._legendItemPos&&a.call(d,c)};b();setTimeout(b)})})(K);(function(a){var C=a.addEvent,F=a.animate,I=a.animObject,n=a.attr,f=a.doc,e=a.Axis,u=a.createElement,x=a.defaultOptions, |
| | | t=a.discardElement,w=a.charts,y=a.css,c=a.defined,h=a.each,p=a.extend,k=a.find,q=a.fireEvent,d=a.grep,b=a.isNumber,v=a.isObject,J=a.isString,l=a.Legend,L=a.marginNames,B=a.merge,D=a.objectEach,m=a.Pointer,G=a.pick,A=a.pInt,N=a.removeEvent,E=a.seriesTypes,g=a.splat,r=a.syncTimeout,M=a.win,O=a.Chart=function(){this.getArgs.apply(this,arguments)};a.chart=function(a,b,c){return new O(a,b,c)};p(O.prototype,{callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(J(a[0])||a[0].nodeName)this.renderTo= |
| | | a.shift();this.init(a[0],a[1])},init:function(b,c){var d,g,m=b.series,h=b.plotOptions||{};q(this,"init",{args:arguments},function(){b.series=null;d=B(x,b);for(g in d.plotOptions)d.plotOptions[g].tooltip=h[g]&&B(h[g].tooltip)||void 0;d.tooltip.userOptions=b.chart&&b.chart.forExport&&b.tooltip.userOptions||b.tooltip;d.series=b.series=m;this.userOptions=b;var e=d.chart,l=e.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.labelCollectors=[];this.callback=c;this.isResizing=0;this.options= |
| | | d;this.axes=[];this.series=[];this.time=b.time&&a.keys(b.time).length?new a.Time(b.time):a.time;this.hasCartesianSeries=e.showAxes;var f=this;f.index=w.length;w.push(f);a.chartCount++;l&&D(l,function(a,b){C(f,b,a)});f.xAxis=[];f.yAxis=[];f.pointCount=f.colorCounter=f.symbolCounter=0;q(f,"afterInit");f.firstRender()})},initSeries:function(b){var c=this.options.chart;(c=E[b.type||c.type||c.defaultSeriesType])||a.error(17,!0);c=new c;c.init(this,b);return c},orderSeries:function(a){var b=this.series; |
| | | for(a=a||0;a<b.length;a++)b[a]&&(b[a].index=a,b[a].name=b[a].getName())},isInsidePlot:function(a,b,c){var d=c?b:a;a=c?a:b;return 0<=d&&d<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(b){q(this,"beforeRedraw");var c=this.axes,d=this.series,g=this.pointer,m=this.legend,e=this.userOptions.legend,l=this.isDirtyLegend,f,A,k=this.hasCartesianSeries,r=this.isDirtyBox,G,v=this.renderer,H=v.isHidden(),E=[];this.setResponsive&&this.setResponsive(!1);a.setAnimation(b,this);H&&this.temporaryDisplay(); |
| | | this.layOutTitles();for(b=d.length;b--;)if(G=d[b],G.options.stacking&&(f=!0,G.isDirty)){A=!0;break}if(A)for(b=d.length;b--;)G=d[b],G.options.stacking&&(G.isDirty=!0);h(d,function(a){a.isDirty&&("point"===a.options.legendType?(a.updateTotals&&a.updateTotals(),l=!0):e&&(e.labelFormatter||e.labelFormat)&&(l=!0));a.isDirtyData&&q(a,"updatedData")});l&&m&&m.options.enabled&&(m.render(),this.isDirtyLegend=!1);f&&this.getStacks();k&&h(c,function(a){a.updateNames();a.updateYNames&&a.updateYNames();a.setScale()}); |
| | | this.getMargins();k&&(h(c,function(a){a.isDirty&&(r=!0)}),h(c,function(a){var b=a.min+","+a.max;a.extKey!==b&&(a.extKey=b,E.push(function(){q(a,"afterSetExtremes",p(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(r||f)&&a.redraw()}));r&&this.drawChartBox();q(this,"predraw");h(d,function(a){(r||a.isDirty)&&a.visible&&a.redraw();a.isDirtyData=!1});g&&g.reset(!0);v.draw();q(this,"redraw");q(this,"render");H&&this.temporaryDisplay(!0);h(E,function(a){a.call()})},get:function(a){function b(b){return b.id=== |
| | | a||b.options&&b.options.id===a}var c,d=this.series,g;c=k(this.axes,b)||k(this.series,b);for(g=0;!c&&g<d.length;g++)c=k(d[g].points||[],b);return c},getAxes:function(){var a=this,b=this.options,c=b.xAxis=g(b.xAxis||{}),b=b.yAxis=g(b.yAxis||{});q(this,"getAxes");h(c,function(a,b){a.index=b;a.isX=!0});h(b,function(a,b){a.index=b});c=c.concat(b);h(c,function(b){new e(a,b)});q(this,"afterGetAxes")},getSelectedPoints:function(){var a=[];h(this.series,function(b){a=a.concat(d(b.data||[],function(a){return a.selected}))}); |
| | | return a},getSelectedSeries:function(){return d(this.series,function(a){return a.selected})},setTitle:function(a,b,c){var d=this,g=d.options,m;m=g.title=B({style:{color:"#333333",fontSize:g.isStock?"16px":"18px"}},g.title,a);g=g.subtitle=B({style:{color:"#666666"}},g.subtitle,b);h([["title",a,m],["subtitle",b,g]],function(a,b){var c=a[0],g=d[c],m=a[1];a=a[2];g&&m&&(d[c]=g=g.destroy());a&&!g&&(d[c]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+c,zIndex:a.zIndex||4}).add(), |
| | | d[c].update=function(a){d.setTitle(!b&&a,b&&a)},d[c].css(a.style))});d.layOutTitles(c)},layOutTitles:function(a){var b=0,c,d=this.renderer,g=this.spacingBox;h(["title","subtitle"],function(a){var c=this[a],m=this.options[a];a="title"===a?-3:m.verticalAlign?0:b+2;var h;c&&(h=m.style.fontSize,h=d.fontMetrics(h,c).b,c.css({width:(m.width||g.width+m.widthAdjust)+"px"}).align(p({y:a+h},m),!1,"spacingBox"),m.floating||m.verticalAlign||(b=Math.ceil(b+c.getBBox(m.useHTML).height)))},this);c=this.titleOffset!== |
| | | b;this.titleOffset=b;!this.isDirtyBox&&c&&(this.isDirtyBox=this.isDirtyLegend=c,this.hasRendered&&G(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var b=this.options.chart,d=b.width,b=b.height,g=this.renderTo;c(d)||(this.containerWidth=a.getStyle(g,"width"));c(b)||(this.containerHeight=a.getStyle(g,"height"));this.chartWidth=Math.max(0,d||this.containerWidth||600);this.chartHeight=Math.max(0,a.relativeLength(b,this.chartWidth)||(1<this.containerHeight?this.containerHeight:400))}, |
| | | temporaryDisplay:function(b){var c=this.renderTo;if(b)for(;c&&c.style;)c.hcOrigStyle&&(a.css(c,c.hcOrigStyle),delete c.hcOrigStyle),c.hcOrigDetached&&(f.body.removeChild(c),c.hcOrigDetached=!1),c=c.parentNode;else for(;c&&c.style;){f.body.contains(c)||c.parentNode||(c.hcOrigDetached=!0,f.body.appendChild(c));if("none"===a.getStyle(c,"display",!1)||c.hcOricDetached)c.hcOrigStyle={display:c.style.display,height:c.style.height,overflow:c.style.overflow},b={display:"block",overflow:"hidden"},c!==this.renderTo&& |
| | | (b.height=0),a.css(c,b),c.offsetWidth||c.style.setProperty("display","block","important");c=c.parentNode;if(c===f.body)break}},setClassName:function(a){this.container.className="highcharts-container "+(a||"")},getContainer:function(){var c,d=this.options,g=d.chart,m,h;c=this.renderTo;var e=a.uniqueKey(),l;c||(this.renderTo=c=g.renderTo);J(c)&&(this.renderTo=c=f.getElementById(c));c||a.error(13,!0);m=A(n(c,"data-highcharts-chart"));b(m)&&w[m]&&w[m].hasRendered&&w[m].destroy();n(c,"data-highcharts-chart", |
| | | this.index);c.innerHTML="";g.skipClone||c.offsetWidth||this.temporaryDisplay();this.getChartSize();m=this.chartWidth;h=this.chartHeight;l=p({position:"relative",overflow:"hidden",width:m+"px",height:h+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},g.style);this.container=c=u("div",{id:e},l,c);this._cursor=c.style.cursor;this.renderer=new (a[g.renderer]||a.Renderer)(c,m,h,null,g.forExport,d.exporting&&d.exporting.allowHTML);this.setClassName(g.className); |
| | | this.renderer.setStyle(g.style);this.renderer.chartIndex=this.index;q(this,"afterGetContainer")},getMargins:function(a){var b=this.spacing,d=this.margin,g=this.titleOffset;this.resetMargins();g&&!c(d[0])&&(this.plotTop=Math.max(this.plotTop,g+this.options.title.margin+b[0]));this.legend&&this.legend.display&&this.legend.adjustMargins(d,b);q(this,"getMargins");a||this.getAxisMargins()},getAxisMargins:function(){var a=this,b=a.axisOffset=[0,0,0,0],d=a.margin;a.hasCartesianSeries&&h(a.axes,function(a){a.visible&& |
| | | a.getOffset()});h(L,function(g,m){c(d[m])||(a[g]+=b[m])});a.setChartSize()},reflow:function(b){var d=this,g=d.options.chart,m=d.renderTo,h=c(g.width)&&c(g.height),e=g.width||a.getStyle(m,"width"),g=g.height||a.getStyle(m,"height"),m=b?b.target:M;if(!h&&!d.isPrinting&&e&&g&&(m===M||m===f)){if(e!==d.containerWidth||g!==d.containerHeight)a.clearTimeout(d.reflowTimeout),d.reflowTimeout=r(function(){d.container&&d.setSize(void 0,void 0,!1)},b?100:0);d.containerWidth=e;d.containerHeight=g}},setReflow:function(a){var b= |
| | | this;!1===a||this.unbindReflow?!1===a&&this.unbindReflow&&(this.unbindReflow=this.unbindReflow()):(this.unbindReflow=C(M,"resize",function(a){b.reflow(a)}),C(this,"destroy",this.unbindReflow))},setSize:function(b,c,d){var g=this,m=g.renderer;g.isResizing+=1;a.setAnimation(d,g);g.oldChartHeight=g.chartHeight;g.oldChartWidth=g.chartWidth;void 0!==b&&(g.options.chart.width=b);void 0!==c&&(g.options.chart.height=c);g.getChartSize();b=m.globalAnimation;(b?F:y)(g.container,{width:g.chartWidth+"px",height:g.chartHeight+ |
| | | "px"},b);g.setChartSize(!0);m.setSize(g.chartWidth,g.chartHeight,d);h(g.axes,function(a){a.isDirty=!0;a.setScale()});g.isDirtyLegend=!0;g.isDirtyBox=!0;g.layOutTitles();g.getMargins();g.redraw(d);g.oldChartHeight=null;q(g,"resize");r(function(){g&&q(g,"endResize",null,function(){--g.isResizing})},I(b).duration)},setChartSize:function(a){var b=this.inverted,c=this.renderer,g=this.chartWidth,d=this.chartHeight,m=this.options.chart,e=this.spacing,l=this.clipOffset,f,A,k,r;this.plotLeft=f=Math.round(this.plotLeft); |
| | | this.plotTop=A=Math.round(this.plotTop);this.plotWidth=k=Math.max(0,Math.round(g-f-this.marginRight));this.plotHeight=r=Math.max(0,Math.round(d-A-this.marginBottom));this.plotSizeX=b?r:k;this.plotSizeY=b?k:r;this.plotBorderWidth=m.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:e[3],y:e[0],width:g-e[3]-e[1],height:d-e[0]-e[2]};this.plotBox=c.plotBox={x:f,y:A,width:k,height:r};g=2*Math.floor(this.plotBorderWidth/2);b=Math.ceil(Math.max(g,l[3])/2);c=Math.ceil(Math.max(g,l[0])/2);this.clipBox={x:b, |
| | | y:c,width:Math.floor(this.plotSizeX-Math.max(g,l[1])/2-b),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(g,l[2])/2-c))};a||h(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()});q(this,"afterSetChartSize",{skipAxes:a})},resetMargins:function(){var a=this,b=a.options.chart;h(["margin","spacing"],function(c){var g=b[c],d=v(g)?g:[g,g,g,g];h(["Top","Right","Bottom","Left"],function(g,m){a[c][m]=G(b[c+g],d[m])})});h(L,function(b,c){a[b]=G(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0, |
| | | 0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,g=this.chartHeight,d=this.chartBackground,m=this.plotBackground,h=this.plotBorder,e,l=this.plotBGImage,f=a.backgroundColor,A=a.plotBackgroundColor,k=a.plotBackgroundImage,r,p=this.plotLeft,G=this.plotTop,v=this.plotWidth,E=this.plotHeight,n=this.plotBox,B=this.clipRect,t=this.clipBox,u="animate";d||(this.chartBackground=d=b.rect().addClass("highcharts-background").add(),u="attr");e=a.borderWidth|| |
| | | 0;r=e+(a.shadow?8:0);f={fill:f||"none"};if(e||d["stroke-width"])f.stroke=a.borderColor,f["stroke-width"]=e;d.attr(f).shadow(a.shadow);d[u]({x:r/2,y:r/2,width:c-r-e%2,height:g-r-e%2,r:a.borderRadius});u="animate";m||(u="attr",this.plotBackground=m=b.rect().addClass("highcharts-plot-background").add());m[u](n);m.attr({fill:A||"none"}).shadow(a.plotShadow);k&&(l?l.animate(n):this.plotBGImage=b.image(k,p,G,v,E).add());B?B.animate({width:t.width,height:t.height}):this.clipRect=b.clipRect(t);u="animate"; |
| | | h||(u="attr",this.plotBorder=h=b.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());h.attr({stroke:a.plotBorderColor,"stroke-width":a.plotBorderWidth||0,fill:"none"});h[u](h.crisp({x:p,y:G,width:v,height:E},-h.strokeWidth()));this.isDirtyBox=!1;q(this,"afterDrawChartBox")},propFromSeries:function(){var a=this,b=a.options.chart,c,g=a.options.series,d,m;h(["inverted","angular","polar"],function(h){c=E[b.type||b.defaultSeriesType];m=b[h]||c&&c.prototype[h];for(d=g&&g.length;!m&&d--;)(c= |
| | | E[g[d].type])&&c.prototype[h]&&(m=!0);a[h]=m})},linkSeries:function(){var a=this,b=a.series;h(b,function(a){a.linkedSeries.length=0});h(b,function(b){var c=b.options.linkedTo;J(c)&&(c=":previous"===c?a.series[b.index-1]:a.get(c))&&c.linkedParent!==b&&(c.linkedSeries.push(b),b.linkedParent=c,b.visible=G(b.options.visible,c.options.visible,b.visible))});q(this,"afterLinkSeries")},renderSeries:function(){h(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels; |
| | | b.items&&h(b.items,function(c){var g=p(b.style,c.style),d=A(g.left)+a.plotLeft,m=A(g.top)+a.plotTop+12;delete g.left;delete g.top;a.renderer.text(c.html,d,m).attr({zIndex:2}).css(g).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options,g,d,m;this.setTitle();this.legend=new l(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;g=this.plotHeight=Math.max(this.plotHeight-21,0);h(a,function(a){a.setScale()});this.getAxisMargins(); |
| | | d=1.1<c/this.plotWidth;m=1.05<g/this.plotHeight;if(d||m)h(a,function(a){(a.horiz&&d||!a.horiz&&m)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&h(a,function(a){a.visible&&a.render()});this.seriesGroup||(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.hasRendered=!0},addCredits:function(a){var b=this;a=B(!0,this.options.credits,a);a.enabled&& |
| | | !this.credits&&(this.credits=this.renderer.text(a.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){a.href&&(M.location.href=a.href)}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position),this.credits.update=function(a){b.credits=b.credits.destroy();b.addCredits(a)})},destroy:function(){var b=this,c=b.axes,g=b.series,d=b.container,m,e=d&&d.parentNode;q(b,"destroy");b.renderer.forExport?a.erase(w,b):w[b.index]=void 0;a.chartCount--;b.renderTo.removeAttribute("data-highcharts-chart"); |
| | | N(b);for(m=c.length;m--;)c[m]=c[m].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(m=g.length;m--;)g[m]=g[m].destroy();h("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),function(a){var c=b[a];c&&c.destroy&&(b[a]=c.destroy())});d&&(d.innerHTML="",N(d),e&&t(d));D(b,function(a,c){delete b[c]})},firstRender:function(){var a=this,b=a.options;if(!a.isReadyToRender|| |
| | | a.isReadyToRender()){a.getContainer();a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();h(b.series||[],function(b){a.initSeries(b)});a.linkSeries();q(a,"beforeRender");m&&(a.pointer=new m(a,b));a.render();if(!a.renderer.imgCount&&a.onload)a.onload();a.temporaryDisplay(!0)}},onload:function(){h([this.callback].concat(this.callbacks),function(a){a&&void 0!==this.index&&a.apply(this,[this])},this);q(this,"load");q(this,"render");c(this.index)&&this.setReflow(this.options.chart.reflow); |
| | | this.onload=null}})})(K);(function(a){var C=a.addEvent,F=a.Chart,I=a.each;C(F,"afterSetChartSize",function(n){var f=this.options.chart.scrollablePlotArea;(f=f&&f.minWidth)&&!this.renderer.forExport&&(this.scrollablePixels=f=Math.max(0,f-this.chartWidth))&&(this.plotWidth+=f,this.clipBox.width+=f,n.skipAxes||I(this.axes,function(e){1===e.side?e.getPlotLinePath=function(){var f=this.right,n;this.right=f-e.chart.scrollablePixels;n=a.Axis.prototype.getPlotLinePath.apply(this,arguments);this.right=f;return n}: |
| | | (e.setAxisSize(),e.setAxisTranslation())}))});C(F,"render",function(){this.scrollablePixels?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()});F.prototype.setUpScrolling=function(){this.scrollingContainer=a.createElement("div",{className:"highcharts-scrolling"},{overflowX:"auto",WebkitOverflowScrolling:"touch"},this.renderTo);this.innerContainer=a.createElement("div",{className:"highcharts-inner-container"},null,this.scrollingContainer);this.innerContainer.appendChild(this.container); |
| | | this.setUpScrolling=null};F.prototype.applyFixed=function(){var n=this.container,f,e,u=!this.fixedDiv;u&&(this.fixedDiv=a.createElement("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:2},null,!0),this.renderTo.insertBefore(this.fixedDiv,this.renderTo.firstChild),this.fixedRenderer=f=new a.Renderer(this.fixedDiv,0,0),this.scrollableMask=f.path().attr({fill:a.color(this.options.chart.backgroundColor||"#fff").setOpacity(.85).get(),zIndex:-1}).addClass("highcharts-scrollable-mask").add(), |
| | | a.each([this.inverted?".highcharts-xaxis":".highcharts-yaxis",this.inverted?".highcharts-xaxis-labels":".highcharts-yaxis-labels",".highcharts-contextbutton",".highcharts-credits",".highcharts-legend",".highcharts-subtitle",".highcharts-title",".highcharts-legend-checkbox"],function(e){a.each(n.querySelectorAll(e),function(a){(a.namespaceURI===f.SVG_NS?f.box:f.box.parentNode).appendChild(a);a.style.pointerEvents="auto"})}));this.fixedRenderer.setSize(this.chartWidth,this.chartHeight);e=this.chartWidth+ |
| | | this.scrollablePixels;a.stop(this.container);this.container.style.width=e+"px";this.renderer.boxWrapper.attr({width:e,height:this.chartHeight,viewBox:[0,0,e,this.chartHeight].join(" ")});this.chartBackground.attr({width:e});u&&(e=this.options.chart.scrollablePlotArea,e.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixels*e.scrollPositionX));u=this.axisOffset;e=this.plotTop-u[0]-1;var u=this.plotTop+this.plotHeight+u[2],x=this.plotLeft+this.plotWidth-this.scrollablePixels;this.scrollableMask.attr({d:this.scrollablePixels? |
| | | ["M",0,e,"L",this.plotLeft-1,e,"L",this.plotLeft-1,u,"L",0,u,"Z","M",x,e,"L",this.chartWidth,e,"L",this.chartWidth,u,"L",x,u,"Z"]:["M",0,0]})}})(K);(function(a){var C,F=a.each,I=a.extend,n=a.erase,f=a.fireEvent,e=a.format,u=a.isArray,x=a.isNumber,t=a.pick,w=a.uniqueKey,y=a.defined,c=a.removeEvent;a.Point=C=function(){};a.Point.prototype={init:function(a,c,e){this.series=a;this.color=a.color;this.applyOptions(c,e);this.id=y(this.id)?this.id:w();a.options.colorByPoint?(c=a.options.colors||a.chart.options.colors, |
| | | this.color=this.color||c[a.colorCounter],c=c.length,e=a.colorCounter,a.colorCounter++,a.colorCounter===c&&(a.colorCounter=0)):e=a.colorIndex;this.colorIndex=t(this.colorIndex,e);a.chart.pointCount++;f(this,"afterInit");return this},applyOptions:function(a,c){var e=this.series,h=e.options.pointValKey||e.pointValKey;a=C.prototype.optionsToObject.call(this,a);I(this,a);this.options=this.options?I(this.options,a):a;a.group&&delete this.group;a.dataLabels&&delete this.dataLabels;h&&(this.y=this[h]);this.isNull= |
| | | t(this.isValid&&!this.isValid(),null===this.x||!x(this.y,!0));this.selected&&(this.state="select");"name"in this&&void 0===c&&e.xAxis&&e.xAxis.hasNames&&(this.x=e.xAxis.nameToX(this));void 0===this.x&&e&&(this.x=void 0===c?e.autoIncrement(this):c);return this},setNestedProperty:function(c,e,f){f=f.split(".");a.reduce(f,function(c,d,b,h){c[d]=h.length-1===b?e:a.isObject(c[d],!0)?c[d]:{};return c[d]},c);return c},optionsToObject:function(c){var e={},h=this.series,f=h.options.keys,d=f||h.pointArrayMap|| |
| | | ["y"],b=d.length,v=0,n=0;if(x(c)||null===c)e[d[0]]=c;else if(u(c))for(!f&&c.length>b&&(h=typeof c[0],"string"===h?e.name=c[0]:"number"===h&&(e.x=c[0]),v++);n<b;)f&&void 0===c[v]||(0<d[n].indexOf(".")?a.Point.prototype.setNestedProperty(e,c[v],d[n]):e[d[n]]=c[v]),v++,n++;else"object"===typeof c&&(e=c,c.dataLabels&&(h._hasPointLabels=!0),c.marker&&(h._hasPointMarkers=!0));return e},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative": |
| | | "")+(this.isNull?" highcharts-null-point":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},getZone:function(){var a=this.series,c=a.zones,a=a.zoneAxis||"y",e=0,f;for(f=c[e];this[a]>=f.value;)f=c[++e];this.nonZonedColor||(this.nonZonedColor=this.color);this.color=f&&f.color&&!this.options.color?f.color:this.nonZonedColor;return f}, |
| | | destroy:function(){var a=this.series.chart,e=a.hoverPoints,f;a.pointCount--;e&&(this.setState(),n(e,this),e.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel||this.dataLabels)c(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(f in this)this[f]=null},destroyElements:function(){for(var a=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],c,e=6;e--;)c=a[e],this[c]&&(this[c]=this[c].destroy());this.dataLabels&& |
| | | (F(this.dataLabels,function(a){a.element&&a.destroy()}),delete this.dataLabels);this.connectors&&(F(this.connectors,function(a){a.element&&a.destroy()}),delete this.connectors)},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var c=this.series,h=c.tooltipOptions,f=t(h.valueDecimals,""),d=h.valuePrefix|| |
| | | "",b=h.valueSuffix||"";F(c.pointArrayMap||["y"],function(c){c="{point."+c;if(d||b)a=a.replace(RegExp(c+"}","g"),d+c+"}"+b);a=a.replace(RegExp(c+"}","g"),c+":,."+f+"f}")});return e(a,{point:this,series:this.series},c.chart.time)},firePointEvent:function(a,c,e){var h=this,d=this.series.options;(d.point.events[a]||h.options&&h.options.events&&h.options.events[a])&&this.importEvents();"click"===a&&d.allowPointSelect&&(e=function(a){h.select&&h.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});f(this,a, |
| | | c,e)},visible:!0}})(K);(function(a){var C=a.addEvent,F=a.animObject,I=a.arrayMax,n=a.arrayMin,f=a.correctFloat,e=a.defaultOptions,u=a.defaultPlotOptions,x=a.defined,t=a.each,w=a.erase,y=a.extend,c=a.fireEvent,h=a.grep,p=a.isArray,k=a.isNumber,q=a.isString,d=a.merge,b=a.objectEach,v=a.pick,J=a.removeEvent,l=a.splat,L=a.SVGElement,B=a.syncTimeout,D=a.win;a.Series=a.seriesType("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{lineWidth:0,lineColor:"#ffffff", |
| | | enabledThreshold:2,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{normal:{animation:!0}, |
| | | hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{}},stickyTracking:!0,turboThreshold:1E3,findNearestPointBy:"x"},{isCartesian:!0,pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,d){var m=this,e,h=a.series,g;m.chart=a;m.options=d=m.setOptions(d);m.linkedSeries=[];m.bindAxes();y(m,{name:d.name,state:"",visible:!1!==d.visible,selected:!0===d.selected}); |
| | | e=d.events;b(e,function(a,b){C(m,b,a)});if(e&&e.click||d.point&&d.point.events&&d.point.events.click||d.allowPointSelect)a.runTrackerClick=!0;m.getColor();m.getSymbol();t(m.parallelArrays,function(a){m[a+"Data"]=[]});m.setData(d.data,!1);m.isCartesian&&(a.hasCartesianSeries=!0);h.length&&(g=h[h.length-1]);m._i=v(g&&g._i,-1)+1;a.orderSeries(this.insert(h));c(this,"afterInit")},insert:function(a){var b=this.options.index,c;if(k(b)){for(c=a.length;c--;)if(b>=v(a[c].options.index,a[c]._i)){a.splice(c+ |
| | | 1,0,this);break}-1===c&&a.unshift(this);c+=1}else a.push(this);return v(c,a.length-1)},bindAxes:function(){var b=this,c=b.options,d=b.chart,e;t(b.axisTypes||[],function(m){t(d[m],function(a){e=a.options;if(c[m]===e.index||void 0!==c[m]&&c[m]===e.id||void 0===c[m]&&0===e.index)b.insert(a.series),b[m]=a,a.isDirty=!0});b[m]||b.optionalAxis===m||a.error(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments,m=k(b)?function(g){var d="y"===g&&c.toYData?c.toYData(a):a[g];c[g+"Data"][b]= |
| | | d}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))};t(c.parallelArrays,m)},autoIncrement:function(){var a=this.options,b=this.xIncrement,c,d=a.pointIntervalUnit,e=this.chart.time,b=v(b,a.pointStart,0);this.pointInterval=c=v(this.pointInterval,a.pointInterval,1);d&&(a=new e.Date(b),"day"===d?e.set("Date",a,e.get("Date",a)+c):"month"===d?e.set("Month",a,e.get("Month",a)+c):"year"===d&&e.set("FullYear",a,e.get("FullYear",a)+c),c=a.getTime()-b);this.xIncrement=b+c;return b}, |
| | | setOptions:function(a){var b=this.chart,m=b.options,h=m.plotOptions,f=(b.userOptions||{}).plotOptions||{},g=h[this.type];this.userOptions=a;b=d(g,h.series,a);this.tooltipOptions=d(e.tooltip,e.plotOptions.series&&e.plotOptions.series.tooltip,e.plotOptions[this.type].tooltip,m.tooltip.userOptions,h.series&&h.series.tooltip,h[this.type].tooltip,a.tooltip);this.stickyTracking=v(a.stickyTracking,f[this.type]&&f[this.type].stickyTracking,f.series&&f.series.stickyTracking,this.tooltipOptions.shared&&!this.noSharedTooltip? |
| | | !0:b.stickyTracking);null===g.marker&&delete b.marker;this.zoneAxis=b.zoneAxis;a=this.zones=(b.zones||[]).slice();!b.negativeColor&&!b.negativeFillColor||b.zones||a.push({value:b[this.zoneAxis+"Threshold"]||b.threshold||0,className:"highcharts-negative",color:b.negativeColor,fillColor:b.negativeFillColor});a.length&&x(a[a.length-1].value)&&a.push({color:this.color,fillColor:this.fillColor});c(this,"afterSetOptions",{options:b});return b},getName:function(){return this.name||"Series "+(this.index+ |
| | | 1)},getCyclic:function(a,b,c){var d,e=this.chart,g=this.userOptions,m=a+"Index",h=a+"Counter",f=c?c.length:v(e.options.chart[a+"Count"],e[a+"Count"]);b||(d=v(g[m],g["_"+m]),x(d)||(e.series.length||(e[h]=0),g["_"+m]=d=e[h]%f,e[h]+=1),c&&(b=c[d]));void 0!==d&&(this[m]=d);this[a]=b},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||u[this.type].color,this.chart.options.colors)},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol, |
| | | this.chart.options.symbols)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,updateData:function(b){var c=this.options,d=this.points,e=[],m,g,h,f=this.requireSorting;t(b,function(b){var g;g=a.defined(b)&&this.pointClass.prototype.optionsToObject.call({series:this},b).x;k(g)&&(g=a.inArray(g,this.xData,h),-1===g||d[g].touched?e.push(b):b!==c.data[g]?(d[g].update(b,!1,null,!1),d[g].touched=!0,f&&(h=g+1)):d[g]&&(d[g].touched=!0),m=!0)},this);if(m)for(b=d.length;b--;)g=d[b],g.touched||g.remove(!1), |
| | | g.touched=!1;else if(b.length===d.length)t(b,function(a,b){d[b].update&&a!==c.data[b]&&d[b].update(a,!1,null,!1)});else return!1;t(e,function(a){this.addPoint(a,!1)},this);return!0},setData:function(b,c,d,e){var m=this,g=m.points,h=g&&g.length||0,f,l=m.options,A=m.chart,G=null,n=m.xAxis,B=l.turboThreshold,u=this.xData,D=this.yData,y=(f=m.pointArrayMap)&&f.length,N;b=b||[];f=b.length;c=v(c,!0);!1!==e&&f&&h&&!m.cropped&&!m.hasGroupedData&&m.visible&&!m.isSeriesBoosting&&(N=this.updateData(b));if(!N){m.xIncrement= |
| | | null;m.colorCounter=0;t(this.parallelArrays,function(a){m[a+"Data"].length=0});if(B&&f>B){for(d=0;null===G&&d<f;)G=b[d],d++;if(k(G))for(d=0;d<f;d++)u[d]=this.autoIncrement(),D[d]=b[d];else if(p(G))if(y)for(d=0;d<f;d++)G=b[d],u[d]=G[0],D[d]=G.slice(1,y+1);else for(d=0;d<f;d++)G=b[d],u[d]=G[0],D[d]=G[1];else a.error(12)}else for(d=0;d<f;d++)void 0!==b[d]&&(G={series:m},m.pointClass.prototype.applyOptions.apply(G,[b[d]]),m.updateParallelArrays(G,d));D&&q(D[0])&&a.error(14,!0);m.data=[];m.options.data= |
| | | m.userOptions.data=b;for(d=h;d--;)g[d]&&g[d].destroy&&g[d].destroy();n&&(n.minRange=n.userMinRange);m.isDirty=A.isDirtyBox=!0;m.isDirtyData=!!g;d=!1}"point"===l.legendType&&(this.processData(),this.generatePoints());c&&A.redraw(d)},processData:function(b){var c=this.xData,d=this.yData,e=c.length,m;m=0;var g,h,f=this.xAxis,l,k=this.options;l=k.cropThreshold;var p=this.getExtremesFromAll||k.getExtremesFromAll,q=this.isCartesian,k=f&&f.val2lin,v=f&&f.isLog,n=this.requireSorting,B,t;if(q&&!this.isDirty&& |
| | | !f.isDirty&&!this.yAxis.isDirty&&!b)return!1;f&&(b=f.getExtremes(),B=b.min,t=b.max);q&&this.sorted&&!p&&(!l||e>l||this.forceCrop)&&(c[e-1]<B||c[0]>t?(c=[],d=[]):this.yData&&(c[0]<B||c[e-1]>t)&&(m=this.cropData(this.xData,this.yData,B,t),c=m.xData,d=m.yData,m=m.start,g=!0));for(l=c.length||1;--l;)e=v?k(c[l])-k(c[l-1]):c[l]-c[l-1],0<e&&(void 0===h||e<h)?h=e:0>e&&n&&(a.error(15),n=!1);this.cropped=g;this.cropStart=m;this.processedXData=c;this.processedYData=d;this.closestPointRange=h},cropData:function(a, |
| | | b,c,d,e){var g=a.length,m=0,h=g,f;e=v(e,this.cropShoulder,1);for(f=0;f<g;f++)if(a[f]>=c){m=Math.max(0,f-e);break}for(c=f;c<g;c++)if(a[c]>d){h=c+e;break}return{xData:a.slice(m,h),yData:b.slice(m,h),start:m,end:h}},generatePoints:function(){var a=this.options,b=a.data,c=this.data,d,e=this.processedXData,g=this.processedYData,h=this.pointClass,f=e.length,k=this.cropStart||0,p,q=this.hasGroupedData,a=a.keys,v,n=[],B;c||q||(c=[],c.length=b.length,c=this.data=c);a&&q&&(this.options.keys=!1);for(B=0;B<f;B++)p= |
| | | k+B,q?(v=(new h).init(this,[e[B]].concat(l(g[B]))),v.dataGroup=this.groupMap[B],v.dataGroup.options&&(v.options=v.dataGroup.options,y(v,v.dataGroup.options))):(v=c[p])||void 0===b[p]||(c[p]=v=(new h).init(this,b[p],e[B])),v&&(v.index=p,n[B]=v);this.options.keys=a;if(c&&(f!==(d=c.length)||q))for(B=0;B<d;B++)B!==k||q||(B+=f),c[B]&&(c[B].destroyElements(),c[B].plotX=void 0);this.data=c;this.points=n},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],g=0;d=this.xAxis.getExtremes(); |
| | | var m=d.min,h=d.max,f,l,q=this.requireSorting?1:0,v,B;a=a||this.stackedYData||this.processedYData||[];d=a.length;for(B=0;B<d;B++)if(l=c[B],v=a[B],f=(k(v,!0)||p(v))&&(!b.positiveValuesOnly||v.length||0<v),l=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(c[B+q]||l)>=m&&(c[B-q]||l)<=h,f&&l)if(f=v.length)for(;f--;)"number"===typeof v[f]&&(e[g++]=v[f]);else e[g++]=v;this.dataMin=n(e);this.dataMax=I(e)},translate:function(){this.processedXData||this.processData();this.generatePoints(); |
| | | var a=this.options,b=a.stacking,d=this.xAxis,e=d.categories,h=this.yAxis,g=this.points,l=g.length,p=!!this.modifyValue,q=a.pointPlacement,B="between"===q||k(q),n=a.threshold,t=a.startFromThreshold?n:0,u,D,y,w,J=Number.MAX_VALUE;"between"===q&&(q=.5);k(q)&&(q*=v(a.pointRange||d.pointRange));for(a=0;a<l;a++){var L=g[a],C=L.x,F=L.y;D=L.low;var I=b&&h.stacks[(this.negStacks&&F<(t?0:n)?"-":"")+this.stackKey],K;h.positiveValuesOnly&&null!==F&&0>=F&&(L.isNull=!0);L.plotX=u=f(Math.min(Math.max(-1E5,d.translate(C, |
| | | 0,0,0,1,q,"flags"===this.type)),1E5));b&&this.visible&&!L.isNull&&I&&I[C]&&(w=this.getStackIndicator(w,C,this.index),K=I[C],F=K.points[w.key],D=F[0],F=F[1],D===t&&w.key===I[C].base&&(D=v(k(n)&&n,h.min)),h.positiveValuesOnly&&0>=D&&(D=null),L.total=L.stackTotal=K.total,L.percentage=K.total&&L.y/K.total*100,L.stackY=F,K.setOffset(this.pointXOffset||0,this.barW||0));L.yBottom=x(D)?Math.min(Math.max(-1E5,h.translate(D,0,1,0,1)),1E5):null;p&&(F=this.modifyValue(F,L));L.plotY=D="number"===typeof F&&Infinity!== |
| | | F?Math.min(Math.max(-1E5,h.translate(F,0,1,0,1)),1E5):void 0;L.isInside=void 0!==D&&0<=D&&D<=h.len&&0<=u&&u<=d.len;L.clientX=B?f(d.translate(C,0,0,0,1,q)):u;L.negative=L.y<(n||0);L.category=e&&void 0!==e[L.x]?e[L.x]:L.x;L.isNull||(void 0!==y&&(J=Math.min(J,Math.abs(u-y))),y=u);L.zone=this.zones.length&&L.getZone()}this.closestPointRangePx=J;c(this,"afterTranslate")},getValidPoints:function(a,b){var c=this.chart;return h(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)? |
| | | !1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,d=b.renderer,e=b.inverted,g=this.clipBox,m=g||b.clipBox,h=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,m.height,c.xAxis,c.yAxis].join(),f=b[h],l=b[h+"m"];f||(a&&(m.width=0,e&&(m.x=b.plotSizeX),b[h+"m"]=l=d.clipRect(e?b.plotSizeX+99:-99,e?-b.plotLeft:-b.plotTop,99,e?b.chartWidth:b.chartHeight)),b[h]=f=d.clipRect(m),f.count={length:0});a&&!f.count[this.index]&&(f.count[this.index]=!0,f.count.length+=1);!1!==c.clip&& |
| | | (this.group.clip(a||g?f:b.clipRect),this.markerGroup.clip(l),this.sharedClipKey=h);a||(f.count[this.index]&&(delete f.count[this.index],--f.count.length),0===f.count.length&&h&&b[h]&&(g||(b[h]=b[h].destroy()),b[h+"m"]&&(b[h+"m"]=b[h+"m"].destroy())))},animate:function(a){var b=this.chart,c=F(this.options.animation),d;a?this.setClip(c):(d=this.sharedClipKey,(a=b[d])&&a.animate({width:b.plotSizeX,x:0},c),b[d+"m"]&&b[d+"m"].animate({width:b.plotSizeX+99,x:0},c),this.animate=null)},afterAnimate:function(){this.setClip(); |
| | | c(this,"afterAnimate");this.finishedAnimating=!0},drawPoints:function(){var a=this.points,b=this.chart,c,d,e,g,h=this.options.marker,f,l,k,p=this[this.specialGroup]||this.markerGroup,q,n=v(h.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>=h.enabledThreshold*h.radius);if(!1!==h.enabled||this._hasPointMarkers)for(c=0;c<a.length;c++)d=a[c],g=d.graphic,f=d.marker||{},l=!!d.marker,e=n&&void 0===f.enabled||f.enabled,k=d.isInside,e&&!d.isNull?(e=v(f.symbol,this.symbol),q=this.markerAttribs(d, |
| | | d.selected&&"select"),g?g[k?"show":"hide"](!0).animate(q):k&&(0<q.width||d.hasImage)&&(d.graphic=g=b.renderer.symbol(e,q.x,q.y,q.width,q.height,l?f:h).add(p)),g&&g.attr(this.pointAttribs(d,d.selected&&"select")),g&&g.addClass(d.getClassName(),!0)):g&&(d.graphic=g.destroy())},markerAttribs:function(a,b){var c=this.options.marker,d=a.marker||{},e=d.symbol||c.symbol,g=v(d.radius,c.radius);b&&(c=c.states[b],b=d.states&&d.states[b],g=v(b&&b.radius,c&&c.radius,g+(c&&c.radiusPlus||0)));a.hasImage=e&&0=== |
| | | e.indexOf("url");a.hasImage&&(g=0);a={x:Math.floor(a.plotX)-g,y:a.plotY-g};g&&(a.width=a.height=2*g);return a},pointAttribs:function(a,b){var c=this.options.marker,d=a&&a.options,e=d&&d.marker||{},g=this.color,h=d&&d.color,m=a&&a.color,d=v(e.lineWidth,c.lineWidth);a=a&&a.zone&&a.zone.color;g=h||a||m||g;a=e.fillColor||c.fillColor||g;g=e.lineColor||c.lineColor||g;b&&(c=c.states[b],b=e.states&&e.states[b]||{},d=v(b.lineWidth,c.lineWidth,d+v(b.lineWidthPlus,c.lineWidthPlus,0)),a=b.fillColor||c.fillColor|| |
| | | a,g=b.lineColor||c.lineColor||g);return{stroke:g,"stroke-width":d,fill:a}},destroy:function(){var d=this,e=d.chart,h=/AppleWebKit\/533/.test(D.navigator.userAgent),f,l,g=d.data||[],k,p;c(d,"destroy");J(d);t(d.axisTypes||[],function(a){(p=d[a])&&p.series&&(w(p.series,d),p.isDirty=p.forceRedraw=!0)});d.legendItem&&d.chart.legend.destroyItem(d);for(l=g.length;l--;)(k=g[l])&&k.destroy&&k.destroy();d.points=null;a.clearTimeout(d.animationTimeout);b(d,function(a,b){a instanceof L&&!a.survive&&(f=h&&"group"=== |
| | | b?"hide":"destroy",a[f]())});e.hoverSeries===d&&(e.hoverSeries=null);w(e.series,d);e.orderSeries();b(d,function(a,b){delete d[b]})},getGraphPath:function(a,b,c){var d=this,e=d.options,g=e.step,h,m=[],f=[],l;a=a||d.points;(h=a.reversed)&&a.reverse();(g={right:1,center:2}[g]||g&&3)&&h&&(g=4-g);!e.connectNulls||b||c||(a=this.getValidPoints(a));t(a,function(h,k){var r=h.plotX,p=h.plotY,q=a[k-1];(h.leftCliff||q&&q.rightCliff)&&!c&&(l=!0);h.isNull&&!x(b)&&0<k?l=!e.connectNulls:h.isNull&&!b?l=!0:(0===k|| |
| | | l?k=["M",h.plotX,h.plotY]:d.getPointSpline?k=d.getPointSpline(a,h,k):g?(k=1===g?["L",q.plotX,p]:2===g?["L",(q.plotX+r)/2,q.plotY,"L",(q.plotX+r)/2,p]:["L",r,q.plotY],k.push("L",r,p)):k=["L",r,p],f.push(h.x),g&&(f.push(h.x),2===g&&f.push(h.x)),m.push.apply(m,k),l=!1)});m.xMap=f;return d.graphPath=m},drawGraph:function(){var a=this,b=this.options,c=(this.gappedPath||this.getGraphPath).call(this),d=[["graph","highcharts-graph",b.lineColor||this.color,b.dashStyle]],d=a.getZonesGraphs(d);t(d,function(d, |
| | | g){var e=d[0],h=a[e];h?(h.endX=a.preventGraphAnimation?null:c.xMap,h.animate({d:c})):c.length&&(a[e]=a.chart.renderer.path(c).addClass(d[1]).attr({zIndex:1}).add(a.group),h={stroke:d[2],"stroke-width":b.lineWidth,fill:a.fillGraph&&a.color||"none"},d[3]?h.dashstyle=d[3]:"square"!==b.linecap&&(h["stroke-linecap"]=h["stroke-linejoin"]="round"),h=a[e].attr(h).shadow(2>g&&b.shadow));h&&(h.startX=c.xMap,h.isArea=c.isArea)})},getZonesGraphs:function(a){t(this.zones,function(b,c){a.push(["zone-graph-"+c, |
| | | "highcharts-graph highcharts-zone-graph-"+c+" "+(b.className||""),b.color||this.color,b.dashStyle||this.options.dashStyle])},this);return a},applyZones:function(){var a=this,b=this.chart,c=b.renderer,d=this.zones,e,g,h=this.clips||[],f,l=this.graph,k=this.area,p=Math.max(b.chartWidth,b.chartHeight),q=this[(this.zoneAxis||"y")+"Axis"],n,B,u=b.inverted,D,y,w,x,J=!1;d.length&&(l||k)&&q&&void 0!==q.min&&(B=q.reversed,D=q.horiz,l&&!this.showLine&&l.hide(),k&&k.hide(),n=q.getExtremes(),t(d,function(d,m){e= |
| | | B?D?b.plotWidth:0:D?0:q.toPixels(n.min);e=Math.min(Math.max(v(g,e),0),p);g=Math.min(Math.max(Math.round(q.toPixels(v(d.value,n.max),!0)),0),p);J&&(e=g=q.toPixels(n.max));y=Math.abs(e-g);w=Math.min(e,g);x=Math.max(e,g);q.isXAxis?(f={x:u?x:w,y:0,width:y,height:p},D||(f.x=b.plotHeight-f.x)):(f={x:0,y:u?x:w,width:p,height:y},D&&(f.y=b.plotWidth-f.y));u&&c.isVML&&(f=q.isXAxis?{x:0,y:B?w:x,height:f.width,width:b.chartWidth}:{x:f.y-b.plotLeft-b.spacingBox.x,y:0,width:f.height,height:b.chartHeight});h[m]? |
| | | h[m].animate(f):(h[m]=c.clipRect(f),l&&a["zone-graph-"+m].clip(h[m]),k&&a["zone-area-"+m].clip(h[m]));J=d.value>n.max;a.resetZones&&0===g&&(g=void 0)}),this.clips=h)},invertGroups:function(a){function b(){t(["group","markerGroup"],function(b){c[b]&&(d.renderer.isVML&&c[b].attr({width:c.yAxis.len,height:c.xAxis.len}),c[b].width=c.yAxis.len,c[b].height=c.xAxis.len,c[b].invert(a))})}var c=this,d=c.chart,e;c.xAxis&&(e=C(d,"resize",b),C(c,"destroy",e),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,d, |
| | | e){var g=this[a],h=!g;h&&(this[a]=g=this.chart.renderer.g().attr({zIndex:d||.1}).add(e));g.addClass("highcharts-"+b+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(x(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(g.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0);g.attr({visibility:c})[h?"attr":"animate"](this.getPlotBox());return g},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;a.inverted&&(b=c,c=this.xAxis); |
| | | return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,d,e=a.options,h=!!a.animate&&b.renderer.isSVG&&F(e.animation).duration,g=a.visible?"inherit":"hidden",f=e.zIndex,l=a.hasRendered,k=b.seriesGroup,p=b.inverted;d=a.plotGroup("group","series",g,f,k);a.markerGroup=a.plotGroup("markerGroup","markers",g,f,k);h&&a.animate(!0);d.inverted=a.isCartesian?p:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels(); |
| | | a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(p);!1===e.clip||a.sharedClipKey||l||d.clip(b.clipRect);h&&a.animate();l||(a.animationTimeout=B(function(){a.afterAnimate()},h));a.isDirty=!1;a.hasRendered=!0;c(a,"afterRender")},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:v(d&&d.left,a.plotLeft), |
| | | translateY:v(e&&e.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,d=this.yAxis,e=this.chart.inverted;return this.searchKDTree({clientX:e?c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:e?d.len-a.chartX+d.pos:a.chartY-d.pos},b)},buildKDTree:function(){function a(c,d,g){var e,h;if(h=c&&c.length)return e=b.kdAxisArray[d%g],c.sort(function(a,b){return a[e]-b[e]}),h=Math.floor(h/2),{point:c[h],left:a(c.slice(0, |
| | | h),d+1,g),right:a(c.slice(h+1),d+1,g)}}this.buildingKdTree=!0;var b=this,c=-1<b.options.findNearestPointBy.indexOf("y")?2:1;delete b.kdTree;B(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c);b.buildingKdTree=!1},b.options.kdNow?0:1)},searchKDTree:function(a,b){function c(a,b,f,l){var m=b.point,k=d.kdAxisArray[f%l],p,q,r=m;q=x(a[e])&&x(m[e])?Math.pow(a[e]-m[e],2):null;p=x(a[g])&&x(m[g])?Math.pow(a[g]-m[g],2):null;p=(q||0)+(p||0);m.dist=x(p)?Math.sqrt(p):Number.MAX_VALUE;m.distX=x(q)? |
| | | Math.sqrt(q):Number.MAX_VALUE;k=a[k]-m[k];p=0>k?"left":"right";q=0>k?"right":"left";b[p]&&(p=c(a,b[p],f+1,l),r=p[h]<r[h]?p:m);b[q]&&Math.sqrt(k*k)<r[h]&&(a=c(a,b[q],f+1,l),r=a[h]<r[h]?a:r);return r}var d=this,e=this.kdAxisArray[0],g=this.kdAxisArray[1],h=b?"distX":"dist";b=-1<d.options.findNearestPointBy.indexOf("y")?2:1;this.kdTree||this.buildingKdTree||this.buildKDTree();if(this.kdTree)return c(a,this.kdTree,b,b)}})})(K);(function(a){var C=a.Axis,F=a.Chart,I=a.correctFloat,n=a.defined,f=a.destroyObjectProperties, |
| | | e=a.each,u=a.format,x=a.objectEach,t=a.pick,w=a.Series;a.StackItem=function(a,c,e,f,k){var h=a.chart.inverted;this.axis=a;this.isNegative=e;this.options=c;this.x=f;this.total=null;this.points={};this.stack=k;this.rightCliff=this.leftCliff=0;this.alignOptions={align:c.align||(h?e?"left":"right":"center"),verticalAlign:c.verticalAlign||(h?"middle":e?"bottom":"top"),y:t(c.y,h?4:e?14:-6),x:t(c.x,h?e?-6:6:0)};this.textAlign=c.textAlign||(h?e?"right":"left":"center")};a.StackItem.prototype={destroy:function(){f(this, |
| | | this.axis)},render:function(a){var c=this.axis.chart,e=this.options,f=e.format,f=f?u(f,this,c.time):e.formatter.call(this);this.label?this.label.attr({text:f,visibility:"hidden"}):this.label=c.renderer.text(f,null,null,e.useHTML).css(e.style).attr({align:this.textAlign,rotation:e.rotation,visibility:"hidden"}).add(a);this.label.labelrank=c.plotHeight},setOffset:function(a,c){var e=this.axis,f=e.chart,k=e.translate(e.usePercentage?100:this.total,0,0,0,1),q=e.translate(0),q=n(k)&&Math.abs(k-q);a=f.xAxis[0].translate(this.x)+ |
| | | a;e=n(k)&&this.getStackBox(f,this,a,k,c,q,e);(c=this.label)&&e&&(c.align(this.alignOptions,null,e),e=c.alignAttr,c[!1===this.options.crop||f.isInsidePlot(e.x,e.y)?"show":"hide"](!0))},getStackBox:function(a,c,e,f,k,q,d){var b=c.axis.reversed,h=a.inverted;a=d.height+d.pos-(h?a.plotLeft:a.plotTop);c=c.isNegative&&!b||!c.isNegative&&b;return{x:h?c?f:f-q:e,y:h?a-e-k:c?a-f-q:a-f,width:h?q:k,height:h?k:q}}};F.prototype.getStacks=function(){var a=this;e(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&& |
| | | (a.oldStacks=a.stacks)});e(a.series,function(c){!c.options.stacking||!0!==c.visible&&!1!==a.options.chart.ignoreHiddenSeries||(c.stackKey=c.type+t(c.options.stack,""))})};C.prototype.buildStacks=function(){var a=this.series,c=t(this.options.reversedStacks,!0),e=a.length,f;if(!this.isXAxis){this.usePercentage=!1;for(f=e;f--;)a[c?f:e-f-1].setStackedPoints();for(f=0;f<e;f++)a[f].modifyStacks()}};C.prototype.renderStackTotals=function(){var a=this.chart,c=a.renderer,e=this.stacks,f=this.stackTotalGroup; |
| | | f||(this.stackTotalGroup=f=c.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());f.translate(a.plotLeft,a.plotTop);x(e,function(a){x(a,function(a){a.render(f)})})};C.prototype.resetStacks=function(){var a=this,c=a.stacks;a.isXAxis||x(c,function(c){x(c,function(e,h){e.touched<a.stacksTouched?(e.destroy(),delete c[h]):(e.total=null,e.cumulative=null)})})};C.prototype.cleanStacks=function(){var a;this.isXAxis||(this.oldStacks&&(a=this.stacks=this.oldStacks),x(a,function(a){x(a,function(a){a.cumulative= |
| | | a.total})}))};w.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var e=this.processedXData,c=this.processedYData,h=[],f=c.length,k=this.options,q=k.threshold,d=t(k.startFromThreshold&&q,0),b=k.stack,k=k.stacking,v=this.stackKey,u="-"+v,l=this.negStacks,w=this.yAxis,B=w.stacks,D=w.oldStacks,m,G,A,x,E,g,r;w.stacksTouched+=1;for(E=0;E<f;E++)g=e[E],r=c[E],m=this.getStackIndicator(m,g,this.index),x=m.key,A=(G=l&&r<(d? |
| | | 0:q))?u:v,B[A]||(B[A]={}),B[A][g]||(D[A]&&D[A][g]?(B[A][g]=D[A][g],B[A][g].total=null):B[A][g]=new a.StackItem(w,w.options.stackLabels,G,g,b)),A=B[A][g],null!==r?(A.points[x]=A.points[this.index]=[t(A.cumulative,d)],n(A.cumulative)||(A.base=x),A.touched=w.stacksTouched,0<m.index&&!1===this.singleStacks&&(A.points[x][0]=A.points[this.index+","+g+",0"][0])):A.points[x]=A.points[this.index]=null,"percent"===k?(G=G?v:u,l&&B[G]&&B[G][g]?(G=B[G][g],A.total=G.total=Math.max(G.total,A.total)+Math.abs(r)|| |
| | | 0):A.total=I(A.total+(Math.abs(r)||0))):A.total=I(A.total+(r||0)),A.cumulative=t(A.cumulative,d)+(r||0),null!==r&&(A.points[x].push(A.cumulative),h[E]=A.cumulative);"percent"===k&&(w.usePercentage=!0);this.stackedYData=h;w.oldStacks={}}};w.prototype.modifyStacks=function(){var a=this,c=a.stackKey,h=a.yAxis.stacks,f=a.processedXData,k,q=a.options.stacking;a[q+"Stacker"]&&e([c,"-"+c],function(c){for(var b=f.length,d,e;b--;)if(d=f[b],k=a.getStackIndicator(k,d,a.index,c),e=(d=h[c]&&h[c][d])&&d.points[k.key])a[q+ |
| | | "Stacker"](e,d,b)})};w.prototype.percentStacker=function(a,c,e){c=c.total?100/c.total:0;a[0]=I(a[0]*c);a[1]=I(a[1]*c);this.stackedYData[e]=a[1]};w.prototype.getStackIndicator=function(a,c,e,f){!n(a)||a.x!==c||f&&a.key!==f?a={x:c,index:0,key:f}:a.index++;a.key=[e,c,a.index].join();return a}})(K);(function(a){var C=a.addEvent,F=a.animate,I=a.Axis,n=a.createElement,f=a.css,e=a.defined,u=a.each,x=a.erase,t=a.extend,w=a.fireEvent,y=a.inArray,c=a.isNumber,h=a.isObject,p=a.isArray,k=a.merge,q=a.objectEach, |
| | | d=a.pick,b=a.Point,v=a.Series,J=a.seriesTypes,l=a.setAnimation,L=a.splat;t(a.Chart.prototype,{addSeries:function(a,b,c){var e,h=this;a&&(b=d(b,!0),w(h,"addSeries",{options:a},function(){e=h.initSeries(a);h.isDirtyLegend=!0;h.linkSeries();w(h,"afterAddSeries");b&&h.redraw(c)}));return e},addAxis:function(a,b,c,e){var h=b?"xAxis":"yAxis",f=this.options;a=k(a,{index:this[h].length,isX:b});b=new I(this,a);f[h]=L(f[h]||{});f[h].push(a);d(c,!0)&&this.redraw(e);return b},showLoading:function(a){var b=this, |
| | | c=b.options,d=b.loadingDiv,e=c.loading,h=function(){d&&f(d,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};d||(b.loadingDiv=d=n("div",{className:"highcharts-loading highcharts-loading-hidden"},null,b.container),b.loadingSpan=n("span",{className:"highcharts-loading-inner"},null,d),C(b,"redraw",h));d.className="highcharts-loading";b.loadingSpan.innerHTML=a||c.lang.loading;f(d,t(e.style,{zIndex:10}));f(b.loadingSpan,e.labelStyle);b.loadingShown||(f(d,{opacity:0, |
| | | display:""}),F(d,{opacity:e.style.opacity||.5},{duration:e.showDuration||0}));b.loadingShown=!0;h()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&(b.className="highcharts-loading highcharts-loading-hidden",F(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){f(b,{display:"none"})}}));this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "), |
| | | propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" "),update:function(a,b,h,f){var l=this,m={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle"},p=a.chart,g,r,v=[];w(l,"update",{options:a});if(p){k(!0,l.options.chart,p);"className"in p&&l.setClassName(p.className);"reflow"in p&&l.setReflow(p.reflow);if("inverted"in p||"polar"in p||"type"in p)l.propFromSeries(),g=!0;"alignTicks"in p&&(g=!0);q(p,function(a,b){-1!== |
| | | y("chart."+b,l.propsRequireUpdateSeries)&&(r=!0);-1!==y(b,l.propsRequireDirtyBox)&&(l.isDirtyBox=!0)});"style"in p&&l.renderer.setStyle(p.style)}a.colors&&(this.options.colors=a.colors);a.plotOptions&&k(!0,this.options.plotOptions,a.plotOptions);q(a,function(a,b){if(l[b]&&"function"===typeof l[b].update)l[b].update(a,!1);else if("function"===typeof l[m[b]])l[m[b]](a);"chart"!==b&&-1!==y(b,l.propsRequireUpdateSeries)&&(r=!0)});u("xAxis yAxis zAxis series colorAxis pane".split(" "),function(b){var c; |
| | | a[b]&&("series"===b&&(c=[],u(l[b],function(a,b){a.options.isInternal||c.push(b)})),u(L(a[b]),function(a,d){(d=e(a.id)&&l.get(a.id)||l[b][c?c[d]:d])&&d.coll===b&&(d.update(a,!1),h&&(d.touched=!0));if(!d&&h)if("series"===b)l.addSeries(a,!1).touched=!0;else if("xAxis"===b||"yAxis"===b)l.addAxis(a,"xAxis"===b,!1).touched=!0}),h&&u(l[b],function(a){a.touched||a.options.isInternal?delete a.touched:v.push(a)}))});u(v,function(a){a.remove&&a.remove(!1)});g&&u(l.axes,function(a){a.update({},!1)});r&&u(l.series, |
| | | function(a){a.update({},!1)});a.loading&&k(!0,l.options.loading,a.loading);g=p&&p.width;p=p&&p.height;c(g)&&g!==l.chartWidth||c(p)&&p!==l.chartHeight?l.setSize(g,p,f):d(b,!0)&&l.redraw(f);w(l,"afterUpdate",{options:a})},setSubtitle:function(a){this.setTitle(void 0,a)}});t(b.prototype,{update:function(a,b,c,e){function f(){l.applyOptions(a);null===l.y&&g&&(l.graphic=g.destroy());h(a,!0)&&(g&&g.element&&a&&a.marker&&void 0!==a.marker.symbol&&(l.graphic=g.destroy()),a&&a.dataLabels&&l.dataLabel&&(l.dataLabel= |
| | | l.dataLabel.destroy()),l.connector&&(l.connector=l.connector.destroy()));k=l.index;m.updateParallelArrays(l,k);p.data[k]=h(p.data[k],!0)||h(a,!0)?l.options:d(a,p.data[k]);m.isDirty=m.isDirtyData=!0;!m.fixedBox&&m.hasCartesianSeries&&(q.isDirtyBox=!0);"point"===p.legendType&&(q.isDirtyLegend=!0);b&&q.redraw(c)}var l=this,m=l.series,g=l.graphic,k,q=m.chart,p=m.options;b=d(b,!0);!1===e?f():l.firePointEvent("update",{options:a},f)},remove:function(a,b){this.series.removePoint(y(this,this.series.data), |
| | | a,b)}});t(v.prototype,{addPoint:function(a,b,c,e){var h=this.options,f=this.data,l=this.chart,g=this.xAxis,g=g&&g.hasNames&&g.names,m=h.data,k,p,q=this.xData,v,n;b=d(b,!0);k={series:this};this.pointClass.prototype.applyOptions.apply(k,[a]);n=k.x;v=q.length;if(this.requireSorting&&n<q[v-1])for(p=!0;v&&q[v-1]>n;)v--;this.updateParallelArrays(k,"splice",v,0,0);this.updateParallelArrays(k,v);g&&k.name&&(g[n]=k.name);m.splice(v,0,a);p&&(this.data.splice(v,0,null),this.processData());"point"===h.legendType&& |
| | | this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(k,"shift"),m.shift()));this.isDirtyData=this.isDirty=!0;b&&l.redraw(e)},removePoint:function(a,b,c){var e=this,h=e.data,f=h[a],m=e.points,g=e.chart,k=function(){m&&m.length===h.length&&m.splice(a,1);h.splice(a,1);e.options.data.splice(a,1);e.updateParallelArrays(f||{series:e},"splice",a,1);f&&f.destroy();e.isDirty=!0;e.isDirtyData=!0;b&&g.redraw()};l(c,g);b=d(b,!0);f?f.firePointEvent("remove",null,k): |
| | | k()},remove:function(a,b,c){function e(){h.destroy();h.remove=null;f.isDirtyLegend=f.isDirtyBox=!0;f.linkSeries();d(a,!0)&&f.redraw(b)}var h=this,f=h.chart;!1!==c?w(h,"remove",null,e):e()},update:function(b,c){var e=this,h=e.chart,f=e.userOptions,l=e.oldType||e.type,q=b.type||f.type||h.options.chart.type,g=J[l].prototype,p,v=["group","markerGroup","dataLabelsGroup"],n=["navigatorSeries","baseSeries"],B=e.finishedAnimating&&{animation:!1},D=["data","name","turboThreshold"],x=a.keys(b),L=0<x.length; |
| | | u(x,function(a){-1===y(a,D)&&(L=!1)});if(L)b.data&&this.setData(b.data,!1),b.name&&this.setName(b.name,!1);else{n=v.concat(n);u(n,function(a){n[a]=e[a];delete e[a]});b=k(f,B,{index:e.index,pointStart:d(f.pointStart,e.xData[0])},{data:e.options.data},b);e.remove(!1,null,!1);for(p in g)e[p]=void 0;J[q||l]?t(e,J[q||l].prototype):a.error(17,!0);u(n,function(a){e[a]=n[a]});e.init(h,b);b.zIndex!==f.zIndex&&u(v,function(a){e[a]&&e[a].attr({zIndex:b.zIndex})});e.oldType=l;h.linkSeries()}w(this,"afterUpdate"); |
| | | d(c,!0)&&h.redraw(L?void 0:!1)},setName:function(a){this.name=this.options.name=this.userOptions.name=a;this.chart.isDirtyLegend=!0}});t(I.prototype,{update:function(a,b){var c=this.chart,e=a&&a.events||{};a=k(this.userOptions,a);c.options[this.coll].indexOf&&(c.options[this.coll][c.options[this.coll].indexOf(this.userOptions)]=a);q(c.options[this.coll].events,function(a,b){"undefined"===typeof e[b]&&(e[b]=void 0)});this.destroy(!0);this.init(c,t(a,{events:e}));c.isDirtyBox=!0;d(b,!0)&&c.redraw()}, |
| | | remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,h=e.length;h--;)e[h]&&e[h].remove(!1);x(b.axes,this);x(b[c],this);p(b.options[c])?b.options[c].splice(this.options.index,1):delete b.options[c];u(b[c],function(a,b){a.options.index=a.userOptions.index=b});this.destroy();b.isDirtyBox=!0;d(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}})})(K);(function(a){var C=a.color,F=a.each,I=a.map,n=a.pick,f=a.Series, |
| | | e=a.seriesType;e("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(e){var f=[],t=[],u=this.xAxis,y=this.yAxis,c=y.stacks[this.stackKey],h={},p=this.index,k=y.series,q=k.length,d,b=n(y.options.reversedStacks,!0)?1:-1,v;e=e||this.points;if(this.options.stacking){for(v=0;v<e.length;v++)e[v].leftNull=e[v].rightNull=null,h[e[v].x]=e[v];a.objectEach(c,function(a,b){null!==a.total&&t.push(b)});t.sort(function(a,b){return a-b});d=I(k,function(){return this.visible});F(t, |
| | | function(a,e){var l=0,k,n;if(h[a]&&!h[a].isNull)f.push(h[a]),F([-1,1],function(f){var l=1===f?"rightNull":"leftNull",m=0,u=c[t[e+f]];if(u)for(v=p;0<=v&&v<q;)k=u.points[v],k||(v===p?h[a][l]=!0:d[v]&&(n=c[a].points[v])&&(m-=n[1]-n[0])),v+=b;h[a][1===f?"rightCliff":"leftCliff"]=m});else{for(v=p;0<=v&&v<q;){if(k=c[a].points[v]){l=k[1];break}v+=b}l=y.translate(l,0,1,0,1);f.push({isNull:!0,plotX:u.translate(a,0,0,0,1),x:a,plotY:l,yBottom:l})}})}return f},getGraphPath:function(a){var e=f.prototype.getGraphPath, |
| | | t=this.options,u=t.stacking,y=this.yAxis,c,h,p=[],k=[],q=this.index,d,b=y.stacks[this.stackKey],v=t.threshold,J=y.getThreshold(t.threshold),l,t=t.connectNulls||"percent"===u,L=function(c,e,h){var f=a[c];c=u&&b[f.x].points[q];var l=f[h+"Null"]||0;h=f[h+"Cliff"]||0;var m,n,f=!0;h||l?(m=(l?c[0]:c[1])+h,n=c[0]+h,f=!!l):!u&&a[e]&&a[e].isNull&&(m=n=v);void 0!==m&&(k.push({plotX:d,plotY:null===m?J:y.getThreshold(m),isNull:f,isCliff:!0}),p.push({plotX:d,plotY:null===n?J:y.getThreshold(n),doCurve:!1}))};a= |
| | | a||this.points;u&&(a=this.getStackPoints(a));for(c=0;c<a.length;c++)if(h=a[c].isNull,d=n(a[c].rectPlotX,a[c].plotX),l=n(a[c].yBottom,J),!h||t)t||L(c,c-1,"left"),h&&!u&&t||(k.push(a[c]),p.push({x:c,plotX:d,plotY:l})),t||L(c,c+1,"right");c=e.call(this,k,!0,!0);p.reversed=!0;h=e.call(this,p,!0,!0);h.length&&(h[0]="L");h=c.concat(h);e=e.call(this,k,!1,t);h.xMap=c.xMap;this.areaPath=h;return e},drawGraph:function(){this.areaPath=[];f.prototype.drawGraph.apply(this);var a=this,e=this.areaPath,t=this.options, |
| | | w=[["area","highcharts-area",this.color,t.fillColor]];F(this.zones,function(e,c){w.push(["zone-area-"+c,"highcharts-area highcharts-zone-area-"+c+" "+e.className,e.color||a.color,e.fillColor||t.fillColor])});F(w,function(f){var c=f[0],h=a[c];h?(h.endX=a.preventGraphAnimation?null:e.xMap,h.animate({d:e})):(h=a[c]=a.chart.renderer.path(e).addClass(f[1]).attr({fill:n(f[3],C(f[2]).setOpacity(n(t.fillOpacity,.75)).get()),zIndex:0}).add(a.group),h.isArea=!0);h.startX=e.xMap;h.shiftUnit=t.step?2:1})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(K); |
| | | (function(a){var C=a.pick;a=a.seriesType;a("spline","line",{},{getPointSpline:function(a,I,n){var f=I.plotX,e=I.plotY,u=a[n-1];n=a[n+1];var x,t,w,y;if(u&&!u.isNull&&!1!==u.doCurve&&!I.isCliff&&n&&!n.isNull&&!1!==n.doCurve&&!I.isCliff){a=u.plotY;w=n.plotX;n=n.plotY;var c=0;x=(1.5*f+u.plotX)/2.5;t=(1.5*e+a)/2.5;w=(1.5*f+w)/2.5;y=(1.5*e+n)/2.5;w!==x&&(c=(y-t)*(w-f)/(w-x)+e-y);t+=c;y+=c;t>a&&t>e?(t=Math.max(a,e),y=2*e-t):t<a&&t<e&&(t=Math.min(a,e),y=2*e-t);y>n&&y>e?(y=Math.max(n,e),t=2*e-y):y<n&&y<e&& |
| | | (y=Math.min(n,e),t=2*e-y);I.rightContX=w;I.rightContY=y}I=["C",C(u.rightContX,u.plotX),C(u.rightContY,u.plotY),C(x,f),C(t,e),f,e];u.rightContX=u.rightContY=null;return I}})})(K);(function(a){var C=a.seriesTypes.area.prototype,F=a.seriesType;F("areaspline","spline",a.defaultPlotOptions.area,{getStackPoints:C.getStackPoints,getGraphPath:C.getGraphPath,drawGraph:C.drawGraph,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(K);(function(a){var C=a.animObject,F=a.color,I=a.each,n=a.extend,f=a.defined, |
| | | e=a.isNumber,u=a.merge,x=a.pick,t=a.Series,w=a.seriesType,y=a.svg;w("column","line",{borderRadius:0,crisp:!0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:"#cccccc",borderColor:"#000000"}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"},{cropShoulder:0,directTouch:!0,trackerGroups:["group", |
| | | "dataLabelsGroup"],negStacks:!0,init:function(){t.prototype.init.apply(this,arguments);var a=this,e=a.chart;e.hasRendered&&I(e.series,function(c){c.type===a.type&&(c.isDirty=!0)})},getColumnMetrics:function(){var a=this,e=a.options,f=a.xAxis,k=a.yAxis,q=f.options.reversedStacks,q=f.reversed&&!q||!f.reversed&&q,d,b={},v=0;!1===e.grouping?v=1:I(a.chart.series,function(c){var e=c.options,f=c.yAxis,h;c.type!==a.type||!c.visible&&a.chart.options.chart.ignoreHiddenSeries||k.len!==f.len||k.pos!==f.pos|| |
| | | (e.stacking?(d=c.stackKey,void 0===b[d]&&(b[d]=v++),h=b[d]):!1!==e.grouping&&(h=v++),c.columnIndex=h)});var n=Math.min(Math.abs(f.transA)*(f.ordinalSlope||e.pointRange||f.closestPointRange||f.tickInterval||1),f.len),l=n*e.groupPadding,t=(n-2*l)/(v||1),e=Math.min(e.maxPointWidth||f.len,x(e.pointWidth,t*(1-2*e.pointPadding)));a.columnMetrics={width:e,offset:(t-e)/2+(l+((a.columnIndex||0)+(q?1:0))*t-n/2)*(q?-1:1)};return a.columnMetrics},crispCol:function(a,e,f,k){var c=this.chart,d=this.borderWidth, |
| | | b=-(d%2?.5:0),d=d%2?.5:1;c.inverted&&c.renderer.isVML&&(d+=1);this.options.crisp&&(f=Math.round(a+f)+b,a=Math.round(a)+b,f-=a);k=Math.round(e+k)+d;b=.5>=Math.abs(e)&&.5<k;e=Math.round(e)+d;k-=e;b&&k&&(--e,k+=1);return{x:a,y:e,width:f,height:k}},translate:function(){var a=this,e=a.chart,p=a.options,k=a.dense=2>a.closestPointRange*a.xAxis.transA,k=a.borderWidth=x(p.borderWidth,k?0:1),q=a.yAxis,d=p.threshold,b=a.translatedThreshold=q.getThreshold(d),v=x(p.minPointLength,5),n=a.getColumnMetrics(),l=n.width, |
| | | u=a.barW=Math.max(l,1+2*k),B=a.pointXOffset=n.offset;e.inverted&&(b-=.5);p.pointPadding&&(u=Math.ceil(u));t.prototype.translate.apply(a);I(a.points,function(c){var h=x(c.yBottom,b),k=999+Math.abs(h),p=l,k=Math.min(Math.max(-k,c.plotY),q.len+k),n=c.plotX+B,t=u,g=Math.min(k,h),r,w=Math.max(k,h)-g;v&&Math.abs(w)<v&&(w=v,r=!q.reversed&&!c.negative||q.reversed&&c.negative,c.y===d&&a.dataMax<=d&&q.min<d&&(r=!r),g=Math.abs(g-b)>v?h-v:b-(r?v:0));f(c.options.pointWidth)&&(p=t=Math.ceil(c.options.pointWidth), |
| | | n-=Math.round((p-l)/2));c.barX=n;c.pointWidth=p;c.tooltipPos=e.inverted?[q.len+q.pos-e.plotLeft-k,a.xAxis.len-n-t/2,w]:[n+t/2,k+q.pos-e.plotTop,w];c.shapeType="rect";c.shapeArgs=a.crispCol.apply(a,c.isNull?[n,b,t,0]:[n,g,t,w])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(a,e){var c=this.options,f,h=this.pointAttrToOptions||{};f=h.stroke||"borderColor";var d= |
| | | h["stroke-width"]||"borderWidth",b=a&&a.color||this.color,n=a&&a[f]||c[f]||this.color||b,t=a&&a[d]||c[d]||this[d]||0,h=c.dashStyle;a&&this.zones.length&&(b=a.getZone(),b=a.options.color||b&&b.color||this.color);e&&(a=u(c.states[e],a.options.states&&a.options.states[e]||{}),e=a.brightness,b=a.color||void 0!==e&&F(b).brighten(a.brightness).get()||b,n=a[f]||n,t=a[d]||t,h=a.dashStyle||h);f={fill:b,stroke:n,"stroke-width":t};h&&(f.dashstyle=h);return f},drawPoints:function(){var a=this,f=this.chart,p= |
| | | a.options,k=f.renderer,q=p.animationLimit||250,d;I(a.points,function(b){var c=b.graphic,h=c&&f.pointCount<q?"animate":"attr";if(e(b.plotY)&&null!==b.y){d=b.shapeArgs;if(c)c[h](u(d));else b.graphic=c=k[b.shapeType](d).add(b.group||a.group);p.borderRadius&&c.attr({r:p.borderRadius});c[h](a.pointAttribs(b,b.selected&&"select")).shadow(p.shadow,null,p.stacking&&!p.borderRadius);c.addClass(b.getClassName(),!0)}else c&&(b.graphic=c.destroy())})},animate:function(a){var c=this,e=this.yAxis,f=c.options,q= |
| | | this.chart.inverted,d={},b=q?"translateX":"translateY",v;y&&(a?(d.scaleY=.001,a=Math.min(e.pos+e.len,Math.max(e.pos,e.toPixels(f.threshold))),q?d.translateX=a-e.len:d.translateY=a,c.group.attr(d)):(v=c.group.attr(b),c.group.animate({scaleY:1},n(C(c.options.animation),{step:function(a,f){d[b]=v+f.pos*(e.pos-v);c.group.attr(d)}})),c.animate=null))},remove:function(){var a=this,e=a.chart;e.hasRendered&&I(e.series,function(c){c.type===a.type&&(c.isDirty=!0)});t.prototype.remove.apply(a,arguments)}})})(K); |
| | | (function(a){a=a.seriesType;a("bar","column",null,{inverted:!0})})(K);(function(a){var C=a.Series;a=a.seriesType;a("scatter","line",{lineWidth:0,findNearestPointBy:"xy",marker:{enabled:!0},tooltip:{headerFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cspan style\x3d"font-size: 0.85em"\x3e {series.name}\x3c/span\x3e\x3cbr/\x3e',pointFormat:"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0, |
| | | trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){this.options.lineWidth&&C.prototype.drawGraph.call(this)}})})(K);(function(a){var C=a.deg2rad,F=a.isNumber,I=a.pick,n=a.relativeLength;a.CenteredSeriesMixin={getCenter:function(){var a=this.options,e=this.chart,u=2*(a.slicedOffset||0),x=e.plotWidth-2*u,e=e.plotHeight-2*u,t=a.center,t=[I(t[0],"50%"),I(t[1],"50%"),a.size||"100%",a.innerSize||0],w=Math.min(x,e),y,c;for(y=0;4>y;++y)c=t[y],a=2>y||2===y&& |
| | | /%$/.test(c),t[y]=n(c,[x,e,w,t[2]][y])+(a?u:0);t[3]>t[2]&&(t[3]=t[2]);return t},getStartAndEndRadians:function(a,e){a=F(a)?a:0;e=F(e)&&e>a&&360>e-a?e:a+360;return{start:C*(a+-90),end:C*(e+-90)}}}})(K);(function(a){var C=a.addEvent,F=a.CenteredSeriesMixin,I=a.defined,n=a.each,f=a.extend,e=F.getStartAndEndRadians,u=a.inArray,x=a.noop,t=a.pick,w=a.Point,y=a.Series,c=a.seriesType,h=a.setAnimation;c("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,distance:30,enabled:!0, |
| | | formatter:function(){return this.point.isNull?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:a.seriesTypes.column.prototype.pointAttribs,animate:function(a){var c=this,e=c.points, |
| | | d=c.startAngleRad;a||(n(e,function(a){var b=a.graphic,e=a.shapeArgs;b&&(b.attr({r:a.startR||c.center[3]/2,start:d,end:d}),b.animate({r:e.r,start:e.start,end:e.end},c.options.animation))}),c.animate=null)},updateTotals:function(){var a,c=0,e=this.points,d=e.length,b,f=this.options.ignoreHiddenPoint;for(a=0;a<d;a++)b=e[a],c+=f&&!b.visible?0:b.isNull?0:b.y;this.total=c;for(a=0;a<d;a++)b=e[a],b.percentage=0<c&&(b.visible||!f)?b.y/c*100:0,b.total=c},generatePoints:function(){y.prototype.generatePoints.call(this); |
| | | this.updateTotals()},translate:function(a){this.generatePoints();var c=0,f=this.options,d=f.slicedOffset,b=d+(f.borderWidth||0),h,n,l,p=e(f.startAngle,f.endAngle),u=this.startAngleRad=p.start,p=(this.endAngleRad=p.end)-u,w=this.points,m,x=f.dataLabels.distance,f=f.ignoreHiddenPoint,A,y=w.length,E;a||(this.center=a=this.getCenter());this.getX=function(b,c,d){l=Math.asin(Math.min((b-a[1])/(a[2]/2+d.labelDistance),1));return a[0]+(c?-1:1)*Math.cos(l)*(a[2]/2+d.labelDistance)};for(A=0;A<y;A++){E=w[A]; |
| | | E.labelDistance=t(E.options.dataLabels&&E.options.dataLabels.distance,x);this.maxLabelDistance=Math.max(this.maxLabelDistance||0,E.labelDistance);h=u+c*p;if(!f||E.visible)c+=E.percentage/100;n=u+c*p;E.shapeType="arc";E.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:Math.round(1E3*h)/1E3,end:Math.round(1E3*n)/1E3};l=(n+h)/2;l>1.5*Math.PI?l-=2*Math.PI:l<-Math.PI/2&&(l+=2*Math.PI);E.slicedTranslation={translateX:Math.round(Math.cos(l)*d),translateY:Math.round(Math.sin(l)*d)};n=Math.cos(l)*a[2]/ |
| | | 2;m=Math.sin(l)*a[2]/2;E.tooltipPos=[a[0]+.7*n,a[1]+.7*m];E.half=l<-Math.PI/2||l>Math.PI/2?1:0;E.angle=l;h=Math.min(b,E.labelDistance/5);E.labelPos=[a[0]+n+Math.cos(l)*E.labelDistance,a[1]+m+Math.sin(l)*E.labelDistance,a[0]+n+Math.cos(l)*h,a[1]+m+Math.sin(l)*h,a[0]+n,a[1]+m,0>E.labelDistance?"center":E.half?"right":"left",l]}},drawGraph:null,drawPoints:function(){var a=this,c=a.chart.renderer,e,d,b,h,t=a.options.shadow;t&&!a.shadowGroup&&(a.shadowGroup=c.g("shadow").add(a.group));n(a.points,function(l){d= |
| | | l.graphic;if(l.isNull)d&&(l.graphic=d.destroy());else{h=l.shapeArgs;e=l.getTranslate();var k=l.shadowGroup;t&&!k&&(k=l.shadowGroup=c.g("shadow").add(a.shadowGroup));k&&k.attr(e);b=a.pointAttribs(l,l.selected&&"select");d?d.setRadialReference(a.center).attr(b).animate(f(h,e)):(l.graphic=d=c[l.shapeType](h).setRadialReference(a.center).attr(e).add(a.group),d.attr(b).attr({"stroke-linejoin":"round"}).shadow(t,k));d.attr({visibility:l.visible?"inherit":"hidden"});d.addClass(l.getClassName())}})},searchPoint:x, |
| | | sortByAngle:function(a,c){a.sort(function(a,d){return void 0!==a.angle&&(d.angle-a.angle)*c})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getCenter:F.getCenter,getSymbol:x},{init:function(){w.prototype.init.apply(this,arguments);var a=this,c;a.name=t(a.name,"Slice");c=function(c){a.slice("select"===c.type)};C(a,"select",c);C(a,"unselect",c);return a},isValid:function(){return a.isNumber(this.y,!0)&&0<=this.y},setVisible:function(a,c){var e=this,d=e.series,b=d.chart,f=d.options.ignoreHiddenPoint; |
| | | c=t(c,f);a!==e.visible&&(e.visible=e.options.visible=a=void 0===a?!e.visible:a,d.options.data[u(e,d.data)]=e.options,n(["graphic","dataLabel","connector","shadowGroup"],function(b){if(e[b])e[b][a?"show":"hide"](!0)}),e.legendItem&&b.legend.colorizeItem(e,a),a||"hover"!==e.state||e.setState(""),f&&(d.isDirty=!0),c&&b.redraw())},slice:function(a,c,e){var d=this.series;h(e,d.chart);t(c,!0);this.sliced=this.options.sliced=I(a)?a:!this.sliced;d.options.data[u(this,d.data)]=this.options;this.graphic.animate(this.getTranslate()); |
| | | this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(a){var c=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.x,c.y,c.r+a,c.r+a,{innerR:this.shapeArgs.r-1,start:c.start,end:c.end})}})})(K);(function(a){var C=a.addEvent,F=a.arrayMax,I=a.defined,n=a.each,f=a.extend,e=a.format,u=a.map,x=a.merge,t=a.noop,w=a.pick,y=a.relativeLength,c= |
| | | a.Series,h=a.seriesTypes,p=a.some,k=a.stableSort,q=a.isArray,d=a.splat;a.distribute=function(b,c,d){function e(a,b){return a.target-b.target}var f,h=!0,q=b,m=[],v;v=0;var t=q.reducedLen||c;for(f=b.length;f--;)v+=b[f].size;if(v>t){k(b,function(a,b){return(b.rank||0)-(a.rank||0)});for(v=f=0;v<=t;)v+=b[f].size,f++;m=b.splice(f-1,b.length)}k(b,e);for(b=u(b,function(a){return{size:a.size,targets:[a.target],align:w(a.align,.5)}});h;){for(f=b.length;f--;)h=b[f],v=(Math.min.apply(0,h.targets)+Math.max.apply(0, |
| | | h.targets))/2,h.pos=Math.min(Math.max(0,v-h.size*h.align),c-h.size);f=b.length;for(h=!1;f--;)0<f&&b[f-1].pos+b[f-1].size>b[f].pos&&(b[f-1].size+=b[f].size,b[f-1].targets=b[f-1].targets.concat(b[f].targets),b[f-1].align=.5,b[f-1].pos+b[f-1].size>c&&(b[f-1].pos=c-b[f-1].size),b.splice(f,1),h=!0)}q.push.apply(q,m);f=0;p(b,function(b){var e=0;if(p(b.targets,function(){q[f].pos=b.pos+e;if(Math.abs(q[f].pos-q[f].target)>d)return n(q.slice(0,f+1),function(a){delete a.pos}),q.reducedLen=(q.reducedLen||c)- |
| | | .1*c,q.reducedLen>.1*c&&a.distribute(q,c,d),!0;e+=q[f].size;f++}))return!0});k(q,e)};c.prototype.drawDataLabels=function(){function b(a,b){var c=b.filter;return c?(b=c.operator,a=a[c.property],c=c.value,"\x3e"===b&&a>c||"\x3c"===b&&a<c||"\x3e\x3d"===b&&a>=c||"\x3c\x3d"===b&&a<=c||"\x3d\x3d"===b&&a==c||"\x3d\x3d\x3d"===b&&a===c?!0:!1):!0}function c(a,b){var c=[],d;if(q(a)&&!q(b))c=u(a,function(a){return x(a,b)});else if(q(b)&&!q(a))c=u(b,function(b){return x(a,b)});else if(q(a)||q(b))for(d=Math.max(a.length, |
| | | b.length);d--;)c[d]=x(a[d],b[d]);else c=x(a,b);return c}var f=this,h=f.chart,k=f.options,p=k.dataLabels,t=f.points,m,y=f.hasRendered||0,A,F=w(p.defer,!!k.animation),E=h.renderer,p=c(c(h.options.plotOptions&&h.options.plotOptions.series&&h.options.plotOptions.series.dataLabels,h.options.plotOptions&&h.options.plotOptions[f.type]&&h.options.plotOptions[f.type].dataLabels),p);if(q(p)||p.enabled||f._hasPointLabels)A=f.plotGroup("dataLabelsGroup","data-labels",F&&!y?"hidden":"visible",p.zIndex||6),F&& |
| | | (A.attr({opacity:+y}),y||C(f,"afterAnimate",function(){f.visible&&A.show(!0);A[k.animation?"animate":"attr"]({opacity:1},{duration:200})})),n(t,function(g){m=d(c(p,g.dlOptions||g.options&&g.options.dataLabels));n(m,function(c,d){var l=c.enabled&&!g.isNull&&b(g,c),m,n,q,r,p=g.dataLabels?g.dataLabels[d]:g.dataLabel,v=g.connectors?g.connectors[d]:g.connector,t=!p;l&&(m=g.getLabelConfig(),n=c[g.formatPrefix+"Format"]||c.format,m=I(n)?e(n,m,h.time):(c[g.formatPrefix+"Formatter"]||c.formatter).call(m,c), |
| | | n=c.style,q=c.rotation,n.color=w(c.color,n.color,f.color,"#000000"),"contrast"===n.color&&(g.contrastColor=E.getContrast(g.color||f.color),n.color=c.inside||0>w(c.distance,g.labelDistance)||k.stacking?g.contrastColor:"#000000"),k.cursor&&(n.cursor=k.cursor),r={fill:c.backgroundColor,stroke:c.borderColor,"stroke-width":c.borderWidth,r:c.borderRadius||0,rotation:q,padding:c.padding,zIndex:1},a.objectEach(r,function(a,b){void 0===a&&delete r[b]}));!p||l&&I(m)?l&&I(m)&&(p?r.text=m:(g.dataLabels=g.dataLabels|| |
| | | [],p=g.dataLabels[d]=q?E.text(m,0,-9999).addClass("highcharts-data-label"):E.label(m,0,-9999,c.shape,null,null,c.useHTML,null,"data-label"),d||(g.dataLabel=p),p.addClass(" highcharts-data-label-color-"+g.colorIndex+" "+(c.className||"")+(c.useHTML?" highcharts-tracker":""))),p.options=c,p.attr(r),p.css(n).shadow(c.shadow),p.added||p.add(A),f.alignDataLabel(g,p,c,null,t)):(g.dataLabel=g.dataLabel.destroy(),g.dataLabels&&(1===g.dataLabels.length?delete g.dataLabels:delete g.dataLabels[d]),d||delete g.dataLabel, |
| | | v&&(g.connector=g.connector.destroy(),g.connectors&&(1===g.connectors.length?delete g.connectors:delete g.connectors[d])))})});a.fireEvent(this,"afterDrawDataLabels")};c.prototype.alignDataLabel=function(a,c,d,e,h){var b=this.chart,l=b.inverted,m=w(a.dlBox&&a.dlBox.centerX,a.plotX,-9999),k=w(a.plotY,-9999),n=c.getBBox(),q,p=d.rotation,g=d.align,r=this.visible&&(a.series.forceDL||b.isInsidePlot(m,Math.round(k),l)||e&&b.isInsidePlot(m,l?e.x+1:e.y+e.height-1,l)),v="justify"===w(d.overflow,"justify"); |
| | | if(r&&(q=d.style.fontSize,q=b.renderer.fontMetrics(q,c).b,e=f({x:l?this.yAxis.len-k:m,y:Math.round(l?this.xAxis.len-m:k),width:0,height:0},e),f(d,{width:n.width,height:n.height}),p?(v=!1,m=b.renderer.rotCorr(q,p),m={x:e.x+d.x+e.width/2+m.x,y:e.y+d.y+{top:0,middle:.5,bottom:1}[d.verticalAlign]*e.height},c[h?"attr":"animate"](m).attr({align:g}),k=(p+720)%360,k=180<k&&360>k,"left"===g?m.y-=k?n.height:0:"center"===g?(m.x-=n.width/2,m.y-=n.height/2):"right"===g&&(m.x-=n.width,m.y-=k?0:n.height),c.placed= |
| | | !0,c.alignAttr=m):(c.align(d,null,e),m=c.alignAttr),v&&0<=e.height?a.isLabelJustified=this.justifyDataLabel(c,d,m,n,e,h):w(d.crop,!0)&&(r=b.isInsidePlot(m.x,m.y)&&b.isInsidePlot(m.x+n.width,m.y+n.height)),d.shape&&!p))c[h?"attr":"animate"]({anchorX:l?b.plotWidth-a.plotY:a.plotX,anchorY:l?b.plotHeight-a.plotX:a.plotY});r||(c.attr({y:-9999}),c.placed=!1)};c.prototype.justifyDataLabel=function(a,c,d,e,f,h){var b=this.chart,l=c.align,k=c.verticalAlign,n,q,p=a.box?0:a.padding||0;n=d.x+p;0>n&&("right"=== |
| | | l?c.align="left":c.x=-n,q=!0);n=d.x+e.width-p;n>b.plotWidth&&("left"===l?c.align="right":c.x=b.plotWidth-n,q=!0);n=d.y+p;0>n&&("bottom"===k?c.verticalAlign="top":c.y=-n,q=!0);n=d.y+e.height-p;n>b.plotHeight&&("top"===k?c.verticalAlign="bottom":c.y=b.plotHeight-n,q=!0);q&&(a.placed=!h,a.align(c,null,f));return q};h.pie&&(h.pie.prototype.drawDataLabels=function(){var b=this,d=b.data,e,f=b.chart,h=b.options.dataLabels,k=w(h.connectorPadding,10),q=w(h.connectorWidth,1),m=f.plotWidth,p=f.plotHeight,t= |
| | | Math.round(f.chartWidth/3),u,x=b.center,g=x[2]/2,r=x[1],y,C,H,K,Q=[[],[]],z,P,T,S,U=[0,0,0,0];b.visible&&(h.enabled||b._hasPointLabels)&&(n(d,function(a){a.dataLabel&&a.visible&&a.dataLabel.shortened&&(a.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),a.dataLabel.shortened=!1)}),c.prototype.drawDataLabels.apply(b),n(d,function(a){a.dataLabel&&(a.visible?(Q[a.half].push(a),a.dataLabel._pos=null,!I(h.style.width)&&!I(a.options.dataLabels&&a.options.dataLabels.style&&a.options.dataLabels.style.width)&& |
| | | a.dataLabel.getBBox().width>t&&(a.dataLabel.css({width:.7*t}),a.dataLabel.shortened=!0)):(a.dataLabel=a.dataLabel.destroy(),a.dataLabels&&1===a.dataLabels.length&&delete a.dataLabels))}),n(Q,function(c,d){var l,q,t=c.length,v=[],u;if(t)for(b.sortByAngle(c,d-.5),0<b.maxLabelDistance&&(l=Math.max(0,r-g-b.maxLabelDistance),q=Math.min(r+g+b.maxLabelDistance,f.plotHeight),n(c,function(a){0<a.labelDistance&&a.dataLabel&&(a.top=Math.max(0,r-g-a.labelDistance),a.bottom=Math.min(r+g+a.labelDistance,f.plotHeight), |
| | | u=a.dataLabel.getBBox().height||21,a.distributeBox={target:a.labelPos[1]-a.top+u/2,size:u,rank:a.y},v.push(a.distributeBox))}),l=q+u-l,a.distribute(v,l,l/5)),S=0;S<t;S++)e=c[S],H=e.labelPos,y=e.dataLabel,T=!1===e.visible?"hidden":"inherit",P=l=H[1],v&&I(e.distributeBox)&&(void 0===e.distributeBox.pos?T="hidden":(K=e.distributeBox.size,P=e.top+e.distributeBox.pos)),delete e.positionIndex,z=h.justify?x[0]+(d?-1:1)*(g+e.labelDistance):b.getX(P<e.top+2||P>e.bottom-2?l:P,d,e),y._attr={visibility:T,align:H[6]}, |
| | | y._pos={x:z+h.x+({left:k,right:-k}[H[6]]||0),y:P+h.y-10},H.x=z,H.y=P,w(h.crop,!0)&&(C=y.getBBox().width,l=null,z-C<k&&1===d?(l=Math.round(C-z+k),U[3]=Math.max(l,U[3])):z+C>m-k&&0===d&&(l=Math.round(z+C-m+k),U[1]=Math.max(l,U[1])),0>P-K/2?U[0]=Math.max(Math.round(-P+K/2),U[0]):P+K/2>p&&(U[2]=Math.max(Math.round(P+K/2-p),U[2])),y.sideOverflow=l)}),0===F(U)||this.verifyDataLabelOverflow(U))&&(this.placeDataLabels(),q&&n(this.points,function(a){var c;u=a.connector;if((y=a.dataLabel)&&y._pos&&a.visible&& |
| | | 0<a.labelDistance){T=y._attr.visibility;if(c=!u)a.connector=u=f.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex+(a.className?" "+a.className:"")).add(b.dataLabelsGroup),u.attr({"stroke-width":q,stroke:h.connectorColor||a.color||"#666666"});u[c?"attr":"animate"]({d:b.connectorPath(a.labelPos)});u.attr("visibility",T)}else u&&(a.connector=u.destroy())}))},h.pie.prototype.connectorPath=function(a){var b=a.x,c=a.y;return w(this.options.dataLabels.softConnector, |
| | | !0)?["M",b+("left"===a[6]?5:-5),c,"C",b,c,2*a[2]-a[4],2*a[3]-a[5],a[2],a[3],"L",a[4],a[5]]:["M",b+("left"===a[6]?5:-5),c,"L",a[2],a[3],"L",a[4],a[5]]},h.pie.prototype.placeDataLabels=function(){n(this.points,function(a){var b=a.dataLabel;b&&a.visible&&((a=b._pos)?(b.sideOverflow&&(b._attr.width=b.getBBox().width-b.sideOverflow,b.css({width:b._attr.width+"px",textOverflow:(this.options.dataLabels.style||{}).textOverflow||"ellipsis"}),b.shortened=!0),b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved= |
| | | !0):b&&b.attr({y:-9999}))},this)},h.pie.prototype.alignDataLabel=t,h.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c.minSize||80,f,h=null!==c.size;h||(null!==d[0]?f=Math.max(b[2]-Math.max(a[1],a[3]),e):(f=Math.max(b[2]-a[1]-a[3],e),b[0]+=(a[3]-a[1])/2),null!==d[1]?f=Math.max(Math.min(f,b[2]-Math.max(a[0],a[2])),e):(f=Math.max(Math.min(f,b[2]-a[0]-a[2]),e),b[1]+=(a[0]-a[2])/2),f<b[2]?(b[2]=f,b[3]=Math.min(y(c.innerSize||0,f),f),this.translate(b),this.drawDataLabels&& |
| | | this.drawDataLabels()):h=!0);return h});h.column&&(h.column.prototype.alignDataLabel=function(a,d,e,f,h){var b=this.chart.inverted,l=a.series,m=a.dlBox||a.shapeArgs,k=w(a.below,a.plotY>w(this.translatedThreshold,l.yAxis.len)),n=w(e.inside,!!this.options.stacking);m&&(f=x(m),0>f.y&&(f.height+=f.y,f.y=0),m=f.y+f.height-l.yAxis.len,0<m&&(f.height-=m),b&&(f={x:l.yAxis.len-f.y-f.height,y:l.xAxis.len-f.x-f.width,width:f.height,height:f.width}),n||(b?(f.x+=k?0:f.width,f.width=0):(f.y+=k?f.height:0,f.height= |
| | | 0)));e.align=w(e.align,!b||n?"center":k?"right":"left");e.verticalAlign=w(e.verticalAlign,b||n?"middle":k?"top":"bottom");c.prototype.alignDataLabel.call(this,a,d,e,f,h);a.isLabelJustified&&a.contrastColor&&d.css({color:a.contrastColor})})})(K);(function(a){var C=a.Chart,F=a.each,I=a.isArray,n=a.objectEach,f=a.pick;a=a.addEvent;a(C,"render",function(){var a=[];F(this.labelCollectors||[],function(e){a=a.concat(e())});F(this.yAxis||[],function(e){e.options.stackLabels&&!e.options.stackLabels.allowOverlap&& |
| | | n(e.stacks,function(e){n(e,function(e){a.push(e.label)})})});F(this.series||[],function(e){var n=e.options.dataLabels;e.visible&&(!1!==n.enabled||e._hasPointLabels)&&F(e.points,function(e){if(e.visible){var n=I(e.dataLabels)?e.dataLabels:e.dataLabel?[e.dataLabel]:[];F(n,function(n){var c=n.options;n.labelrank=f(c.labelrank,e.labelrank,e.shapeArgs&&e.shapeArgs.height);c.allowOverlap||a.push(n)})}})});this.hideOverlappingLabels(a)});C.prototype.hideOverlappingLabels=function(a){var e=a.length,f=this.renderer, |
| | | n,w,y,c,h,p,k=function(a,c,b,e,f,h,k,n){return!(f>a+b||f+k<a||h>c+e||h+n<c)};y=function(a){var c,b,e,h=a.box?0:a.padding||0;e=0;if(a&&(!a.alignAttr||a.placed))return c=a.alignAttr||{x:a.attr("x"),y:a.attr("y")},b=a.parentGroup,a.width||(e=a.getBBox(),a.width=e.width,a.height=e.height,e=f.fontMetrics(null,a.element).h),{x:c.x+(b.translateX||0)+h,y:c.y+(b.translateY||0)+h-e,width:a.width-2*h,height:a.height-2*h}};for(w=0;w<e;w++)if(n=a[w])n.oldOpacity=n.opacity,n.newOpacity=1,n.absoluteBox=y(n);a.sort(function(a, |
| | | c){return(c.labelrank||0)-(a.labelrank||0)});for(w=0;w<e;w++)for(p=(y=a[w])&&y.absoluteBox,n=w+1;n<e;++n)if(h=(c=a[n])&&c.absoluteBox,p&&h&&y!==c&&0!==y.newOpacity&&0!==c.newOpacity&&(h=k(p.x,p.y,p.width,p.height,h.x,h.y,h.width,h.height)))(y.labelrank<c.labelrank?y:c).newOpacity=0;F(a,function(a){var c,b;a&&(b=a.newOpacity,a.oldOpacity!==b&&(a.alignAttr&&a.placed?(b?a.show(!0):c=function(){a.hide()},a.alignAttr.opacity=b,a[a.isOld?"animate":"attr"](a.alignAttr,null,c)):a.attr({opacity:b})),a.isOld= |
| | | !0)})}})(K);(function(a){var C=a.addEvent,F=a.Chart,I=a.createElement,n=a.css,f=a.defaultOptions,e=a.defaultPlotOptions,u=a.each,x=a.extend,t=a.fireEvent,w=a.hasTouch,y=a.inArray,c=a.isObject,h=a.Legend,p=a.merge,k=a.pick,q=a.Point,d=a.Series,b=a.seriesTypes,v=a.svg,J;J=a.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart.pointer,c=function(a){var c=b.getPointFromEvent(a);void 0!==c&&(b.isDirectTouch=!0,c.onMouseOver(a))};u(a.points,function(a){a.graphic&&(a.graphic.element.point=a);a.dataLabel&& |
| | | (a.dataLabel.div?a.dataLabel.div.point=a:a.dataLabel.element.point=a)});a._hasTracking||(u(a.trackerGroups,function(d){if(a[d]){a[d].addClass("highcharts-tracker").on("mouseover",c).on("mouseout",function(a){b.onTrackerMouseOut(a)});if(w)a[d].on("touchstart",c);a.options.cursor&&a[d].css(n).css({cursor:a.options.cursor})}}),a._hasTracking=!0);t(this,"afterDrawTracker")},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,h= |
| | | f.pointer,k=f.renderer,n=f.options.tooltip.snap,g=a.tracker,q,p=function(){if(f.hoverSeries!==a)a.onMouseOver()},x="rgba(192,192,192,"+(v?.0001:.002)+")";if(e&&!c)for(q=e+1;q--;)"M"===d[q]&&d.splice(q+1,0,d[q+1]-n,d[q+2],"L"),(q&&"M"===d[q]||q===e)&&d.splice(q,0,"L",d[q-2]+n,d[q-1]);g?g.attr({d:d}):a.graph&&(a.tracker=k.path(d).attr({"stroke-linejoin":"round",stroke:x,fill:c?x:"none","stroke-width":a.graph.strokeWidth()+(c?0:2*n),visibility:a.visible?"visible":"hidden",zIndex:2}).addClass(c?"highcharts-tracker-area": |
| | | "highcharts-tracker-line").add(a.group),u([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",p).on("mouseout",function(a){h.onTrackerMouseOut(a)});b.cursor&&a.css({cursor:b.cursor});if(w)a.on("touchstart",p)}));t(this,"afterDrawTracker")}};b.column&&(b.column.prototype.drawTracker=J.drawTrackerPoint);b.pie&&(b.pie.prototype.drawTracker=J.drawTrackerPoint);b.scatter&&(b.scatter.prototype.drawTracker=J.drawTrackerPoint);f.legend.itemStyle.cursor="pointer";x(h.prototype, |
| | | {setItemEvents:function(a,b,c){var d=this,e=d.chart.renderer.boxWrapper,f="highcharts-legend-"+(a instanceof q?"point":"series")+"-active";(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");e.addClass(f);b.css(d.options.itemHoverStyle)}).on("mouseout",function(){b.css(p(a.visible?d.itemStyle:d.itemHiddenStyle));e.removeClass(f);a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible()};e.removeClass(f);b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick", |
| | | b,c):t(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=I("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);C(a.checkbox,"click",function(b){t(a.series||a,"checkboxClick",{checked:b.target.checked,item:a},function(){a.select()})})}});x(F.prototype,{showResetZoom:function(){function a(){b.zoomOut()}var b=this,c=f.lang,d=b.options.chart.resetZoomButton,e=d.theme,h= |
| | | e.states,k="chart"===d.relativeTo?null:"plotBox";t(this,"beforeShowResetZoom",null,function(){b.resetZoomButton=b.renderer.button(c.resetZoom,null,null,a,e,h&&h.hover).attr({align:d.position.align,title:c.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(d.position,!1,k)})},zoomOut:function(){t(this,"selection",{resetSelection:!0},this.zoom)},zoom:function(a){var b,d=this.pointer,e=!1,f;!a||a.resetSelection?(u(this.axes,function(a){b=a.zoom()}),d.initiated=!1):u(a.xAxis.concat(a.yAxis), |
| | | function(a){var c=a.axis;d[c.isXAxis?"zoomX":"zoomY"]&&(b=c.zoom(a.min,a.max),c.displayBtn&&(e=!0))});f=this.resetZoomButton;e&&!f?this.showResetZoom():!e&&c(f)&&(this.resetZoomButton=f.destroy());b&&this.redraw(k(this.options.chart.animation,a&&a.animation,100>this.pointCount))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&u(d,function(a){a.setState()});u("xy"===b?[1,0]:[1],function(b){b=c[b?"xAxis":"yAxis"][0];var d=b.horiz,f=a[d?"chartX":"chartY"],d=d?"mouseDownX":"mouseDownY",h=c[d],g=(b.pointRange|| |
| | | 0)/2,l=b.reversed&&!c.inverted||!b.reversed&&c.inverted?-1:1,m=b.getExtremes(),k=b.toValue(h-f,!0)+g*l,l=b.toValue(h+b.len-f,!0)-g*l,n=l<k,h=n?l:k,k=n?k:l,l=Math.min(m.dataMin,g?m.min:b.toValue(b.toPixels(m.min)-b.minPixelPadding)),g=Math.max(m.dataMax,g?m.max:b.toValue(b.toPixels(m.max)+b.minPixelPadding)),n=l-h;0<n&&(k+=n,h=l);n=k-g;0<n&&(k=g,h-=n);b.series.length&&h!==m.min&&k!==m.max&&(b.setExtremes(h,k,!1,!1,{trigger:"pan"}),e=!0);c[d]=f});e&&c.redraw(!1);n(c.container,{cursor:"move"})}});x(q.prototype, |
| | | {select:function(a,b){var c=this,d=c.series,e=d.chart;a=k(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[y(c,d.data)]=c.options;c.setState(a&&"select");b||u(e.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,d.options.data[y(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a){var b=this.series.chart,c=b.pointer;a=a?c.normalize(a):c.getChartCoordinatesFromPoint(this, |
| | | b.inverted);c.runPointActions(a,this)},onMouseOut:function(){var a=this.series.chart;this.firePointEvent("mouseOut");u(a.hoverPoints||[],function(a){a.setState()});a.hoverPoints=a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var b=this,c=p(b.series.options.point,b.options).events;b.events=c;a.objectEach(c,function(a,c){C(b,c,a)});this.hasImportedEvents=!0}},setState:function(a,b){var c=Math.floor(this.plotX),d=this.plotY,f=this.series,h=f.options.states[a||"normal"]||{},l= |
| | | e[f.type].marker&&f.options.marker,n=l&&!1===l.enabled,q=l&&l.states&&l.states[a||"normal"]||{},g=!1===q.enabled,p=f.stateMarkerGraphic,v=this.marker||{},u=f.chart,w=f.halo,y,C=l&&f.markerAttribs;a=a||"";if(!(a===this.state&&!b||this.selected&&"select"!==a||!1===h.enabled||a&&(g||n&&!1===q.enabled)||a&&v.states&&v.states[a]&&!1===v.states[a].enabled)){C&&(y=f.markerAttribs(this,a));if(this.graphic)this.state&&this.graphic.removeClass("highcharts-point-"+this.state),a&&this.graphic.addClass("highcharts-point-"+ |
| | | a),this.graphic.animate(f.pointAttribs(this,a),k(u.options.chart.animation,h.animation)),y&&this.graphic.animate(y,k(u.options.chart.animation,q.animation,l.animation)),p&&p.hide();else{if(a&&q){l=v.symbol||f.symbol;p&&p.currentSymbol!==l&&(p=p.destroy());if(p)p[b?"animate":"attr"]({x:y.x,y:y.y});else l&&(f.stateMarkerGraphic=p=u.renderer.symbol(l,y.x,y.y,y.width,y.height).add(f.markerGroup),p.currentSymbol=l);p&&p.attr(f.pointAttribs(this,a))}p&&(p[a&&u.isInsidePlot(c,d,u.inverted)?"show":"hide"](), |
| | | p.element.point=this)}(c=h.halo)&&c.size?(w||(f.halo=w=u.renderer.path().add((this.graphic||p).parentGroup)),w.show()[b?"animate":"attr"]({d:this.haloPath(c.size)}),w.attr({"class":"highcharts-halo highcharts-color-"+k(this.colorIndex,f.colorIndex)+(this.className?" "+this.className:""),zIndex:-1}),w.point=this,w.attr(x({fill:this.color||f.color,"fill-opacity":c.opacity},c.attributes))):w&&w.point&&w.point.haloPath&&w.animate({d:w.point.haloPath(0)},null,w.hide);this.state=a;t(this,"afterSetState")}}, |
| | | haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-a,this.plotY-a,2*a,2*a)}});x(d.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&t(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;b.hoverSeries=null;if(d)d.onMouseOut();this&&a.events.mouseOut&&t(this,"mouseOut");!c||this.stickyTracking|| |
| | | c.shared&&!this.noSharedTooltip||c.hide();this.setState()},setState:function(a){var b=this,c=b.options,d=b.graph,e=c.states,f=c.lineWidth,c=0;a=a||"";if(b.state!==a&&(u([b.group,b.markerGroup,b.dataLabelsGroup],function(c){c&&(b.state&&c.removeClass("highcharts-series-"+b.state),a&&c.addClass("highcharts-series-"+a))}),b.state=a,!e[a]||!1!==e[a].enabled)&&(a&&(f=e[a].lineWidth||f+(e[a].lineWidthPlus||0)),d&&!d.dashstyle))for(f={"stroke-width":f},d.animate(f,k(e[a||"normal"]&&e[a||"normal"].animation, |
| | | b.chart.options.chart.animation));b["zone-graph-"+c];)b["zone-graph-"+c].attr(f),c+=1},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,h=d.options.chart.ignoreHiddenSeries,k=c.visible;f=(c.visible=a=c.options.visible=c.userOptions.visible=void 0===a?!k:a)?"show":"hide";u(["group","dataLabelsGroup","markerGroup","tracker","tt"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c||(d.hoverPoint&&d.hoverPoint.series)===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&& |
| | | u(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});u(c.linkedSeries,function(b){b.setVisible(a,!1)});h&&(d.isDirtyBox=!0);t(c,f);!1!==b&&d.redraw()},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=void 0===a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);t(this,a?"select":"unselect")},drawTracker:J.drawTrackerGraph})})(K);(function(a){var C=a.Chart,F=a.each,I=a.inArray,n=a.isArray,f=a.isObject,e=a.pick,u=a.splat; |
| | | C.prototype.setResponsive=function(e){var f=this.options.responsive,n=[],u=this.currentResponsive;f&&f.rules&&F(f.rules,function(c){void 0===c._id&&(c._id=a.uniqueKey());this.matchResponsiveRule(c,n,e)},this);var c=a.merge.apply(0,a.map(n,function(c){return a.find(f.rules,function(a){return a._id===c}).chartOptions})),n=n.toString()||void 0;n!==(u&&u.ruleIds)&&(u&&this.update(u.undoOptions,e),n?(this.currentResponsive={ruleIds:n,mergedOptions:c,undoOptions:this.currentOptions(c)},this.update(c,e)): |
| | | this.currentResponsive=void 0)};C.prototype.matchResponsiveRule=function(a,f){var n=a.condition;(n.callback||function(){return this.chartWidth<=e(n.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=e(n.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=e(n.minWidth,0)&&this.chartHeight>=e(n.minHeight,0)}).call(this)&&f.push(a._id)};C.prototype.currentOptions=function(e){function t(e,c,h,p){var k;a.objectEach(e,function(a,d){if(!p&&-1<I(d,["series","xAxis","yAxis"]))for(a=u(a),h[d]=[],k=0;k<a.length;k++)c[d][k]&& |
| | | (h[d][k]={},t(a[k],c[d][k],h[d][k],p+1));else f(a)?(h[d]=n(a)?[]:{},t(a,c[d]||{},h[d],p+1)):h[d]=c[d]||null})}var w={};t(e,this.options,w,0);return w}})(K);return K}); |
| | | //# sourceMappingURL=highcharts.js.map |
| New file |
| | |
| | | /* @license |
| | | * jQuery.print, version 1.6.0 |
| | | * (c) Sathvik Ponangi, Doers' Guild |
| | | * Licence: CC-By (http://creativecommons.org/licenses/by/3.0/) |
| | | *--------------------------------------------------------------------------*/ |
| | | (function ($) { |
| | | "use strict"; |
| | | // A nice closure for our definitions |
| | | |
| | | function jQueryCloneWithSelectAndTextAreaValues(elmToClone, withDataAndEvents, deepWithDataAndEvents) { |
| | | // Replacement jQuery clone that also clones the values in selects and textareas as jQuery doesn't for performance reasons - https://stackoverflow.com/questions/742810/clone-isnt-cloning-select-values |
| | | // Based on https://github.com/spencertipping/jquery.fix.clone |
| | | var $elmToClone = $(elmToClone), |
| | | $result = $elmToClone.clone(withDataAndEvents, deepWithDataAndEvents), |
| | | $myTextareas = $elmToClone.find('textarea').add($elmToClone.filter('textarea')), |
| | | $resultTextareas = $result.find('textarea').add($result.filter('textarea')), |
| | | $mySelects = $elmToClone.find('select').add($elmToClone.filter('select')), |
| | | $resultSelects = $result.find('select').add($result.filter('select')), |
| | | i, l, j, m; |
| | | |
| | | for (i = 0, l = $myTextareas.length; i < l; ++i) { |
| | | $($resultTextareas[i]).val($($myTextareas[i]).val()); |
| | | } |
| | | for (i = 0, l = $mySelects.length; i < l; ++i) { |
| | | for (j = 0, m = $mySelects[i].options.length; j < m; ++j) { |
| | | if ($mySelects[i].options[j].selected === true) { |
| | | $resultSelects[i].options[j].selected = true; |
| | | } |
| | | } |
| | | } |
| | | return $result; |
| | | } |
| | | |
| | | function getjQueryObject(string) { |
| | | // Make string a vaild jQuery thing |
| | | var jqObj = $(""); |
| | | try { |
| | | jqObj = jQueryCloneWithSelectAndTextAreaValues(string); |
| | | } catch (e) { |
| | | jqObj = $("<span />") |
| | | .html(string); |
| | | } |
| | | return jqObj; |
| | | } |
| | | |
| | | function printFrame(frameWindow, content, options) { |
| | | // Print the selected window/iframe |
| | | var def = $.Deferred(); |
| | | try { |
| | | frameWindow = frameWindow.contentWindow || frameWindow.contentDocument || frameWindow; |
| | | var wdoc = frameWindow.document || frameWindow.contentDocument || frameWindow; |
| | | if(options.doctype) { |
| | | wdoc.write(options.doctype); |
| | | } |
| | | wdoc.write(content); |
| | | wdoc.close(); |
| | | var printed = false, |
| | | callPrint = function () { |
| | | if(printed) { |
| | | return; |
| | | } |
| | | // Fix for IE : Allow it to render the iframe |
| | | frameWindow.focus(); |
| | | try { |
| | | // Fix for IE11 - printng the whole page instead of the iframe content |
| | | if (!frameWindow.document.execCommand('print', false, null)) { |
| | | // document.execCommand returns false if it failed -http://stackoverflow.com/a/21336448/937891 |
| | | frameWindow.print(); |
| | | } |
| | | // focus body as it is losing focus in iPad and content not getting printed |
| | | $('body').focus(); |
| | | } catch (e) { |
| | | frameWindow.print(); |
| | | } |
| | | frameWindow.close(); |
| | | printed = true; |
| | | def.resolve(); |
| | | }; |
| | | // Print once the frame window loads - seems to work for the new-window option but unreliable for the iframe |
| | | $(frameWindow).on("load", callPrint); |
| | | // Fallback to printing directly if the frame doesn't fire the load event for whatever reason |
| | | setTimeout(callPrint, options.timeout); |
| | | } catch (err) { |
| | | def.reject(err); |
| | | } |
| | | return def; |
| | | } |
| | | |
| | | function printContentInIFrame(content, options) { |
| | | var $iframe = $(options.iframe + ""); |
| | | var iframeCount = $iframe.length; |
| | | if (iframeCount === 0) { |
| | | // Create a new iFrame if none is given |
| | | $iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>') |
| | | .prependTo('body') |
| | | .css({ |
| | | "position": "absolute", |
| | | "top": -999, |
| | | "left": -999 |
| | | }); |
| | | } |
| | | var frameWindow = $iframe.get(0); |
| | | return printFrame(frameWindow, content, options) |
| | | .done(function () { |
| | | // Success |
| | | setTimeout(function () { |
| | | // Wait for IE |
| | | if (iframeCount === 0) { |
| | | // Destroy the iframe if created here |
| | | $iframe.remove(); |
| | | } |
| | | }, 1000); |
| | | }) |
| | | .fail(function (err) { |
| | | // Use the pop-up method if iframe fails for some reason |
| | | console.error("Failed to print from iframe", err); |
| | | printContentInNewWindow(content, options); |
| | | }) |
| | | .always(function () { |
| | | try { |
| | | options.deferred.resolve(); |
| | | } catch (err) { |
| | | console.warn('Error notifying deferred', err); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function printContentInNewWindow(content, options) { |
| | | // Open a new window and print selected content |
| | | var frameWindow = window.open(); |
| | | return printFrame(frameWindow, content, options) |
| | | .always(function () { |
| | | try { |
| | | options.deferred.resolve(); |
| | | } catch (err) { |
| | | console.warn('Error notifying deferred', err); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function isNode(o) { |
| | | /* http://stackoverflow.com/a/384380/937891 */ |
| | | return !!(typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"); |
| | | } |
| | | $.print = $.fn.print = function () { |
| | | // Print a given set of elements |
| | | var options, $this, self = this; |
| | | // console.log("Printing", this, arguments); |
| | | if (self instanceof $) { |
| | | // Get the node if it is a jQuery object |
| | | self = self.get(0); |
| | | } |
| | | if (isNode(self)) { |
| | | // If `this` is a HTML element, i.e. for |
| | | // $(selector).print() |
| | | $this = $(self); |
| | | if (arguments.length > 0) { |
| | | options = arguments[0]; |
| | | } |
| | | } else { |
| | | if (arguments.length > 0) { |
| | | // $.print(selector,options) |
| | | $this = $(arguments[0]); |
| | | if (isNode($this[0])) { |
| | | if (arguments.length > 1) { |
| | | options = arguments[1]; |
| | | } |
| | | } else { |
| | | // $.print(options) |
| | | options = arguments[0]; |
| | | $this = $("html"); |
| | | } |
| | | } else { |
| | | // $.print() |
| | | $this = $("html"); |
| | | } |
| | | } |
| | | // Default options |
| | | var defaults = { |
| | | globalStyles: true, |
| | | mediaPrint: false, |
| | | stylesheet: null, |
| | | noPrintSelector: ".no-print", |
| | | iframe: true, |
| | | append: null, |
| | | prepend: null, |
| | | manuallyCopyFormValues: true, |
| | | deferred: $.Deferred(), |
| | | timeout: 750, |
| | | title: null, |
| | | doctype: '<!doctype html>' |
| | | }; |
| | | // Merge with user-options |
| | | options = $.extend({}, defaults, (options || {})); |
| | | var $styles = $(""); |
| | | if (options.globalStyles) { |
| | | // Apply the stlyes from the current sheet to the printed page |
| | | $styles = $("style, link, meta, base, title"); |
| | | } else if (options.mediaPrint) { |
| | | // Apply the media-print stylesheet |
| | | $styles = $("link[media=print]"); |
| | | } |
| | | if (options.stylesheet) { |
| | | // Add a custom stylesheet if given |
| | | $styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">')); |
| | | } |
| | | // Create a copy of the element to print |
| | | var copy = jQueryCloneWithSelectAndTextAreaValues($this); |
| | | // Wrap it in a span to get the HTML markup string |
| | | copy = $("<span/>") |
| | | .append(copy); |
| | | // Remove unwanted elements |
| | | copy.find(options.noPrintSelector) |
| | | .remove(); |
| | | // Add in the styles |
| | | copy.append(jQueryCloneWithSelectAndTextAreaValues($styles)); |
| | | // Update title |
| | | if (options.title) { |
| | | var title = $("title", copy); |
| | | if (title.length === 0) { |
| | | title = $("<title />"); |
| | | copy.append(title); |
| | | } |
| | | title.text(options.title); |
| | | } |
| | | // Appedned content |
| | | copy.append(getjQueryObject(options.append)); |
| | | // Prepended content |
| | | copy.prepend(getjQueryObject(options.prepend)); |
| | | if (options.manuallyCopyFormValues) { |
| | | // Manually copy form values into the HTML for printing user-modified input fields |
| | | // http://stackoverflow.com/a/26707753 |
| | | copy.find("input") |
| | | .each(function () { |
| | | var $field = $(this); |
| | | if ($field.is("[type='radio']") || $field.is("[type='checkbox']")) { |
| | | if ($field.prop("checked")) { |
| | | $field.attr("checked", "checked"); |
| | | } |
| | | } else { |
| | | $field.attr("value", $field.val()); |
| | | } |
| | | }); |
| | | copy.find("select").each(function () { |
| | | var $field = $(this); |
| | | $field.find(":selected").attr("selected", "selected"); |
| | | }); |
| | | copy.find("textarea").each(function () { |
| | | // Fix for https://github.com/DoersGuild/jQuery.print/issues/18#issuecomment-96451589 |
| | | var $field = $(this); |
| | | $field.text($field.val()); |
| | | }); |
| | | } |
| | | // Get the HTML markup string |
| | | var content = copy.html(); |
| | | // Notify with generated markup & cloned elements - useful for logging, etc |
| | | try { |
| | | options.deferred.notify('generated_markup', content, copy); |
| | | } catch (err) { |
| | | console.warn('Error notifying deferred', err); |
| | | } |
| | | // Destroy the copy |
| | | copy.remove(); |
| | | if (options.iframe) { |
| | | // Use an iframe for printing |
| | | try { |
| | | printContentInIFrame(content, options); |
| | | } catch (e) { |
| | | // Use the pop-up method if iframe fails for some reason |
| | | console.error("Failed to print from iframe", e.stack, e.message); |
| | | printContentInNewWindow(content, options); |
| | | } |
| | | } else { |
| | | // Use a new window for printing |
| | | printContentInNewWindow(content, options); |
| | | } |
| | | return this; |
| | | }; |
| | | })(jQuery); |
| New file |
| | |
| | | /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ |
| | | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w}); |
| New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#resource', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/resource/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'code', align: 'center',title: '菜单编码'} |
| | | ,{field: 'name', align: 'center',title: '菜单名称'} |
| | | ,{field: 'resourceName', align: 'center',title: '父级菜单'} |
| | | ,{field: 'level$', align: 'center',title: '菜单等级'} |
| | | ,{field: 'sort', align: 'center',title: '排序'} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(resource)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(resource)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'resource_detail.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | var ids=[]; |
| | | data.map(function (track) { |
| | | ids.push(track.id); |
| | | }); |
| | | if (ids.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/resource/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'resource': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/resource/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(resource)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'resource_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'resource_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | case 'Resource': |
| | | var param = top.reObject(data).resourceId; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '父级详情', |
| | | maxmin: true, |
| | | area: [top.detailHeight, top.detailWidth], |
| | | shadeClose: false, |
| | | content: '../resource/resource_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/resource/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | id: $('#id').val(), |
| | | code: $('#code').val(), |
| | | name: $('#name').val(), |
| | | resourceId: $('#resourceId').val(), |
| | | level: $('#level').val(), |
| | | sort: $('#sort').val(), |
| | | status: $('#status').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/resource/edit/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | tableReload(true); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | } |
| | | layer.style(index, { |
| | | top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | $(".layui-layer-shade").remove(); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| New file |
| | |
| | | var pageCurr; |
| | | var roleId; |
| | | var powerTreeData; |
| | | $(function (){ |
| | | $.ajax({ |
| | | url: baseUrl+"/power/list/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | powerTreeData = res.data; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#role', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/role/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'code', align: 'center',title: '编码'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'leader$', align: 'center',title: '上级'} |
| | | // ,{field: 'level$', align: 'center',title: '角色等级'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(role)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(role)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'role_detail.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | var ids=[]; |
| | | data.map(function (track) { |
| | | ids.push(track.id); |
| | | }); |
| | | if (ids.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/role/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'role': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/role/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(role)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'role_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'role_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | case 'leader': |
| | | var param = top.reObject(data).leader; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailHeight, top.detailWidth], |
| | | shadeClose: false, |
| | | content: '../role/role_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/role/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'power': |
| | | roleId = data.id; |
| | | layer.open({ |
| | | type: 2, |
| | | title: data.name + ' 权限分配', |
| | | maxmin: true, |
| | | area: [top.detailWidth/2, '85%'], |
| | | shadeClose: false, |
| | | content: 'role_power_detail.html', |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | id: $('#id').val(), |
| | | code: $('#code').val(), |
| | | name: $('#name').val(), |
| | | leader: $('#leader').val(), |
| | | level: $('#level').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/role/edit/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | tableReload(true); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | } |
| | | layer.style(index, { |
| | | top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | $(".layui-layer-shade").remove(); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| New file |
| | |
| | | layui.use(['form', 'tree'], function() { |
| | | var form = layui.form; |
| | | var tree = layui.tree; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | |
| | | // 权限分配树形图 |
| | | var powerTree = tree.render({ |
| | | elem: '#power-tree', |
| | | id: 'powerTree', |
| | | showCheckbox: true, |
| | | data: parent.powerTreeData, |
| | | isJump: true |
| | | }); |
| | | |
| | | loadPower(); |
| | | function loadPower(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/power/"+parent.roleId+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | beforeSend: function () { |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | }, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | tree.setChecked('powerTree', res.data); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.closeAll("loading"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(save)', function () { |
| | | var param = []; |
| | | var checkData = tree.getChecked('powerTree'); |
| | | checkData.map(function (obj) { |
| | | obj.children.map(function (resource) { |
| | | |
| | | var childrens = []; |
| | | resource.children.map(function (resource) { |
| | | childrens.push(resource.id); |
| | | }); |
| | | var one = { |
| | | 'two': resource.id, |
| | | 'three': childrens |
| | | }; |
| | | param.push(one); |
| | | }) |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl+"/power/auth", |
| | | traditional: true, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'roleId': parent.roleId, |
| | | 'powers': JSON.stringify(param) |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | parent.layer.msg(res.msg); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| New file |
| | |
| | | /* |
| | | 2017 Julian Garnier |
| | | Released under the MIT license |
| | | */ |
| | | var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; |
| | | $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++}; |
| | | $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return r<e.length?{done:!1,value:e[r++]}:{done:!0}})}; |
| | | $jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,r){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var p=0,m={next:function(){if(p<e.length){var u=p++;return{value:r(u,e[u]),done:!1}}m.next=function(){return{done:!0,value:void 0}};return m.next()}};m[Symbol.iterator]=function(){return m};return m}; |
| | | $jscomp.polyfill=function(e,r,p,m){if(r){p=$jscomp.global;e=e.split(".");for(m=0;m<e.length-1;m++){var u=e[m];u in p||(p[u]={});p=p[u]}e=e[e.length-1];m=p[e];r=r(m);r!=m&&null!=r&&$jscomp.defineProperty(p,e,{configurable:!0,writable:!0,value:r})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");var $jscomp$this=this; |
| | | (function(e,r){"function"===typeof define&&define.amd?define([],r):"object"===typeof module&&module.exports?module.exports=r():e.anime=r()})(this,function(){function e(a){if(!h.col(a))try{return document.querySelectorAll(a)}catch(c){}}function r(a,c){for(var d=a.length,b=2<=arguments.length?arguments[1]:void 0,f=[],n=0;n<d;n++)if(n in a){var k=a[n];c.call(b,k,n,a)&&f.push(k)}return f}function p(a){return a.reduce(function(a,d){return a.concat(h.arr(d)?p(d):d)},[])}function m(a){if(h.arr(a))return a; |
| | | h.str(a)&&(a=e(a)||a);return a instanceof NodeList||a instanceof HTMLCollection?[].slice.call(a):[a]}function u(a,c){return a.some(function(a){return a===c})}function C(a){var c={},d;for(d in a)c[d]=a[d];return c}function D(a,c){var d=C(a),b;for(b in a)d[b]=c.hasOwnProperty(b)?c[b]:a[b];return d}function z(a,c){var d=C(a),b;for(b in c)d[b]=h.und(a[b])?c[b]:a[b];return d}function T(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,k){return c+c+d+d+k+k});var c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a); |
| | | a=parseInt(c[1],16);var d=parseInt(c[2],16),c=parseInt(c[3],16);return"rgba("+a+","+d+","+c+",1)"}function U(a){function c(a,c,b){0>b&&(b+=1);1<b&&--b;return b<1/6?a+6*(c-a)*b:.5>b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+ |
| | | 255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1<a.indexOf("translate")||"perspective"===a)return"px";if(-1<a.indexOf("rotate")||-1<a.indexOf("skew"))return"deg"}function I(a,c){return h.fnc(a)?a(c.target,c.id,c.total):a}function E(a,c){if(c in a.style)return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function J(a,c){if(h.dom(a)&& |
| | | u(W,c))return"transform";if(h.dom(a)&&(a.getAttribute(c)||h.svg(a)&&a[c]))return"attribute";if(h.dom(a)&&"transform"!==c&&E(a,c))return"css";if(null!=a[c])return"object"}function X(a,c){var d=V(c),d=-1<c.indexOf("scale")?1:0+d;a=a.style.transform;if(!a)return d;for(var b=[],f=[],n=[],k=/(\w+)\((.+?)\)/g;b=k.exec(a);)f.push(b[1]),n.push(b[2]);a=r(n,function(a,b){return f[b]===c});return a.length?a[0]:d}function K(a,c){switch(J(a,c)){case "transform":return X(a,c);case "css":return E(a,c);case "attribute":return a.getAttribute(c)}return a[c]|| |
| | | 0}function L(a,c){var d=/^(\*=|\+=|-=)/.exec(a);if(!d)return a;var b=y(a)||0;c=parseFloat(c);a=parseFloat(a.replace(d[0],""));switch(d[0][0]){case "+":return c+a+b;case "-":return c-a+b;case "*":return c*a+b}}function F(a,c){return Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2))}function M(a){a=a.points;for(var c=0,d,b=0;b<a.numberOfItems;b++){var f=a.getItem(b);0<b&&(c+=F(d,f));d=f}return c}function N(a){if(a.getTotalLength)return a.getTotalLength();switch(a.tagName.toLowerCase()){case "circle":return 2* |
| | | Math.PI*a.getAttribute("r");case "rect":return 2*a.getAttribute("width")+2*a.getAttribute("height");case "line":return F({x:a.getAttribute("x1"),y:a.getAttribute("y1")},{x:a.getAttribute("x2"),y:a.getAttribute("y2")});case "polyline":return M(a);case "polygon":var c=a.points;return M(a)+F(c.getItem(c.numberOfItems-1),c.getItem(0))}}function Y(a,c){function d(b){b=void 0===b?0:b;return a.el.getPointAtLength(1<=c+b?c+b:0)}var b=d(),f=d(-1),n=d(1);switch(a.property){case "x":return b.x;case "y":return b.y; |
| | | case "angle":return 180*Math.atan2(n.y-f.y,n.x-f.x)/Math.PI}}function O(a,c){var d=/-?\d*\.?\d+/g,b;b=h.pth(a)?a.totalLength:a;if(h.col(b))if(h.rgb(b)){var f=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b=f?"rgba("+f[1]+",1)":b}else b=h.hex(b)?T(b):h.hsl(b)?U(b):void 0;else f=(f=y(b))?b.substr(0,b.length-f.length):b,b=c&&!/\s/g.test(b)?f+c:f;b+="";return{original:b,numbers:b.match(d)?b.match(d).map(Number):[0],strings:h.str(a)||c?b.split(d):[]}}function P(a){a=a?p(h.arr(a)?a.map(m):m(a)):[];return r(a, |
| | | function(a,d,b){return b.indexOf(a)===d})}function Z(a){var c=P(a);return c.map(function(a,b){return{target:a,id:b,total:c.length}})}function aa(a,c){var d=C(c);if(h.arr(a)){var b=a.length;2!==b||h.obj(a[0])?h.fnc(c.duration)||(d.duration=c.duration/b):a={value:a}}return m(a).map(function(a,b){b=b?0:c.delay;a=h.obj(a)&&!h.pth(a)?a:{value:a};h.und(a.delay)&&(a.delay=b);return a}).map(function(a){return z(a,d)})}function ba(a,c){var d={},b;for(b in a){var f=I(a[b],c);h.arr(f)&&(f=f.map(function(a){return I(a, |
| | | c)}),1===f.length&&(f=f[0]));d[b]=f}d.duration=parseFloat(d.duration);d.delay=parseFloat(d.delay);return d}function ca(a){return h.arr(a)?A.apply(this,a):Q[a]}function da(a,c){var d;return a.tweens.map(function(b){b=ba(b,c);var f=b.value,e=K(c.target,a.name),k=d?d.to.original:e,k=h.arr(f)?f[0]:k,w=L(h.arr(f)?f[1]:f,k),e=y(w)||y(k)||y(e);b.from=O(k,e);b.to=O(w,e);b.start=d?d.end:a.offset;b.end=b.start+b.delay+b.duration;b.easing=ca(b.easing);b.elasticity=(1E3-Math.min(Math.max(b.elasticity,1),999))/ |
| | | 1E3;b.isPath=h.pth(f);b.isColor=h.col(b.from.original);b.isColor&&(b.round=1);return d=b})}function ea(a,c){return r(p(a.map(function(a){return c.map(function(b){var c=J(a.target,b.name);if(c){var d=da(b,a);b={type:c,property:b.name,animatable:a,tweens:d,duration:d[d.length-1].end,delay:d[0].delay}}else b=void 0;return b})})),function(a){return!h.und(a)})}function R(a,c,d,b){var f="delay"===a;return c.length?(f?Math.min:Math.max).apply(Math,c.map(function(b){return b[a]})):f?b.delay:d.offset+b.delay+ |
| | | b.duration}function fa(a){var c=D(ga,a),d=D(S,a),b=Z(a.targets),f=[],e=z(c,d),k;for(k in a)e.hasOwnProperty(k)||"targets"===k||f.push({name:k,offset:e.offset,tweens:aa(a[k],d)});a=ea(b,f);return z(c,{children:[],animatables:b,animations:a,duration:R("duration",a,c,d),delay:R("delay",a,c,d)})}function q(a){function c(){return window.Promise&&new Promise(function(a){return p=a})}function d(a){return g.reversed?g.duration-a:a}function b(a){for(var b=0,c={},d=g.animations,f=d.length;b<f;){var e=d[b], |
| | | k=e.animatable,h=e.tweens,n=h.length-1,l=h[n];n&&(l=r(h,function(b){return a<b.end})[0]||l);for(var h=Math.min(Math.max(a-l.start-l.delay,0),l.duration)/l.duration,w=isNaN(h)?1:l.easing(h,l.elasticity),h=l.to.strings,p=l.round,n=[],m=void 0,m=l.to.numbers.length,t=0;t<m;t++){var x=void 0,x=l.to.numbers[t],q=l.from.numbers[t],x=l.isPath?Y(l.value,w*x):q+w*(x-q);p&&(l.isColor&&2<t||(x=Math.round(x*p)/p));n.push(x)}if(l=h.length)for(m=h[0],w=0;w<l;w++)p=h[w+1],t=n[w],isNaN(t)||(m=p?m+(t+p):m+(t+" ")); |
| | | else m=n[0];ha[e.type](k.target,e.property,m,c,k.id);e.currentValue=m;b++}if(b=Object.keys(c).length)for(d=0;d<b;d++)H||(H=E(document.body,"transform")?"transform":"-webkit-transform"),g.animatables[d].target.style[H]=c[d].join(" ");g.currentTime=a;g.progress=a/g.duration*100}function f(a){if(g[a])g[a](g)}function e(){g.remaining&&!0!==g.remaining&&g.remaining--}function k(a){var k=g.duration,n=g.offset,w=n+g.delay,r=g.currentTime,x=g.reversed,q=d(a);if(g.children.length){var u=g.children,v=u.length; |
| | | if(q>=g.currentTime)for(var G=0;G<v;G++)u[G].seek(q);else for(;v--;)u[v].seek(q)}if(q>=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q<k)b(q);else if(q<=n&&0!==r&&(b(0),x&&e()),q>=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime= |
| | | 0;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1<a&&v.splice(a,1);g.paused=!0};g.play=function(){g.paused&&(g.paused=!1,t=0,l=d(g.currentTime),v.push(g),B||ia())};g.reverse=function(){g.reversed=!g.reversed;t=0;l=d(g.currentTime)};g.restart=function(){g.pause(); |
| | | g.reset();g.play()};g.finished=m;g.reset();g.autoplay&&g.play();return g}var ga={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},S={duration:1E3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},W="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),H,h={arr:function(a){return Array.isArray(a)},obj:function(a){return-1<Object.prototype.toString.call(a).indexOf("Object")}, |
| | | pth:function(a){return h.obj(a)&&a.hasOwnProperty("totalLength")},svg:function(a){return a instanceof SVGElement},dom:function(a){return a.nodeType||h.svg(a)},str:function(a){return"string"===typeof a},fnc:function(a){return"function"===typeof a},und:function(a){return"undefined"===typeof a},hex:function(a){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)},rgb:function(a){return/^rgb/.test(a)},hsl:function(a){return/^hsl/.test(a)},col:function(a){return h.hex(a)||h.rgb(a)||h.hsl(a)}},A=function(){function a(a, |
| | | d,b){return(((1-3*b+3*d)*a+(3*b-6*d))*a+3*d)*a}return function(c,d,b,f){if(0<=c&&1>=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0=== |
| | | n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0<n?h=m:l=m;while(1e-7<Math.abs(n)&&10>++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25, |
| | | .46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)? |
| | | d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;d<b;)v[d]&&v[d].tick(c),d++;a()}else cancelAnimationFrame(B),B=0}return a}();q.version="2.2.0";q.speed=1;q.running=v;q.remove= |
| | | function(a){a=P(a);for(var c=v.length;c--;)for(var d=v[c],b=d.animations,f=b.length;f--;)u(a,b[f].animatable.target)&&(b.splice(f,1),b.length||d.pause())};q.getValue=K;q.path=function(a,c){var d=h.str(a)?e(a)[0]:a,b=c||100;return function(a){return{el:d,property:a,totalLength:N(d)*(b/100)}}};q.setDashoffset=function(a){var c=N(a);a.setAttribute("stroke-dasharray",c);return c};q.bezier=A;q.easings=Q;q.timeline=function(a){var c=q(a);c.pause();c.duration=0;c.add=function(d){c.children.forEach(function(a){a.began= |
| | | !0;a.completed=!0});m(d).forEach(function(b){var d=z(b,D(S,a||{}));d.targets=d.targets||a.targets;b=c.duration;var e=d.offset;d.autoplay=!1;d.direction=c.direction;d.offset=h.und(e)?b:L(e,b);c.began=!0;c.completed=!0;c.seek(d.offset);d=q(d);d.began=!0;d.completed=!0;d.duration>b&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q}); |
| New file |
| | |
| | | /*! For license information please see main.js.LICENSE.txt */ |
| | | !function(){var e={26981:function(e,t,n){"use strict";n(11983);var r,i=(r=n(40115))&&r.__esModule?r:{default:r};i.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),i.default._babelPolyfill=!0},11983:function(e,t,n){"use strict";n(16266),n(10990),n(70911),n(14160),n(6197),n(96728),n(54039),n(93568),n(78051),n(38250),n(15434),n(54952),n(96337),n(35666)},67084:function(e,t,n){"use strict";var r=n(90887);t.Z={updateVelocity:function(e,t,n){r.vec3.scale(t,t,1/n),r.vec3.add(e,e,t)},applyFriction:function(e,t,n){var i=[0,0,0];r.vec3.scale(i,e,-1),r.vec3.normalize(i,i),r.vec3.scale(i,i,t),r.vec3.add(e,e,i)},applyDrag:function(e,t){var n=[0,0,0];r.vec3.scale(n,e,-1),r.vec3.normalize(n,n),r.vec3.scale(n,n,r.vec3.length(e)*t),r.vec3.add(e,e,n)},applyHook:function(e,t,n,i,o){var a=[0,0,0];r.vec3.sub(a,e,n);var s=r.vec3.length(a)-i;r.vec3.normalize(a,a),r.vec3.scale(a,a,-1*o*s),r.vec3.add(t,t,a)}}},97355:function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{Z:function(){return l}});var c=n(2212),u=n(67084).Z,l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(f,e);var t,n,r,c,l=(r=f,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=s(r);if(c){var n=s(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)});function f(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(i=l.call(this,e,t,n,r)).k=.02,i.d=.2,i.velocity=[0,0,0],i.acceleration=[0,0,0],i.anchor=[0,0,0],i.lookK=.02,i.lookD=.2,i.lookVelocity=[0,0,0],i.lookAcceleration=[0,0,0],i.lookAnchor=[0,0,0],i}return t=f,(n=[{key:"updatePosition",value:function(){u.applyHook(this.velocity,this.acceleration,this.anchor,0,this.k),u.applyDrag(this.acceleration,this.d),u.updateVelocity(this.velocity,this.acceleration,1)}},{key:"updateLook",value:function(){u.applyHook(this.lookVelocity,this.lookAcceleration,this.lookAnchor,0,this.lookK),u.applyDrag(this.lookAcceleration,this.lookD),u.updateVelocity(this.lookVelocity,this.lookAcceleration,1)}},{key:"render",value:function(){this.updatePosition(),this.updateLook(),this.position.set(this.velocity[0],this.velocity[1],this.velocity[2]),this.lookAt(this.lookVelocity[0],this.lookVelocity[1],this.lookVelocity[2])}}])&&i(t.prototype,n),f}(c.PerspectiveCamera)},46365:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.side=0,this.aScene=new i.Scene,this.vScene=new i.Scene,this.camera=new i.PerspectiveCamera(45,1,1,1e3),this.option={type:i.FloatType,minFilter:i.LinearFilter,magFilter:i.NearestFilter},this.acceleration=[new i.WebGLRenderTarget(0,0,this.option),new i.WebGLRenderTarget(0,0,this.option)],this.velocity=[new i.WebGLRenderTarget(0,0,this.option),new i.WebGLRenderTarget(0,0,this.option)],this.aUniforms={resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},velocity:{type:"t",value:null},acceleration:{type:"t",value:null},time:{type:"f",value:0}},this.vUniforms={resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},side:{type:"f",value:0},velocityInit:{type:"t",value:null},velocity:{type:"t",value:null},acceleration:{type:"t",value:null},time:{type:"f",value:0}},this.accelerationMesh=this.createMesh(this.aUniforms,t,n),this.velocityMesh=this.createMesh(this.vUniforms,r,o),this.uvs=[],this.targetIndex=0}var t,o;return t=e,(o=[{key:"init",value:function(e,t,r,o){this.side=Math.ceil(Math.sqrt(t.length/3)),this.vUniforms.side.value=this.side;for(var a=[],s=0;s<3*Math.pow(this.side,2);s+=3)null!=t[s]?(a[s+0]=t[s+0],a[s+1]=t[s+1],a[s+2]=t[s+2],this.uvs[s/3*2+0]=s/3%this.side/(this.side-1),this.uvs[s/3*2+1]=Math.floor(s/3/this.side)/(this.side-1)):(a[s+0]=0,a[s+1]=0,a[s+2]=0);if(r){var c=Object.keys(r);if(c.length)for(s=0;s<c.length;s++){for(var u=r[c[s]],l=u.array.length;l<a.length/3*u.itemSize;l++)u.array.push(0);this.accelerationMesh.geometry.setAttribute(c[s],new i.BufferAttribute(new Float32Array(u.array),u.itemSize))}}if(o){var f=Object.keys(o);if(f.length)for(s=0;s<f.length;s++){var h=o[f[s]];for(l=h.array.length;l<a.length/3*h.itemSize;l++)h.array.push(0);this.velocityMesh.geometry.setAttribute(f[s],new i.BufferAttribute(new Float32Array(h.array),h.itemSize))}}this.vUniforms.velocityInit.value=new i.DataTexture(new Float32Array(a),this.side,this.side,i.RGBFormat,i.FloatType),this.vUniforms.velocityInit.value.needsUpdate=!0;var v=new i.Mesh(new i.PlaneGeometry(2,2),new i.ShaderMaterial({uniforms:{velocity:{type:"t",value:this.vUniforms.velocityInit.value}},vertexShader:n(58679).Z,fragmentShader:n(4575).Z}));for(s=0;s<2;s++)this.acceleration[s].setSize(this.side,this.side),this.velocity[s].setSize(this.side,this.side);this.vScene.add(this.camera),this.vScene.add(v),e.setRenderTarget(this.velocity[0]),e.render(this.vScene,this.camera),e.setRenderTarget(this.velocity[1]),e.render(this.vScene,this.camera),this.vScene.remove(v),this.vScene.add(this.velocityMesh),this.aScene.add(this.accelerationMesh)}},{key:"createMesh",value:function(e,t,n){return new i.Mesh(new i.PlaneGeometry(2,2),new i.ShaderMaterial({uniforms:e,vertexShader:t,fragmentShader:n}))}},{key:"render",value:function(e,t){var n=Math.abs(this.targetIndex-1),r=this.targetIndex;this.aUniforms.acceleration.value=this.acceleration[n].texture,this.aUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.acceleration[r]),e.render(this.aScene,this.camera),this.vUniforms.acceleration.value=this.acceleration[r].texture,this.vUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.velocity[n]),e.render(this.vScene,this.camera),this.targetIndex=n,this.aUniforms.time.value+=t,this.vUniforms.time.value+=t}},{key:"getBufferAttributeUv",value:function(){return new i.BufferAttribute(new Float32Array(this.uvs),2)}},{key:"getCurrentVelocity",value:function(){return this.velocity[Math.abs(this.targetIndex-1)].texture}},{key:"getCurrentAcceleration",value:function(){return this.acceleration[Math.abs(this.targetIndex-1)].texture}},{key:"mergeAUniforms",value:function(e){this.aUniforms=Object.assign(this.aUniforms,e)}},{key:"mergeVUniforms",value:function(e){this.vUniforms=Object.assign(this.vUniforms,e)}},{key:"resize",value:function(e){this.aUniforms.resolution.value.set(document.body.clientWidth,window.clientHeight),this.vUniforms.resolution.value.set(document.body.clientWidth,window.clientHeight)}}])&&r(t.prototype,o),e}()},59170:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2212),i=new r.TextureLoader;function o(e,t){var n=Object.keys(e).length,o={},a=0,s=function(){var s=c;e.hasOwnProperty(s)&&i.load(e[s],(function(e){e.repeat=r.RepeatWrapping,o[s]=e,++a>=n&&t(o)}))};for(var c in e)s()}},89813:function(e,t,n){"use strict";function r(e){e.x=e.x/document.body.clientWidth*2-1,e.y=-e.y/window.innerHeight*2+1}n.d(t,{Z:function(){return r}})},60287:function(e,t,n){"use strict";function r(){for(var e=decodeURIComponent(location.search.substring(1)).split("&"),t=0;t<e.length;t++)if(!(e[t].indexOf("sketch_id")<0)){var n=e[t].replace("sketch_id=","");switch(n=parseInt(n,10)){case 9:location.href="/sketch-threejs/sketch/attract.html";break;case 8:location.href="/sketch-threejs/sketch/hole.html";break;case 7:location.href="/sketch-threejs/sketch/metal_cube.html";break;case 6:location.href="/sketch-threejs/sketch/distort.html";break;case 5:location.href="/sketch-threejs/sketch/image_data.html";break;case 4:location.href="/sketch-threejs/sketch/gallery.html";break;case 3:location.href="/sketch-threejs/sketch/comet.html";break;case 2:location.href="/sketch-threejs/sketch/hyper_space.html";break;case 1:location.href="/sketch-threejs/sketch/fire_ball.html"}}}n.d(t,{Z:function(){return r}})},79268:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},rotate:{type:"f",value:10*Math.random()}},this.obj=this.createObj(),this.obj.position.set(t,n,r)}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.BoxGeometry(100,100,100),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(38577).Z,fragmentShader:n(85458).Z,transparent:!0,wireframe:!0}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},14908:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj=this.createObj(),this.obj.position.set(0,-200,0),this.obj.rotation.set(o.radians(-90),0,0)}var t,a;return t=e,(a=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(1024,1024,32,32),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(72406).Z,fragmentShader:n(5860).Z,transparent:!0,wireframe:!0}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},49115:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},texture:{type:"t",value:t}},this.obj=this.createObj(t),this.time=1}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(47925).Z,fragmentShader:n(6595).Z}))}},{key:"render",value:function(e){this.uniforms.time.value+=e*this.time}},{key:"resize",value:function(){this.uniforms.resolution.value.set(document.body.clientWidth,window.innerHeight)}}])&&r(t.prototype,o),e}()},98899:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=function(e,t,n){var r=[],i=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],o=[n[0]-e[0],n[1]-e[1],n[2]-e[2]];r[0]=i[1]*o[2]-i[2]*o[1],r[1]=i[2]*o[0]-i[0]*o[2],r[2]=i[0]*o[1]-i[1]*o[0];for(var a=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2],2),s=0;s<r.length;s++)r[s]=r[s]/a;return r},a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj=this.createObj()}var t,a;return t=e,(a=[{key:"createObj",value:function(){for(var e=new i.OctahedronGeometry(90,20),t=e.attributes.position.array,r=[],a=[],s=[],c=0;c<t.length;c+=9){var u=o([t[c+0],t[c+1],t[c+2]],[t[c+3],t[c+4],t[c+5]],[t[c+6],t[c+7],t[c+8]]);r.push(u[0],u[1],u[2],u[0],u[1],u[2],u[0],u[1],u[2]);var l=[(t[c+0]+t[c+3]+t[c+6])/3,(t[c+1]+t[c+4]+t[c+7])/3,(t[c+2]+t[c+5]+t[c+8])/3],f=.5*Math.random();a.push(l[0],l[1],l[2],l[0],l[1],l[2],l[0],l[1],l[2]),s.push(f,f,f)}var h=new Float32Array(r),v=new Float32Array(a),d=new Float32Array(s);return e.setAttribute("faceNormal",new i.BufferAttribute(h,3)),e.setAttribute("center",new i.BufferAttribute(v,3)),e.setAttribute("delay",new i.BufferAttribute(d,1)),new i.Mesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(33821).Z,fragmentShader:n(1483).Z,transparent:!0,side:i.DoubleSide}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},68396:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.OctahedronGeometry(150,20);return new i.Mesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(14595).Z,fragmentShader:n(99133).Z,transparent:!0,side:i.DoubleSide,depthWrite:!1}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}()},77583:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},resolution:{type:"v2",value:new i.Vector2},texture:{type:"t",value:null}},this.obj,this.isLoaded=!1}var t,o;return t=e,(o=[{key:"loadTexture",value:function(e){var t=this;(new i.TextureLoader).load("/sketch-threejs/img/index/tex_title.png",(function(n){n.magFilter=i.NearestFilter,n.minFilter=i.NearestFilter,t.uniforms.texture.value=n,t.obj=t.createObj(),t.isLoaded=!0,e()}))}},{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(256,64,40,10),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(47807).Z,fragmentShader:n(47272).Z,transparent:!0}))}},{key:"render",value:function(e){this.isLoaded&&(this.uniforms.time.value+=e)}}])&&r(t.prototype,o),e}()},78948:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2212),i=n(38314),o=n(93604).Z,a=n(77583).Z,s=n(98899).Z,c=n(68396).Z,u=n(14908).Z,l=n(79268).Z,f=n(49115).Z;function h(){var e=new o,t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({antialias:!1,canvas:t}),h=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),v=new r.Scene,d=new r.Scene,p=new r.OrthographicCamera(-1,1,1,-1,0,1),m=new r.PerspectiveCamera(45,document.body.clientWidth/window.innerHeight,1,1e4),y=new r.Clock,g=new a,x=new s,b=new c,w=new u,M=[new l(400,-500,200),new l(-350,-600,-50),new l(-150,-700,-150),new l(-500,-900,0),new l(100,-1100,250),new l(-100,-1200,-300),new l(150,-1500,-100)],_=new f(h.texture),S=document.getElementsByClassName("js-transition-intro"),P=function(){t.width=document.body.clientWidth,t.height=window.innerHeight,m.aspect=document.body.clientWidth/window.innerHeight,m.updateProjectionMatrix(),h.setSize(document.body.clientWidth,window.innerHeight),n.setSize(document.body.clientWidth,window.innerHeight),_.resize()};n.setSize(document.body.clientWidth,window.innerHeight),n.setClearColor(1118481,1),m.position.z=800,v.add(_.obj),g.loadTexture((function(){d.add(g.obj),d.add(x.obj),d.add(b.obj),d.add(w.obj);for(var e=0;e<M.length;e++)d.add(M[e].obj);!function(){for(var e=0;e<S.length;e++)S[e].classList.add("is-shown")}()})),y.start(),window.addEventListener("resize",i((function(){P()})),1e3),e.renderNext=function(){e.isValidSmooth()?m.position.y=.6*e.hookes.contents.velocity[1]:m.position.y=-1*e.scrollTop},P(),function e(){!function(){var e=y.getDelta();g.render(e),x.render(e),b.render(e),w.render(e);for(var t=0;t<M.length;t++)M[t].render(e);n.setRenderTarget(h),n.render(d,m),_.render(e),n.setRenderTarget(null),n.render(v,p)}(),requestAnimationFrame(e)}(),e.start()}},12390:function(e,t,n){var r,i=n(2212);n(45695),e.exports=((r=function(){this.velocity=new i.Vector2,this.acceleration=new i.Vector2,this.anchor=new i.Vector2,this.mass=1}).prototype.updateVelocity=function(){this.acceleration.divideScalar(this.mass),this.velocity.add(this.acceleration)},r.prototype.applyForce=function(e){this.acceleration.add(e)},r.prototype.applyFriction=function(e,t){var n=this.acceleration.clone();t||(t=1),n.multiplyScalar(-1),n.normalize(),n.multiplyScalar(e),this.applyForce(n)},r.prototype.applyDrag=function(e){var t=this.acceleration.clone();t.multiplyScalar(-1),t.normalize(),t.multiplyScalar(this.acceleration.length()*e),this.applyForce(t)},r.prototype.applyHook=function(e,t){var n=this.velocity.clone().sub(this.anchor),r=n.length()-e;n.normalize(),n.multiplyScalar(-1*t*r),this.applyForce(n)},r)},69338:function(e,t,n){var r,i=n(2212);n(45695),e.exports=((r=function(){this.velocity=new i.Vector3,this.acceleration=new i.Vector3,this.anchor=new i.Vector3,this.mass=1}).prototype.updateVelocity=function(){this.acceleration.divideScalar(this.mass),this.velocity.add(this.acceleration)},r.prototype.applyForce=function(e){this.acceleration.add(e)},r.prototype.applyFriction=function(e,t){var n=this.acceleration.clone();t||(t=1),n.multiplyScalar(-1),n.normalize(),n.multiplyScalar(e),this.applyForce(n)},r.prototype.applyDrag=function(e){var t=this.acceleration.clone();t.multiplyScalar(-1),t.normalize(),t.multiplyScalar(this.acceleration.length()*e),this.applyForce(t)},r.prototype.applyHook=function(e,t){var n=this.velocity.clone().sub(this.anchor),r=n.length()-e;n.normalize(),n.multiplyScalar(-1*t*r),this.applyForce(n)},r)},97719:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(2212),i=n(45695),o=n.n(i),a=n(69338),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(c,e);var t,n,r,i,a=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(r);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function c(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(i=a.call(this,e,t,n,r)).force={position:new(s()),look:new(s())},i.up.set(0,1,0),i}return t=c,(n=[{key:"updatePosition",value:function(){this.position.copy(this.force.position.velocity)}},{key:"updateLook",value:function(){this.lookAt(this.force.look.velocity.x,this.force.look.velocity.y,this.force.look.velocity.z)}},{key:"reset",value:function(){this.setPolarCoord(),this.lookAtCenter()}},{key:"resize",value:function(e,t){this.aspect=e/t,this.updateProjectionMatrix()}},{key:"setPolarCoord",value:function(e,t,n){this.force.position.anchor.copy(o().getPolarCoord(e,t,n))}},{key:"lookAtCenter",value:function(){this.lookAt(0,0,0)}}])&&u(t.prototype,n),c}(r.PerspectiveCamera)},5097:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(2212),i=n(45695),o=n.n(i),a=n(69338),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(c,e);var t,n,r,i,a=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(r);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function c(e,t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(r=a.call(this,e,t,n)).force=new(s()),r}return t=c,(n=[{key:"updatePosition",value:function(){this.position.copy(this.force.velocity)}},{key:"setPolarCoord",value:function(e,t,n){this.position.copy(o().getPolarCoord(e,t,n))}}])&&u(t.prototype,n),c}(r.HemisphereLight)},42935:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(2212),i=n(45695),o=n.n(i),a=n(69338),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(c,e);var t,n,r,i,a=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(r);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function c(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(i=a.call(this,e,t,n,r)).force=new(s()),i}return t=c,(n=[{key:"updatePosition",value:function(){this.position.copy(this.force.velocity)}},{key:"setPolarCoord",value:function(e,t,n){this.position.copy(o().getPolarCoord(e,t,n))}}])&&u(t.prototype,n),c}(r.PointLight)},33286:function(e,t,n){n(2212),n(45695);var r,i=n(69338);e.exports=(((r=function(){this.size=0,this.time=0,this.is_active=!1,i.call(this)}).prototype=Object.create(i.prototype)).constructor=r,r.prototype.init=function(e){this.velocity=e.clone(),this.anchor=e.clone(),this.acceleration.set(0,0,0),this.time=0},r.prototype.activate=function(){this.is_active=!0},r.prototype.inactivate=function(){this.is_active=!1},r)},7318:function(e,t,n){var r,i=n(2212),o=(n(45695),n(69338));e.exports=(((r=function(){this.geometry=new i.BufferGeometry,this.material=null,this.obj,o.call(this)}).prototype=Object.create(o.prototype)).constructor=r,r.prototype.init=function(e){this.material=new i.ShaderMaterial({uniforms:{color:{type:"c",value:new i.Color(16777215)},texture:{type:"t",value:e.texture}},vertexShader:e.vs,fragmentShader:e.fs,transparent:!0,depthWrite:!1,blending:e.blending}),this.geometry.setAttribute("position",new i.BufferAttribute(e.positions,3)),this.geometry.setAttribute("customColor",new i.BufferAttribute(e.colors,3)),this.geometry.setAttribute("vertexOpacity",new i.BufferAttribute(e.opacities,1)),this.geometry.setAttribute("size",new i.BufferAttribute(e.sizes,1)),this.obj=new i.Points(this.geometry,this.material),e.scene.add(this.obj)},r.prototype.updatePoints=function(){this.obj.position.copy(this.velocity),this.obj.geometry.attributes.position.needsUpdate=!0,this.obj.geometry.attributes.vertexOpacity.needsUpdate=!0,this.obj.geometry.attributes.size.needsUpdate=!0,this.obj.geometry.attributes.customColor.needsUpdate=!0},r)},45695:function(e,t,n){var r=n(2212);e.exports={getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e))+e},getDegree:function(e){return e/Math.PI*180},getRadian:function(e){return e*Math.PI/180},getPolarCoord:function(e,t,n){var i=Math.cos(e)*Math.cos(t)*n,o=Math.cos(e)*Math.sin(t)*n,a=Math.sin(e)*n;return new r.Vector3(i,a,o)}}},22732:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(46365),c=n(97719),u=n(45695),l=n.n(u);function f(){var e,t,i,u,f,h,v=document.getElementById("canvas-webgl"),d=new r.WebGL1Renderer({antialias:!0,canvas:v}),p=new r.Scene,m=new c.Z(35,window.innerWidth/window.innerHeight,1,1e4),y=(new r.Clock,1e3),g=null,x=function(){for(var e=new r.BufferGeometry,t=[],i=[],o=[],a=[],s=0;s<Math.pow(y,2);s++)t.push(0,0,0),i.push(s%y*(1/999),Math.floor(s/y)*(1/999)),o.push(l().getRandomInt(0,120)/360,.8,1),a.push(l().getRandomInt(1,100));var c=new Float32Array(t);e.setAttribute("position",new r.BufferAttribute(c,3));var u=new Float32Array(i);e.setAttribute("uv2",new r.BufferAttribute(u,2));var f=new Float32Array(o);e.setAttribute("color",new r.BufferAttribute(f,3));var h=new Float32Array(a);e.setAttribute("mass",new r.BufferAttribute(h,1));var v=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0},velocity:{type:"t",value:new r.Texture},acceleration:{type:"t",value:new r.Texture}},vertexShader:n(33524).Z,fragmentShader:n(46663).Z,transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return new r.Points(e,v)}(),b=function(){v.width=window.innerWidth,v.height=window.innerHeight,m.aspect=window.innerWidth/window.innerHeight,m.updateProjectionMatrix(),d.setSize(window.innerWidth,window.innerHeight)};d.setSize(window.innerWidth,window.innerHeight),d.setClearColor(1118481,1),m.position.set(1e3,1e3,1e3),m.lookAt(new r.Vector3),e=new r.Vector2,t=new r.Vector2,i=new r.Vector2,u=function(t,n,r){e.set(t,n),(0,a.Z)(e)},f=function(e,n,r){t.set(e,n),(0,a.Z)(t),g.accelerationMesh.material.uniforms.anchor.value.copy(t)},h=function(e,t,n){i.set(e,t)},window.addEventListener("resize",o()((function(){b()})),1e3),v.addEventListener("mousedown",(function(e){e.preventDefault(),u(e.clientX,e.clientY)})),v.addEventListener("mousemove",(function(e){e.preventDefault(),f(e.clientX,e.clientY)})),v.addEventListener("mouseup",(function(e){e.preventDefault(),h(e.clientX,e.clientY)})),v.addEventListener("touchstart",(function(e){e.preventDefault(),u(e.touches[0].clientX,e.touches[0].clientY)})),v.addEventListener("touchmove",(function(e){e.preventDefault(),f(e.touches[0].clientX,e.touches[0].clientY)})),v.addEventListener("touchend",(function(e){e.preventDefault(),h(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),i.set(0,0),g.accelerationMesh.material.uniforms.anchor.value.set(0,0,0)})),(g=new s.Z(n(47347).Z,n(64928).Z,n(40354).Z,n(95669).Z)).init(d,function(){for(var e=[],t=0;t<Math.pow(y,2);t++){var n=l().getPolarCoord(l().getRadian(l().getRandomInt(0,360)),l().getRadian(l().getRandomInt(0,360)),l().getRandomInt(10,1e3));e.push(n.x,n.y/10,n.z)}return e}()),g.accelerationMesh.material.uniforms.anchor={type:"v2",value:new r.Vector2},p.add(x),m.force.position.anchor.set(0,15,600),m.force.look.anchor.set(0,0,0),b(),function e(){g.render(d),x.material.uniforms.time.value++,x.material.uniforms.velocity.value=g.getCurrentVelocity(),x.material.uniforms.acceleration.value=g.getCurrentAcceleration(),m.force.position.applyHook(0,.025),m.force.position.applyDrag(.2),m.force.position.updateVelocity(),m.updatePosition(),m.force.look.applyHook(0,.2),m.force.look.applyDrag(.4),m.force.look.updateVelocity(),m.updateLook(),d.setRenderTarget(null),d.render(p,m),requestAnimationFrame(e)}()}},88811:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=n(2212),i=n(38314),o=n.n(i);function a(e){return(a="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})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(f,e);var t,n,i,o,a=(i=f,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(i);if(o){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function f(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(i=a.call(this,e,t,n,r)).time=0,i.isActive=!1,i}return t=f,(n=[{key:"start",value:function(){this.aspect=1.5,this.far=1e3,this.setFocalLength(50),this.position.set(0,14,45),this.lookAt(new r.Vector3(0,-1,0)),this.isActive=!0}},{key:"update",value:function(e){!1!==this.isActive&&(this.time+=e)}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&s(t.prototype,n),f}(r.PerspectiveCamera),h=n(17393),v=n.n(h);function d(e){return(d="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})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g(i);if(o){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return y(this,e)});function s(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(i=a.call(this,e,t,n,r)).distance=0,i}return t=s,(n=[{key:"start",value:function(){this.aspect=1,this.far=1e3,this.setFocalLength(50),this.distance=30*Math.abs(2*Math.tan(v().radians(this.fov)/2))}},{key:"update",value:function(e){this.position.copy(e.position).normalize().multiplyScalar(this.distance),this.lookAt(new r.Vector3)}}])&&p(t.prototype,n),s}(r.PerspectiveCamera);function b(e){return(b="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(i);if(o){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.TorusKnotGeometry(2,.5,60,4),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},alpha:{type:"f",value:0},renderOutline:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float renderOutline;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + normal * renderOutline * 0.3, 1.0);\n\n vPosition = mPosition.xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float alpha;\nuniform float renderOutline;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, -1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = dot(normal, light) * 0.5;\n\n vec3 hsv = vec3(0.5 + alpha + diff * 0.8, 0.4, 0.8);\n vec3 rgb = convertHsvToRgb(hsv);\n\n vec3 color = (rgb + diff) * (1.0 - renderOutline);\n vec3 colorOutline = vec3(1.0) * renderOutline;\n\n gl_FragColor = vec4(color + colorOutline, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="TorusKnot",e.isActive=!1,e}return t=s,(n=[{key:"start",value:function(e){this.isActive=!0,this.rotation.set(v().radians(360*Math.random()),v().radians(360*Math.random()),v().radians(360*Math.random())),this.material.uniforms.alpha.value=e}},{key:"update",value:function(e,t){!1!==this.isActive&&(this.rotation.set(this.rotation.x+e,this.rotation.y+e,this.rotation.z),this.material.uniforms.time.value+=e)}}])&&w(t.prototype,n),s}(r.Mesh);function T(e){return(T="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})(e)}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=L(i);if(o){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return z(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(15,15),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},alpha:{type:"f",value:0},outlineTex:{type:"t",value:null},noiseTex:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float alpha;\nuniform sampler2D outlineTex;\nuniform sampler2D noiseTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nconst float blurIteration = 8.0;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // calculate blur mask.\n vec4 destColor = vec4(0.0);\n for (float i = 0.0; i < blurIteration; i++) {\n for (float j = 0.0; j < blurIteration; j++) {\n vec2 p = (vec2(i, j) / blurIteration * 2.0 - 1.0) / 512.0 * 60.0;\n destColor += texture2D(outlineTex, vUv + p) / pow(blurIteration, 2.0);\n }\n }\n float blurMask = smoothstep(0.0, 0.8, destColor.r) * (1.0 - smoothstep(0.5, 1.0, destColor.r));\n\n float noise1 = texture2D(noiseTex, vUv + vec2(0.0, time * 0.1 + alpha)).r;\n float noise2 = texture2D(noiseTex, vUv * 2.0 - vec2(0.0, time * 0.4 + alpha)).g;\n float noise3 = texture2D(noiseTex, vUv * 3.0 + vec2(0.0, time * 0.8 + alpha)).b;\n float noise = noise1 * 0.65 + noise2 * 0.3 + noise3 * 0.05;\n\n float mask = blurMask * pow(smoothstep(0.2, 1.0, noise), 3.0) * 15.0;\n\n vec3 hsv = vec3(1.0 + mask * 0.5 + alpha, 0.8 - mask * 0.6, 0.5 + mask * 0.5);\n\n gl_FragColor = vec4(convertHsvToRgb(hsv), mask);\n}\n",transparent:!0});return(e=a.call(this,t,n)).name="Aura",e.isActive=!1,e}return t=s,(n=[{key:"start",value:function(e,t,n){this.isActive=!0,this.material.uniforms.alpha.value=e,this.material.uniforms.outlineTex.value=t,this.material.uniforms.noiseTex.value=n}},{key:"update",value:function(e,t){!1!==this.isActive&&(this.rotation.copy(t.rotation),this.material.uniforms.time.value+=e)}}])&&R(t.prototype,n),s}(r.Mesh);function A(e){return(A="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})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(i);if(o){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this)).name="AuraObject",t.obj=new P,t.aura=new C,t.add(t.aura),t.add(t.obj),t.renderTarget=new r.WebGLRenderTarget(512,512),t.alpha=e,t.radian=v().radians(360*e),t.time=0,t.isActive=!1,t}return t=s,(n=[{key:"start",value:function(e){this.obj.start(this.alpha),this.aura.start(this.alpha,this.renderTarget.texture,e),this.isActive=!0}},{key:"update",value:function(e,t,n,r,i){!1!==this.isActive&&(this.time+=e,this.radian+=e,this.obj.update(e,r),this.aura.update(e,r),t.setRenderTarget(this.renderTarget),n.add(this.obj),this.obj.material.uniforms.renderOutline.value=1,t.render(n,i),t.setRenderTarget(null),n.remove(this.obj),this.add(this.obj),this.obj.material.uniforms.renderOutline.value=0,this.position.set(11*Math.cos(this.radian),0,11*Math.sin(this.radian)))}},{key:"resize",value:function(e){}}])&&O(t.prototype,n),s}(r.Group);function j(e){return(j="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})(e)}function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e,t){return!t||"object"!==j(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var H,V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=N(i);if(o){var n=N(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return G(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(100,12,12),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},hex:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float hex;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec3 rgb = mix(\n convertHsvToRgb(vec3(0.5, 0.8, 0.05)),\n convertHsvToRgb(vec3(0.0, 0.4, 0.4)),\n vUv.y * 4.0 - 1.15\n );\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n",side:r.BackSide});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(){}}])&&U(t.prototype,n),s}(r.Mesh);function W(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}for(var q=new r.Scene,Y=new f,X=new r.Clock({autoStart:!1}),K=new r.Scene,Q=new x,J=new Array(7),$=0;$<J.length;$++){var ee=$/J.length;J[$]=new F(ee)}var te=new V,ne=new r.TextureLoader,re=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(H=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),H.setClearColor(0,1),e.next=5,Promise.all([ne.loadAsync("/sketch-threejs/img/sketch/splash/noise.png")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,Y.start(),Q.start();for(var n=0;n<J.length;n++)J[n].start(t),q.add(J[n]);te.start(),q.add(te)}));case 5:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){W(o,n,r,a,s,"next",e)}function s(e){W(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){X.start(),this.update()}},{key:"pause",value:function(){X.stop()}},{key:"update",value:function(){if(!1!==X.running){var e=X.getDelta();Y.update(e),Q.update(Y);for(var t=0;t<J.length;t++)J[t].update(e,H,K,Y,Q);H.render(q,Y)}}},{key:"resize",value:function(e){Y.resize(e);for(var t=0;t<J.length;t++)J[t].resize(Y);H.setSize(e.x,e.y)}}])&&Z(t.prototype,n),e}();function ie(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function oe(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ie(o,r,i,a,s,"next",e)}function s(e){ie(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ae(){return se.apply(this,arguments)}function se(){return(se=oe(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new re,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},24491:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.instances=500,this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(1,1e3,1,2,128);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),a=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),s=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),c=0,u=this.instances;c<u;c++)r.setXYZ(c,300*((Math.random()+Math.random()+Math.random())/3*2-1),0,150*((Math.random()+Math.random()+Math.random())/3*2-1)),a.setXYZ(c,90*(2*o.randomInt(0,1)-1)+60*(2*Math.random()-1)),s.setXYZ(c,2*Math.random());e.setAttribute("instancePosition",r),e.setAttribute("rotate",a),e.setAttribute("delay",s);var l=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(61915).Z,fragmentShader:n(71883).Z,depthWrite:!1,transparent:!0,side:i.DoubleSide,blending:i.AdditiveBlending});this.obj=new i.InstancedMesh(e,l,this.instances)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},45032:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2212),i=n(38314),o=n(24491).Z;function a(){var e=new r.Vector2,t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({antialias:!0,canvas:t}),a=new r.Scene,s=new r.PerspectiveCamera(120,1,1,1e4),c=new r.Clock,u=new r.Vector2,l=new r.Vector2,f=new r.Vector2,h=new o,v=function(){e.set(document.body.clientWidth,window.innerHeight),t.width=e.x,t.height=e.y,s.aspect=e.x/e.y,s.updateProjectionMatrix(),n.setSize(e.x,e.y)};window.addEventListener("resize",i(v,1e3)),t.addEventListener("mousedown",(function(e){e.preventDefault(),u.set(e.clientX,e.clientY)})),document.addEventListener("mousemove",(function(e){e.preventDefault(),l.set(e.clientX,e.clientY)})),document.addEventListener("mouseup",(function(e){e.preventDefault(),f.set(e.clientX,e.clientY)})),t.addEventListener("touchstart",(function(e){e.preventDefault(),u.set(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchmove",(function(e){e.preventDefault(),l.set(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchend",(function(e){e.preventDefault(),f.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),v(),h.createObj(),a.add(h.obj),n.setClearColor(921102,1),s.position.set(0,0,100),s.lookAt(new r.Vector3(0,0,0)),function e(){var t;t=c.getDelta(),h.render(t),n.render(a,s),requestAnimationFrame(e)}()}},53739:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){for(var e=new i.BufferGeometry,t=[],r=50,o=0;o<r;o++)for(var a=0;a<r;a++)for(var s=0;s<r;s++){var c=70*(s/r*2-1),u=70*(a/r*2-1),l=70*(o/r*2-1);t.push(c,u,l)}var f=new i.BufferAttribute(new Float32Array(t),3);e.setAttribute("position",f);var h=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(61765).Z,fragmentShader:n(7401).Z,transparent:!0,depthWrite:!1});this.obj=new i.Points(e,h)}},{key:"render",value:function(e){this.uniforms.time.value+=e,this.obj.rotation.set(.005*this.uniforms.time.value,.02*this.uniforms.time.value,.004*this.uniforms.time.value)}}])&&r(t.prototype,o),e}()},75255:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2212),i=n(38314),o=n(53739).Z;function a(){var e=new r.Vector2,t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({antialias:!1,canvas:t}),a=new r.Scene,s=new r.PerspectiveCamera(90,1,1,1e4),c=new r.Clock,u=new r.Vector2,l=new r.Vector2,f=new r.Vector2,h=new o,v=function(){e.set(document.body.clientWidth,window.innerHeight),t.width=e.x,t.height=e.y,s.aspect=e.x/e.y,s.updateProjectionMatrix(),n.setSize(e.x,e.y)};window.addEventListener("resize",i(v,1e3)),t.addEventListener("mousedown",(function(e){e.preventDefault(),u.set(e.clientX,e.clientY)})),document.addEventListener("mousemove",(function(e){e.preventDefault(),l.set(e.clientX,e.clientY)})),document.addEventListener("mouseup",(function(e){e.preventDefault(),f.set(e.clientX,e.clientY)})),t.addEventListener("touchstart",(function(e){e.preventDefault(),u.set(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchmove",(function(e){e.preventDefault(),l.set(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchend",(function(e){e.preventDefault(),f.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),v(),h.createObj(),a.add(h.obj),n.setClearColor(15329769,1),s.position.set(10,10,50),s.lookAt(new r.Vector3),function e(){var t;t=c.getDelta(),h.render(t),n.render(a,s),requestAnimationFrame(e)}()}},54614:function(e,t,n){"use strict";n.d(t,{Z:function(){return H}});var r=n(2212),i=n(38314),o=n.n(i),a=n(29130),s=n.n(a),c=n(17393),u=n.n(c);function l(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var h=new(n(48840).L),v=new r.TextureLoader,d=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},tex:{type:"t",value:null}},this.obj}var t,i,o,a;return t=e,(i=[{key:"createObj",value:(o=regeneratorRuntime.mark((function e(){var t,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h.loadAsync("/sketch-threejs/model/buddha/buddha_head.obj");case 2:return t=e.sent,e.next=5,v.loadAsync("/sketch-threejs/model/buddha/buddha_ao.jpg");case 5:this.uniforms.tex.value=e.sent,i=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(11530).Z,fragmentShader:n(34566).Z}),this.obj=new r.Mesh(t.children[0].geometry,i),this.obj.position.y=16,this.obj.scale.set(7,7,7);case 10:case"end":return e.stop()}}),e,this)})),a=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){l(i,n,r,a,s,"next",e)}function s(e){l(i,n,r,a,s,"throw",e)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"render",value:function(e,t,n){this.uniforms.time.value+=e,this.obj.rotation.set(u().radians(t-15),u().radians(n+15-5*this.uniforms.time.value),u().radians(-20))}}])&&f(t.prototype,i),e}();function p(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y=new r.TextureLoader,g=void 0,x=void 0,b=void 0,w=void 0,M=void 0,_=void 0,S=void 0,P=0,T=0,R=0,E=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},texHannyaShingyo:{type:"t",value:void 0},unitUv:{type:"f",value:0},duration:{type:"f",value:4}},this.obj}var t,i,o,a;return t=e,(i=[{key:"createObj",value:(o=regeneratorRuntime.mark((function e(){var t,i,o,a,s,c,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t="観自在菩薩行深般若波羅蜜多時照見五蘊皆空度一切苦厄舎利子色不異空空不異色色即是空空即是色受想行識亦復如是舎利子是諸法空相不生不滅不垢不浄不増不減是故空中無色無受想行識無眼耳鼻舌身意無色声香味触法無眼界乃至無意識界無無明亦無無明尽乃至無老死亦無老死尽無苦集滅道無智亦無得以無所得故菩提薩埵依般若波羅蜜多故心無罣礙無罣礙故無有恐怖遠離一切顛倒夢想究竟涅槃三世諸仏依般若波羅蜜多故得阿耨多羅三藐三菩提故知般若波羅蜜多是大神呪是大明呪是無上呪是無等等呪能除一切苦真実不虚故説般若波羅蜜多呪即説呪日羯諦羯諦波羅羯諦波羅僧羯諦菩提薩婆訶般若心経",i=Math.ceil(Math.sqrt(t.length)),o=new r.InstancedBufferGeometry,a=new r.PlaneGeometry(6,6),o.copy(a),P=t.length,g=new r.InstancedBufferAttribute(new Float32Array(3*P),3),x=new r.InstancedBufferAttribute(new Float32Array(2*P),2),b=new r.InstancedBufferAttribute(new Float32Array(P),1),w=new r.InstancedBufferAttribute(new Float32Array(P),1),M=new r.InstancedBufferAttribute(new Float32Array(P),1),_=new r.InstancedBufferAttribute(new Float32Array(P),1),S=new r.InstancedBufferAttribute(new Float32Array(P),1),s=0;s<i;s++)for(c=0;c<i;c++)l=s*i+c,u().radians(360*Math.random()),Math.random(),x.setXY(l,c/i,(i-s-1)/i),b.setX(l,l);return o.setAttribute("iPosition",g),o.setAttribute("iUv",x),o.setAttribute("iId",b),o.setAttribute("iTime",w),o.setAttribute("iIsAnimated",M),o.setAttribute("iScale",_),o.setAttribute("iMove",S),f=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(46301).Z,fragmentShader:n(83257).Z,transparent:!0,depthWrite:!1}),e.next=26,y.loadAsync("/sketch-threejs/img/sketch/buddha/hannya_text.png");case 26:this.uniforms.texHannyaShingyo.value=e.sent,this.uniforms.unitUv.value=1/i,this.obj=new r.InstancedMesh(o,f,i*i),this.obj.position.y=0,this.obj.frustumCulled=!1;case 31:case"end":return e.stop()}}),e,this)})),a=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,s,"next",e)}function s(e){p(i,n,r,a,s,"throw",e)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"render",value:function(e){if(this.uniforms.time.value+=e,(R+=e)>.5){var t=u().radians(270*Math.random()-45),n=12*Math.random()+12;g.setXYZ(T,Math.cos(t)*n,0,Math.sin(t)*n),M.setX(T,1),_.setX(T,.1*(Math.random()+Math.random()-1)+1),S.setX(T,5*(Math.random()+Math.random()-1)+30),g.needsUpdate=!0,M.needsUpdate=!0,_.needsUpdate=!0,S.needsUpdate=!0,R=0,T=T>=P-1?0:T+1}for(var r=0;r<P;r++)if(0!==M.getX(r)){var i=w.getX(r);i>4?(M.setX(r,0),w.setX(r,0)):w.setX(r,i+e)}M.needsUpdate=!0,w.needsUpdate=!0}}])&&m(t.prototype,i),e}();function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var L=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,i;return t=e,(i=[{key:"createObj",value:function(){var e=new r.PlaneGeometry(70,70,512,512),t=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(67467).Z,fragmentShader:n(76100).Z,transparent:!0});this.obj=new r.Mesh(e,t),this.obj.rotation.set(u().radians(-90),0,0)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&z(t.prototype,i),e}();function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var A=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,i;return t=e,(i=[{key:"createObj",value:function(){for(var e=new r.BufferGeometry,t=[],i=[],o=[],a=0;a<1800;a+=3){var s=Math.random()*Math.random()*60+20,c=u().radians(360*Math.random());t[a+0]=Math.cos(c)*s,t[a+1]=0,t[a+2]=Math.sin(c)*s,i[a/3]=120*Math.random(),o[a/3]=120*Math.random()}var l=new r.BufferAttribute(new Float32Array(t),3),f=new r.BufferAttribute(new Float32Array(i),1),h=new r.BufferAttribute(new Float32Array(o),1);e.setAttribute("position",l),e.setAttribute("delay1",f),e.setAttribute("delay2",h);var v=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(47869).Z,fragmentShader:n(29808).Z,transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});this.obj=new r.Points(e,v)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&C(t.prototype,i),e}();function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var D=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,i;return t=e,(i=[{key:"createObj",value:function(){var e=new r.PlaneGeometry(60,60,512,512),t=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(42832).Z,fragmentShader:n(29608).Z,transparent:!0});this.obj=new r.Mesh(e,t),this.obj.position.y=16,this.obj.position.z=-30}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&O(t.prototype,i),e}();function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var k=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,i;return t=e,(i=[{key:"createObj",value:function(){var e=new r.SphereGeometry(100,128,128),t=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(6834).Z,fragmentShader:n(51261).Z,side:r.BackSide});this.obj=new r.Mesh(e,t),this.obj.position.y=16}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&I(t.prototype,i),e}();function F(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var j=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},texture:{type:"t",value:t},resolution:{type:"v2",value:new r.Vector2}},this.obj}var t,i;return t=e,(i=[{key:"createObj",value:function(){var e=new r.PlaneGeometry(2,2),t=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(59933).Z,fragmentShader:n(16918).Z});this.obj=new r.Mesh(e,t)}},{key:"resize",value:function(e,t){this.uniforms.resolution.value.set(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&F(t.prototype,i),e}();function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var B=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolution=t,this.vTouchStart=new r.Vector2,this.vPrev=new r.Vector2,this.v=new r.Vector2,this.a=new r.Vector2,this.anchor=new r.Vector2,this.isTouched=!1}var t,n;return t=e,(n=[{key:"touchStart",value:function(e){e.touches||e.preventDefault(),this.vPrev.copy(this.v),this.a.set(0,0),this.vTouchStart.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.isTouched=!0}},{key:"touchMove",value:function(e){e.touches&&e.preventDefault();var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY;!1!==this.isTouched&&this.anchor.set((t-this.vTouchStart.x)/(this.resolution.x/200)+this.vPrev.x,u().clamp((n-this.vTouchStart.y)/(this.resolution.y/200)+this.vPrev.y,-90,90))}},{key:"touchEnd",value:function(e){this.isTouched=!1}},{key:"render",value:function(){this.a.set((this.anchor.x-this.v.x)/10,(this.anchor.y-this.v.y)/10),this.v.add(this.a)}}])&&U(t.prototype,n),e}();function G(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function N(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){G(o,r,i,a,s,"next",e)}function s(e){G(o,r,i,a,s,"throw",e)}a(void 0)}))}}function H(){return V.apply(this,arguments)}function V(){return(V=N(regeneratorRuntime.mark((function e(){var t,n,i,a,c,u,l,f,h,v,p,m,y,g,x,b,w,M,_,S,P,T,R;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new r.Vector2,n=document.getElementById("canvas-webgl"),i=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),a=new r.Scene,c=new r.PerspectiveCamera,u=new r.Clock({autoStart:!1}),l=new r.WebGLRenderTarget,f=new r.Scene,h=new r.OrthographicCamera(-1,1,1,-1,1,2),v=document.querySelector(".p-preloader"),p=new d,m=new E,y=new L,g=new A,x=new D,b=new k,w=new B(t),(M=new j(l.texture)).createObj(),f.add(M.obj),_=function(){var e=u.getDelta();w.render(t),p.render(e,w.v.y,w.v.x),m.render(e),y.render(e),g.render(e),x.render(e),i.setRenderTarget(l),i.render(a,c),M.render(e),i.setRenderTarget(null),i.render(f,h)},S=function e(){_(),requestAnimationFrame(e)},P=function(){c.setFocalLength(35*Math.min(t.x/1200,1)+15),c.setViewOffset(1200,800,(t.x-1200)/-2,(t.y-800)/-2,t.x,t.y),c.updateProjectionMatrix()},T=function(){t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,P(),i.setSize(t.x,t.y),l.setSize(t.x,t.y),M.resize(t.x,t.y)},R=function(){var e=function(e){w.touchStart(e)},t=function(e){w.touchMove(e)},r=function(e){w.touchEnd(e)};n.addEventListener("mousedown",e,{passive:!1}),window.addEventListener("mousemove",t,{passive:!1}),window.addEventListener("mouseup",r),n.addEventListener("touchstart",e,{passive:!1}),window.addEventListener("touchmove",t,{passive:!1}),window.addEventListener("touchend",r),window.addEventListener("resize",o()(T,100))},i.setClearColor(592137,1),c.aspect=1.5,c.far=1e3,c.position.set(0,12,85),c.lookAt(new r.Vector3(0,14,0)),e.next=32,p.createObj();case 32:return e.next=34,m.createObj();case 34:return y.createObj(),g.createObj(),x.createObj(),b.createObj(),m.obj.renderOrder=10,a.add(p.obj),a.add(m.obj),a.add(y.obj),a.add(g.obj),a.add(x.obj),a.add(b.obj),R(),T(),v.classList.add("is-hidden"),e.next=50,s()(200);case 50:u.start(),S();case 52:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},97018:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var r=n(2212),i=n(38314),o=n.n(i);function a(e){return(a="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})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(f,e);var t,n,i,o,a=(i=f,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(i);if(o){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function f(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o}return t=f,(n=[{key:"start",value:function(){this.aspect=1.5,this.far=1e3,this.setFocalLength(50),this.position.set(0,0,50),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&s(t.prototype,n),f}(r.PerspectiveCamera),h=n(31430),v=n(17393),d=n.n(v);function p(e){return(p="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})(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=x(i);if(o){var n=x(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(1,1,64,64),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},easeTransition:{type:"f",value:0},noiseTex:{type:"t",value:null},imgPrevTex:{type:"t",value:null},imgNextTex:{type:"t",value:null},imgRatio:{type:"v2",value:new r.Vector2}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float easeTransition;\nuniform vec2 imgRatio;\nuniform sampler2D noiseTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec2 vUpdateUv;\nvarying float vTime;\n\nvoid main(void) {\n vec2 updateUv = uv * imgRatio + vec2(\n (1.0 - imgRatio.x) * 0.5,\n (1.0 - imgRatio.y) * 0.5\n );\n\n float noiseR = texture2D(noiseTex, updateUv + vec2(time * 0.1, 0.0)).r;\n float noiseG = texture2D(noiseTex, updateUv + vec2(time * 0.2, 0.0)).g;\n float slide = texture2D(noiseTex, uv * vec2(0.998) + 0.001).b;\n\n float mask = easeTransition * 1.6 - slide;\n float maskPrev = smoothstep(0.0, 0.3, mask);\n float maskNext = 1.0 - smoothstep(0.3, 0.6, mask);\n float height = maskPrev * maskNext * 4.0;\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + vec3(0.0, 0.0, height), 1.0);\n\n vPosition = position;\n vUv = uv;\n vUpdateUv = updateUv;\n vTime = easeTransition;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float easeTransition;\nuniform vec2 imgRatio;\nuniform sampler2D noiseTex;\nuniform sampler2D imgPrevTex;\nuniform sampler2D imgNextTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec2 vUpdateUv;\nvarying float vTime;\n\nvoid main() {\n vec2 ratio = vec2(\n min(imgRatio.x / imgRatio.y / 3.0 * 2.0, 1.0),\n min(imgRatio.y / imgRatio.x / 2.0 * 3.0, 1.0) / 3.0 * 2.0\n );\n vec2 imgUv = vec2(\n vUv.x * ratio.x + (1.0 - ratio.x) * 0.5,\n vUv.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n\n float noiseR = texture2D(noiseTex, vUpdateUv + vec2(time * 0.1, 0.0)).r;\n float noiseG = texture2D(noiseTex, vUpdateUv + vec2(time * 0.2, 0.0)).g;\n float slide = texture2D(noiseTex, vUv * vec2(0.998) + 0.001).b;\n\n float mask = vTime * 1.24 - (slide * 0.6 + noiseR * 0.2 + noiseG * 0.2);\n float maskPrev = 1.0 - smoothstep(0.12, 0.16, mask);\n float maskNext = smoothstep(0.16, 0.2, mask);\n float maskEdge = smoothstep(0.04, 0.12, mask) * (1.0 - smoothstep(0.2, 0.28, mask));\n\n vec4 imgPrev = texture2D(imgPrevTex, imgUv * (0.95 - 0.05 * easeTransition) + 0.025 + 0.025 * easeTransition);\n vec4 imgNext = texture2D(imgNextTex, imgUv * (1.0 - 0.05 * easeTransition) + 0.025 * easeTransition);\n\n // 0.9 - 0.8\n // 1.0 - 0.9\n\n vec3 color1 = imgPrev.rgb * maskPrev;\n vec3 color2 = imgNext.rgb * maskNext;\n vec3 color3 = vec3(0.0, 0.2, 1.0) * maskEdge;\n\n gl_FragColor = vec4(color1 + color2 - color3, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Image",e.imgIndexPrev=0,e.imgIndexNext=1,e}return t=s,(n=[{key:"start",value:function(e,t){this.imgTexes=t,this.material.uniforms.noiseTex.value=e,this.material.uniforms.imgPrevTex.value=this.imgTexes[this.imgIndexPrev],this.material.uniforms.imgNextTex.value=this.imgTexes[this.imgIndexNext]}},{key:"update",value:function(e,t){this.material.uniforms.time.value+=e,this.material.uniforms.easeTransition.value=t}},{key:"resize",value:function(e){this.material.uniforms.imgRatio.value.set(Math.min(1,e.x/e.y),Math.min(1,e.y/e.x)),this.scale.copy(e)}},{key:"changeTex",value:function(){this.imgIndexPrev=this.imgIndexNext,this.imgIndexNext=this.imgIndexNext+1>=this.imgTexes.length?0:this.imgIndexNext+1,this.material.uniforms.imgPrevTex.value=this.imgTexes[this.imgIndexPrev],this.material.uniforms.imgNextTex.value=this.imgTexes[this.imgIndexNext]}}])&&m(t.prototype,n),s}(r.Mesh);function w(e){return(w="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})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=P(i);if(o){var n=P(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return S(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(1,1,128,128),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},easeTransition:{type:"f",value:0},noiseTex:{type:"t",value:null},imgRatio:{type:"v2",value:new r.Vector2}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float easeTransition;\nuniform vec2 imgRatio;\nuniform sampler2D noiseTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\nvarying float vTime;\n\nvoid main(void) {\n vec2 p = uv * 2.0 - 1.0;\n float edge = abs(p.x);\n\n vec2 updateUv = uv * imgRatio + vec2(\n (1.0 - imgRatio.x) * 0.5,\n (1.0 - imgRatio.y) * 0.5\n );\n\n float noiseR = texture2D(noiseTex, updateUv + vec2(time * 0.1, 0.0)).r;\n float noiseG = texture2D(noiseTex, updateUv + vec2(time * 0.2, 0.0)).g;\n float slide = texture2D(noiseTex, uv * vec2(0.998) + 0.001).b;\n\n float mask = easeTransition * 1.24 - (slide * 0.6 + noiseR * 0.2 + noiseG * 0.2);\n float h1 = (1.0 - smoothstep(0.14, 0.24, mask)) * 12.0;\n\n float mask2 = easeTransition * 1.6 - slide;\n float maskPrev = smoothstep(0.0, 0.3, mask2);\n float maskNext = 1.0 - smoothstep(0.3, 0.6, mask2);\n float h2 = maskPrev * maskNext * 8.0;\n\n float h = h1 + h2;\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + vec3(slide * 0.2, slide * 0.2 + h * 0.006, h), 1.0);\n\n float opacity = smoothstep(0.0, 2.0, h1) * (1.0 - smoothstep(8.0, 12.0, h1)) * (1.0 - pow(edge, 2.0));\n\n vPosition = mPosition.xyz;\n vUv = uv;\n vOpacity = opacity;\n vTime = easeTransition;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float duration;\nuniform vec2 imgRatio;\nuniform sampler2D noiseTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\nvarying float vTime;\n\nvoid main() {\n vec2 updateUv = vUv * imgRatio + vec2(\n (1.0 - imgRatio.x) * 0.5,\n (1.0 - imgRatio.y) * 0.5\n );\n\n float noiseR = texture2D(noiseTex, updateUv + vec2(time * 0.1, 0.0)).r;\n float noiseG = texture2D(noiseTex, updateUv + vec2(time * 0.2, 0.0)).g;\n\n gl_FragColor = vec4(1.0, 0.38, 0.0, vOpacity * smoothstep(0.4, 0.6, noiseR));\n}\n",transparent:!0,blending:r.AdditiveBlending});return(e=a.call(this,t,n)).name="ImageFire",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){this.material.uniforms.time.value+=e,this.material.uniforms.easeTransition.value=t}},{key:"resize",value:function(e){this.material.uniforms.imgRatio.value.set(Math.min(1,e.x/e.y),Math.min(1,e.y/e.x)),this.scale.copy(e)}}])&&M(t.prototype,n),s}(r.Mesh);function R(e){return(R="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})(e)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=C(i);if(o){var n=C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return L(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(1,1,32,32),n=new r.BufferGeometry;n.setAttribute("position",t.attributes.position),n.setAttribute("uv",t.attributes.uv);var i=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},easeTransition:{type:"f",value:0},noiseTex:{type:"t",value:null},imgRatio:{type:"v2",value:new r.Vector2},pixelRatio:{type:"f",value:window.devicePixelRatio}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float easeTransition;\nuniform vec2 imgRatio;\nuniform sampler2D noiseTex;\nuniform float pixelRatio;\n\nvarying float vOpacity;\n\nvoid main(void) {\n vec2 updateUv = uv * imgRatio + vec2(\n (1.0 - imgRatio.x) * 0.5,\n (1.0 - imgRatio.y) * 0.5\n );\n\n float noiseR = texture2D(noiseTex, updateUv + vec2(time * 0.1, 0.0)).r;\n float noiseG = texture2D(noiseTex, updateUv + vec2(time * 0.2, 0.0)).g;\n float slide = texture2D(noiseTex, uv * vec2(0.99) + 0.005).b;\n\n float mask = easeTransition * 1.24 - (slide * 0.6 + noiseR * 0.2 + noiseG * 0.2);\n float h = (easeTransition - slide) * 30.0;\n\n float opacity = smoothstep(0.3, 0.5, easeTransition * 2.0 - slide) * (1.0 - smoothstep(0.8, 1.0, easeTransition * 2.0 - slide)) * 0.8;\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + vec3(\n cos(radians(noiseR * 360.0 + time * 200.0)) * 0.1,\n sin(radians(noiseG * 360.0 + time * 200.0)) * 0.1,\n h\n ), 1.0);\n\n float distanceFromCamera = length((viewMatrix * mPosition).xyz);\n float pointSize = pixelRatio * 50.0 / distanceFromCamera * 4.0;\n\n vOpacity = opacity;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n gl_PointSize = pointSize;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying float vOpacity;\n\nvoid main() {\n // Convert PointCoord to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // Draw circle\n float radius = length(p);\n float opacity = (1.0 - smoothstep(0.5, 1.0, radius));\n\n // Define Colors\n vec3 color = vec3(1.0, 0.38, 0.0);\n\n gl_FragColor = vec4(color, opacity * vOpacity);\n}\n",transparent:!0,blending:r.AdditiveBlending});return(e=a.call(this,n,i)).name="ImagePoints",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){this.material.uniforms.time.value+=e,this.material.uniforms.easeTransition.value=t}},{key:"resize",value:function(e){this.material.uniforms.imgRatio.value.set(Math.min(1,e.x/e.y),Math.min(1,e.y/e.x)),this.scale.copy(e)}}])&&E(t.prototype,n),s}(r.Points);function O(e){return(O="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})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j,U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=F(i);if(o){var n=F(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).name="ImageGroup",e.size=new r.Vector3,e.margin=new r.Vector2,e.timeTransition=0,e}return t=s,(n=[{key:"start",value:function(e,t){var n=new b,r=new T,i=new A;n.start(e,t),r.start(e),i.start(e),r.renderOrder=10,i.position.z=5,this.add(n),this.add(r),this.add(i)}},{key:"update",value:function(e){if(this.timeTransition+=e,this.timeTransition/3>=1)this.timeTransition=0,this.children[0].changeTex(),this.children[0].update(e,0),this.children[1].update(e,0),this.children[2].update(e,0);else{var t=(0,h.easeInOutQuad)(Math.min(this.timeTransition/3,1));this.children[0].update(e,t),this.children[1].update(e,t),this.children[2].update(e,t)}}},{key:"resize",value:function(e,t){var n=Math.abs((e.position.z-this.position.z)*Math.tan(d().radians(e.fov)/2)*2),r=n*e.aspect;this.margin.set(t.x>t.y?.2*t.y:.1*t.x,t.x>t.y?.2*t.y:.333*t.y),this.size.set(r*(t.x-this.margin.x)/t.x,n*(t.y-this.margin.y)/t.y,1),this.children[0].resize(this.size),this.children[1].resize(this.size),this.children[2].resize(this.size)}}])&&D(t.prototype,n),s}(r.Group);function B(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function G(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var N=new r.Scene,H=new f,V=new r.Clock({autoStart:!1}),W=new r.TextureLoader,Z=new U,q=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(j=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),j.setClearColor(921102,1),e.next=5,Promise.all([W.loadAsync("/sketch-threejs/img/sketch/burn/noise.png"),W.loadAsync("/sketch-threejs/img/sketch/burn/image01.jpg"),W.loadAsync("/sketch-threejs/img/sketch/burn/image02.jpg"),W.loadAsync("/sketch-threejs/img/sketch/burn/image03.jpg")]).then((function(e){var t=e[0],n=e.slice(1);t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,Z.start(t,n),N.add(Z)}));case 5:H.start();case 6:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){B(o,n,r,a,s,"next",e)}function s(e){B(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){V.start(),this.update()}},{key:"pause",value:function(){V.stop()}},{key:"update",value:function(){if(!1!==V.running){var e=V.getDelta();H.update(e),Z.update(e),j.render(N,H)}}},{key:"resize",value:function(e){H.resize(e),j.setSize(e.x,e.y),Z.resize(H,e)}}])&&G(t.prototype,n),e}();function Y(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Y(o,r,i,a,s,"next",e)}function s(e){Y(o,r,i,a,s,"throw",e)}a(void 0)}))}}function K(){return Q.apply(this,arguments)}function Q(){return(Q=X(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new q,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},94429:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={index:{type:"f",value:t},time:{type:"f",value:0},size:{type:"f",value:280},texture:{type:"t",value:n},colorH:{type:"f",value:Math.random()}},this.obj=this.createObj(),this.obj.renderOrder=10}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(280,140,24,12),t=new i.Mesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(72648).Z,fragmentShader:n(34326).Z,side:i.DoubleSide,transparent:!0}));return t.position.y=140+280*(2*Math.random()-1)*.1,t.rotation.set(-45*Math.PI/180,0,0),t}},{key:"render",value:function(e,t){this.uniforms.time.value+=t,this.obj.position.z-=4,this.obj.position.z<-900&&(this.obj.position.x=280*(2*Math.random()-1),this.obj.position.z=900,this.uniforms.colorH.value=Math.random())}}])&&r(t.prototype,o),e}()},65722:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(78934).Z,a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mirrorCamera=new i.PerspectiveCamera(30,t.x/t.y,1,15e3),this.mirrorRender=new i.WebGLRenderTarget(t.x,t.y),this.textureMatrix=new i.Matrix4,this.uniforms={time:{type:"f",value:0},texture:{type:"t",value:this.mirrorRender.texture},textureMatrix:{type:"m4",value:this.textureMatrix}},this.renderBack1=new i.WebGLRenderTarget(t.x,t.y),this.renderBack2=new i.WebGLRenderTarget(t.x,t.y),this.postEffectBlurX=new o(this.renderBack1.texture,1,0,4),this.postEffectBlurY=new o(this.renderBack2.texture,0,1,4),this.mirrorCamera.up.set(0,-1,0),this.obj=this.createObj()}var t,a;return t=e,(a=[{key:"add",value:function(e,t){t.add(this.obj),e.add(this.postEffectBlurX.obj),e.add(this.postEffectBlurY.obj)}},{key:"createObj",value:function(){var e=new i.Mesh(new i.PlaneGeometry(1e3,2e3),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(440).Z,fragmentShader:n(3410).Z,transparent:!0}));return e.rotation.set(-.5*Math.PI,0,0),e}},{key:"updateTextureMatrix",value:function(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1),this.textureMatrix.multiply(this.mirrorCamera.projectionMatrix),this.textureMatrix.multiply(this.mirrorCamera.matrixWorldInverse)}},{key:"render",value:function(e,t,n,r,i){this.uniforms.time.value+=i,this.updateTextureMatrix(),this.obj.visible=!1,e.setRenderTarget(this.renderBack1),e.render(n,this.mirrorCamera),this.obj.visible=!0,this.postEffectBlurX.render(e,t,r,this.renderBack2),this.postEffectBlurY.render(e,t,r,this.mirrorRender)}},{key:"resize",value:function(e){this.mirrorCamera.aspect=e.x/e.y,this.mirrorCamera.updateProjectionMatrix(),this.mirrorRender.setSize(e.x,e.y),this.renderBack1.setSize(e.x,e.y),this.renderBack2.setSize(e.x,e.y),this.postEffectBlurX.resize(e),this.postEffectBlurY.resize(e)}}])&&r(t.prototype,a),e}()},87344:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.interval=4,this.attr={position:new i.BufferAttribute(new Float32Array(3*t),3),colorH:new i.BufferAttribute(new Float32Array(t),1),index:new i.BufferAttribute(new Float32Array(t),1),valid:new i.BufferAttribute(new Float32Array(t),1)},this.geometry=new i.BufferGeometry,this.uniforms={size:{type:"f",value:t},interval:{type:"f",value:this.interval},time:{type:"f",value:0}},this.butterflies=null,this.butterfliesLengh=0,this.obj=this.createObj(),this.obj.renderOrder=20}var t,a;return t=e,(a=[{key:"createObj",value:function(){for(var e=0;e<this.uniforms.size.value;e++)this.attr.index.setX(e,e);return this.geometry.setAttribute("position",this.attr.position),this.geometry.setAttribute("colorH",this.attr.colorH),this.geometry.setAttribute("i",this.attr.index),this.geometry.setAttribute("valid",this.attr.valid),new i.Points(this.geometry,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(13677).Z,fragmentShader:n(13190).Z,depthWrite:!1,transparent:!0}))}},{key:"addButterflies",value:function(e){this.butterflies=e,this.butterfliesLengh=e.length}},{key:"render",value:function(e){this.uniforms.time.value+=e;for(var t=0;t<this.uniforms.size.value;t++){var n=(this.uniforms.time.value+this.attr.index.getX(t)/this.uniforms.size.value*this.interval)%this.interval,r=this.attr.valid.getX(t);if(n>=.9*this.interval&&1==r)this.attr.valid.setX(t,0);else if(n<=.9*this.interval&&0==r){var i=Math.floor(Math.random()*this.butterfliesLengh),a=this.butterflies[i],s=(-90*Math.random()-90)*Math.PI/180,c=-180*Math.random()*Math.PI/180,u=Math.random()*a.uniforms.size.value/4+a.uniforms.size.value/8,l=o.spherical(s,c,u);this.attr.position.setXYZ(t,l[0]+a.obj.position.x,.2*l[1]+a.obj.position.y+20*Math.sin(a.uniforms.time.value),.5*l[2]+a.obj.position.z),this.attr.colorH.setX(t,a.uniforms.colorH.value),this.attr.valid.setX(t,1)}}this.attr.position.needsUpdate=!0,this.attr.colorH.needsUpdate=!0}}])&&r(t.prototype,a),e}()},9406:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={texture1:{type:"t",value:t},texture2:{type:"t",value:n}},this.obj=this.createObj(),this.obj.visible=!1}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(56500).Z,fragmentShader:n(50413).Z}))}},{key:"render",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&r(t.prototype,o),e}()},78934:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={resolution:{type:"v2",value:new i.Vector2},direction:{type:"v2",value:new i.Vector2(n,r)},radius:{type:"f",value:o},texture:{type:"t",value:t}},this.obj=this.createObj(),this.obj.visible=!1}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(56500).Z,fragmentShader:n(92586).Z}))}},{key:"resize",value:function(e){this.uniforms.resolution.value.set(e.x,e.y)}},{key:"render",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&r(t.prototype,o),e}()},22607:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={minBright:{type:"f",value:.3},texture:{type:"t",value:t}},this.obj=this.createObj(),this.obj.visible=!1}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(56500).Z,fragmentShader:n(38913).Z}))}},{key:"render",value:function(e,t,n,r){this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&r(t.prototype,o),e}()},58238:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2212),i=n(38314),o=n(89813).Z,a=n(94429).Z,s=n(87344).Z,c=n(65722).Z,u=n(22607).Z,l=n(78934).Z,f=n(9406).Z;function h(){var e={x:0,y:0},t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({antialias:!1,canvas:t,alpha:!0}),h=new r.WebGLRenderTarget(0,0),v=new r.WebGLRenderTarget(0,0),d=new r.WebGLRenderTarget(0,0),p=new r.Scene,m=new r.Scene,y=new r.OrthographicCamera(-1,1,1,-1,0,1),g=new r.PerspectiveCamera(30,1,1,15e3),x=new r.Clock,b=new r.TextureLoader,w=new r.Vector2,M=new r.Vector2,_=new r.Vector2,S=[],P=new s(720),T=new c(e),R=new u(h.texture),E=new l(v.texture,1,0,1),z=new l(d.texture,0,1,1),L=new f(h.texture,v.texture),C=function(){e.x=document.body.clientWidth,e.y=window.innerHeight,t.width=e.x,t.height=e.y,g.aspect=e.x/e.y,g.updateProjectionMatrix(),T.resize(e),E.resize(e),z.resize(e),h.setSize(e.x,e.y),v.setSize(e.x,e.y),d.setSize(e.x,e.y),n.setSize(e.x,e.y)},A=function e(){!function(){for(var e=x.getDelta(),t=0;t<S.length;t++)S[t].render(n,e);P.render(e),T.render(n,p,m,y,e),n.setRenderTarget(h),n.render(m,g),R.render(n,p,y,v),E.render(n,p,y,d),z.render(n,p,y,v),L.render(n,p,y)}(),requestAnimationFrame(e)};C(),window.addEventListener("resize",i(C,1e3)),t.addEventListener("mousedown",(function(e){e.preventDefault(),w.set(e.clientX,e.clientY),o(w)})),t.addEventListener("mousemove",(function(e){e.preventDefault(),M.set(e.clientX,e.clientY),o(M)})),t.addEventListener("mouseup",(function(e){e.preventDefault(),_.set(e.clientX,e.clientY),o(_)})),t.addEventListener("touchstart",(function(e){e.preventDefault(),w.set(e.touches[0].clientX,e.touches[0].clientY),o(w),e.touches[0].clientX,e.touches[0].clientY})),t.addEventListener("touchmove",(function(e){e.preventDefault(),M.set(e.touches[0].clientX,e.touches[0].clientY),o(M)})),t.addEventListener("touchend",(function(e){e.preventDefault(),_.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),o(_)})),window.addEventListener("mouseout",(function(){event.preventDefault(),_.set(0,0)})),n.setClearColor(15658734,1),g.position.set(400,500,800),T.mirrorCamera.position.set(g.position.x,-1*g.position.y,g.position.z),g.lookAt(new r.Vector3(0,100,0)),T.mirrorCamera.lookAt(new r.Vector3(0,-100,0)),b.load("/sketch-threejs/img/sketch/butterfly/tex.png",(function(e){e.magFilter=r.NearestFilter,e.minFilter=r.NearestFilter;for(var t=0;t<12;t++)S[t]=new a(t,e),S[t].obj.position.x=280*(2*Math.random()-1),S[t].obj.position.z=150*t,m.add(S[t].obj);P.addButterflies(S),m.add(P.obj),T.add(p,m),p.add(R.obj),p.add(E.obj),p.add(z.obj),p.add(L.obj),A()}))}},87848:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(12390),c=n.n(s),u=n(97719),l=n(42935),f=n(5097),h=n(33286),v=n.n(h),d=n(7318),p=n.n(d),m=n(45695),y=n.n(m);function g(){var e,t,i,s,h,d,m=document.getElementById("canvas-webgl"),g=new r.WebGL1Renderer({antialias:!0,canvas:m}),x=new r.Scene,b=new u.Z(35,window.innerWidth/window.innerHeight,1,1e4),w=1e4,M=[],_=2,S=new(p()),P=null,T=null,R=null,E=new Float32Array(3e4),z=new Float32Array(3e4),L=new Float32Array(w),C=new Float32Array(w),A=null,O=new(c()),D=null,I=Date.now(),k=Date.now(),F=Date.now(),j=Date.now(),U=0,B=!1,G=!1,N=!0,H=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=null,i=null;return e.width=200,e.height=200,(n=t.createRadialGradient(100,100,20,100,100,100)).addColorStop(.9,"rgba(255, 255, 255, 1)"),n.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=n,t.arc(100,100,100,0,Math.PI/180,!0),t.fill(),(i=new r.Texture(e)).minFilter=r.NearestFilter,i.needsUpdate=!0,i},V=function(){m.width=window.innerWidth,m.height=window.innerHeight,b.aspect=window.innerWidth/window.innerHeight,b.updateProjectionMatrix(),g.setSize(window.innerWidth,window.innerHeight)};g.setSize(window.innerWidth,window.innerHeight),g.setClearColor(0,1),b.position.set(1e3,1e3,1e3),b.lookAt(new r.Vector3),e=new r.Vector2,t=new r.Vector2,i=new r.Vector2,s=function(t,n,r){e.set(t,n),(0,a.Z)(e),B=!0,j=Date.now()},h=function(e,n,r){t.set(e,n),(0,a.Z)(t)},d=function(e,t,n){i.set(e,t),B=!1,Date.now()-j<100&&(!0===N?(b.force.position.anchor.set(1200,1200,0),b.force.look.anchor.set(0,0,0),N=!1):N=!0)},window.addEventListener("resize",o()((function(){V()})),1e3),m.addEventListener("mousedown",(function(e){e.preventDefault(),s(e.clientX,e.clientY)})),m.addEventListener("mousemove",(function(e){e.preventDefault(),h(e.clientX,e.clientY)})),m.addEventListener("mouseup",(function(e){e.preventDefault(),d(e.clientX,e.clientY)})),m.addEventListener("touchstart",(function(e){e.preventDefault(),s(e.touches[0].clientX,e.touches[0].clientY)})),m.addEventListener("touchmove",(function(e){e.preventDefault(),h(e.touches[0].clientX,e.touches[0].clientY)})),m.addEventListener("touchend",(function(e){e.preventDefault(),d(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),i.set(0,0),B=!1,Date.now()-j<100&&(!0===N?(b.force.position.anchor.set(1200,1200,0),b.force.look.anchor.set(0,0,0),N=!1):N=!0)})),function(){var e,t;e=new r.OctahedronGeometry(30,2),t=new r.MeshPhongMaterial({color:new r.Color("hsl(140, 100%, 100%)"),flatShading:!0}),A=new r.Mesh(e,t),x.add(A),D=function(){var e=new r.OctahedronGeometry(250,4),t=new r.MeshPhongMaterial({color:2236962,flatShading:!0});return new r.Mesh(e,t)}(),x.add(D);for(var i=0;i<w;i++){var o=new(v()),a=y().getRandomInt(95,185),s=y().getRandomInt(60,80);o.init(new r.Vector3(y().getRandomInt(-100,100),0,0)),o.color=new r.Color("hsl("+a+", "+s+"%, 70%)"),M.push(o),E[3*i+0]=o.velocity.x,E[3*i+1]=o.velocity.y,E[3*i+2]=o.velocity.z,z[3*i+0]=o.color.r,z[3*i+1]=o.color.g,z[3*i+2]=o.color.b,L[i]=o.a,C[i]=o.size}S.init({scene:x,vs:n(99173).Z,fs:n(77911).Z,positions:E,colors:z,opacities:L,sizes:C,texture:H(),blending:r.NormalBlending}),S.rad1=0,S.rad1_base=0,S.rad2=0,S.rad3=0,P=new f.Z(new r.Color("hsl(95, 50%, 60%)").getHex(),new r.Color("hsl(185, 50%, 60%)").getHex(),1),x.add(P),T=new l.Z("hsl(95, 60%, 50%)",1,500,1),x.add(T),R=new l.Z("hsl(95, 60%, 50%)",1,500,1),x.add(R),b.anchor=new r.Vector3(1500,0,0)}(),V(),function e(){B&&U<200?U+=1:U>0&&(U-=1),S.velocity=(A.rotation.x+=.03+U/1e3,A.rotation.y+=.01+U/1e3,A.rotation.z+=.01+U/1e3,S.rad1_base+=y().getRadian(.6),S.rad1=y().getRadian(45*Math.sin(S.rad1_base)+U/100),S.rad2+=y().getRadian(.8+U/100),S.rad3+=.01,y().getPolarCoord(S.rad1,S.rad2,350)),!0===N&&(b.force.position.anchor.copy(S.velocity.clone().add(S.velocity.clone().sub(S.obj.position).normalize().multiplyScalar(-400))),b.force.position.anchor.y+=2*S.velocity.y,b.force.look.anchor.copy(S.velocity)),S.updatePoints(),A.position.copy(S.velocity),P.color.setHSL((95-U/1.5)/360,.5,.6),P.groundColor.setHSL((185-U/1.5)/360,.5,.6),T.position.copy(S.velocity),T.color.setHSL((95-U/1.5)/360,.5,.6),R.position.copy(S.velocity),R.color.setHSL((185-U/1.5)/360,.5,.6),function(){var e=0;if(Date.now()-I>10){for(var t=0;t<M.length;t++){var n=M[t];if(!n.is_active){var r=y().getRadian(y().getRandomInt(0,360)),i=y().getRadian(y().getRandomInt(0,360)),o=y().getRandomInt(1,30),a=y().getPolarCoord(r,i,o),s=y().getPolarCoord(r,i,o/20),c=y().getRandomInt(95,185)-U/1.5,u=y().getRandomInt(60,80);if(a.add(S.velocity),n.activate(),n.init(a),n.color.setHSL(c/360,u/100,.7),n.applyForce(s),n.a=1,n.size=25,++e>=_)break}}I=Date.now()}}(),function(){for(var e=0;e<M.length;e++){var t=M[e];t.is_active&&(t.time++,t.applyDrag(.1),t.updateVelocity(),t.time>10&&(t.size-=2),t.size<=0&&(t.init(new r.Vector3(0,0,0)),t.time=0,t.a=0,t.inactivate())),E[3*e+0]=t.velocity.x-S.velocity.x,E[3*e+1]=t.velocity.y-S.velocity.y,E[3*e+2]=t.velocity.z-S.velocity.z,z[3*e+0]=t.color.r,z[3*e+1]=t.color.g,z[3*e+2]=t.color.b,L[e]=t.a,C[e]=t.size}S.updatePoints()}(),b.force.position.applyHook(0,.025),b.force.position.applyDrag(.2),b.force.position.updateVelocity(),b.updatePosition(),b.force.look.applyHook(0,.2),b.force.look.applyDrag(.4),b.force.look.updateVelocity(),b.updateLook(),T.position.copy(y().getPolarCoord(y().getRadian(0),y().getRadian(0),24).add(S.velocity)),R.position.copy(y().getPolarCoord(y().getRadian(180),y().getRadian(0),24).add(S.velocity)),Date.now()-F>1e3-3*U&&(O.applyForce(new r.Vector2(.08+U/5e3,0)),F=Date.now(),G=!0,k=Date.now()),_=G&&Date.now()-k<500?6+Math.floor(U/40):1+Math.floor(U/40),O.applyHook(0,.1),O.applyDrag(.12),O.updateVelocity(),A.scale.set(1+O.velocity.x,1+O.velocity.x,1+O.velocity.x),g.render(x,b),requestAnimationFrame(e)}()}},44428:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ie}});var r=n(2212),i=n(38314),o=n.n(i),a=n(17393),s=n.n(a),c=n(48840);function u(e){return(u="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})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e,t,n){t.multiplyScalar(1/n),e.add(t)},p=function(e,t,n){n.copy(e.clone().multiplyScalar(-1)).normalize().multiplyScalar(e.length()*t),e.add(n)},m=function(e,t,n,r,i,o){o.copy(e.clone().sub(n));var a=o.length()-r;o.normalize().multiplyScalar(-1*i*a),t.add(o)},y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(i);if(o){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.drag=new r.Vector3,o.hook=new r.Vector3,o.k=.02,o.d=.3,o.velocity=new r.Vector3,o.acceleration=new r.Vector3,o.anchor=new r.Vector3,o.lookK=.02,o.lookD=.3,o.lookVelocity=new r.Vector3,o.lookAcceleration=new r.Vector3,o.lookAnchor=new r.Vector3,o}return t=s,(n=[{key:"start",value:function(){this.aspect=1.5,this.far=1e3,this.setFocalLength(50),this.position.set(0,0,50),this.lookAt(new r.Vector3)}},{key:"update",value:function(){m(this.velocity,this.acceleration,this.anchor,0,this.k,this.hook),p(this.acceleration,this.d,this.drag),d(this.velocity,this.acceleration,1),m(this.lookVelocity,this.lookAcceleration,this.lookAnchor,0,this.lookK,this.hook),p(this.lookAcceleration,this.lookD,this.drag),d(this.lookVelocity,this.lookAcceleration,1),this.position.copy(this.velocity),this.lookAt(this.lookVelocity)}},{key:"resize",value:function(e){e.x>e.y?this.cameraResolution.set(e.x>=1200?1200:e.x,e.x>=1200?800:.66*e.x):this.cameraResolution.set(.6*(e.y>=1200?800:.66*e.y),.6*(e.y>=1200?1200:e.y)),this.setViewOffset(this.cameraResolution.x,this.cameraResolution.y,(e.x-this.cameraResolution.x)/-2,(e.y-this.cameraResolution.y)/-2,e.x,e.y),this.updateProjectionMatrix()}}])&&l(t.prototype,n),s}(r.PerspectiveCamera);function g(e){return(g="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})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=M(i);if(o){var n=M(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function c(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},hsv:{type:"v3",value:new r.Vector3},normalMap:{type:"t",value:null},surfaceTex:{type:"t",value:null},fogTex:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = mPosition.xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform vec3 hsv;\nuniform float time;\nuniform sampler2D normalMap;\nuniform sampler2D surfaceTex;\nuniform sampler2D fogTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Get normal vector from the normal map.\n vec3 n = texture2D(normalMap, vUv).xyz;\n\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, -1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal + n, light) + 1.0) / 2.0;\n\n // the pointyness color\n vec3 surface = texture2D(surfaceTex, vUv).rgb;\n vec4 fog1 = texture2D(fogTex, vUv + vec2(0.0, time * 0.06));\n vec4 fog2 = texture2D(fogTex, vUv + vec2(0.0, time * -0.03));\n vec4 fog3 = texture2D(fogTex, vUv + vec2(0.0, time * 0.03));\n vec4 fog4 = texture2D(fogTex, vUv + vec2(0.0, time * -0.06));\n\n vec3 rgb = convertHsvToRgb(hsv + vec3((fog3.r + fog4.r - 1.0) * 0.16, (1.0 - surface.r) * 0.05, surface.r + (fog1.r + fog2.g - 1.0) + 0.5));\n vec3 color = rgb;\n\n gl_FragColor = vec4(color, 1.0);\n}\n"});return(t=a.call(this,e,n)).name="Mesh",t.rotation.set(s().radians(30*(2*Math.random()-1)),0,s().radians(30*(2*Math.random()-1))),t.axisBodyRotate=(new r.Vector3).copy(t.up).applyEuler(t.rotation),t.quaternionPrev=new r.Quaternion,t}return t=c,(n=[{key:"start",value:function(e,t,n,r){this.material.uniforms.hsv.value.set(e,.65,0),this.material.uniforms.normalMap.value=t,this.material.uniforms.surfaceTex.value=n,this.material.uniforms.fogTex.value=r}},{key:"update",value:function(e){this.material.uniforms.time.value+=e,this.quaternionPrev.copy(this.quaternion),this.quaternion.setFromAxisAngle(this.axisBodyRotate,.1*e).multiply(this.quaternionPrev)}}])&&x(t.prototype,n),c}(r.Mesh);function S(e){return(S="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})(e)}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function R(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E(i);if(o){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return R(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=new r.BufferGeometry,n=new r.BufferAttribute(new Float32Array(1500),3),i=new r.BufferAttribute(new Float32Array(500),1,1),o=new r.BufferAttribute(new Float32Array(500),1,1),u=0;u<500;u++){var l=s().radians(s().randomArbitrary(0,150)-75),f=s().radians(s().randomArbitrary(0,360)),h=Math.random()*Math.random()*4+2,v=s().spherical(l,f,h);n.setXYZ(u,v[0],v[1],v[2]),i.setXYZ(u,Math.random()),o.setXYZ(u,s().randomArbitrary(1,10)*(2*s().randomInt(0,1)-1))}t.setAttribute("position",n),t.setAttribute("delay",i),t.setAttribute("speed",o);var d=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},pixelRatio:{type:"f",value:window.devicePixelRatio},hex:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute float delay;\nattribute float speed;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float pixelRatio;\nuniform float hex;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nconst float duration = 3.0;\n\nvoid main() {\n // calculate interval time from 0 to 1\n float interval = mod(time + delay * duration, duration) / duration;\n\n // update position and size\n float size = 3.0 * sin(interval * 4.0);\n float blink = max(\n (sin(interval * 4.0) + cos(interval * 27.0) * 0.3 + cos(interval * 36.0) * 0.2) / 1.5 * 2.0 - 1.0,\n 0.0\n );\n mat4 rotateMat = calcRotateMat4(vec3(\n radians(time * speed * 0.3),\n radians(time * speed),\n radians(time * speed * 0.3)\n ));\n\n // calculate colors\n vec3 hsv = vec3(hex, 0.6, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * rotateMat * vec4(position, 1.0);\n float distanceFromCamera = 35.0 / length(mvPosition.xyz);\n\n vColor = rgb;\n vOpacity = blink * clamp(distanceFromCamera, 0.5, 1.0);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = distanceFromCamera * pixelRatio * size;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // convert PointCoord to range from -1.0 to 1.0\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // draw double circle\n float r = (1.0 - smoothstep(0.95, 1.0, length(p)));\n\n gl_FragColor = vec4(vColor * r, vOpacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(e=a.call(this,t,d)).name="CrystalSparkle",e}return t=c,(n=[{key:"start",value:function(e){this.material.uniforms.hex.value=e}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&P(t.prototype,n),c}(r.Points);function L(e){return(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})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e,t){return!t||"object"!==L(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=D(i);if(o){var n=D(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return O(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.PlaneGeometry(55,55),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},hex:{type:"f",value:0},fogTex:{type:"t",value:null},maskTex:{type:"t",value:null},direction:{type:"v2",value:new r.Vector2}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float hex;\nuniform sampler2D fogTex;\nuniform vec2 direction;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n vec4 fog1 = texture2D(fogTex, vUv - direction * time * 0.05);\n vec4 fog2 = texture2D(\n fogTex,\n vUv\n + direction * time * 0.025\n + vec2(\n cos(radians(fog1.g * 360.0)) * 0.01 * cos(radians(fog1.b * 360.0)),\n sin(radians(fog1.g * 360.0)) * 0.01 * cos(radians(fog1.b * 360.0))\n )\n );\n float opacity = (pow(fog2.r, 2.0) - smoothstep(0.5, 1.0, abs(p.x)) - smoothstep(0.25, 1.0, abs(p.y)));\n\n vec3 hsv = vec3(hex + fog2.b * 0.16, 0.9, 0.24);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",transparent:!0,blending:r.AdditiveBlending,depthWrite:!1});(e=a.call(this,t,n)).name="Fog";var i=s().radians(360*Math.random());return e.material.uniforms.direction.value.set(Math.cos(i),Math.sin(i)),e}return t=c,(n=[{key:"start",value:function(e,t,n){this.material.uniforms.hex.value=e,this.material.uniforms.fogTex.value=t,this.material.uniforms.maskTex.value=n}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&C(t.prototype,n),c}(r.Mesh);function k(e){return(k="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})(e)}function F(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function U(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=B(i);if(o){var n=B(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return U(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(100,12,12),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},hex:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float hex;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec3 rgb = mix(\n convertHsvToRgb(vec3(hex, 0.6, 0.6)),\n convertHsvToRgb(vec3(hex, 0.4, 0.2)),\n vUv.y * 4.0 - 1.0\n );\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n",side:r.BackSide,depthTest:!1});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e,t){this.material.uniforms.time.value+=e,this.material.uniforms.hex.value=t}}])&&F(t.prototype,n),s}(r.Mesh),N="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n gl_Position = vec4(position, 1.0);\n}\n";function H(e){return(H="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})(e)}function V(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e,t){return!t||"object"!==H(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=q(i);if(o){var n=q(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Z(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(2,2),n=new r.RawShaderMaterial({uniforms:{minBright:{type:"f",value:.5},texture:{type:"t",value:null}},vertexShader:N,fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float minBright;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 bright = max(vec4(0.0), (texture2D(texture, vUv) - minBright));\n gl_FragColor = bright;\n}\n"});return(e=a.call(this,t,n)).name="PostEffectBright",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.texture.value=e}}])&&V(t.prototype,n),s}(r.Mesh);function X(e){return(X="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})(e)}function K(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J(e,t){return!t||"object"!==X(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ee=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$(i);if(o){var n=$(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return J(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(2,2),n=new r.RawShaderMaterial({uniforms:{resolution:{type:"v2",value:new r.Vector2},direction:{type:"v2",value:new r.Vector2},texture:{type:"t",value:null}},vertexShader:N,fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 direction;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvec4 gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 step = radius / resolution * direction;\n color += texture2D(texture, uv - 4.0 * step) * 0.02699548325659403;\n color += texture2D(texture, uv - 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv - 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv - 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv) * 0.19947114020071635;\n color += texture2D(texture, uv + 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv + 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv + 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv + 4.0 * step) * 0.02699548325659403;\n return color;\n}\n\nvoid main() {\n vec4 color = gaussianBlur(texture, vUv, 1.0, resolution, direction);\n gl_FragColor = color;\n}\n"});return(e=a.call(this,t,n)).name="PostEffectBlur",e}return t=s,(n=[{key:"start",value:function(e,t,n){this.material.uniforms.texture.value=e,this.material.uniforms.direction.value.set(t,n)}},{key:"resize",value:function(e,t){this.material.uniforms.resolution.value.set(e,t)}}])&&K(t.prototype,n),s}(r.Mesh);function te(e){return(te="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})(e)}function ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function re(e,t){return(re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ie(e,t){return!t||"object"!==te(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ae,se=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&re(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oe(i);if(o){var n=oe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ie(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(2,2),n=new r.RawShaderMaterial({uniforms:{texture1:{type:"t",value:null},texture2:{type:"t",value:null}},vertexShader:N,fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture1;\nuniform sampler2D texture2;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color1 = texture2D(texture1, vUv);\n vec4 color2 = texture2D(texture2, vUv);\n gl_FragColor = color1 + color2;\n}\n"});return(e=a.call(this,t,n)).name="PostEffectBloom",e}return t=s,(n=[{key:"start",value:function(e,t){this.material.uniforms.texture1.value=e,this.material.uniforms.texture2.value=t}}])&&ne(t.prototype,n),s}(r.Mesh);function ce(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var le=new r.Scene,fe=new y,he=new r.Clock({autoStart:!1}),ve=new c.L,de=new r.TextureLoader,pe=new r.WebGLRenderTarget,me=new r.WebGLRenderTarget,ye=new r.WebGLRenderTarget,ge=new r.Scene,xe=new r.OrthographicCamera(-1,1,1,-1,1,2),be=[],we=[],Me=[],_e=new r.Vector3,Se=new r.Vector3,Pe=new G,Te=new Y,Re=new ee,Ee=new ee,ze=new se,Le=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){var n,i,o,a,c,u,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(ae=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),ae.setClearColor(921102,1),fe.start(),Te.start(pe.texture),Re.start(me.texture,1,0),Ee.start(ye.texture,0,1),ze.start(pe.texture,me.texture),e.next=10,Promise.all([ve.loadAsync("/sketch-threejs/model/crystal/crystal.obj"),de.loadAsync("/sketch-threejs/img/sketch/crystal/normal.jpg"),de.loadAsync("/sketch-threejs/img/sketch/crystal/surface.jpg"),de.loadAsync("/sketch-threejs/img/sketch/crystal/fog.jpg")]).then((function(e){n=e[0].children.map((function(e){return e.geometry})),i=e[1],o=e[2],(a=e[3]).wrapS=r.RepeatWrapping,a.wrapT=r.RepeatWrapping})).catch((function(e){console.log(e)}));case 10:for(c=0;c<20;c++)u=s().radians(c/20*360),be[c]=new _(n[c%3]),be[c].position.set(35*Math.cos(u),0,35*Math.sin(u)),be[c].start(c/20,i,o,a),le.add(be[c]),we[c]=new z,we[c].position.copy(be[c].position),we[c].start(c/20),le.add(we[c]);for(c=0;c<40;c++)l=s().radians(c/40*360),f=s().radians(c/40*-360-90),Me[c]=new I,Me[c].position.set(100*Math.cos(l),-18-8*Math.sin(s().radians(c/40*360*8)),100*Math.sin(l)),Me[c].rotation.set(0,f,0),Me[c].start(c/40,a),le.add(Me[c]);le.add(Pe),_e.copy(be[0].position);case 14:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){ce(o,n,r,a,s,"next",e)}function s(e){ce(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"stop",value:function(){this.pause()}},{key:"play",value:function(e){he.start(),this.update(e)}},{key:"pause",value:function(){he.stop()}},{key:"update",value:function(e){if(!1!==he.running){for(var t=he.getDelta(),n=0;n<be.length;n++)be[n].update(t),we[n].update(t);for(n=0;n<Me.length;n++)Me[n].update(t);Pe.update(t,Math.atan2(fe.lookVelocity.z,fe.lookVelocity.x)/s().radians(360)),_e.set(Math.cos(s().radians(.6*-e.anchor.x)),0,Math.sin(s().radians(.6*-e.anchor.x))),fe.lookAnchor.copy(_e.clone().add(Se.clone().applyQuaternion(fe.quaternion))),fe.update(),ae.setRenderTarget(pe),ae.render(le,fe),ge.add(Te),ae.setRenderTarget(me),ae.render(ge,xe),ge.remove(Te),ge.add(Re),ae.setRenderTarget(ye),ae.render(ge,xe),ge.remove(Re),ge.add(Ee),ae.setRenderTarget(me),ae.render(ge,xe),ge.remove(Ee),ge.add(ze),ae.setRenderTarget(null),ae.render(ge,xe),ge.remove(ze)}}},{key:"resize",value:function(e){fe.resize(e),ae.setSize(e.x,e.y),pe.setSize(e.x*ae.getPixelRatio(),e.y*ae.getPixelRatio()),me.setSize(e.x*ae.getPixelRatio(),e.y*ae.getPixelRatio()),ye.setSize(e.x*ae.getPixelRatio(),e.y*ae.getPixelRatio()),Ee.resize(e.x/3,e.y/3),Re.resize(e.x/3,e.y/3)}},{key:"pan",value:function(e){Se.copy(e)}}])&&ue(t.prototype,n),e}();function Ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ae=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolution=t,this.vTouchStart=new r.Vector2,this.vPrev=new r.Vector2,this.v=new r.Vector2,this.a=new r.Vector2,this.anchor=new r.Vector2,this.isTouched=!1}var t,n;return t=e,(n=[{key:"update",value:function(){this.a.set((this.anchor.x-this.v.x)/10,(this.anchor.y-this.v.y)/10),this.v.add(this.a)}},{key:"touchStart",value:function(e){e.touches||e.preventDefault(),this.vPrev.copy(this.v),this.a.set(0,0),this.vTouchStart.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.isTouched=!0}},{key:"touchMove",value:function(e){e.preventDefault();var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY;!1!==this.isTouched&&this.anchor.set((t-this.vTouchStart.x)/(this.resolution.x/200)+this.vPrev.x,s().clamp((n-this.vTouchStart.y)/(this.resolution.y/200)+this.vPrev.y,-90,90))}},{key:"touchEnd",value:function(e){this.isTouched=!1}}])&&Ce(t.prototype,n),e}();function Oe(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function De(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Oe(o,r,i,a,s,"next",e)}function s(e){Oe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ie(){return ke.apply(this,arguments)}function ke(){return(ke=De(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u,l,f,h,v,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Le,n=new r.Vector2,i=new r.Vector3,a=document.getElementById("canvas-webgl"),s=document.querySelector(".p-preloader"),c=new Ae(n),u=function(){n.set(document.body.clientWidth,window.innerHeight),a.width=n.x,a.height=n.y,t.resize(n)},l=function(e){c.touchStart(e)},f=function(e){c.touchMove(e)},h=function(e){c.touchEnd(e)},v=function(){a.addEventListener("mousedown",l,{passive:!1}),window.addEventListener("mousemove",(function(e){f(e),i.set(.1*(e.clientX/n.x*2-1),.1*(-e.clientY/n.y*2+1),0),t.pan(i)})),document.addEventListener("mouseleave",(function(e){i.set(0,0,0),t.pan(i)})),window.addEventListener("mouseup",h),a.addEventListener("touchstart",l,{passive:!1}),window.addEventListener("touchmove",f,{passive:!1}),window.addEventListener("touchend",h),window.addEventListener("resize",o()(u,100))},d=function e(){c.update(n),t.update(c),requestAnimationFrame(e)},e.next=14,t.start(a);case 14:v(),u(),s.classList.add("is-hidden"),t.play(c),d();case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},12700:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.instances=2e3,this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(100,4e3,2,2,2);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),a=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),s=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),c=0,u=this.instances;c<u;c++)r.setXYZ(c,o.randomArbitrary(-5e3,5e3),0,o.randomArbitrary(-500,500)+700*(2*o.randomInt(0,1)-1)),a.setXYZ(c,2*Math.random()),s.setXYZ(c,.3*Math.random());e.setAttribute("instancePosition",r),e.setAttribute("delay",a),e.setAttribute("h",s);var l=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(75923).Z,fragmentShader:n(83528).Z,depthWrite:!1,transparent:!0,side:i.DoubleSide,blending:i.AdditiveBlending});this.obj=new i.InstancedMesh(e,l,this.instances)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},30131:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.isShown=!1,this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.SphereGeometry(1e4,32,32),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(97550).Z,fragmentShader:n(63819).Z,side:i.BackSide});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},2925:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},wave1:{type:"f",value:0},wave2:{type:"f",value:0},wave3:{type:"f",value:0},wave4:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(e,t,r,o,a){var s=new i.SphereGeometry(e,64,64),c=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(21750).Z,fragmentShader:n(57139).Z,transparent:!0,depthWrite:!1,side:i.BackSide,blending:i.AdditiveBlending});this.uniforms.wave1.value=t,this.uniforms.wave2.value=r,this.uniforms.wave3.value=o,this.uniforms.wave4.value=a,this.obj=new i.Mesh(s,c)}},{key:"render",value:function(e,t,n,r){this.uniforms.time.value+=e,this.obj.rotation.set(t,this.uniforms.time.value*n,r)}}])&&r(t.prototype,o),e}())},67735:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}}),n(2212);var i=n(90887),o=(n(17393),function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.camera=t,this.anchorTilt=[0,0,0]}var t,n;return t=e,(n=[{key:"init",value:function(e,t){for(var n=0;n<e.length;n++)this.camera.anchor[n]=this.camera.velocity[n]=e[n],this.camera.lookAnchor[n]=this.camera.lookVelocity[n]=t[n]}},{key:"tilt",value:function(e){this.anchorTilt=[-50*e.x,25*e.y,0]}},{key:"move",value:function(e,t,n){for(var r=0;r<e.length;r++)this.camera.anchor[r]=e[r],this.camera.lookAnchor[r]=t[r];n>0&&this.focalLength.next!==n&&(this.focalLength.prev=this.focalLength.next,this.focalLength.next=n,this.focalLength.time=0)}},{key:"render",value:function(e,t){this.tilt(t),i.vec3.add(this.camera.velocity,this.camera.velocity,this.anchorTilt),this.camera.render()}}])&&r(t.prototype,n),e}())},40602:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.num=2e3,this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){for(var e=new i.BufferGeometry,t=new i.BufferAttribute(new Float32Array(3*this.num),3,1),r=new i.BufferAttribute(new Float32Array(this.num),1,1),a=new i.BufferAttribute(new Float32Array(this.num),1,1),s=0,c=this.num;s<c;s++){var u=o.radians(o.randomArbitrary(0,150)-75),l=o.radians(o.randomArbitrary(0,360)),f=o.randomArbitrary(600,2500),h=o.spherical(u,l,f);t.setXYZ(s,h[0],h[1],h[2]),r.setXYZ(s,Math.random()),a.setXYZ(s,o.randomArbitrary(5,10)*(2*o.randomInt(0,1)-1))}e.setAttribute("position",t),e.setAttribute("delay",r),e.setAttribute("speed",a);var v=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(51263).Z,fragmentShader:n(80261).Z,transparent:!0,depthWrite:!1,blending:i.AdditiveBlending});this.obj=new i.Points(e,v)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},15642:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},texture1:{type:"t",value:null},texture2:{type:"t",value:null},texture3:{type:"t",value:null}},this.num=6,this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(e){var t=new i.InstancedBufferGeometry,r=new i.PlaneGeometry(1200,1200,2,2);t.copy(r);for(var o=new i.InstancedBufferAttribute(new Float32Array(3*this.num),3),a=new i.InstancedBufferAttribute(new Float32Array(this.num),1),s=new i.InstancedBufferAttribute(new Float32Array(this.num),1),c=new i.InstancedBufferAttribute(new Float32Array(this.num),1),u=new i.InstancedBufferAttribute(new Float32Array(this.num),1),l=0,f=this.num;l<f;l++)o.setXYZ(l,0,0,-150*(this.num-l)),a.setXYZ(l,2*Math.random()-1),s.setXYZ(l,2*Math.random()-1),c.setXYZ(l,2*Math.random()-1),u.setXYZ(l,.15*(2*Math.random()-1));t.setAttribute("instancePosition",o),t.setAttribute("rotate1",a),t.setAttribute("rotate2",s),t.setAttribute("rotate3",c),t.setAttribute("h",u);var h=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(40233).Z,fragmentShader:n(54691).Z,transparent:!0,blending:i.AdditiveBlending});this.uniforms.texture1.value=e[0],this.uniforms.texture2.value=e[1],this.uniforms.texture3.value=e[2],this.obj=new i.InstancedMesh(t,h,this.num)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},58525:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj,this.objWire=null,this.objPoints=null}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.RingGeometry(1550,1600,36,2,o.radians(135),o.radians(270)),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(85345).Z,fragmentShader:n(45943).Z,depthWrite:!1,transparent:!0,blending:i.AdditiveBlending}),r=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(85345).Z,fragmentShader:n(2766).Z,depthWrite:!1,transparent:!0,blending:i.AdditiveBlending,wireframe:!0}),a=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(4798).Z,fragmentShader:n(97125).Z,depthWrite:!1,transparent:!0,blending:i.AdditiveBlending});this.obj=new i.Mesh(e,t),this.objWire=new i.Mesh(e,r),this.objPoints=new i.Points(e,a),this.obj.position.set(0,0,-1200),this.objWire.position.set(0,0,-1200),this.objPoints.position.set(0,0,-1200)}},{key:"render",value:function(e){this.uniforms.time.value+=e;var t=[o.radians(20*Math.sin(.1*this.uniforms.time.value)+90),o.radians(20*Math.sin(.05*this.uniforms.time.value)),0];this.obj.rotation.set(t[0],t[1],t[2]),this.objWire.rotation.set(t[0],t[1],t[2]),this.objPoints.rotation.set(t[0],t[1],t[2])}}])&&r(t.prototype,a),e}()},57262:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(2212),i=n(38314),o=n(17393),a=n(4679),s=n(71243),c=n(97355).Z,u=n(59170).Z,l=n(67735).Z,f=n(15642).Z,h=n(12700).Z,v=n(58525).Z,d=n(40602).Z,p=n(30131).Z,m=n(2925).Z;function y(){var e=new r.Vector2,t=new r.Vector2,n=document.getElementById("canvas-webgl"),y=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),g=new r.Scene,x=new c,b=new l(x),w=new r.Clock;x.far=5e4,x.setFocalLength(24);var M=new f,_=new h,S=new v,P=new d,T=new p,R=new m,E=new m,z=function e(){var n;n=w.getDelta(),M.render(n),_.render(n),S.render(n),P.render(n),T.render(n),R.render(n,.1,.1,.3),E.render(n,-.2,.02,-.8),b.render(n,t),y.render(g,x),requestAnimationFrame(e)},L=function(){e.set(document.body.clientWidth,window.innerHeight),n.width=e.x,n.height=e.y,x.aspect=e.x/e.y,x.updateProjectionMatrix(),y.setSize(e.x,e.y)};u({gui1:"img/cyberspace/tex_gui01.png",gui2:"img/cyberspace/tex_gui02.png",gui3:"img/cyberspace/tex_gui03.png"},(function(n){M.createObj([n.gui1,n.gui2,n.gui3]),_.createObj(),S.createObj(),P.createObj(),T.createObj(),R.createObj(1200,284.1,398.6,601.2,828.4),E.createObj(2400,222.6,412.4,683.9,961.2),g.add(M.obj),g.add(_.obj),g.add(S.obj),g.add(S.objWire),g.add(S.objPoints),g.add(P.obj),g.add(T.obj),g.add(R.obj),g.add(E.obj),T.obj.position.set(0,0,-2e3),y.setClearColor(0,1),b.init([0,0,1e3],[0,0,0]),w.start(),window.addEventListener("resize",i(L,1e3)),a()||s()?window.addEventListener("deviceorientation",(function(n){e.x/e.y<1?t.set(n.gamma/60,o.clamp(Math.abs(n.beta)-90,-90,90)/-30):t.set(0,0)})):(window.addEventListener("mousemove",(function(n){t.set(n.clientX/e.x*2-1,-(n.clientY/e.y*2-1))})),window.addEventListener("mouseout",(function(e){t.set(0,0)}))),L(),z()}))}},37175:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(2212),i=n(38314),o=n.n(i),a=n(29130),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(c,e);var t,i,o,a,s=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(o);if(a){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.PlaneGeometry(2,2),i=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},interval:{type:"f",value:5},duration:{type:"f",value:3},resolution:{type:"v2",value:new r.Vector2},imageResolution:{type:"v2",value:new r.Vector2(2048,1356)},textures:{type:"f",value:0}},vertexShader:n(54312).Z,fragmentShader:n(88940).Z});return(e=s.call(this,t,i)).name="Mesh",e}return t=c,(i=[{key:"start",value:function(e,t){this.resize(e);for(var n=0;n<t.length;n++)t[n].magFilter=r.NearestFilter,t[n].minFilter=r.NearestFilter;this.material.uniforms.textures.value=t}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&u(t.prototype,i),c}(r.Mesh);function d(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){d(o,r,i,a,s,"next",e)}function s(e){d(o,r,i,a,s,"throw",e)}a(void 0)}))}}var m=new r.TextureLoader;function y(){return g.apply(this,arguments)}function g(){return(g=p(regeneratorRuntime.mark((function e(){var t,n,i,a,c,u,l,f,h,d,p,y,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new r.Vector2,n=document.getElementById("canvas-webgl"),i=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),a=new r.Scene,c=new r.PerspectiveCamera,u=new r.Clock({autoStart:!1}),l=document.querySelector(".p-preloader"),f=new v,h=function(){var e=u.getDelta();f.update(e),i.render(a,c)},d=function e(){h(),requestAnimationFrame(e)},p=function(){c.setViewOffset(1200,800,(t.x-1200)/-2,(t.y-800)/-2,t.x,t.y),c.updateProjectionMatrix()},y=function(){t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,p(),f.resize(t),i.setSize(t.x,t.y)},g=function(){window.addEventListener("resize",o()(y,1e3))},i.setClearColor(15658734,1),c.aspect=1.5,c.far=1e3,c.setFocalLength(50),c.position.set(0,0,300),c.lookAt(new r.Vector3),g(),y(),e.next=23,Promise.all([m.loadAsync("/sketch-threejs/img/sketch/dissolve/osaka01.jpg"),m.loadAsync("/sketch-threejs/img/sketch/dissolve/osaka02.jpg"),m.loadAsync("/sketch-threejs/img/sketch/dissolve/osaka03.jpg"),m.loadAsync("/sketch-threejs/img/sketch/dissolve/osaka04.jpg"),m.loadAsync("/sketch-threejs/img/sketch/dissolve/osaka05.jpg")]).then((function(e){f.start(t,e)}));case 23:return a.add(f),l.classList.add("is-hidden"),e.next=27,s()(200);case 27:u.start(),d();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},19963:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(12390),c=n.n(s),u=n(97719);function l(){var e,t,i,s,l,f,h,v,d=document.getElementById("canvas-webgl"),p=new r.WebGL1Renderer({antialias:!0,canvas:d}),m=new r.Scene,y=new u.Z(35,window.innerWidth/window.innerHeight,1,1e4),g=(new r.Clock,null),x=null,b=new r.HemisphereLight(16777215,6710886,1),w=new r.Scene,M=new u.Z(45,window.innerWidth/window.innerHeight,1,1e4),_=new r.HemisphereLight(16777215,6710886,1),S=new(c()),P=1,T=new r.WebGLRenderTarget(window.innerWidth,window.innerHeight,{magFilter:r.NearestFilter,minFilter:r.NearestFilter,wrapS:r.ClampToEdgeWrapping,wrapT:r.ClampToEdgeWrapping}),R=null,E=function(){d.width=window.innerWidth,d.height=window.innerHeight,y.aspect=window.innerWidth/window.innerHeight,y.updateProjectionMatrix(),p.setSize(window.innerWidth,window.innerHeight),T.setSize(window.innerWidth,window.innerHeight),M.resize(window.innerWidth,window.innerHeight),R.material.uniforms.resolution.value.set(window.innerWidth,window.innerHeight)};p.setSize(window.innerWidth,window.innerHeight),p.setClearColor(15658734,1),y.position.set(1e3,1e3,1e3),y.lookAt(new r.Vector3),i=new r.Vector2,s=new r.Vector2,l=new r.Vector2,f=function(e,t,n){i.set(e,t),(0,a.Z)(i),S.anchor.x<3?(S.k+=.005,S.d-=.02,S.anchor.x+=.8,P+=.4):(S.k=.05,S.d=.16,S.anchor.x=1,P=1)},h=function(e,t,n){s.set(e,t),(0,a.Z)(s)},v=function(e,t,n){l.set(e,t)},window.addEventListener("resize",o()((function(){E()})),1e3),d.addEventListener("mousedown",(function(e){e.preventDefault(),f(e.clientX,e.clientY)})),d.addEventListener("mousemove",(function(e){e.preventDefault(),h(e.clientX,e.clientY)})),d.addEventListener("mouseup",(function(e){e.preventDefault(),v(e.clientX,e.clientY)})),d.addEventListener("touchstart",(function(e){e.preventDefault(),f(e.touches[0].clientX,e.touches[0].clientY)})),d.addEventListener("touchmove",(function(e){e.preventDefault(),h(e.touches[0].clientX,e.touches[0].clientY)})),d.addEventListener("touchend",(function(e){e.preventDefault(),v(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),l.set(0,0)})),document.body.className="bg-white",e=new r.OctahedronGeometry(200,16),t=new r.ShaderMaterial({uniforms:r.UniformsUtils.merge([r.UniformsLib.lights,{time:{type:"f",value:0},radius:{type:"f",value:1},distort:{type:"f",value:.4}}]),vertexShader:n(67112).Z,fragmentShader:n(61786).Z,lights:!0}),g=new r.Mesh(e,t),w.add(g),x=function(){var e=new r.SphereGeometry(1800),t=new r.MeshPhongMaterial({side:r.BackSide});return new r.Mesh(e,t)}(),w.add(x),w.add(_),M.force.position.anchor.set(1800,1800,0),M.force.look.anchor.set(0,0,0),R=function(){var e=new r.PlaneGeometry(2,2),t=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0},resolution:{type:"v2",value:new r.Vector2(window.innerWidth,window.innerHeight)},acceleration:{type:"f",value:0},texture:{type:"t",value:T.texture}},vertexShader:n(11697).Z,fragmentShader:n(19820).Z});return new r.Mesh(e,t)}(),m.add(R),m.add(b),y.force.position.anchor.set(1800,1800,0),y.force.look.anchor.set(0,0,0),S.anchor.set(1,0),S.anchor.set(1,0),S.velocity.set(1,0),S.k=.045,S.d=.16,E(),function e(){S.applyHook(0,S.k),S.applyDrag(S.d),S.updateVelocity(),g.material.uniforms.time.value+=P,g.material.uniforms.radius.value=S.velocity.x,g.material.uniforms.distort.value=S.velocity.x/2-.1,M.force.position.applyHook(0,.025),M.force.position.applyDrag(.2),M.force.position.updateVelocity(),M.updatePosition(),M.force.look.applyHook(0,.2),M.force.look.applyDrag(.4),M.force.look.updateVelocity(),M.updateLook(),R.material.uniforms.time.value+=P,R.material.uniforms.acceleration.value=S.acceleration.length(),y.force.position.applyHook(0,.025),y.force.position.applyDrag(.2),y.force.position.updateVelocity(),y.updatePosition(),y.force.look.applyHook(0,.2),y.force.look.applyDrag(.4),y.force.look.updateVelocity(),y.lookAt(y.force.look.velocity),p.setRenderTarget(T),p.render(w,M),p.setRenderTarget(null),p.render(m,y),requestAnimationFrame(e)}()}},67687:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(2212),i=n(38314),o=n.n(i),a=n(29130),s=n.n(a),c=n(17393),u=n.n(c);function l(e){return(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})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(c,e);var t,i,o,a,s=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(o);if(a){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=new r.BufferGeometry,i=6e3,o=12e3,a=new r.BufferAttribute(new Float32Array(36e3),3),l=new r.BufferAttribute(new Float32Array(o),1),f=new r.BufferAttribute(new Float32Array(o),1),h=new r.BufferAttribute(new Float32Array(o),1),v=0;v<i;v++){var d=Math.random(),p={x:(2*Math.random()-1)*d*6,y:(2*Math.random()-1)*d*6,z:(2*Math.random()-1)*d*6};a.setXYZ(v,150*(v/i*2-1)+p.x,p.y,p.z),l.setX(v,u().radians(v/i*900+v%2*180)),f.setX(v,18),h.setX(v,u().radians(360*Math.random()))}for(var m=0;m<60;m++)for(var y=u().radians(m/60*900),g=0;g<100;g++){var x=100*m+g+i,b=Math.random(),w={x:(2*Math.random()-1)*b*1,y:(2*Math.random()-1)*b*1,z:(2*Math.random()-1)*b*1};a.setXYZ(x,150*(m/60*2-1)+w.x,w.y,w.z),l.setX(x,y),f.setX(x,18*(g/100*2-1)),h.setX(x,u().radians(360*Math.random()))}t.setAttribute("position",a),t.setAttribute("radian",l),t.setAttribute("radius",f),t.setAttribute("delay",h);var M=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:n(29277).Z,fragmentShader:n(90217).Z,transparent:!0,blending:r.AdditiveBlending,depthWrite:!1});return(e=s.call(this,t,M)).name="DNA Herix",e}return t=c,(i=[{key:"render",value:function(e){this.material.uniforms.time.value+=e}}])&&f(t.prototype,i),c}(r.Points);function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},texture:{type:"t",value:t},resolution:{type:"v2",value:new r.Vector2}},this.obj}var t,i;return t=e,(i=[{key:"createObj",value:function(){var e=new r.PlaneGeometry(2,2),t=new r.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(60125).Z,fragmentShader:n(59339).Z});this.obj=new r.Mesh(e,t),this.obj.name="PostEffect"}},{key:"resize",value:function(e,t){this.uniforms.resolution.value.set(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&m(t.prototype,i),e}();function g(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function x(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){g(o,r,i,a,s,"next",e)}function s(e){g(o,r,i,a,s,"throw",e)}a(void 0)}))}}function b(){return w.apply(this,arguments)}function w(){return(w=x(regeneratorRuntime.mark((function e(){var t,n,i,a,c,u,l,f,h,v,d,m,g,x,b,w,M;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new r.Vector2,n=document.getElementById("canvas-webgl"),i=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),a=new r.Scene,c=new r.PerspectiveCamera,u=new r.Clock({autoStart:!1}),l=new r.WebGLRenderTarget,f=new r.Scene,h=new r.OrthographicCamera(-1,1,1,-1,1,2),v=document.querySelector(".p-preloader"),d=new p,(m=new y(l.texture)).createObj(),f.add(m.obj),g=function(){var e=u.getDelta();d.render(e),i.setRenderTarget(l),i.render(a,c),m.render(e),i.setRenderTarget(null),i.render(f,h)},x=function e(){g(),requestAnimationFrame(e)},b=function(){c.setFocalLength(50),c.setViewOffset(1200,800,(t.x-1200)/-2,(t.y-800)/-2,t.x,t.y),c.updateProjectionMatrix()},w=function(){t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,b(),i.setSize(t.x,t.y),l.setSize(t.x,t.y),m.resize(t.x,t.y)},M=function(){window.addEventListener("blur",(function(){u.stop()})),window.addEventListener("focus",(function(){u.start()})),window.addEventListener("resize",o()(w,1e3))},i.setClearColor(0,1),c.aspect=1.5,c.far=1e3,c.position.set(-110,-75,45),c.lookAt(new r.Vector3(0,0,0)),a.add(d),M(),w(),v.classList.add("is-hidden"),e.next=30,s()(200);case 30:u.start(),x();case 32:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},61954:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(2212),i=n(38314),o=n.n(i),a=n(29130),s=n.n(a),c=n(17393),u=n.n(c);function l(e){return(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})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(i);if(o){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(20,10),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},texture:{type:"t",value:null},textureNoise:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\nuniform sampler2D textureNoise;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 getGlitchColor(vec2 uv, float force) {\n vec2 r = vec2(\n random(vec2(ceil(time * 20.0), 0.0)) * 2.0 - 1.0,\n random(vec2(0.0, ceil(time * 20.0))) * 2.0 - 1.0\n );\n vec2 noiseUv = uv + r * 0.001;\n float mask = smoothstep(\n length(vec3(1.0)) - force * 0.004,\n length(vec3(1.0)),\n length(texture2D(textureNoise, uv * vec2(0.2, 0.4) * r).rgb)\n );\n vec4 texColor = texture2D(texture, noiseUv + r * 0.01 * force) * (1.0 - mask);\n vec4 texColorDiff = texture2D(texture, noiseUv + r * force) * mask;\n return texColor + texColorDiff;\n}\n\nvoid main() {\n float shake = random(vec2(time));\n float force = smoothstep(0.5, 1.0, sin(time * 4.0) * 0.8 + sin(time * 5.0) + 0.2);\n\n vec2 uvR = vUv + vec2(-0.008 - shake * 0.002, 0.0);\n vec2 uvG = vUv + vec2( 0.0, 0.0);\n vec2 uvB = vUv + vec2( 0.008 + shake * 0.002, 0.0);\n\n vec4 r = getGlitchColor(uvR, force) * vec4(1.0, 0.0, 0.0, 1.0);\n vec4 g = getGlitchColor(uvG, force) * vec4(0.0, 1.0, 0.0, 1.0);\n vec4 b = getGlitchColor(uvB, force) * vec4(0.0, 0.0, 1.0, 1.0);\n vec4 color = r + g + b;\n\n if (color.a < 0.1) discard;\n\n gl_FragColor = color;\n}\n",transparent:!0,blending:r.AdditiveBlending});return(e=a.call(this,t,n)).name="Typo",e}return t=s,(n=[{key:"start",value:function(e,t){this.material.uniforms.texture.value=e,this.material.uniforms.textureNoise.value=t}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&f(t.prototype,n),s}(r.Mesh);function m(e){return(m="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})(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b(i);if(o){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return x(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.InstancedBufferGeometry,n=new r.OctahedronGeometry(2,0);t.copy(n);for(var i=new r.InstancedBufferAttribute(new Float32Array(90),3),o=new r.InstancedBufferAttribute(new Float32Array(30),1),c=(new r.Vector3,0);c<30;c++)i.setXYZ(c,3*c+15,0,0),o.setXYZ(c,c);t.setAttribute("iPosition",i),t.setAttribute("iIds",o);var l=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 iPosition;\nattribute float iIds;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main(void) {\n // coordinate transformation\n mat4 rotateMat = calcRotateMat4(vec3(radians(iIds * 20.0 + time * 4.0)));\n vec3 rotatePosition = (rotateMat * vec4(position, 1.0)).xyz;\n mat4 rotateMatWorld = calcRotateMat4Y(radians(iIds * 56.0 + time * 0.5));\n vec4 mPosition = modelMatrix * rotateMatWorld * vec4(iPosition + rotatePosition, 1.0);\n\n vPosition = mPosition.xyz;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\n\nvoid main() {\n vec3 light = normalize(vec3(1.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = pow((dot(normal, light) + 1.0) / 2.0, 3.0);\n\n vec3 rgb = vec3(10.0 / 255.0, 20.0 / 255.0, 38.0 / 255.0);\n\n gl_FragColor = vec4(rgb + diff * 0.2, 1.0);\n}\n"});return(e=a.call(this,t,l,30)).rotation.set(0,u().radians(40),u().radians(30)),e.name="Debris",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&y(t.prototype,n),s}(r.InstancedMesh);function M(e){return(M="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})(e)}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=T(i);if(o){var n=T(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return P(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(100,12,12),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nconst vec3 rgb1 = vec3(0.0 / 255.0, 0.0 / 255.0, 0.0 / 255.0);\nconst vec3 rgb2 = vec3(44.0 / 255.0, 58.0 / 255.0, 83.0 / 255.0);\n\nvoid main() {\n vec3 rgb = mix(rgb1, rgb2, vUv.y * 4.0 - 1.0);\n float noise = random(vUv + vec2(0.0, time * 0.01)) * 0.04;\n\n gl_FragColor = vec4(rgb + noise, 1.0);\n}\n",side:r.BackSide});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&_(t.prototype,n),s}(r.Mesh);function E(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function z(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){E(o,r,i,a,s,"next",e)}function s(e){E(o,r,i,a,s,"throw",e)}a(void 0)}))}}function L(){return C.apply(this,arguments)}function C(){return(C=z(regeneratorRuntime.mark((function e(){var t,n,i,a,c,u,l,f,h,v,d,m,y,g,x,b,M,_;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new r.Vector2,n=document.getElementById("canvas-webgl"),i=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),a=new r.Scene,c=new r.PerspectiveCamera,u=new r.Vector2,l=new r.Clock({autoStart:!1}),f=new r.TextureLoader,h=document.querySelector(".p-preloader"),v=new p,d=new w,m=new R,g=function(){var e=l.getDelta();v.update(e),d.update(e),m.update(e),i.render(a,c)},x=function e(){g(),requestAnimationFrame(e)},b=function(){t.x>t.y?u.set(t.x>=1200?1200:t.x,t.x>=1200?800:.66*t.x):u.set(.6*(t.y>=1200?800:.66*t.y),.6*(t.y>=1200?1200:t.y)),c.setViewOffset(u.x,u.y,(t.x-u.x)/-2,(t.y-u.y)/-2,t.x,t.y),c.updateProjectionMatrix()},M=function(){t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,b(),i.setSize(t.x,t.y)},_=function(){window.addEventListener("blur",(function(){l.stop()})),window.addEventListener("focus",(function(){l.start()})),window.addEventListener("resize",o()(M,100))},i.setClearColor(1118481,1),c.aspect=1.5,c.far=1e3,c.setFocalLength(50),c.position.set(0,0,50),c.lookAt(new r.Vector3),e.next=25,Promise.all([f.loadAsync("../img/sketch/easy_glitch/typo.png"),f.loadAsync("../img/sketch/easy_glitch/noise.png")]).then((function(e){y=e}));case 25:return y&&(y[0].wrapS=r.RepeatWrapping,y[0].wrapT=r.RepeatWrapping,y[1].wrapS=r.RepeatWrapping,y[1].wrapT=r.RepeatWrapping,y[1].minFilter=r.NearestFilter,y[1].magFilter=r.NearestFilter,v.start(y[0],y[1]),a.add(v)),d.start(),m.start(),a.add(d),a.add(m),_(),M(),h.classList.add("is-hidden"),e.next=35,s()(200);case 35:l.start(),x();case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},99729:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},noiseRange:{type:"f",value:3*Math.random()},speed:{type:"f",value:.08},circleOutStepMin:{type:"f",value:.1},circleOutStepMax:{type:"f",value:1},circleInStepMin:{type:"f",value:0},circleInStepMax:{type:"f",value:.3},noisePosition:{type:"f",value:.8},noiseSize:{type:"f",value:.5}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.Mesh(new i.PlaneGeometry(640,640),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(28914).Z,fragmentShader:n(24678).Z,transparent:!0}));return e.position.set(80,0,0),e}},{key:"render",value:function(e){this.obj.visible&&(this.uniforms.time.value+=e)}}])&&r(t.prototype,o),e}()},59895:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2212),i=n(38314),o=n(99729).Z;function a(){var e={x:0,y:0},t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({antialias:!1,canvas:t}),a=new r.Scene,s=new r.OrthographicCamera(-1,1,1,-1,1,1e4),c=new r.Clock,u=new r.Vector2,l=new r.Vector2,f=new r.Vector2,h=new o,v=function(){var r,i;e.x=document.body.clientWidth,e.y=window.innerHeight,t.width=e.x,t.height=e.y,r=640*Math.min(e.x/e.y/(640/480),1),i=480*Math.min(e.y/e.x/.75,1),s.left=-.5*r,s.right=.5*r,s.top=.5*i,s.bottom=-.5*i,s.updateProjectionMatrix(),n.setSize(e.x,e.y)};window.addEventListener("resize",i(v,1e3)),t.addEventListener("mousedown",(function(e){e.preventDefault(),u.set(e.clientX,e.clientY)})),document.addEventListener("mousemove",(function(e){e.preventDefault(),l.set(e.clientX,e.clientY)})),document.addEventListener("mouseup",(function(e){e.preventDefault(),f.set(e.clientX,e.clientY)})),t.addEventListener("touchstart",(function(e){e.preventDefault(),u.set(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchmove",(function(e){e.preventDefault(),l.set(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchend",(function(e){e.preventDefault(),f.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),v(),n.setClearColor(16711406,1),s.position.set(0,0,100),s.lookAt(new r.Vector3),a.add(h.obj),function e(){var t;t=c.getDelta(),h.render(t),n.render(a,s),requestAnimationFrame(e)}()}},56160:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(97719),c=n(42935),u=n(33286),l=n.n(u),f=n(7318),h=n.n(f),v=n(45695),d=n.n(v);function p(){var e,t,i,u,f,v,p=document.getElementById("canvas-webgl"),m=new r.WebGL1Renderer({antialias:!0,canvas:p}),y=new r.Scene,g=new s.Z(35,window.innerWidth/window.innerHeight,1,1e4),x=(new r.Clock,1e4),b=[],w=new(h()),M=new c.Z(16737792,1,1800,1),_=new Float32Array(3e4),S=new Float32Array(3e4),P=new Float32Array(x),T=new Float32Array(x),R=new r.Vector3(0,.1,0),E=null,z=Date.now(),L=!1,C=function(e){var t=e.y*window.innerHeight/3,n=e.x*window.innerWidth/-3;w.anchor.y=t,w.anchor.z=n,M.force.anchor.y=t,M.force.anchor.z=n},A=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=null,i=null;return e.width=200,e.height=200,(n=t.createRadialGradient(100,100,20,100,100,100)).addColorStop(.2,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.3)"),n.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=n,t.arc(100,100,100,0,Math.PI/180,!0),t.fill(),(i=new r.Texture(e)).minFilter=r.NearestFilter,i.needsUpdate=!0,i},O=function(){p.width=window.innerWidth,p.height=window.innerHeight,g.aspect=window.innerWidth/window.innerHeight,g.updateProjectionMatrix(),m.setSize(window.innerWidth,window.innerHeight)};m.setSize(window.innerWidth,window.innerHeight),m.setClearColor(0,1),g.position.set(1e3,1e3,1e3),g.lookAt(new r.Vector3),e=new r.Vector2,t=new r.Vector2,i=new r.Vector2,u=function(t,n,r){e.set(t,n),(0,a.Z)(e),C(e),L=!0},f=function(e,n,r){t.set(e,n),(0,a.Z)(t),L&&C(t)},v=function(e,t,n){i.set(e,t),L=!1,w.anchor.set(0,0,0),M.force.anchor.set(0,0,0)},window.addEventListener("resize",o()((function(){O()})),1e3),p.addEventListener("mousedown",(function(e){e.preventDefault(),u(e.clientX,e.clientY)})),p.addEventListener("mousemove",(function(e){e.preventDefault(),f(e.clientX,e.clientY)})),p.addEventListener("mouseup",(function(e){e.preventDefault(),v(e.clientX,e.clientY)})),p.addEventListener("touchstart",(function(e){e.preventDefault(),u(e.touches[0].clientX,e.touches[0].clientY)})),p.addEventListener("touchmove",(function(e){e.preventDefault(),f(e.touches[0].clientX,e.touches[0].clientY)})),p.addEventListener("touchend",(function(e){e.preventDefault(),v(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),i.set(0,0),L=!1,w.anchor.set(0,0,0),M.force.anchor.set(0,0,0)})),function(){for(var e=0;e<x;e++){var t=new(l()),i=d().getRandomInt(0,45),o=d().getRandomInt(60,90),a=new r.Color("hsl("+i+", "+o+"%, 50%)");t.init(new r.Vector3(d().getRandomInt(-100,100),0,0)),b.push(t),_[3*e+0]=t.velocity.x,_[3*e+1]=t.velocity.y,_[3*e+2]=t.velocity.z,a.toArray(S,3*e),P[e]=t.a,T[e]=t.size}var s,c;w.init({scene:y,vs:n(99173).Z,fs:n(77911).Z,positions:_,colors:S,opacities:P,sizes:T,texture:A(),blending:r.AdditiveBlending}),y.add(M),s=new r.OctahedronGeometry(1500,3),c=new r.MeshPhongMaterial({color:16777215,flatShading:!0,side:r.BackSide}),E=new r.Mesh(s,c),y.add(E),g.setPolarCoord(d().getRadian(25),0,1e3),M.setPolarCoord(d().getRadian(25),0,200)}(),O(),function e(){w.applyHook(0,.08),w.applyDrag(.2),w.updateVelocity(),M.force.applyHook(0,.08),M.force.applyDrag(.2),M.force.updateVelocity(),M.updatePosition(),function(){var e=0;if(Date.now()-z>10){for(var t=0;t<b.length;t++){var n=b[t];if(!n.is_active){var i=d().getRadian(Math.log(d().getRandomInt(0,256))/Math.log(256)*260),o=d().getRadian(d().getRandomInt(0,360)),a=12*(1-Math.log(d().getRandomInt(32,256))/Math.log(256)),s=new r.Vector3,c=d().getPolarCoord(i,o,a);if(s.add(w.velocity),n.activate(),n.init(s),n.applyForce(c),n.a=.2,n.size=Math.pow(12-a,2)*d().getRandomInt(1,24)/10,++e>=6)break}}z=Date.now()}}(),function(){for(var e=0;e<b.length;e++){var t=b[e];t.is_active&&(t.time++,t.applyForce(R),t.applyDrag(.01),t.updateVelocity(),t.time>50&&(t.size-=.7,t.a-=.009),t.a<=0&&(t.init(new r.Vector3(0,0,0)),t.time=0,t.a=0,t.inactivate())),_[3*e+0]=t.velocity.x-w.velocity.x,_[3*e+1]=t.velocity.y-w.velocity.y,_[3*e+2]=t.velocity.z-w.velocity.z,P[e]=t.a,T[e]=t.size}w.updatePoints()}(),g.force.position.applyHook(0,.004),g.force.position.applyDrag(.1),g.force.position.updateVelocity(),g.updatePosition(),g.lookAtCenter(),m.render(y,g),requestAnimationFrame(e)}()}},14449:function(e,t,n){"use strict";n.d(t,{Z:function(){return We}});var r=n(2212),i=n(38314),o=n.n(i),a=n(17393),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(i);if(o){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=5e3,this.setFocalLength(50),this.position.set(0,0,130),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix(),this.position.z=this.aspect<1?150:120}}])&&u(t.prototype,n),s}(r.PerspectiveCamera);function d(e){return(d="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})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g(i);if(o){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return y(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.OctahedronGeometry(10,6),n=new r.RawShaderMaterial({uniforms:{time:{value:0},noiseTex:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\n\nvarying vec2 vUv;\nvarying float vEdge;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n float angleToCamera = acos(dot(normalize(cameraPosition), normal));\n\n vUv = uv;\n vEdge = smoothstep(0.4, 1.0, abs(sin(angleToCamera)));\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\nvarying float vEdge;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n float noise1 = texture2D(noiseTex, vUv + vec2(time * 0.1, 0.0)).r;\n float noise2 = texture2D(noiseTex, vUv + vec2(time * -0.1, 0.0)).g;\n vec3 hsv = vec3(\n (noise1 + noise2) * 0.35 + time * 0.1,\n 1.0 - vEdge,\n 0.02 + vEdge * 0.98\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Core",e.acceleration=new r.Vector3,e.anchor=new r.Vector3,e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){this.material.uniforms.time.value+=e,this.applyHook(0,.2),this.applyDrag(.6),this.position.add(this.acceleration),this.lookAt(t.position)}},{key:"applyDrag",value:function(e){var t=this.acceleration.clone();t.multiplyScalar(-1),t.normalize(),t.multiplyScalar(this.acceleration.length()*e),this.acceleration.add(t)}},{key:"applyHook",value:function(e,t){var n=this.position.clone().sub(this.anchor),r=n.length()-e;n.normalize(),n.multiplyScalar(-1*t*r),this.acceleration.add(n)}}])&&p(t.prototype,n),s}(r.Mesh);function b(e){return(b="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(i);if(o){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(30,30),n=new r.RawShaderMaterial({uniforms:{time:{value:0},noiseTex:{value:null},acceleration:{value:new r.Vector3}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n float noise1 = texture2D(noiseTex, vUv * 0.25 + vec2(time * 0.1, 0.0)).r;\n float noise2 = texture2D(noiseTex, vUv * 0.25 + vec2(time * -0.1, 0.0)).g;\n float noise = (noise1 + noise2) / 2.0;\n vec3 hsv = vec3(\n noise * 0.5 + time * 0.1,\n 0.7,\n 0.7\n );\n vec3 rgb = convertHsvToRgb(hsv) * (1.0 - smoothstep(0.4, 1.0, length(p))) + (1.0 - smoothstep(0.67, 0.74, length(p)));\n float opacity = 1.0 - smoothstep(0.9, 1.0, length(p));\n\n if (opacity < 0.01) discard;\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",transparent:!0,blending:r.AdditiveBlending});return(e=a.call(this,t,n)).name="CoreLight",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){var n=this.material.uniforms;n.time.value+=e,n.acceleration.value.copy(t.acceleration),this.position.copy(t.position)}}])&&w(t.prototype,n),s}(r.Mesh);function T(e){return(T="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})(e)}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=L(i);if(o){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return z(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.OctahedronGeometry(10.1,10),n=new r.RawShaderMaterial({uniforms:{time:{value:0},noiseTex:{value:null},acceleration:{value:new r.Vector3}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nuniform float time;\nuniform sampler2D noiseTex;\nuniform vec3 acceleration;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n float noise1 = texture2D(noiseTex, uv * 0.25 + vec2(0.1, -0.1) * time).r;\n float noise2 = texture2D(noiseTex, uv * 0.25 + vec2(-0.1, -0.1) * time).g;\n float noise = (noise1 + noise2) * 0.5 * (1.0 - min(length(acceleration) / 5.0, 1.0));\n\n vec3 transformed = vec3(position + normalize(position) * smoothstep(0.2, 1.0, noise) * 15.0);\n\n vec4 mPosition = modelMatrix * vec4(transformed, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D noiseTex;\nuniform vec3 acceleration;\n\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float noise1 = texture2D(noiseTex, vUv * vec2(1.0, 0.5) + vec2(0.4, -0.3) * time).r;\n float noise2 = texture2D(noiseTex, vUv * vec2(1.0, 0.5) + vec2(-0.4, -0.6) * time).g;\n float noise3 = texture2D(noiseTex, vUv * vec2(1.0, 0.5) + vec2(0.0, -0.6) * time).b;\n float noise = (noise1 + noise2) / 2.0 * smoothstep(0.0, 0.15, vUv.y) * (1.0 - smoothstep(0.9, 1.0, vUv.y));\n noise = smoothstep(0.5 - min(length(acceleration) / 5.0, 1.0) * 0.15, 1.0, noise);\n vec3 hsv = vec3(\n noise * 0.5 + time * 0.1 + noise3 * 0.4,\n 0.7 - noise * 3.0,\n 0.6 + noise * 0.6\n );\n vec3 rgb = convertHsvToRgb(hsv);\n float opacity = noise;\n\n if (opacity < 0.01) discard;\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",side:r.DoubleSide});return(e=a.call(this,t,n)).name="Aura",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){var n=this.material.uniforms;n.time.value+=e,n.acceleration.value.copy(t.acceleration),this.position.copy(t.position)}}])&&R(t.prototype,n),s}(r.Mesh);function A(e){return(A="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})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F=400,j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(i);if(o){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.InstancedBufferGeometry,n=new r.PlaneGeometry(1,1);t.copy(n);for(var i=new r.InstancedBufferAttribute(new Float32Array(1200),3),o=new r.InstancedBufferAttribute(new Float32Array(1200),3),u=new r.InstancedBufferAttribute(new Float32Array(F),1),l=new r.InstancedBufferAttribute(new Float32Array(F),1),f=new r.InstancedBufferAttribute(new Float32Array(F),1),h=new r.InstancedBufferAttribute(new Float32Array(F),1),v=new r.InstancedBufferAttribute(new Float32Array(1200),3),d=new r.InstancedBufferAttribute(new Float32Array(800),2),p=0;p<400;p++){var m=s().radians(75*(2*Math.random()-1)),y=s().radians(360*Math.random()),g=s().spherical(m,y,1);i.setXYZ(p,5*g[0],5*g[1],5*g[2]),o.setXYZ(p,g[0],g[1],g[2]),u.setXYZ(p,0-5*Math.random()),l.setXYZ(p,2+4*Math.random()),f.setXYZ(p,20+15*Math.random()),h.setXYZ(p,1+1*Math.random()),v.setXYZ(p,2*Math.random()-1,2*Math.random()-1,2*Math.random()-1),d.setXYZ(p,2*Math.random()-1,2*Math.random()-1)}t.setAttribute("iPosition",i),t.setAttribute("iDirection",o),t.setAttribute("iTime",u),t.setAttribute("iDuration",l),t.setAttribute("iDistance",f),t.setAttribute("iScale",h),t.setAttribute("iRotate",v),t.setAttribute("iUvDiff",d);var x=new r.RawShaderMaterial({uniforms:{time:{value:0},noiseTex:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 iPosition;\nattribute vec3 iDirection;\nattribute float iTime;\nattribute float iDuration;\nattribute float iDistance;\nattribute float iScale;\nattribute vec3 iRotate;\nattribute vec2 iUvDiff;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec2 vUv;\nvarying vec2 vUvDiff;\nvarying float vOpacity;\nvarying float vStep;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvoid main(void) {\n float stp = iTime / iDuration;\n\n mat4 rotateMat = calcRotateMat4(iRotate * time * 2.0);\n mat4 scaleMat = calcScaleMat4(vec3(iScale));\n vec3 transformed = position + vec3(cos(time * 3.0) * 6.0 * stp, 0.0, sin(time * 3.0) * 6.0 * stp);\n transformed = (rotateMat * scaleMat * vec4(transformed, 1.0)).xyz;\n transformed = transformed + iPosition + iDirection * iDistance * stp;\n vec4 mPosition = modelMatrix * vec4(transformed, 1.0);\n\n vUv = uv;\n vUvDiff = iUvDiff;\n vOpacity = step(0.0, iTime);\n vStep = stp;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\nvarying vec2 vUvDiff;\nvarying float vOpacity;\nvarying float vStep;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n float noise = texture2D(noiseTex, (vUv + vUvDiff) * 0.25 + time * 0.1).r * 2.0 - 1.0;\n float stp = smoothstep(0.25, 1.0, vStep);\n noise = smoothstep(0.0 + stp, 0.2 + stp, noise * (1.0 - length(p)));\n float noise2 = texture2D(noiseTex, (vUv + vUvDiff) * 0.125 + time * 0.1).g;\n\n vec3 hsv = vec3(\n noise2 * 0.5 + time * 0.1,\n 0.4 - stp * 5.0,\n 0.95\n );\n vec3 rgb = convertHsvToRgb(hsv);\n float opacity = noise * vOpacity;\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",transparent:!0,side:r.DoubleSide,depthWrite:!1});return(e=a.call(this,t,x,F)).name="Sparks",e.frustumCulled=!1,e}return t=c,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){var n=this.geometry.attributes,r=n.iPosition,i=n.iDirection,o=n.iTime,a=n.iDuration;this.material.uniforms.time.value+=e;for(var s=0;s<o.count;s++){var c=a.getX(s),u=o.getX(s);(u>c||u<0&&u+e>0)&&(u%=c,r.setXYZ(s,5*i.getX(s)+t.position.x,5*i.getY(s)+t.position.y,5*i.getZ(s)+t.position.z)),o.setX(s,u+e)}r.needsUpdate=!0,o.needsUpdate=!0}}])&&O(t.prototype,n),c}(r.InstancedMesh);function U(e){return(U="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})(e)}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var V=function(e,t){var n=e.clone();n.multiplyScalar(-1),n.normalize(),n.multiplyScalar(e.length()*t),e.add(n)},W=function(e,t,n,r,i){var o=e.clone().sub(n),a=o.length()-r;o.normalize(),o.multiplyScalar(-1*i*a),t.add(o)},Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=H(i);if(o){var n=H(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return N(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=[],n=new r.CylinderGeometry(5,10,40,24,60,!0),i=n.attributes.position,o=new r.Vector3,c=[],u=[],l=[],f=new r.Bone,h=0;h<i.count;h++){o.fromBufferAttribute(i,h);var v=o.y+20,d=Math.floor(v/2),p=v%2/2;c.push(d,d+1,0,0),u.push(1-p,p,0,0)}for(var m=0;m<=20;m++){if(0===m)f.position.y=-20,l.push(f);else{var y=new r.Bone;y.position.y=2,l.push(y),f.add(y),f=y}t.push({velocity:new r.Vector3,acceleration:new r.Vector3})}n.setAttribute("skinIndex",new r.Uint16BufferAttribute(c,4)),n.setAttribute("skinWeight",new r.Float32BufferAttribute(u,4));var g=new r.RawShaderMaterial({uniforms:{time:{value:0},noiseTex:{value:null},acceleration:{value:new r.Vector3}},vertexShader:"precision highp float;\n#define GLSLIFY 1\n\n#define MAX_BONES 1024\n\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\n\nuniform mat4 bindMatrix;\nuniform mat4 bindMatrixInverse;\nuniform highp sampler2D boneTexture;\nuniform int boneTextureSize;\n\nuniform float time;\nuniform sampler2D noiseTex;\nuniform vec3 acceleration;\n\nmat4 getBoneMatrix(const in float i) {\n float j = i * 4.0;\n float x = mod(j, float(boneTextureSize));\n float y = floor(j / float(boneTextureSize));\n float dx = 1.0 / float(boneTextureSize);\n float dy = 1.0 / float(boneTextureSize);\n\n y = dy * (y + 0.5);\n\n vec4 v1 = texture2D(boneTexture, vec2(dx * (x + 0.5), y));\n vec4 v2 = texture2D(boneTexture, vec2(dx * (x + 1.5), y));\n vec4 v3 = texture2D(boneTexture, vec2(dx * (x + 2.5), y));\n vec4 v4 = texture2D(boneTexture, vec2(dx * (x + 3.5), y));\n mat4 bone = mat4(v1, v2, v3, v4);\n\n return bone;\n}\n\nvarying vec2 vUv;\n\nvoid main() {\n float noise1 = texture2D(noiseTex, uv + vec2(0.4, -0.8) * time).r;\n float noise2 = texture2D(noiseTex, uv + vec2(-0.4, -1.4) * time).g;\n float noise = ((noise1 + noise2) - 1.0) * (uv.y * 0.9 + 0.1) * min(length(acceleration) / 3.0, 1.0);\n\n vec3 transformed = vec3(position + normalize(position) * vec3(1.0, 0.0, 1.0) * noise * 40.0);\n\n mat4 boneMatX = getBoneMatrix(skinIndex.x);\n mat4 boneMatY = getBoneMatrix(skinIndex.y);\n mat4 boneMatZ = getBoneMatrix(skinIndex.z);\n mat4 boneMatW = getBoneMatrix(skinIndex.w);\n vec4 skinVertex = bindMatrix * vec4(transformed, 1.0);\n vec4 skinned = vec4(0.0);\n\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = (bindMatrixInverse * skinned).xyz;\n\n vec4 mvPosition = modelViewMatrix * vec4(transformed, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float noise1 = texture2D(noiseTex, vUv + vec2(0.4, -1.6) * time).r;\n float noise2 = texture2D(noiseTex, vUv + vec2(-0.4, -2.4) * time).g;\n float noise3 = texture2D(noiseTex, vUv + vec2(0.0, -0.6) * time).b;\n float noise = (noise1 + noise2) / 2.0 * (1.0 - vUv.y) * smoothstep(0.0, 0.05, vUv.y);\n noise = smoothstep(0.3, 1.0, noise);\n vec3 hsv = vec3(\n noise * 0.5 + time * 0.1 + noise3 * 0.4,\n 0.7 - noise * 3.0,\n 0.6 + noise * 0.6\n );\n vec3 rgb = convertHsvToRgb(hsv);\n float opacity = noise;\n\n if (opacity < 0.01) discard;\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",skinning:!0,side:r.DoubleSide}),x=new r.Skeleton(l);return(e=a.call(this,n,g)).top=new r.Vector3(0,1,0),e.hookes=t,e.time=0,e.add(l[0]),e.bind(x),e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){var n=this.material.uniforms,i=this.skeleton.bones,o=new r.Quaternion,a=new r.Quaternion;this.time+=e,n.time.value+=e;for(var s=0;s<this.hookes.length;s++){var c=this.hookes[s],u=c.velocity,l=c.acceleration;if(0===s)u.copy(t.position);else{var f=this.hookes[s-1].velocity;W(u,l,f,0,1),V(l,.7),u.add(l)}}n.acceleration.value.copy(t.acceleration);for(var h=0;h<i.length;h++){var v=i[h],d=this.hookes[h].velocity;if(0===h){var p=this.hookes[h+1].velocity.clone().sub(d).normalize(),m=(new r.Vector3).crossVectors(this.top,p).normalize(),y=Math.acos(this.top.clone().dot(p));o.setFromAxisAngle(m,y),v.rotation.setFromQuaternion(o),v.position.copy(t.position)}else if(h<i.length-1){var g=this.hookes[h-1].velocity,x=d.clone().sub(g).normalize(),b=(new r.Vector3).crossVectors(this.top,x).normalize(),w=Math.acos(this.top.clone().dot(x)),M=this.hookes[h+1].velocity.clone().sub(d).normalize(),_=(new r.Vector3).crossVectors(this.top,M).normalize(),S=Math.acos(this.top.clone().dot(M));o.setFromAxisAngle(b,w),a.setFromAxisAngle(_,S),o.conjugate().multiply(a),v.rotation.setFromQuaternion(o),v.position.y=d.distanceTo(g)}}}}])&&B(t.prototype,n),s}(r.SkinnedMesh);function q(e){return(q="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})(e)}function Y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e,t){return!t||"object"!==q(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var J=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&X(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Q(i);if(o){var n=Q(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return K(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.PlaneGeometry(1,1),n=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},noiseTex:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main() {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 updateUv = vec2(\n vUv.x * min(resolution.x / resolution.y, 1.0) + max(1.0 - resolution.x / resolution.y, 0.0) / 2.0,\n vUv.y * min(resolution.y / resolution.x, 1.0) + max(1.0 - resolution.y / resolution.x, 0.0) / 2.0\n );\n vec2 p = updateUv * 2.0 - 1.0;\n vec4 texColor1 = texture2D(noiseTex, updateUv + vec2(0.0, time * 0.01));\n vec4 texColor2 = texture2D(noiseTex, updateUv - vec2(0.0, time * 0.02));\n vec3 hsv1 = vec3(0.5 + time * 0.1 + vUv.y * 0.2, 0.4, 0.05);\n vec3 hsv2 = vec3(0.0 + time * 0.1 + vUv.y * 0.2, 0.4, 0.4);\n float hsvAlpha = pow((texColor1.r + texColor2.g) / 2.0, 3.0) * 2.0;\n vec3 color = convertHsvToRgb(mix(hsv1, hsv2, hsvAlpha) - (1.0 - smoothstep(0.0, 1.0, length(p))) * 0.3);\n\n gl_FragColor = vec4(color, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Background",e.position.z=-1e3,e}return t=c,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}},{key:"resize",value:function(e,t){var n=this.material.uniforms,r=Math.abs((e.position.z-this.position.z)*Math.tan(s().radians(e.fov)/2)*2),i=r*e.aspect;this.scale.set(i,r,1),n.resolution.value.copy(t)}}])&&Y(t.prototype,n),c}(r.Mesh),$="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n gl_Position = vec4(position, 1.0);\n}\n";function ee(e){return(ee="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})(e)}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function re(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ie(e){return(ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var oe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ne(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ie(i);if(o){var n=ie(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return re(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(2,2),n=new r.RawShaderMaterial({uniforms:{minBright:{value:.5},texture:{value:null}},vertexShader:$,fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float minBright;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 bright = max(vec4(0.0), (texture2D(texture, vUv) - minBright));\n gl_FragColor = bright;\n}\n"});return(e=a.call(this,t,n)).name="PostEffectBright",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.texture.value=e}}])&&te(t.prototype,n),s}(r.Mesh);function ae(e){return(ae="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})(e)}function se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ce(e,t){return(ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ue(e,t){return!t||"object"!==ae(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ce(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=le(i);if(o){var n=le(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ue(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(2,2),n=new r.RawShaderMaterial({uniforms:{resolution:{value:new r.Vector2},direction:{value:new r.Vector2},texture:{value:null}},vertexShader:$,fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 direction;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvec4 gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 step = radius / resolution * direction;\n color += texture2D(texture, uv - 4.0 * step) * 0.02699548325659403;\n color += texture2D(texture, uv - 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv - 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv - 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv) * 0.19947114020071635;\n color += texture2D(texture, uv + 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv + 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv + 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv + 4.0 * step) * 0.02699548325659403;\n return color;\n}\n\nvoid main() {\n vec4 color = gaussianBlur(texture, vUv, 1.0, resolution, direction);\n gl_FragColor = color;\n}\n"});return(e=a.call(this,t,n)).name="PostEffectBlur",e}return t=s,(n=[{key:"start",value:function(e,t,n){this.material.uniforms.texture.value=e,this.material.uniforms.direction.value.set(t,n)}},{key:"resize",value:function(e,t){this.material.uniforms.resolution.value.set(e,t)}}])&&se(t.prototype,n),s}(r.Mesh);function he(e){return(he="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})(e)}function ve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function de(e,t){return(de=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e,t){return!t||"object"!==he(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function me(e){return(me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye,ge=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&de(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=me(i);if(o){var n=me(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return pe(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(2,2),n=new r.RawShaderMaterial({uniforms:{texture1:{value:null},texture2:{value:null}},vertexShader:$,fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture1;\nuniform sampler2D texture2;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color1 = texture2D(texture1, vUv);\n vec4 color2 = texture2D(texture2, vUv);\n gl_FragColor = color1 + color2;\n}\n"});return(e=a.call(this,t,n)).name="PostEffectBloom",e}return t=s,(n=[{key:"start",value:function(e,t){this.material.uniforms.texture1.value=e,this.material.uniforms.texture2.value=t}}])&&ve(t.prototype,n),s}(r.Mesh);function xe(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var we=new r.Scene,Me=new v,_e=new r.Clock({autoStart:!1}),Se=new r.WebGLRenderTarget,Pe=new r.WebGLRenderTarget,Te=new r.WebGLRenderTarget,Re=new r.Scene,Ee=new r.OrthographicCamera(-1,1,1,-1,1,2),ze=new x,Le=new P,Ce=new C,Ae=new j,Oe=new Z,De=new J,Ie=new r.TextureLoader,ke=new r.Vector2,Fe=!1,je=new oe,Ue=new fe,Be=new fe,Ge=new ge,Ne=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(ye=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),ye.setClearColor(921102,1),e.next=5,Promise.all([Ie.loadAsync("/sketch-threejs/img/sketch/flow_field/noise.jpg")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,t.format=r.RGBFormat,t.type=r.FloatType,t.minFilter=r.NearestFilter,t.magFilter=r.NearestFilter,ze.start(t),Le.start(t),Ce.start(t),Ae.start(t),Oe.start(t),De.start(t)}));case 5:we.add(ze),we.add(Le),we.add(Ce),we.add(Ae),we.add(Oe),we.add(De),Me.start(),je.start(Se.texture),Ue.start(Pe.texture,1,0),Be.start(Te.texture,0,1),Ge.start(Se.texture,Pe.texture);case 16:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){xe(o,n,r,a,s,"next",e)}function s(e){xe(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){_e.start(),this.update()}},{key:"pause",value:function(){_e.stop()}},{key:"update",value:function(){if(!1!==_e.running){var e=_e.getDelta();Me.update(e),ze.update(e,Me),Le.update(e,ze),Ce.update(e,ze),Ae.update(e,ze),Oe.update(e,ze),De.update(e),ye.setRenderTarget(Se),ye.render(we,Me),Re.add(je),ye.setRenderTarget(Pe),ye.render(Re,Ee),Re.remove(je),Re.add(Ue),ye.setRenderTarget(Te),ye.render(Re,Ee),Re.remove(Ue),Re.add(Be),ye.setRenderTarget(Pe),ye.render(Re,Ee),Re.remove(Be),Re.add(Ge),ye.setRenderTarget(null),ye.render(Re,Ee),Re.remove(Ge)}}},{key:"resize",value:function(e){Me.resize(e),De.resize(Me,e),ye.setSize(e.x,e.y),Se.setSize(e.x*ye.getPixelRatio(),e.y*ye.getPixelRatio()),Pe.setSize(e.x*ye.getPixelRatio(),e.y*ye.getPixelRatio()),Te.setSize(e.x*ye.getPixelRatio(),e.y*ye.getPixelRatio()),Be.resize(e.x/4,e.y/4),Ue.resize(e.x/4,e.y/4)}},{key:"setCoreAnchor",value:function(e){var t=70*(ke.y/e.y*2-1),n=Math.abs((Me.position.z-t)*Math.tan(s().radians(Me.fov)/2)*2),r=n*Me.aspect;ze.anchor.set((ke.x/e.x-.5)*r,-(ke.y/e.y-.5)*n,t)}},{key:"touchStart",value:function(e,t){e.touches||e.preventDefault(),ke.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),Fe=!0,this.setCoreAnchor(t)}},{key:"touchMove",value:function(e,t){e.touches||e.preventDefault(),!0===Fe&&(ke.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.setCoreAnchor(t))}},{key:"touchEnd",value:function(){Fe=!1}}])&&be(t.prototype,n),e}();function He(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Ve(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){He(o,r,i,a,s,"next",e)}function s(e){He(o,r,i,a,s,"throw",e)}a(void 0)}))}}function We(){return Ze.apply(this,arguments)}function Ze(){return(Ze=Ve(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Ne,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){var e=function(e){t.touchStart(e,n)},r=function(e){t.touchMove(e,n)},a=function(){t.touchEnd()};i.addEventListener("mousedown",e,{passive:!1}),window.addEventListener("mousemove",r,{passive:!1}),window.addEventListener("mouseup",a),i.addEventListener("touchstart",e,{passive:!1}),window.addEventListener("touchmove",r,{passive:!1}),window.addEventListener("touchend",a),window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},18081:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.SphereGeometry(1e4,128,128),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(44873).Z,fragmentShader:n(33274).Z,side:i.BackSide});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},56027:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}}),n(2212);var i=n(90887),o=(n(17393),function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.camera=t,this.anchorTilt=[0,0,0]}var t,n;return t=e,(n=[{key:"init",value:function(e,t){for(var n=0;n<e.length;n++)this.camera.anchor[n]=this.camera.velocity[n]=e[n],this.camera.lookAnchor[n]=this.camera.lookVelocity[n]=t[n]}},{key:"tilt",value:function(e){this.anchorTilt=[-200*e.x,200*e.y,0]}},{key:"move",value:function(e,t,n){for(var r=0;r<e.length;r++)this.camera.anchor[r]=e[r],this.camera.lookAnchor[r]=t[r];n>0&&this.focalLength.next!==n&&(this.focalLength.prev=this.focalLength.next,this.focalLength.next=n,this.focalLength.time=0)}},{key:"render",value:function(e,t){this.tilt(t),i.vec3.add(this.camera.velocity,this.camera.velocity,this.anchorTilt),this.camera.render()}}])&&r(t.prototype,n),e}())},41208:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.OctahedronGeometry(450,10),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(92665).Z,fragmentShader:n(97459).Z});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},22215:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(1e3,3e3,128,128),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(44202).Z,fragmentShader:n(4653).Z,transparent:!0,depthWrite:!1,side:i.DoubleSide,blending:i.AdditiveBlending});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},55536:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.num=5e3,this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(16,800,200);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(3*this.num),3),a=new i.InstancedBufferAttribute(new Float32Array(this.num),1),s=new i.InstancedBufferAttribute(new Float32Array(this.num),1),c=new i.InstancedBufferAttribute(new Float32Array(this.num),1),u=0,l=this.num;u<l;u++){o.radians(o.randomArbitrary(0,360));var f=o.randomArbitrary(1e3,7e3),h=(7e3-f)/7e3*.75+.25,v=o.randomArbitrary(.1,.4);r.setXYZ(u,f,o.randomArbitrary(-1e4,-100),0),a.setXYZ(u,h),s.setXYZ(u,u),c.setXYZ(u,v)}e.setAttribute("instancePosition",r),e.setAttribute("scale",a),e.setAttribute("rotate",s),e.setAttribute("speed",c);var d=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(25746).Z,fragmentShader:n(13292).Z});this.obj=new i.InstancedMesh(e,d,this.num)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},86918:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(2212),i=n(38314),o=n(17393),a=n(4679),s=n(71243),c=n(97355).Z,u=n(56027).Z,l=n(41208).Z,f=n(22215).Z,h=n(55536).Z,v=n(18081).Z;function d(){var e=new r.Vector2,t=new r.Vector2,n=document.getElementById("canvas-webgl"),d=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),p=new r.Scene,m=new c,y=new u(m),g=new r.Clock;m.far=5e4,m.setFocalLength(35);var x=new l,b=new f,w=new h,M=new v,_=function(){e.set(document.body.clientWidth,window.innerHeight),n.width=e.x,n.height=e.y,m.aspect=e.x/e.y,m.updateProjectionMatrix(),d.setSize(e.x,e.y)};x.createObj(),b.createObj(),w.createObj(),M.createObj(),p.add(x.obj),p.add(b.obj),p.add(w.obj),p.add(M.obj),d.setClearColor(0,1),y.init([0,1500,3e3],[0,-100,0]),g.start(),window.addEventListener("resize",i(_,1e3)),a()||s()?window.addEventListener("deviceorientation",(function(n){e.x/e.y<1?t.set(n.gamma/60,-.02*o.clamp(Math.abs(n.beta)-90,-90,90)):t.set(0,0)})):(window.addEventListener("mousemove",(function(n){t.set(n.clientX/e.x*2-1,-(n.clientY/e.y*2-1))})),window.addEventListener("mouseout",(function(e){t.set(0,0)}))),_(),function e(){var n;n=g.getDelta(),x.render(n),b.render(n),w.render(n),M.render(n),y.render(n,t),d.render(p,m),requestAnimationFrame(e)}()}},95185:function(e,t,n){"use strict";n.d(t,{Z:function(){return Q}});var r=n(2212),i=n(38314),o=n.n(i),a=n(52886);function s(e){return(s="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})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(i);if(o){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=1e3,this.setFocalLength(50),this.position.set(0,0,90),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&c(t.prototype,n),s}(r.PerspectiveCamera);function v(e){return(v="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})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(i);if(o){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=new r.BufferGeometry,n=new r.BufferAttribute(new Float32Array(3*Math.pow(32,3)),3),i=new r.BufferAttribute(new Float32Array(3*Math.pow(32,3)),3),o=new r.BufferAttribute(new Float32Array(Math.pow(32,3)),1),c=0;c<16;c++)for(var u=c/15,l=30*(2*u-1),f=0;f<16;f++)for(var h=f/15,v=30*(2*h-1),d=0;d<16;d++){var p=2*(c*Math.pow(16,2)+16*f+d),m=d/15,y=30*(2*m-1);n.setXYZ(p,l,v,y),n.setXYZ(p+1,l,v,y),i.setXYZ(p,u,h,m),i.setXYZ(p+1,u,h,m),o.setXYZ(p,0),o.setXYZ(p+1,1)}t.setAttribute("position",n),t.setAttribute("uv",i),t.setAttribute("movable",o);var g=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},pixelRatio:{value:window.devicePixelRatio},noiseTex:{value:null},multiTime:{value:new r.Vector2}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 uv;\nattribute float movable;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform vec2 resolution;\nuniform float pixelRatio;\nuniform sampler2D noiseTex;\nuniform vec2 multiTime;\n\nvarying vec3 vColor;\n\nvoid main() {\n // Coordinate transformation\n vec3 v = position;\n float texColorR = texture2D(noiseTex, (v.yz + v.x + time * multiTime * 14.0) * 0.01).r;\n float texColorG = texture2D(noiseTex, (v.zx + v.y + time * multiTime * 14.0) * 0.01).g;\n float texColorB = texture2D(noiseTex, (v.xy + v.z + time * multiTime * 14.0) * 0.01).b;\n vec3 noise = vec3(\n texColorR,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(position + noise * movable * 2.0, 1.0);\n float distanceFromCamera = length(mvPosition.xyz);\n\n vColor = vec3(texColorR, texColorG, texColorB);\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 0.2);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(e=a.call(this,t,g)).name="Points",e}return t=s,(n=[{key:"start",value:function(e,t){var n=this.material.uniforms;n.noiseTex.value=e,n.multiTime.value.copy(t)}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&d(t.prototype,n),s}(r.LineSegments),x=n(17393),b=n.n(x),w="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",M="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D initData;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = texture2D(initData, vUv);\n}\n";function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var S=function(e,t,n){return new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:e,vertexShader:t,fragmentShader:n}))},P=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a={type:/(iPad|iPhone|iPod)/g.test(navigator.userAgent)?r.HalfFloatType:r.FloatType,minFilter:r.NearestFilter,magFilter:r.NearestFilter};this.side=0,this.aScene=new r.Scene,this.vScene=new r.Scene,this.camera=new r.OrthographicCamera,this.acceleration=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.velocity=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.aUniforms={velocity:{value:null},acceleration:{value:null},time:{value:0}},this.vUniforms={side:{value:0},velocity:{value:null},acceleration:{value:null},time:{value:0}},this.aMesh=S(this.aUniforms,t,n),this.vMesh=S(this.vUniforms,i,o),this.uvs=[],this.targetIndex=0}var t,n;return t=e,(n=[{key:"start",value:function(e,t,n,i,o){this.side=this.vUniforms.side.value=Math.ceil(Math.sqrt(n.length/3)),this.camera.top=.5*this.side,this.camera.bottom=-.5*this.side,this.camera.right=.5*this.side,this.camera.left=-.5*this.side,this.camera.position.z=10;for(var a=[],s=[],c=0;c<3*Math.pow(this.side,2);c+=3)t&&null!=t[c]?(a[c+0]=t[c+0],a[c+1]=t[c+1],a[c+2]=t[c+2]):(a[c+0]=0,a[c+1]=0,a[c+2]=0),n&&null!=n[c]?(s[c+0]=n[c+0],s[c+1]=n[c+1],s[c+2]=n[c+2]):(s[c+0]=0,s[c+1]=0,s[c+2]=0),this.uvs[c/3*2+0]=c/3%this.side/(this.side-1),this.uvs[c/3*2+1]=Math.floor(c/3/this.side)/(this.side-1);if(i){var u=Object.keys(i);if(u.length)for(c=0;c<u.length;c++){for(var l=i[u[c]],f=l.array.length;f<s.length/3*l.itemSize;f++)l.array.push(0);this.aMesh.geometry.setAttribute(u[c],new r.BufferAttribute(new Float32Array(l.array),l.itemSize))}}if(o){var h=Object.keys(o);if(h.length)for(c=0;c<h.length;c++){var v=o[h[c]];for(f=v.array.length;f<s.length/3*v.itemSize;f++)v.array.push(0);this.vMesh.geometry.setAttribute(h[c],new r.BufferAttribute(new Float32Array(v.array),v.itemSize))}}for(c=0;c<2;c++)this.acceleration[c].setSize(this.side,this.side),this.velocity[c].setSize(this.side,this.side);var d=new r.DataTexture(new Float32Array(a),this.side,this.side,r.RGBFormat,r.FloatType);d.format=r.RGBFormat,d.type=r.FloatType,d.magFilter=r.NearestFilter,d.minFilter=r.NearestFilter,d.needsUpdate=!0;var p=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:d}},vertexShader:w,fragmentShader:M}));this.aScene.add(this.camera),this.aScene.add(p),e.setRenderTarget(this.acceleration[Math.abs(this.targetIndex-1)]),e.render(this.aScene,this.camera),this.aScene.remove(p),this.aScene.add(this.aMesh);var m=new r.DataTexture(new Float32Array(s),this.side,this.side);m.format=r.RGBFormat,m.type=r.FloatType,m.magFilter=r.NearestFilter,m.minFilter=r.NearestFilter,m.needsUpdate=!0;var y=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:m}},vertexShader:w,fragmentShader:M}));this.vScene.add(this.camera),this.vScene.add(y),e.setRenderTarget(this.velocity[this.targetIndex]),e.render(this.vScene,this.camera),this.vScene.remove(y),this.vScene.add(this.vMesh)}},{key:"update",value:function(e,t){var n=Math.abs(this.targetIndex-1),r=this.targetIndex;this.aUniforms.acceleration.value=this.acceleration[n].texture,this.aUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.acceleration[r]),e.render(this.aScene,this.camera),this.vUniforms.acceleration.value=this.acceleration[r].texture,this.vUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.velocity[n]),e.render(this.vScene,this.camera),this.targetIndex=n,this.aUniforms.time.value+=t,this.vUniforms.time.value+=t}},{key:"getBufferAttributeUv",value:function(){return new r.BufferAttribute(new Float32Array(this.uvs),2)}},{key:"getCurrentVelocity",value:function(){return this.velocity[Math.abs(this.targetIndex-1)].texture}},{key:"getCurrentAcceleration",value:function(){return this.acceleration[Math.abs(this.targetIndex-1)].texture}},{key:"mergeAUniforms",value:function(e){this.aUniforms=Object.assign(this.aUniforms,e)}},{key:"mergeVUniforms",value:function(e){this.vUniforms=Object.assign(this.vUniforms,e)}},{key:"createDataTexture",value:function(e){for(var t=[],n=0;n<3*Math.pow(this.side,2);n+=3)null!=e[n]?(t[n+0]=e[n+0],t[n+1]=e[n+1],t[n+2]=e[n+2]):(t[n+0]=0,t[n+1]=0,t[n+2]=0);return new r.DataTexture(new Float32Array(t),this.side,this.side,r.RGBFormat,r.FloatType)}}])&&_(t.prototype,n),e}();function T(e){return(T="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})(e)}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=L(i);if(o){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return z(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=new r.BufferGeometry,n=new r.BufferAttribute(new Float32Array(45e4),3),i=0;i<15e4;i++)n.setXYZ(i,0,0,0);t.setAttribute("position",n);var o=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},pixelRatio:{value:window.devicePixelRatio},acceleration:{value:null},velocity:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\nuniform vec2 resolution;\nuniform float pixelRatio;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v = texture2D(velocity, uvVelocity).xyz;\n vec4 mvPosition = modelViewMatrix * vec4(v, 1.0);\n\n // Define the point size.\n float distanceFromCamera = length(mvPosition.xyz);\n float pointSize = 4.0 * resolution.y / 1024.0 * pixelRatio * 50.0 / distanceFromCamera;\n\n vColor = a * 0.4 + 0.4;\n vOpacity = length(a);\n\n gl_PointSize = pointSize;\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n float radius = length(p);\n float opacity = 1.0 - smoothstep(0.5, 1.0, radius);\n\n if (opacity <= 0.0) discard;\n\n gl_FragColor = vec4(vColor, vOpacity * opacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(e=a.call(this,t,o)).name="Mover",e.frustumCulled=!1,e.physicsRenderer,e.multiTime=new r.Vector2(2*Math.random()-1,2*Math.random()-1),e}return t=s,(n=[{key:"start",value:function(e,t){for(var n=this.material.uniforms,r=this.geometry.attributes.position.array,i=[],o=[],a=[],s=[],c=0;c<r.length;c+=3){var u=b().radians(360*Math.random()),l=1*Math.random()+2;i[c+0]=-29.99,i[c+1]=Math.cos(u)*l,i[c+2]=Math.sin(u)*l,o[c+0]=i[c+0],o[c+1]=i[c+1],o[c+2]=i[c+2],a[c+0]=10*Math.random(),a[c+1]=0,a[c+2]=0,s[c+0]=Math.random(),s[c+1]=0,s[c+2]=0}this.physicsRenderer=new P("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D noiseTex;\nuniform sampler2D delay;\nuniform sampler2D mass;\nuniform vec2 multiTime;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n float dl = texture2D(delay, vUv).x;\n float mass = texture2D(mass, vUv).x;\n vec3 d = drag(a, 0.01 + mass * 0.01);\n\n float texColorR = texture2D(noiseTex, (v.yz + v.x + time * multiTime * 14.0) * 0.01).r;\n float texColorG = texture2D(noiseTex, (v.zx + v.y + time * multiTime * 14.0) * 0.01).g;\n float texColorB = texture2D(noiseTex, (v.xy + v.z + time * multiTime * 14.0) * 0.01).b;\n vec3 noise = vec3(\n texColorR,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec3 f = noise * 0.008 * step(dl, time);\n\n float init = clamp(step(30.0, abs(v.x)) + step(30.0, abs(v.y)) + step(30.0, abs(v.z)), 0.0, 1.0);\n vec3 ff = (f + a + d) * (1.0 - init) + vec3(0.0) * init;\n\n gl_FragColor = vec4(ff, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocityFirst;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 vf = texture2D(velocityFirst, vUv).xyz;\n\n float init = clamp(step(30.0, abs(v.x)) + step(30.0, abs(v.y)) + step(30.0, abs(v.z)), 0.0, 1.0);\n v = (a + v) * (1.0 - init) + vf * init;\n\n gl_FragColor = vec4(v, 1.0);\n}\n"),this.physicsRenderer.start(e,[],i),this.physicsRenderer.mergeAUniforms({noiseTex:{value:t},delay:{value:this.physicsRenderer.createDataTexture(a)},mass:{value:this.physicsRenderer.createDataTexture(s)},multiTime:{value:this.multiTime}}),this.physicsRenderer.mergeVUniforms({velocityFirst:{value:this.physicsRenderer.createDataTexture(o)}}),n.acceleration.value=this.physicsRenderer.getCurrentAcceleration(),n.velocity.value=this.physicsRenderer.getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",this.physicsRenderer.getBufferAttributeUv())}},{key:"update",value:function(e,t){var n=this.material.uniforms;this.physicsRenderer.update(e,t),n.acceleration.value=this.physicsRenderer.getCurrentAcceleration(),n.velocity.value=this.physicsRenderer.getCurrentVelocity(),n.time.value+=t}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&R(t.prototype,n),s}(r.Points);function A(e){return(A="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})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F,j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(i);if(o){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=new r.BufferGeometry,n=16,i=new r.BufferAttribute(new Float32Array(3*Math.pow(n,3)),3),o=new r.BufferAttribute(new Float32Array(3*Math.pow(n,3)),3),c=0;c<n;c++)for(var u=c/15,l=30*(2*u-1),f=0;f<n;f++)for(var h=f/15,v=30*(2*h-1),d=0;d<n;d++){var p=c*Math.pow(n,2)+f*n+d,m=d/15,y=30*(2*m-1);i.setXYZ(p,l,v,y),o.setXYZ(p,u,h,m)}t.setAttribute("position",i),t.setAttribute("uv",o);var g=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},pixelRatio:{value:window.devicePixelRatio},noiseTex:{value:null},multiTime:{value:new r.Vector2}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform vec2 resolution;\nuniform float pixelRatio;\nuniform sampler2D noiseTex;\nuniform vec2 multiTime;\n\nvarying vec3 vColor;\n\nvoid main() {\n // Coordinate transformation\n vec3 v = position;\n float texColorR = texture2D(noiseTex, (v.yz + v.x + time * multiTime * 14.0) * 0.01).r;\n float texColorG = texture2D(noiseTex, (v.zx + v.y + time * multiTime * 14.0) * 0.01).g;\n float texColorB = texture2D(noiseTex, (v.xy + v.z + time * multiTime * 14.0) * 0.01).b;\n vec3 noise = vec3(\n texColorR,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(position + noise * 2.0, 1.0);\n float distanceFromCamera = length(mvPosition.xyz);\n\n // Define the point size.\n float pointSize = 3.0 * resolution.y / 1024.0 * pixelRatio * 50.0 / distanceFromCamera;\n\n vColor = vec3(texColorR, texColorG, texColorB);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = pointSize;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 0.2);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(e=a.call(this,t,g)).name="Points",e}return t=s,(n=[{key:"start",value:function(e,t){var n=this.material.uniforms;n.noiseTex.value=e,n.multiTime.value.copy(t)}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&O(t.prototype,n),s}(r.Points);function U(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var G=new r.Scene,N=new h,H=new r.Clock({autoStart:!1}),V=new g,W=new C,Z=new j,q=new r.TextureLoader,Y=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(F=new r.WebGLRenderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),F.setClearColor(921102,1),new a.z(N,F.domElement),e.next=6,Promise.all([q.loadAsync("/sketch-threejs/img/sketch/flow_field/noise.jpg")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,t.format=r.RGBFormat,t.type=r.FloatType,t.minFilter=r.NearestFilter,t.magFilter=r.NearestFilter,W.start(F,t),V.start(t,W.multiTime),Z.start(t,W.multiTime)}));case 6:G.add(V),G.add(W),G.add(Z),N.start();case 10:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){U(o,n,r,a,s,"next",e)}function s(e){U(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){H.start(),this.update()}},{key:"pause",value:function(){H.stop()}},{key:"update",value:function(){if(!1!==H.running){var e=H.getDelta();N.update(e),V.update(e),W.update(F,e),Z.update(e),F.setRenderTarget(null),F.render(G,N)}}},{key:"resize",value:function(e){N.resize(e),V.resize(e),W.resize(e),Z.resize(e),F.setSize(e.x,e.y)}}])&&B(t.prototype,n),e}();function X(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){X(o,r,i,a,s,"next",e)}function s(e){X(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Q(){return J.apply(this,arguments)}function J(){return(J=K(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Y,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},86139:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var r=n(2212),i=n(38314),o=n.n(i),a=n(52886);function s(e){return(s="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})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(i);if(o){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=1e3,this.setFocalLength(50),this.position.set(80,0,0),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&c(t.prototype,n),s}(r.PerspectiveCamera),v=n(17393),d=n.n(v),p="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",m="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D initData;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = texture2D(initData, vUv);\n}\n";function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var g=function(e,t,n){return new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:e,vertexShader:t,fragmentShader:n}))},x=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a={type:/(iPad|iPhone|iPod)/g.test(navigator.userAgent)?r.HalfFloatType:r.FloatType,minFilter:r.NearestFilter,magFilter:r.NearestFilter};this.side=0,this.aScene=new r.Scene,this.vScene=new r.Scene,this.camera=new r.OrthographicCamera,this.acceleration=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.velocity=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.aUniforms={velocity:{value:null},acceleration:{value:null},time:{value:0}},this.vUniforms={side:{value:0},velocity:{value:null},acceleration:{value:null},time:{value:0}},this.aMesh=g(this.aUniforms,t,n),this.vMesh=g(this.vUniforms,i,o),this.uvs=[],this.targetIndex=0}var t,n;return t=e,(n=[{key:"start",value:function(e,t,n,i,o){this.side=this.vUniforms.side.value=Math.ceil(Math.sqrt(n.length/3)),this.camera.top=.5*this.side,this.camera.bottom=-.5*this.side,this.camera.right=.5*this.side,this.camera.left=-.5*this.side,this.camera.position.z=10;for(var a=[],s=[],c=0;c<3*Math.pow(this.side,2);c+=3)t&&null!=t[c]?(a[c+0]=t[c+0],a[c+1]=t[c+1],a[c+2]=t[c+2]):(a[c+0]=0,a[c+1]=0,a[c+2]=0),n&&null!=n[c]?(s[c+0]=n[c+0],s[c+1]=n[c+1],s[c+2]=n[c+2]):(s[c+0]=0,s[c+1]=0,s[c+2]=0),this.uvs[c/3*2+0]=c/3%this.side/(this.side-1),this.uvs[c/3*2+1]=Math.floor(c/3/this.side)/(this.side-1);if(i){var u=Object.keys(i);if(u.length)for(c=0;c<u.length;c++){for(var l=i[u[c]],f=l.array.length;f<s.length/3*l.itemSize;f++)l.array.push(0);this.aMesh.geometry.setAttribute(u[c],new r.BufferAttribute(new Float32Array(l.array),l.itemSize))}}if(o){var h=Object.keys(o);if(h.length)for(c=0;c<h.length;c++){var v=o[h[c]];for(f=v.array.length;f<s.length/3*v.itemSize;f++)v.array.push(0);this.vMesh.geometry.setAttribute(h[c],new r.BufferAttribute(new Float32Array(v.array),v.itemSize))}}for(c=0;c<2;c++)this.acceleration[c].setSize(this.side,this.side),this.velocity[c].setSize(this.side,this.side);var d=new r.DataTexture(new Float32Array(a),this.side,this.side,r.RGBFormat,r.FloatType);d.format=r.RGBFormat,d.type=r.FloatType,d.magFilter=r.NearestFilter,d.minFilter=r.NearestFilter,d.needsUpdate=!0;var y=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:d}},vertexShader:p,fragmentShader:m}));this.aScene.add(this.camera),this.aScene.add(y),e.setRenderTarget(this.acceleration[Math.abs(this.targetIndex-1)]),e.render(this.aScene,this.camera),this.aScene.remove(y),this.aScene.add(this.aMesh);var g=new r.DataTexture(new Float32Array(s),this.side,this.side);g.format=r.RGBFormat,g.type=r.FloatType,g.magFilter=r.NearestFilter,g.minFilter=r.NearestFilter,g.needsUpdate=!0;var x=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:g}},vertexShader:p,fragmentShader:m}));this.vScene.add(this.camera),this.vScene.add(x),e.setRenderTarget(this.velocity[this.targetIndex]),e.render(this.vScene,this.camera),this.vScene.remove(x),this.vScene.add(this.vMesh)}},{key:"update",value:function(e,t){var n=Math.abs(this.targetIndex-1),r=this.targetIndex;this.aUniforms.acceleration.value=this.acceleration[n].texture,this.aUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.acceleration[r]),e.render(this.aScene,this.camera),this.vUniforms.acceleration.value=this.acceleration[r].texture,this.vUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.velocity[n]),e.render(this.vScene,this.camera),this.targetIndex=n,this.aUniforms.time.value+=t,this.vUniforms.time.value+=t}},{key:"getBufferAttributeUv",value:function(e){var t=e.instanced;return void 0!==t&&t?new r.InstancedBufferAttribute(new Float32Array(this.uvs),2):new r.BufferAttribute(new Float32Array(this.uvs),2)}},{key:"getCurrentVelocity",value:function(){return this.velocity[Math.abs(this.targetIndex-1)].texture}},{key:"getCurrentAcceleration",value:function(){return this.acceleration[Math.abs(this.targetIndex-1)].texture}},{key:"mergeAUniforms",value:function(e){this.aUniforms=Object.assign(this.aUniforms,e)}},{key:"mergeVUniforms",value:function(e){this.vUniforms=Object.assign(this.vUniforms,e)}},{key:"createDataTexture",value:function(e){for(var t=[],n=0;n<3*Math.pow(this.side,2);n+=3)null!=e[n]?(t[n+0]=e[n+0],t[n+1]=e[n+1],t[n+2]=e[n+2]):(t[n+0]=0,t[n+1]=0,t[n+2]=0);return new r.DataTexture(new Float32Array(t),this.side,this.side,r.RGBFormat,r.FloatType)}}])&&y(t.prototype,n),e}();function b(e){return(b="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P,T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(i);if(o){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.InstancedBufferGeometry,n=new r.ConeGeometry(.1,2,5);t.copy(n);var i=new r.RawShaderMaterial({uniforms:{time:{value:0},acceleration:{value:null},velocity:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\nuniform vec2 resolution;\nuniform float pixelRatio;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nstruct Quaternion {\n float x;\n float y;\n float z;\n float w;\n};\n\n// https://qiita.com/aa_debdeb/items/c34a3088b2d8d3731813\nQuaternion axisAngle(vec3 axis, float radian) {\n vec3 naxis = normalize(axis);\n float h = 0.5 * radian;\n float s = sin(h);\n return Quaternion(naxis.x * s, naxis.y * s, naxis.z * s, cos(h));\n}\n\nQuaternion conjugate(Quaternion q) {\n return Quaternion(-q.x, -q.y, -q.z, q.w);\n}\n\nQuaternion mul(Quaternion q, float f) {\n return Quaternion(f * q.x, f * q.y, f * q.z, f * q.w);\n}\n\nQuaternion mul(Quaternion q1, Quaternion q2) {\n return Quaternion(\n q2.w * q1.x - q2.z * q1.y + q2.y * q1.z + q2.x * q1.w,\n q2.z * q1.x + q2.w * q1.y - q2.x * q1.z + q2.y * q1.w,\n -q2.y * q1.x + q2.x * q1.y + q2.w * q1.z + q2.z * q1.w,\n -q2.x * q1.x - q2.y * q1.y - q2.z * q1.z + q2.w * q1.w\n );\n}\n\nvec3 rotate(vec3 v, Quaternion q) {\n // norm of q must be 1.\n Quaternion vq = Quaternion(v.x, v.y, v.z, 0.0);\n Quaternion cq = conjugate(q);\n Quaternion mq = mul(mul(cq, vq), q);\n return vec3(mq.x, mq.y, mq.z);\n}\n\nvoid main() {\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v = texture2D(velocity, uvVelocity).xyz;\n float alpha = texture2D(velocity, uvVelocity).w;\n\n // for scale.\n mat4 scaleMat = calcScaleMat4(vec3(1.0, length(a) * 3.0 + 0.1, 1.0));\n vec3 scaledPosition = (scaleMat * vec4(position, 1.0)).xyz;\n\n // for rotation.\n vec3 top = vec3(0.0, 1.0, 0.0);\n vec3 dir = normalize(a);\n vec3 axis = cross(top, dir);\n float angle = acos(dot(top, dir));\n Quaternion q = axisAngle(axis, angle);\n vec3 rotatedPosition = rotate(scaledPosition, q);\n \n vec4 mvPosition = modelViewMatrix * calcTranslateMat4(v) * vec4(rotatedPosition, 1.0);\n\n // Define the point size.\n float distanceFromCamera = length(mvPosition.xyz);\n\n vColor = convertHsvToRgb(\n vec3(\n degrees(angle) / 180.0,\n 0.45,\n 0.8\n )\n );\n vOpacity = alpha;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n if (vOpacity <= 0.01) discard;\n\n gl_FragColor = vec4(vColor, vOpacity);\n}\n",transparent:!0});return(e=a.call(this,t,i,3e4)).name="Mover",e.frustumCulled=!1,e.physicsRenderer,e.multiTime=new r.Vector2(2*Math.random()-1,2*Math.random()-1),e}return t=s,(n=[{key:"start",value:function(e,t){for(var n=this.material.uniforms,r=[],i=[],o=[],a=[],s=[],c=[],u=0;u<3*this.count;u+=3){var l=d().radians(360*Math.random()),f=d().radians(360*Math.random()),h=d().spherical(l,f,5);r[u+0]=.02*h[0],r[u+1]=.02*h[1],r[u+2]=.02*h[2],i[u+0]=h[0],i[u+1]=h[1],i[u+2]=h[2],o[u+0]=.3*r[u+0],o[u+1]=.3*r[u+1],o[u+2]=.3*r[u+2],a[u+0]=i[u+0],a[u+1]=i[u+1],a[u+2]=i[u+2],s[u+0]=0,s[u+1]=0,s[u+2]=0,c[u+0]=Math.random(),c[u+1]=0,c[u+2]=0}this.physicsRenderer=new x("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D accelerationFirst;\nuniform sampler2D noiseTex;\nuniform sampler2D delay;\nuniform sampler2D mass;\nuniform vec2 multiTime;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 af = texture2D(accelerationFirst, vUv).xyz;\n float dl = texture2D(delay, vUv).x;\n float mass = texture2D(mass, vUv).x;\n vec3 d = drag(a, 0.012 + mass * 0.004);\n\n float texColorR = texture2D(noiseTex, (v.yz + vec2(v.x, 0.0) + time * multiTime * 12.0) * 0.006).r;\n float texColorG = texture2D(noiseTex, (v.zx + vec2(v.y, 0.0) + time * multiTime * 12.0) * 0.006).g;\n float texColorB = texture2D(noiseTex, (v.xy + vec2(v.z, 0.0) + time * multiTime * 12.0) * 0.006).b;\n vec3 noise = vec3(\n texColorR * 2.0 - 1.0,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec3 f = noise * 0.014 * step(dl, time);\n\n float init = step(100.0, length(v));\n vec3 f2 = (f + a + d + af * 0.003) * (1.0 - init) + af * init;\n\n gl_FragColor = vec4(f2, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocityFirst;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 vf = texture2D(velocityFirst, vUv).xyz;\n\n float init = step(100.0, length(v));\n v = (a + v) * (1.0 - init) + vf * init;\n\n gl_FragColor = vec4(v, (1.0 - init));\n}\n"),this.physicsRenderer.start(e,r,i),this.physicsRenderer.mergeAUniforms({noiseTex:{value:t},accelerationFirst:{value:this.physicsRenderer.createDataTexture(o)},delay:{value:this.physicsRenderer.createDataTexture(s)},mass:{value:this.physicsRenderer.createDataTexture(c)},multiTime:{value:this.multiTime}}),this.physicsRenderer.mergeVUniforms({velocityFirst:{value:this.physicsRenderer.createDataTexture(a)}}),n.acceleration.value=this.physicsRenderer.getCurrentAcceleration(),n.velocity.value=this.physicsRenderer.getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",this.physicsRenderer.getBufferAttributeUv({instanced:!0}))}},{key:"update",value:function(e,t){var n=this.material.uniforms;this.physicsRenderer.update(e,t),n.acceleration.value=this.physicsRenderer.getCurrentAcceleration(),n.velocity.value=this.physicsRenderer.getCurrentVelocity(),n.time.value+=t}}])&&w(t.prototype,n),s}(r.InstancedMesh);function R(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var z=new r.Scene,L=new h,C=new r.Clock({autoStart:!1}),A=new T,O=new r.TextureLoader,D=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(P=new r.WebGLRenderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),P.setClearColor(921102,1),new a.z(L,P.domElement),e.next=6,Promise.all([O.loadAsync("/sketch-threejs/img/sketch/flow_field/noise.jpg")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,t.format=r.RGBFormat,t.type=r.FloatType,t.minFilter=r.NearestFilter,t.magFilter=r.NearestFilter,A.start(P,t)}));case 6:z.add(A),L.start();case 8:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){R(o,n,r,a,s,"next",e)}function s(e){R(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){C.start(),this.update()}},{key:"pause",value:function(){C.stop()}},{key:"update",value:function(){if(!1!==C.running){var e=C.getDelta();L.update(e),A.update(P,e),P.setRenderTarget(null),P.render(z,L)}}},{key:"resize",value:function(e){L.resize(e),P.setSize(e.x,e.y)}}])&&E(t.prototype,n),e}();function I(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){I(o,r,i,a,s,"next",e)}function s(e){I(o,r,i,a,s,"throw",e)}a(void 0)}))}}function F(){return j.apply(this,arguments)}function j(){return(j=k(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new D,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},76837:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var r=n(2212),i=n(38314),o=n.n(i),a=n(52886);function s(e){return(s="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})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(i);if(o){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=1e3,this.setFocalLength(50),this.position.set(80,0,0),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&c(t.prototype,n),s}(r.PerspectiveCamera),v=n(17393),d=n.n(v),p="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",m="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D initData;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = texture2D(initData, vUv);\n}\n";function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var g=function(e,t,n){return new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:e,vertexShader:t,fragmentShader:n}))},x=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a={type:/(iPad|iPhone|iPod)/g.test(navigator.userAgent)?r.HalfFloatType:r.FloatType,minFilter:r.NearestFilter,magFilter:r.NearestFilter};this.side=0,this.aScene=new r.Scene,this.vScene=new r.Scene,this.camera=new r.OrthographicCamera,this.acceleration=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.velocity=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.aUniforms={velocity:{value:null},acceleration:{value:null},time:{value:0}},this.vUniforms={side:{value:0},velocity:{value:null},acceleration:{value:null},time:{value:0}},this.aMesh=g(this.aUniforms,t,n),this.vMesh=g(this.vUniforms,i,o),this.uvs=[],this.targetIndex=0}var t,n;return t=e,(n=[{key:"start",value:function(e,t,n,i,o){this.side=this.vUniforms.side.value=Math.ceil(Math.sqrt(n.length/3)),this.camera.top=.5*this.side,this.camera.bottom=-.5*this.side,this.camera.right=.5*this.side,this.camera.left=-.5*this.side,this.camera.position.z=10;for(var a=[],s=[],c=0;c<3*Math.pow(this.side,2);c+=3)t&&null!=t[c]?(a[c+0]=t[c+0],a[c+1]=t[c+1],a[c+2]=t[c+2]):(a[c+0]=0,a[c+1]=0,a[c+2]=0),n&&null!=n[c]?(s[c+0]=n[c+0],s[c+1]=n[c+1],s[c+2]=n[c+2]):(s[c+0]=0,s[c+1]=0,s[c+2]=0),this.uvs[c/3*2+0]=c/3%this.side/(this.side-1),this.uvs[c/3*2+1]=Math.floor(c/3/this.side)/(this.side-1);if(i){var u=Object.keys(i);if(u.length)for(var l=0;l<u.length;l++){for(var f=i[u[l]],h=f.array.length;h<s.length/3*f.itemSize;h++)f.array.push(0);this.aMesh.geometry.setAttribute(u[l],new r.BufferAttribute(new Float32Array(f.array),f.itemSize))}}if(o){var v=Object.keys(o);if(v.length)for(var d=0;d<v.length;d++){for(var y=o[v[d]],g=y.array.length;g<s.length/3*y.itemSize;g++)y.array.push(0);this.vMesh.geometry.setAttribute(v[d],new r.BufferAttribute(new Float32Array(y.array),y.itemSize))}}for(var x=0;x<2;x++)this.acceleration[x].setSize(this.side,this.side),this.velocity[x].setSize(this.side,this.side);var b=new r.DataTexture(new Float32Array(a),this.side,this.side,r.RGBFormat,r.FloatType);b.format=r.RGBFormat,b.type=r.FloatType,b.magFilter=r.NearestFilter,b.minFilter=r.NearestFilter,b.needsUpdate=!0;var w=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:b}},vertexShader:p,fragmentShader:m}));this.aScene.add(this.camera),this.aScene.add(w),e.setRenderTarget(this.acceleration[Math.abs(this.targetIndex-1)]),e.render(this.aScene,this.camera),this.aScene.remove(w),this.aScene.add(this.aMesh);var M=new r.DataTexture(new Float32Array(s),this.side,this.side);M.format=r.RGBFormat,M.type=r.FloatType,M.magFilter=r.NearestFilter,M.minFilter=r.NearestFilter,M.needsUpdate=!0;var _=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:M}},vertexShader:p,fragmentShader:m}));this.vScene.add(this.camera),this.vScene.add(_),e.setRenderTarget(this.velocity[this.targetIndex]),e.render(this.vScene,this.camera),this.vScene.remove(_),this.vScene.add(this.vMesh)}},{key:"update",value:function(e,t){var n=Math.abs(this.targetIndex-1),r=this.targetIndex;this.aUniforms.acceleration.value=this.acceleration[n].texture,this.aUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.acceleration[r]),e.render(this.aScene,this.camera),this.vUniforms.acceleration.value=this.acceleration[r].texture,this.vUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.velocity[n]),e.render(this.vScene,this.camera),e.setRenderTarget(null),this.targetIndex=n,this.aUniforms.time.value+=t,this.vUniforms.time.value+=t}},{key:"getBufferAttributeUv",value:function(e){var t=e.instanced;return void 0!==t&&t?new r.InstancedBufferAttribute(new Float32Array(this.uvs),2):new r.BufferAttribute(new Float32Array(this.uvs),2)}},{key:"getCurrentVelocity",value:function(){return this.velocity[Math.abs(this.targetIndex-1)].texture}},{key:"getCurrentAcceleration",value:function(){return this.acceleration[Math.abs(this.targetIndex-1)].texture}},{key:"mergeAUniforms",value:function(e){this.aUniforms=Object.assign(this.aUniforms,e)}},{key:"mergeVUniforms",value:function(e){this.vUniforms=Object.assign(this.vUniforms,e)}},{key:"createDataTexture",value:function(e){for(var t=[],n=0;n<3*Math.pow(this.side,2);n+=3)null!=e[n]?(t[n+0]=e[n+0],t[n+1]=e[n+1],t[n+2]=e[n+2]):(t[n+0]=0,t[n+1]=0,t[n+2]=0);return new r.DataTexture(new Float32Array(t),this.side,this.side,r.RGBFormat,r.FloatType)}}])&&y(t.prototype,n),e}();function b(e){return(b="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P,T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(i);if(o){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.InstancedBufferGeometry,n=new r.BoxGeometry(.25,.5,.25,1,10,1);t.copy(n);var i=new r.RawShaderMaterial({uniforms:{acceleration:{value:null},velocity:{value:null},time:{value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocity1;\nuniform sampler2D velocity2;\nuniform sampler2D velocity3;\nuniform sampler2D velocity4;\nuniform sampler2D velocity5;\nuniform sampler2D velocity6;\nuniform sampler2D velocity7;\nuniform sampler2D velocity8;\nuniform sampler2D velocity9;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nstruct Quaternion {\n float x;\n float y;\n float z;\n float w;\n};\n\n// https://qiita.com/aa_debdeb/items/c34a3088b2d8d3731813\nQuaternion axisAngle(vec3 axis, float radian) {\n vec3 naxis = normalize(axis);\n float h = 0.5 * radian;\n float s = sin(h);\n return Quaternion(naxis.x * s, naxis.y * s, naxis.z * s, cos(h));\n}\n\nQuaternion conjugate(Quaternion q) {\n return Quaternion(-q.x, -q.y, -q.z, q.w);\n}\n\nQuaternion mul(Quaternion q, float f) {\n return Quaternion(f * q.x, f * q.y, f * q.z, f * q.w);\n}\n\nQuaternion mul(Quaternion q1, Quaternion q2) {\n return Quaternion(\n q2.w * q1.x - q2.z * q1.y + q2.y * q1.z + q2.x * q1.w,\n q2.z * q1.x + q2.w * q1.y - q2.x * q1.z + q2.y * q1.w,\n -q2.y * q1.x + q2.x * q1.y + q2.w * q1.z + q2.z * q1.w,\n -q2.x * q1.x - q2.y * q1.y - q2.z * q1.z + q2.w * q1.w\n );\n}\n\nvec3 rotate(vec3 v, Quaternion q) {\n // norm of q must be 1.\n Quaternion vq = Quaternion(v.x, v.y, v.z, 0.0);\n Quaternion cq = conjugate(q);\n Quaternion mq = mul(mul(cq, vq), q);\n return vec3(mq.x, mq.y, mq.z);\n}\n\nvoid main() {\n float y = position.y + 0.5;\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v0 = texture2D(velocity, uvVelocity).xyz;\n vec3 v1 = texture2D(velocity1, uvVelocity).xyz;\n vec3 v2 = texture2D(velocity2, uvVelocity).xyz;\n vec3 v3 = texture2D(velocity3, uvVelocity).xyz;\n vec3 v4 = texture2D(velocity4, uvVelocity).xyz;\n vec3 v5 = texture2D(velocity5, uvVelocity).xyz;\n vec3 v6 = texture2D(velocity6, uvVelocity).xyz;\n vec3 v7 = texture2D(velocity7, uvVelocity).xyz;\n vec3 v8 = texture2D(velocity8, uvVelocity).xyz;\n vec3 v9 = texture2D(velocity9, uvVelocity).xyz;\n vec3 v =\n v0 * step(0.0, y) * (1.0 - step(1.0 / 10.0, y)) +\n v1 * step(1.0 / 10.0, y) * (1.0 - step(2.0 / 10.0, y)) +\n v2 * step(2.0 / 10.0, y) * (1.0 - step(3.0 / 10.0, y)) +\n v3 * step(3.0 / 10.0, y) * (1.0 - step(4.0 / 10.0, y)) +\n v4 * step(4.0 / 10.0, y) * (1.0 - step(5.0 / 10.0, y)) +\n v5 * step(5.0 / 10.0, y) * (1.0 - step(6.0 / 10.0, y)) +\n v6 * step(6.0 / 10.0, y) * (1.0 - step(7.0 / 10.0, y)) +\n v7 * step(7.0 / 10.0, y) * (1.0 - step(8.0 / 10.0, y)) +\n v8 * step(8.0 / 10.0, y) * (1.0 - step(9.0 / 10.0, y)) +\n v9 * step(9.0 / 10.0, y);\n vec3 pv =\n (v + a) * (1.0 - step(1.0 / 10.0, y)) +\n v0 * step(1.0 / 10.0, y) * (1.0 - step(2.0 / 10.0, y)) +\n v1 * step(2.0 / 10.0, y) * (1.0 - step(3.0 / 10.0, y)) +\n v2 * step(3.0 / 10.0, y) * (1.0 - step(4.0 / 10.0, y)) +\n v3 * step(4.0 / 10.0, y) * (1.0 - step(5.0 / 10.0, y)) +\n v4 * step(5.0 / 10.0, y) * (1.0 - step(6.0 / 10.0, y)) +\n v5 * step(6.0 / 10.0, y) * (1.0 - step(7.0 / 10.0, y)) +\n v6 * step(7.0 / 10.0, y) * (1.0 - step(8.0 / 10.0, y)) +\n v7 * step(8.0 / 10.0, y) * (1.0 - step(9.0 / 10.0, y)) +\n v8 * step(9.0 / 10.0, y);\n float alpha = texture2D(velocity, uvVelocity).w;\n\n // for rotation.\n vec3 top = vec3(0.0, 1.0, 0.0);\n vec3 dir = normalize(pv - v);\n vec3 axis = cross(top, dir);\n float angle = acos(dot(top, dir));\n Quaternion q = axisAngle(axis, angle);\n vec3 rotatedPosition = rotate(position, q);\n \n vec4 mvPosition = modelViewMatrix * calcTranslateMat4(v) * vec4(rotatedPosition, 1.0);\n\n // Define the point size.\n float distanceFromCamera = length(mvPosition.xyz);\n\n vColor = convertHsvToRgb(\n vec3(\n degrees(angle) / 180.0,\n 0.45,\n 0.8\n )\n );\n vOpacity = alpha;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n if (vOpacity <= 0.01) discard;\n\n gl_FragColor = vec4(vColor, vOpacity);\n}\n"});return(e=a.call(this,t,i,5e3)).name="Mover",e.frustumCulled=!1,e.physicsRenderers=[],e.multiTime=new r.Vector2(2*Math.random()-1,2*Math.random()-1),e}return t=s,(n=[{key:"start",value:function(e,t){for(var n=this.material.uniforms,r=[],i=[],o=[],a=[],s=[],c=0;c<3*this.count;c+=3){var u=d().radians(360*Math.random()),l=d().radians(360*Math.random()),f=d().spherical(u,l,5);r[c+0]=.02*f[0],r[c+1]=.02*f[1],r[c+2]=.02*f[2],i[c+0]=f[0],i[c+1]=f[1],i[c+2]=f[2],o[c+0]=.3*r[c+0],o[c+1]=.3*r[c+1],o[c+2]=.3*r[c+2],a[c+0]=i[c+0],a[c+1]=i[c+1],a[c+2]=i[c+2],s[c+0]=Math.random(),s[c+1]=0,s[c+2]=0}for(var h=0;h<10;h++)0===h?(this.physicsRenderers[h]=new x("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D accelerationFirst;\nuniform sampler2D noiseTex;\nuniform sampler2D mass;\nuniform vec2 multiTime;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 af = texture2D(accelerationFirst, vUv).xyz;\n float mass = texture2D(mass, vUv).x;\n vec3 d = drag(a, 0.012 + mass * 0.004);\n\n float texColorR = texture2D(noiseTex, (v.yz + vec2(v.x, 0.0) + time * multiTime * 6.0) * 0.0045).r;\n float texColorG = texture2D(noiseTex, (v.zx + vec2(v.y, 0.0) + time * multiTime * 6.0) * 0.0045).g;\n float texColorB = texture2D(noiseTex, (v.xy + vec2(v.z, 0.0) + time * multiTime * 6.0) * 0.0045).b;\n vec3 noise = vec3(\n texColorR * 2.0 - 1.0,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec3 f = noise * 0.016;\n\n float init = step(200.0, length(v));\n vec3 f2 = (f + a + d + af * 0.003) * (1.0 - init) + af * init;\n\n gl_FragColor = vec4(f2, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocityFirst;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 vf = texture2D(velocityFirst, vUv).xyz;\n\n float init = step(200.0, length(v));\n v = (a + v) * (1.0 - init) + vf * init;\n\n gl_FragColor = vec4(v, (1.0 - init));\n}\n"),this.physicsRenderers[h].start(e,r,i),this.physicsRenderers[h].mergeAUniforms({noiseTex:{value:t},accelerationFirst:{value:this.physicsRenderers[h].createDataTexture(o)},mass:{value:this.physicsRenderers[h].createDataTexture(s)},multiTime:{value:this.multiTime}}),this.physicsRenderers[h].mergeVUniforms({velocityFirst:{value:this.physicsRenderers[h].createDataTexture(a)}})):(this.physicsRenderers[h]=new x("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D prevVelocity;\nuniform sampler2D headVelocity;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D noiseTex;\nuniform sampler2D delay;\nuniform sampler2D mass;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 hook(vec3 velocity, vec3 anchor, float restLength, float k) {\n return normalize(velocity - anchor + PRECISION) * (-1.0 * k * (length(velocity - anchor) - restLength));\n}\n\nvoid main(void) {\n vec3 pv = texture2D(prevVelocity, vUv).xyz;\n vec3 hv = texture2D(headVelocity, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n float mass = texture2D(mass, vUv).x;\n vec3 d = drag(a, 0.6);\n vec3 h = hook(v, pv, 0.8, 0.12);\n\n float init = step(200.0, length(hv));\n vec3 f = (a + d + h) * (1.0 - init) + vec3(0.0) * init;\n\n gl_FragColor = vec4(f, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocityFirst;\nuniform sampler2D headVelocity;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 vf = texture2D(velocityFirst, vUv).xyz;\n vec3 hv = texture2D(headVelocity, vUv).xyz;\n\n float init = step(200.0, length(hv));\n v = (a + v) * (1.0 - init) + vf * init;\n\n gl_FragColor = vec4(v, 1.0);\n}\n"),this.physicsRenderers[h].start(e,null,i),this.physicsRenderers[h].mergeAUniforms({mass:{value:this.physicsRenderers[h].createDataTexture(s)},prevVelocity:{value:this.physicsRenderers[h-1].getCurrentVelocity()},headVelocity:{value:this.physicsRenderers[0].getCurrentVelocity()}}),this.physicsRenderers[h].mergeVUniforms({velocityFirst:{value:this.physicsRenderers[h].createDataTexture(a)},headVelocity:{value:this.physicsRenderers[0].getCurrentVelocity()}}),n["velocity".concat(h)]={value:this.physicsRenderers[h].getCurrentVelocity()});n.acceleration.value=this.physicsRenderers[0].getCurrentAcceleration(),n.velocity.value=this.physicsRenderers[0].getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",this.physicsRenderers[0].getBufferAttributeUv({instanced:!0}))}},{key:"update",value:function(e,t){for(var n=this.material.uniforms,r=0;r<this.physicsRenderers.length;r++){var i=this.physicsRenderers[r];0!==r&&(i.aUniforms.prevVelocity.value=this.physicsRenderers[r-1].getCurrentVelocity(),i.aUniforms.headVelocity.value=this.physicsRenderers[0].getCurrentVelocity(),i.vUniforms.headVelocity.value=this.physicsRenderers[0].getCurrentVelocity()),i.update(e,t),0===r?(n.acceleration.value=i.getCurrentAcceleration(),n.velocity.value=i.getCurrentVelocity()):n["velocity".concat(r)].value=i.getCurrentVelocity()}n.time.value+=t}}])&&w(t.prototype,n),s}(r.InstancedMesh);function R(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var z=new r.Scene,L=new h,C=new r.Clock({autoStart:!1}),A=new T,O=new r.TextureLoader,D=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(P=new r.WebGLRenderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),P.setClearColor(921102,1),new a.z(L,P.domElement),e.next=6,Promise.all([O.loadAsync("/sketch-threejs/img/sketch/flow_field/noise.jpg")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,t.format=r.RGBFormat,t.type=r.FloatType,t.minFilter=r.NearestFilter,t.magFilter=r.NearestFilter,A.start(P,t)}));case 6:z.add(A),L.start();case 8:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){R(o,n,r,a,s,"next",e)}function s(e){R(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){C.start(),this.update()}},{key:"pause",value:function(){C.stop()}},{key:"update",value:function(){if(!1!==C.running){var e=C.getDelta();L.update(e),A.update(P,e),P.setRenderTarget(null),P.render(z,L)}}},{key:"resize",value:function(e){L.resize(e),P.setSize(e.x,e.y)}}])&&E(t.prototype,n),e}();function I(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){I(o,r,i,a,s,"next",e)}function s(e){I(o,r,i,a,s,"throw",e)}a(void 0)}))}}function F(){return j.apply(this,arguments)}function j(){return(j=k(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new D,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},87389:function(e,t,n){"use strict";n.d(t,{Z:function(){return X}});var r=n(2212),i=n(38314),o=n.n(i),a=n(52886);function s(e){return(s="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})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(i);if(o){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=5e3,this.setFocalLength(35),this.position.set(80,0,0),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&c(t.prototype,n),s}(r.PerspectiveCamera),v=n(17393),d=n.n(v);function p(e){return(p="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})(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=x(i);if(o){var n=x(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var n=new r.InstancedBufferGeometry,i=new r.PlaneGeometry(8,8);n.copy(i);var o=new r.RawShaderMaterial({uniforms:{time:{value:0},acceleration:{value:null},velocity:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec3 cameraPosition;\nuniform float time;\nuniform vec2 resolution;\nuniform float pixelRatio;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nstruct Quaternion {\n float x;\n float y;\n float z;\n float w;\n};\n\n// https://qiita.com/aa_debdeb/items/c34a3088b2d8d3731813\nQuaternion axisAngle(vec3 axis, float radian) {\n vec3 naxis = normalize(axis);\n float h = 0.5 * radian;\n float s = sin(h);\n return Quaternion(naxis.x * s, naxis.y * s, naxis.z * s, cos(h));\n}\n\nQuaternion conjugate(Quaternion q) {\n return Quaternion(-q.x, -q.y, -q.z, q.w);\n}\n\nQuaternion mul(Quaternion q, float f) {\n return Quaternion(f * q.x, f * q.y, f * q.z, f * q.w);\n}\n\nQuaternion mul(Quaternion q1, Quaternion q2) {\n return Quaternion(\n q2.w * q1.x - q2.z * q1.y + q2.y * q1.z + q2.x * q1.w,\n q2.z * q1.x + q2.w * q1.y - q2.x * q1.z + q2.y * q1.w,\n -q2.y * q1.x + q2.x * q1.y + q2.w * q1.z + q2.z * q1.w,\n -q2.x * q1.x - q2.y * q1.y - q2.z * q1.z + q2.w * q1.w\n );\n}\n\nvec3 rotate(vec3 v, Quaternion q) {\n // norm of q must be 1.\n Quaternion vq = Quaternion(v.x, v.y, v.z, 0.0);\n Quaternion cq = conjugate(q);\n Quaternion mq = mul(mul(cq, vq), q);\n return vec3(mq.x, mq.y, mq.z);\n}\n\nvoid main() {\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v = texture2D(velocity, uvVelocity).xyz;\n float alpha = texture2D(velocity, uvVelocity).w;\n\n // for rotation.\n vec3 top = vec3(0.0, 0.0, 1.0);\n vec3 dir = normalize(cameraPosition - v);\n vec3 axis = cross(top, dir);\n float angle = acos(dot(top, dir));\n Quaternion q = axisAngle(axis, angle);\n vec3 rotatedPosition = rotate(position, q);\n vec4 mvPosition = modelViewMatrix * calcTranslateMat4(v) * vec4(rotatedPosition, 1.0);\n\n vec3 top2 = vec3(0.0, 1.0, 0.0);\n vec3 dir2 = normalize(a);\n float angle2 = acos(dot(top2, dir2));\n\n vUv = uv;\n vColor = vec3(\n degrees(angle2) / 90.0,\n 0.55,\n 0.3\n );\n vOpacity = alpha;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n vec3 color = convertHsvToRgb(\n vColor +\n vec3(\n 0.0,\n (1.0 - smoothstep(0.2, 0.6, length(p))) * -0.5,\n (1.0 - smoothstep(0.2, 0.6, length(p))) * 0.4\n )\n );\n float opacity = (1.0 - smoothstep(0.6, 1.0, length(p))) * vOpacity;\n\n if (opacity <= 0.01) discard;\n\n gl_FragColor = vec4(color, opacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(t=a.call(this,n,o,e)).name="MoverCore",t.frustumCulled=!1,t.renderOrder=2,t}return t=s,(n=[{key:"start",value:function(e){var t=this.material.uniforms;t.acceleration.value=e.getCurrentAcceleration(),t.velocity.value=e.getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",e.getBufferAttributeUv({instanced:!0}))}},{key:"update",value:function(e,t){var n=this.material.uniforms;n.acceleration.value=e.getCurrentAcceleration(),n.velocity.value=e.getCurrentVelocity(),n.time.value+=t}}])&&m(t.prototype,n),s}(r.InstancedMesh);function w(e){return(w="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})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=P(i);if(o){var n=P(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return S(this,e)});function s(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var i=new r.InstancedBufferGeometry,o=new r.CylinderGeometry(0,2.5,2,6,t,!0);i.copy(o);var c=new r.RawShaderMaterial({uniforms:{acceleration:{value:null},velocity:{value:null},time:{value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocity1;\nuniform sampler2D velocity2;\nuniform sampler2D velocity3;\nuniform sampler2D velocity4;\nuniform sampler2D velocity5;\nuniform sampler2D velocity6;\nuniform sampler2D velocity7;\nuniform sampler2D velocity8;\nuniform sampler2D velocity9;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nstruct Quaternion {\n float x;\n float y;\n float z;\n float w;\n};\n\n// https://qiita.com/aa_debdeb/items/c34a3088b2d8d3731813\nQuaternion axisAngle(vec3 axis, float radian) {\n vec3 naxis = normalize(axis);\n float h = 0.5 * radian;\n float s = sin(h);\n return Quaternion(naxis.x * s, naxis.y * s, naxis.z * s, cos(h));\n}\n\nQuaternion conjugate(Quaternion q) {\n return Quaternion(-q.x, -q.y, -q.z, q.w);\n}\n\nQuaternion mul(Quaternion q, float f) {\n return Quaternion(f * q.x, f * q.y, f * q.z, f * q.w);\n}\n\nQuaternion mul(Quaternion q1, Quaternion q2) {\n return Quaternion(\n q2.w * q1.x - q2.z * q1.y + q2.y * q1.z + q2.x * q1.w,\n q2.z * q1.x + q2.w * q1.y - q2.x * q1.z + q2.y * q1.w,\n -q2.y * q1.x + q2.x * q1.y + q2.w * q1.z + q2.z * q1.w,\n -q2.x * q1.x - q2.y * q1.y - q2.z * q1.z + q2.w * q1.w\n );\n}\n\nvec3 rotate(vec3 v, Quaternion q) {\n // norm of q must be 1.\n Quaternion vq = Quaternion(v.x, v.y, v.z, 0.0);\n Quaternion cq = conjugate(q);\n Quaternion mq = mul(mul(cq, vq), q);\n return vec3(mq.x, mq.y, mq.z);\n}\n\nvoid main() {\n float y = uv.y;\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v0 = texture2D(velocity, uvVelocity).xyz;\n vec3 v1 = texture2D(velocity1, uvVelocity).xyz;\n vec3 v2 = texture2D(velocity2, uvVelocity).xyz;\n vec3 v3 = texture2D(velocity3, uvVelocity).xyz;\n vec3 v4 = texture2D(velocity4, uvVelocity).xyz;\n vec3 v =\n v0 * (1.0 - step(1.0 / 5.0, y)) +\n v1 * step(1.0 / 5.0, y) * (1.0 - step(2.0 / 5.0, y)) +\n v2 * step(2.0 / 5.0, y) * (1.0 - step(3.0 / 5.0, y)) +\n v3 * step(3.0 / 5.0, y) * (1.0 - step(4.0 / 5.0, y)) +\n v4 * step(4.0 / 5.0, y);\n vec3 pv =\n (v + a) * (1.0 - step(1.0 / 5.0, y)) +\n v0 * step(1.0 / 5.0, y) * (1.0 - step(2.0 / 5.0, y)) +\n v1 * step(2.0 / 5.0, y) * (1.0 - step(3.0 / 5.0, y)) +\n v2 * step(3.0 / 5.0, y) * (1.0 - step(4.0 / 5.0, y)) +\n v3 * step(4.0 / 5.0, y);\n float alpha = 1.0 - smoothstep(450.0, 490.0, abs(v.x));\n\n // for rotation.\n vec3 top = vec3(0.0, 1.0, 0.0);\n vec3 dir = normalize(pv - v);\n vec3 axis = cross(top, dir);\n float angle = acos(dot(top, dir));\n Quaternion q = axisAngle(axis, angle);\n vec3 rotatedPosition = rotate(position, q);\n \n vec4 mvPosition = modelViewMatrix * calcTranslateMat4(v) * vec4(rotatedPosition, 1.0);\n\n // Define the point size.\n float distanceFromCamera = length(mvPosition.xyz);\n\n vColor = convertHsvToRgb(\n vec3(\n degrees(angle) / 90.0,\n 0.55,\n 0.3\n )\n );\n vOpacity = (1.0 - y) * alpha;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n if (vOpacity <= 0.01) discard;\n\n gl_FragColor = vec4(vColor, vOpacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending,side:r.DoubleSide});return(n=a.call(this,i,c,e)).name="MoverTrail",n.frustumCulled=!1,n.multiTime=new r.Vector2(2*Math.random()-1,2*Math.random()-1),n}return t=s,(n=[{key:"start",value:function(e){for(var t=this.material.uniforms,n=0;n<e.length;n++)n>0&&(t["velocity".concat(n)]={value:e[n].getCurrentVelocity()});t.acceleration.value=e[0].getCurrentAcceleration(),t.velocity.value=e[0].getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",e[0].getBufferAttributeUv({instanced:!0}))}},{key:"update",value:function(e,t){for(var n=this.material.uniforms,r=0;r<e.length;r++){var i=e[r];0===r?(n.acceleration.value=i.getCurrentAcceleration(),n.velocity.value=i.getCurrentVelocity()):n["velocity".concat(r)].value=i.getCurrentVelocity()}n.time.value+=t}}])&&M(t.prototype,n),s}(r.InstancedMesh),R="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",E="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D initData;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = texture2D(initData, vUv);\n}\n";function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var L=function(e,t,n){return new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:e,vertexShader:t,fragmentShader:n}))},C=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a={type:/(iPad|iPhone|iPod)/g.test(navigator.userAgent)?r.HalfFloatType:r.FloatType,minFilter:r.NearestFilter,magFilter:r.NearestFilter};this.side=0,this.aScene=new r.Scene,this.vScene=new r.Scene,this.camera=new r.OrthographicCamera,this.acceleration=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.velocity=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.aUniforms={velocity:{value:null},acceleration:{value:null},time:{value:0}},this.vUniforms={side:{value:0},velocity:{value:null},acceleration:{value:null},time:{value:0}},this.aMesh=L(this.aUniforms,t,n),this.vMesh=L(this.vUniforms,i,o),this.uvs=[],this.targetIndex=0}var t,n;return t=e,(n=[{key:"start",value:function(e,t,n,i,o){this.side=this.vUniforms.side.value=Math.ceil(Math.sqrt(n.length/3)),this.camera.top=.5*this.side,this.camera.bottom=-.5*this.side,this.camera.right=.5*this.side,this.camera.left=-.5*this.side,this.camera.position.z=10;for(var a=[],s=[],c=0;c<3*Math.pow(this.side,2);c+=3)t&&null!=t[c]?(a[c+0]=t[c+0],a[c+1]=t[c+1],a[c+2]=t[c+2]):(a[c+0]=0,a[c+1]=0,a[c+2]=0),n&&null!=n[c]?(s[c+0]=n[c+0],s[c+1]=n[c+1],s[c+2]=n[c+2]):(s[c+0]=0,s[c+1]=0,s[c+2]=0),this.uvs[c/3*2+0]=c/3%this.side/(this.side-1),this.uvs[c/3*2+1]=Math.floor(c/3/this.side)/(this.side-1);if(i){var u=Object.keys(i);if(u.length)for(c=0;c<u.length;c++){for(var l=i[u[c]],f=l.array.length;f<s.length/3*l.itemSize;f++)l.array.push(0);this.aMesh.geometry.setAttribute(u[c],new r.BufferAttribute(new Float32Array(l.array),l.itemSize))}}if(o){var h=Object.keys(o);if(h.length)for(c=0;c<h.length;c++){var v=o[h[c]];for(f=v.array.length;f<s.length/3*v.itemSize;f++)v.array.push(0);this.vMesh.geometry.setAttribute(h[c],new r.BufferAttribute(new Float32Array(v.array),v.itemSize))}}for(c=0;c<2;c++)this.acceleration[c].setSize(this.side,this.side),this.velocity[c].setSize(this.side,this.side);var d=new r.DataTexture(new Float32Array(a),this.side,this.side,r.RGBFormat,r.FloatType);d.format=r.RGBFormat,d.type=r.FloatType,d.magFilter=r.NearestFilter,d.minFilter=r.NearestFilter,d.needsUpdate=!0;var p=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:d}},vertexShader:R,fragmentShader:E}));this.aScene.add(this.camera),this.aScene.add(p),e.setRenderTarget(this.acceleration[Math.abs(this.targetIndex-1)]),e.render(this.aScene,this.camera),this.aScene.remove(p),this.aScene.add(this.aMesh);var m=new r.DataTexture(new Float32Array(s),this.side,this.side);m.format=r.RGBFormat,m.type=r.FloatType,m.magFilter=r.NearestFilter,m.minFilter=r.NearestFilter,m.needsUpdate=!0;var y=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:m}},vertexShader:R,fragmentShader:E}));this.vScene.add(this.camera),this.vScene.add(y),e.setRenderTarget(this.velocity[this.targetIndex]),e.render(this.vScene,this.camera),this.vScene.remove(y),this.vScene.add(this.vMesh),e.setRenderTarget(null)}},{key:"update",value:function(e,t){var n=Math.abs(this.targetIndex-1),r=this.targetIndex;this.aUniforms.acceleration.value=this.acceleration[n].texture,this.aUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.acceleration[r]),e.render(this.aScene,this.camera),this.vUniforms.acceleration.value=this.acceleration[r].texture,this.vUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.velocity[n]),e.render(this.vScene,this.camera),this.targetIndex=n,this.aUniforms.time.value+=t,this.vUniforms.time.value+=t}},{key:"getBufferAttributeUv",value:function(e){var t=e.instanced;return void 0!==t&&t?new r.InstancedBufferAttribute(new Float32Array(this.uvs),2):new r.BufferAttribute(new Float32Array(this.uvs),2)}},{key:"getCurrentVelocity",value:function(){return this.velocity[Math.abs(this.targetIndex-1)].texture}},{key:"getCurrentAcceleration",value:function(){return this.acceleration[Math.abs(this.targetIndex-1)].texture}},{key:"mergeAUniforms",value:function(e){this.aUniforms=Object.assign(this.aUniforms,e)}},{key:"mergeVUniforms",value:function(e){this.vUniforms=Object.assign(this.vUniforms,e)}},{key:"createDataTexture",value:function(e){for(var t=[],n=0;n<3*Math.pow(this.side,2);n+=3)null!=e[n]?(t[n+0]=e[n+0],t[n+1]=e[n+1],t[n+2]=e[n+2]):(t[n+0]=0,t[n+1]=0,t[n+2]=0);return new r.DataTexture(new Float32Array(t),this.side,this.side,r.RGBFormat,r.FloatType)}}])&&z(t.prototype,n),e}();function A(e){return(A="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})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F,j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(i);if(o){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).name="Mover",e.core=new b(5e3),e.trail=new T(5e3,5),e.physicsRenderers=[],e.multiTime=new r.Vector2(2*Math.random()-1,2*Math.random()-1),e}return t=s,(n=[{key:"start",value:function(e,t){for(var n=[],r=[],i=[],o=[],a=[],s=[],c=0;c<15e3;c+=3){var u=d().radians(360*Math.random());n[c+0]=3,n[c+1]=5*Math.cos(u),n[c+2]=5*Math.sin(u),r[c+0]=-499.99,r[c+1]=30*Math.cos(u),r[c+2]=30*Math.sin(u),i[c+0]=n[c+0],i[c+1]=n[c+1],i[c+2]=n[c+2],o[c+0]=r[c+0],o[c+1]=r[c+1],o[c+2]=r[c+2],a[c+0]=5*Math.random(),a[c+1]=0,a[c+2]=0,s[c+0]=Math.random(),s[c+1]=0,s[c+2]=0}for(var l=0;l<5;l++)0===l?(this.physicsRenderers[l]=new C("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D accelerationFirst;\nuniform sampler2D noiseTex;\nuniform sampler2D delay;\nuniform sampler2D mass;\nuniform vec2 multiTime;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 af = texture2D(accelerationFirst, vUv).xyz;\n float dl = texture2D(delay, vUv).x;\n float mass = texture2D(mass, vUv).x;\n vec3 d = drag(a, 0.032 + mass * 0.006);\n\n float texColorR = texture2D(noiseTex, (v.yz + vec2(sin(v.x * 0.1), 0.0) + time * multiTime * 12.0) * 0.002).r;\n float texColorG = texture2D(noiseTex, (v.zx + vec2(sin(v.y * 0.1), 0.0) + time * multiTime * 12.0) * 0.002).g;\n float texColorB = texture2D(noiseTex, (v.xy + vec2(sin(v.z * 0.1), 0.0) + time * multiTime * 12.0) * 0.002).b;\n vec3 noise = vec3(\n texColorR,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec3 f = noise * 0.2;\n\n float init = clamp(step(500.0, v.x), 0.0, 1.0);\n vec3 f2 = (a + (f + d) * step(dl, time)) * (1.0 - init) + af * init;\n\n gl_FragColor = vec4(f2, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocityFirst;\nuniform sampler2D delay;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 vf = texture2D(velocityFirst, vUv).xyz;\n float dl = texture2D(delay, vUv).x;\n\n float init = clamp(step(500.0, v.x), 0.0, 1.0);\n v = (a * step(dl, time) + v) * (1.0 - init) + vf * init;\n\n float alpha = 1.0 - smoothstep(450.0, 500.0, abs(v.x));\n\n gl_FragColor = vec4(v, alpha);\n}\n"),this.physicsRenderers[l].start(e,n,r),this.physicsRenderers[l].mergeAUniforms({noiseTex:{value:t},accelerationFirst:{value:this.physicsRenderers[l].createDataTexture(i)},delay:{value:this.physicsRenderers[l].createDataTexture(a)},mass:{value:this.physicsRenderers[l].createDataTexture(s)},multiTime:{value:this.multiTime}}),this.physicsRenderers[l].mergeVUniforms({delay:{value:this.physicsRenderers[l].createDataTexture(a)},velocityFirst:{value:this.physicsRenderers[l].createDataTexture(o)}})):(this.physicsRenderers[l]=new C("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D prevVelocity;\nuniform sampler2D headVelocity;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D noiseTex;\nuniform sampler2D delay;\nuniform sampler2D mass;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 hook(vec3 velocity, vec3 anchor, float restLength, float k) {\n return normalize(velocity - anchor + PRECISION) * (-1.0 * k * (length(velocity - anchor) - restLength));\n}\n\nvoid main(void) {\n vec3 pv = texture2D(prevVelocity, vUv).xyz;\n vec3 hv = texture2D(headVelocity, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n float mass = texture2D(mass, vUv).x;\n vec3 d = drag(a, 0.28);\n vec3 h = hook(v, pv, 1.0, 0.12);\n\n float init = clamp(step(500.0, hv.x), 0.0, 1.0);\n vec3 f = (a + d + h) * (1.0 - init) + vec3(0.0) * init;\n\n gl_FragColor = vec4(f, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocityFirst;\nuniform sampler2D headVelocity;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 vf = texture2D(velocityFirst, vUv).xyz;\n vec3 hv = texture2D(headVelocity, vUv).xyz;\n\n float init = clamp(step(500.0, hv.x), 0.0, 1.0);\n v = (a + v) * (1.0 - init) + vf * init;\n\n gl_FragColor = vec4(v, 1.0);\n}\n"),this.physicsRenderers[l].start(e,null,r),this.physicsRenderers[l].mergeAUniforms({mass:{value:this.physicsRenderers[l].createDataTexture(s)},prevVelocity:{value:this.physicsRenderers[l-1].getCurrentVelocity()},headVelocity:{value:this.physicsRenderers[0].getCurrentVelocity()}}),this.physicsRenderers[l].mergeVUniforms({velocityFirst:{value:this.physicsRenderers[l].createDataTexture(o)},headVelocity:{value:this.physicsRenderers[0].getCurrentVelocity()}}));this.core.start(this.physicsRenderers[0]),this.trail.start(this.physicsRenderers),this.add(this.core),this.add(this.trail)}},{key:"update",value:function(e,t){for(var n=0;n<this.physicsRenderers.length;n++){var r=this.physicsRenderers[n];0!==n&&(r.aUniforms.prevVelocity.value=this.physicsRenderers[n-1].getCurrentVelocity(),r.aUniforms.headVelocity.value=this.physicsRenderers[0].getCurrentVelocity(),r.vUniforms.headVelocity.value=this.physicsRenderers[0].getCurrentVelocity()),r.update(e,t)}this.core.update(this.physicsRenderers[0],t),this.trail.update(this.physicsRenderers,t)}}])&&O(t.prototype,n),s}(r.Group);function U(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var G=new r.Scene,N=new h,H=new r.Clock({autoStart:!1}),V=new j,W=new r.TextureLoader,Z=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(F=new r.WebGLRenderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),F.setClearColor(921102,1),new a.z(N,F.domElement),e.next=6,Promise.all([W.loadAsync("/sketch-threejs/img/sketch/flow_field/noise.jpg")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,t.format=r.RGBFormat,t.type=r.FloatType,t.minFilter=r.NearestFilter,t.magFilter=r.NearestFilter,V.start(F,t)}));case 6:G.add(V),N.start();case 8:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){U(o,n,r,a,s,"next",e)}function s(e){U(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){H.start(),this.update()}},{key:"pause",value:function(){H.stop()}},{key:"update",value:function(){if(!1!==H.running){var e=H.getDelta();N.update(e),V.update(F,e),F.setRenderTarget(null),F.render(G,N)}}},{key:"resize",value:function(e){N.resize(e),F.setSize(e.x,e.y)}}])&&B(t.prototype,n),e}();function q(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Y(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){q(o,r,i,a,s,"next",e)}function s(e){q(o,r,i,a,s,"throw",e)}a(void 0)}))}}function X(){return K.apply(this,arguments)}function K(){return(K=Y(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Z,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},53312:function(e,t,n){"use strict";n.d(t,{Z:function(){return le}});var r=n(2212),i=n(38314),o=n.n(i),a=n(17393),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(i);if(o){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=5e3,this.setFocalLength(35),this.position.set(0,0,250),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&u(t.prototype,n),s}(r.PerspectiveCamera);function d(e){return(d="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})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g(i);if(o){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return y(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.OctahedronGeometry(30,6),n=new r.RawShaderMaterial({uniforms:{time:{value:0},noiseTex:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\n\nvarying vec2 vUv;\nvarying float vEdge;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n float angleToCamera = acos(dot(normalize(cameraPosition), normal));\n\n vUv = uv;\n vEdge = smoothstep(0.4, 1.0, abs(sin(angleToCamera)));\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\nvarying float vEdge;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n float noise1 = texture2D(noiseTex, vUv + vec2(time * 0.1, 0.0)).r;\n float noise2 = texture2D(noiseTex, vUv + vec2(time * -0.1, 0.0)).g;\n vec3 hsv = vec3(\n (noise1 + noise2) * 0.35 + time * 0.1,\n 1.0 - vEdge,\n 0.02 + vEdge * 0.98\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Core",e.acceleration=new r.Vector3,e.anchor=new r.Vector3,e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){this.material.uniforms.time.value+=e,this.applyHook(0,.2),this.applyDrag(.6),this.position.add(this.acceleration),this.lookAt(t.position)}},{key:"applyDrag",value:function(e){var t=this.acceleration.clone();t.multiplyScalar(-1),t.normalize(),t.multiplyScalar(this.acceleration.length()*e),this.acceleration.add(t)}},{key:"applyHook",value:function(e,t){var n=this.position.clone().sub(this.anchor),r=n.length()-e;n.normalize(),n.multiplyScalar(-1*t*r),this.acceleration.add(n)}}])&&p(t.prototype,n),s}(r.Mesh);function b(e){return(b="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(i);if(o){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var n=new r.InstancedBufferGeometry,i=new r.PlaneGeometry(2,2);n.copy(i);var o=new r.RawShaderMaterial({uniforms:{time:{value:0},acceleration:{value:null},velocity:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec3 cameraPosition;\nuniform float time;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nstruct Quaternion {\n float x;\n float y;\n float z;\n float w;\n};\n\n// https://qiita.com/aa_debdeb/items/c34a3088b2d8d3731813\nQuaternion axisAngle(vec3 axis, float radian) {\n vec3 naxis = normalize(axis);\n float h = 0.5 * radian;\n float s = sin(h);\n return Quaternion(naxis.x * s, naxis.y * s, naxis.z * s, cos(h));\n}\n\nQuaternion conjugate(Quaternion q) {\n return Quaternion(-q.x, -q.y, -q.z, q.w);\n}\n\nQuaternion mul(Quaternion q, float f) {\n return Quaternion(f * q.x, f * q.y, f * q.z, f * q.w);\n}\n\nQuaternion mul(Quaternion q1, Quaternion q2) {\n return Quaternion(\n q2.w * q1.x - q2.z * q1.y + q2.y * q1.z + q2.x * q1.w,\n q2.z * q1.x + q2.w * q1.y - q2.x * q1.z + q2.y * q1.w,\n -q2.y * q1.x + q2.x * q1.y + q2.w * q1.z + q2.z * q1.w,\n -q2.x * q1.x - q2.y * q1.y - q2.z * q1.z + q2.w * q1.w\n );\n}\n\nvec3 rotate(vec3 v, Quaternion q) {\n // norm of q must be 1.\n Quaternion vq = Quaternion(v.x, v.y, v.z, 0.0);\n Quaternion cq = conjugate(q);\n Quaternion mq = mul(mul(cq, vq), q);\n return vec3(mq.x, mq.y, mq.z);\n}\n\nvoid main() {\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v = texture2D(velocity, uvVelocity).xyz;\n\n // for rotation.\n vec3 top = vec3(0.0, 0.0, 1.0);\n vec3 dir = normalize(cameraPosition - v);\n vec3 axis = cross(top, dir);\n float angle = acos(dot(top, dir));\n Quaternion q = axisAngle(axis, angle);\n vec3 rotatedPosition = rotate(position, q);\n vec4 mvPosition = modelViewMatrix * calcTranslateMat4(v) * vec4(rotatedPosition, 1.0);\n\n vec3 top2 = vec3(0.0, 1.0, 0.0);\n vec3 dir2 = normalize(a);\n float angle2 = acos(dot(top2, dir2));\n\n vUv = uv;\n vColor = vec3(\n degrees(angle2) / 90.0 * 0.35 + time * 0.1,\n 0.7,\n 0.4\n );\n vOpacity = 0.2;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n vec3 color = convertHsvToRgb(\n vColor +\n vec3(\n 0.0,\n (1.0 - smoothstep(0.2, 0.6, length(p))) * -0.5,\n (1.0 - smoothstep(0.2, 0.6, length(p))) * 0.4\n )\n );\n float opacity = (1.0 - smoothstep(0.95, 1.0, length(p))) * vOpacity;\n\n if (opacity <= 0.01) discard;\n\n gl_FragColor = vec4(color, opacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(t=a.call(this,n,o,e)).name="MoverCore",t.renderOrder=2,t}return t=s,(n=[{key:"start",value:function(e){var t=this.material.uniforms;t.acceleration.value=e.getCurrentAcceleration(),t.velocity.value=e.getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",e.getBufferAttributeUv({instanced:!0}))}},{key:"update",value:function(e,t){var n=this.material.uniforms;n.acceleration.value=e.getCurrentAcceleration(),n.velocity.value=e.getCurrentVelocity(),n.time.value+=t}}])&&w(t.prototype,n),s}(r.InstancedMesh);function T(e){return(T="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})(e)}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=L(i);if(o){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return z(this,e)});function s(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var i=new r.InstancedBufferGeometry,o=new r.CylinderGeometry(0,.8,2,3,t,!0);i.copy(o);var c=new r.RawShaderMaterial({uniforms:{acceleration:{value:null},velocity:{value:null},time:{value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\nuniform sampler2D velocity1;\nuniform sampler2D velocity2;\nuniform sampler2D velocity3;\nuniform sampler2D velocity4;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nstruct Quaternion {\n float x;\n float y;\n float z;\n float w;\n};\n\n// https://qiita.com/aa_debdeb/items/c34a3088b2d8d3731813\nQuaternion axisAngle(vec3 axis, float radian) {\n vec3 naxis = normalize(axis);\n float h = 0.5 * radian;\n float s = sin(h);\n return Quaternion(naxis.x * s, naxis.y * s, naxis.z * s, cos(h));\n}\n\nQuaternion conjugate(Quaternion q) {\n return Quaternion(-q.x, -q.y, -q.z, q.w);\n}\n\nQuaternion mul(Quaternion q, float f) {\n return Quaternion(f * q.x, f * q.y, f * q.z, f * q.w);\n}\n\nQuaternion mul(Quaternion q1, Quaternion q2) {\n return Quaternion(\n q2.w * q1.x - q2.z * q1.y + q2.y * q1.z + q2.x * q1.w,\n q2.z * q1.x + q2.w * q1.y - q2.x * q1.z + q2.y * q1.w,\n -q2.y * q1.x + q2.x * q1.y + q2.w * q1.z + q2.z * q1.w,\n -q2.x * q1.x - q2.y * q1.y - q2.z * q1.z + q2.w * q1.w\n );\n}\n\nvec3 rotate(vec3 v, Quaternion q) {\n // norm of q must be 1.\n Quaternion vq = Quaternion(v.x, v.y, v.z, 0.0);\n Quaternion cq = conjugate(q);\n Quaternion mq = mul(mul(cq, vq), q);\n return vec3(mq.x, mq.y, mq.z);\n}\n\nvoid main() {\n float y = uv.y;\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v0 = texture2D(velocity, uvVelocity).xyz;\n vec3 v1 = texture2D(velocity1, uvVelocity).xyz;\n vec3 v2 = texture2D(velocity2, uvVelocity).xyz;\n vec3 v3 = texture2D(velocity3, uvVelocity).xyz;\n vec3 v4 = texture2D(velocity4, uvVelocity).xyz;\n vec3 v =\n v0 * (1.0 - step(1.0 / 5.0, y)) +\n v1 * step(1.0 / 5.0, y) * (1.0 - step(2.0 / 5.0, y)) +\n v2 * step(2.0 / 5.0, y) * (1.0 - step(3.0 / 5.0, y)) +\n v3 * step(3.0 / 5.0, y) * (1.0 - step(4.0 / 5.0, y)) +\n v4 * step(4.0 / 5.0, y);\n vec3 pv =\n (v + a) * (1.0 - step(1.0 / 5.0, y)) +\n v0 * step(1.0 / 5.0, y) * (1.0 - step(2.0 / 5.0, y)) +\n v1 * step(2.0 / 5.0, y) * (1.0 - step(3.0 / 5.0, y)) +\n v2 * step(3.0 / 5.0, y) * (1.0 - step(4.0 / 5.0, y)) +\n v3 * step(4.0 / 5.0, y);\n\n // for rotation.\n vec3 top = vec3(0.0, 1.0, 0.0);\n vec3 dir = normalize(pv - v);\n vec3 axis = cross(top, dir);\n float angle = acos(dot(top, dir));\n Quaternion q = axisAngle(axis, angle);\n vec3 rotatedPosition = rotate(position, q);\n \n vec4 mvPosition = modelViewMatrix * calcTranslateMat4(v) * vec4(rotatedPosition, 1.0);\n\n // Define the point size.\n float distanceFromCamera = length(mvPosition.xyz);\n\n vColor = convertHsvToRgb(\n vec3(\n degrees(angle) / 90.0 * 0.35 + time * 0.1,\n 0.65,\n 0.24\n )\n );\n vOpacity = (1.0 - y) * 0.2;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n if (vOpacity <= 0.01) discard;\n\n gl_FragColor = vec4(vColor, vOpacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending,side:r.DoubleSide});return(n=a.call(this,i,c,e)).name="MoverTrail",n}return t=s,(n=[{key:"start",value:function(e){for(var t=this.material.uniforms,n=0;n<e.length;n++)n>0&&(t["velocity".concat(n)]={value:e[n].getCurrentVelocity()});t.acceleration.value=e[0].getCurrentAcceleration(),t.velocity.value=e[0].getCurrentVelocity(),this.geometry.setAttribute("uvVelocity",e[0].getBufferAttributeUv({instanced:!0}))}},{key:"update",value:function(e,t){for(var n=this.material.uniforms,r=0;r<e.length;r++){var i=e[r];0===r?(n.acceleration.value=i.getCurrentAcceleration(),n.velocity.value=i.getCurrentVelocity()):n["velocity".concat(r)].value=i.getCurrentVelocity()}n.time.value+=t}}])&&R(t.prototype,n),s}(r.InstancedMesh),A="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",O="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D initData;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = texture2D(initData, vUv);\n}\n";function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var I=function(e,t,n){return new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:e,vertexShader:t,fragmentShader:n}))},k=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a={type:/(iPad|iPhone|iPod)/g.test(navigator.userAgent)?r.HalfFloatType:r.FloatType,minFilter:r.NearestFilter,magFilter:r.NearestFilter};this.side=0,this.aScene=new r.Scene,this.vScene=new r.Scene,this.camera=new r.OrthographicCamera,this.acceleration=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.velocity=[new r.WebGLRenderTarget(0,0,a),new r.WebGLRenderTarget(0,0,a)],this.aUniforms={velocity:{value:null},acceleration:{value:null},time:{value:0}},this.vUniforms={side:{value:0},velocity:{value:null},acceleration:{value:null},time:{value:0}},this.aMesh=I(this.aUniforms,t,n),this.vMesh=I(this.vUniforms,i,o),this.uvs=[],this.targetIndex=0}var t,n;return t=e,(n=[{key:"start",value:function(e,t,n,i,o){this.side=this.vUniforms.side.value=Math.ceil(Math.sqrt(n.length/3)),this.camera.top=.5*this.side,this.camera.bottom=-.5*this.side,this.camera.right=.5*this.side,this.camera.left=-.5*this.side,this.camera.position.z=10;for(var a=[],s=[],c=0;c<3*Math.pow(this.side,2);c+=3)t&&null!=t[c]?(a[c+0]=t[c+0],a[c+1]=t[c+1],a[c+2]=t[c+2]):(a[c+0]=0,a[c+1]=0,a[c+2]=0),n&&null!=n[c]?(s[c+0]=n[c+0],s[c+1]=n[c+1],s[c+2]=n[c+2]):(s[c+0]=0,s[c+1]=0,s[c+2]=0),this.uvs[c/3*2+0]=c/3%this.side/(this.side-1),this.uvs[c/3*2+1]=Math.floor(c/3/this.side)/(this.side-1);if(i){var u=Object.keys(i);if(u.length)for(c=0;c<u.length;c++){for(var l=i[u[c]],f=l.array.length;f<s.length/3*l.itemSize;f++)l.array.push(0);this.aMesh.geometry.setAttribute(u[c],new r.BufferAttribute(new Float32Array(l.array),l.itemSize))}}if(o){var h=Object.keys(o);if(h.length)for(c=0;c<h.length;c++){var v=o[h[c]];for(f=v.array.length;f<s.length/3*v.itemSize;f++)v.array.push(0);this.vMesh.geometry.setAttribute(h[c],new r.BufferAttribute(new Float32Array(v.array),v.itemSize))}}for(c=0;c<2;c++)this.acceleration[c].setSize(this.side,this.side),this.velocity[c].setSize(this.side,this.side);var d=new r.DataTexture(new Float32Array(a),this.side,this.side,r.RGBFormat,r.FloatType);d.magFilter=r.NearestFilter,d.minFilter=r.NearestFilter;var p=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:d}},vertexShader:A,fragmentShader:O}));this.aScene.add(this.camera),this.aScene.add(p),e.setRenderTarget(this.acceleration[Math.abs(this.targetIndex-1)]),e.render(this.aScene,this.camera),this.aScene.remove(p),this.aScene.add(this.aMesh);var m=new r.DataTexture(new Float32Array(s),this.side,this.side,r.RGBFormat,r.FloatType);m.magFilter=r.NearestFilter,m.minFilter=r.NearestFilter;var y=new r.Mesh(new r.PlaneGeometry(2,2),new r.RawShaderMaterial({uniforms:{initData:{value:m}},vertexShader:A,fragmentShader:O}));this.vScene.add(this.camera),this.vScene.add(y),e.setRenderTarget(this.velocity[this.targetIndex]),e.render(this.vScene,this.camera),this.vScene.remove(y),this.vScene.add(this.vMesh),e.setRenderTarget(null)}},{key:"update",value:function(e,t){var n=Math.abs(this.targetIndex-1),r=this.targetIndex;this.aUniforms.acceleration.value=this.acceleration[n].texture,this.aUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.acceleration[r]),e.render(this.aScene,this.camera),this.vUniforms.acceleration.value=this.acceleration[r].texture,this.vUniforms.velocity.value=this.velocity[r].texture,e.setRenderTarget(this.velocity[n]),e.render(this.vScene,this.camera),e.setRenderTarget(null),this.targetIndex=n,this.aUniforms.time.value+=t,this.vUniforms.time.value+=t}},{key:"getBufferAttributeUv",value:function(e){var t=e.instanced;return void 0!==t&&t?new r.InstancedBufferAttribute(new Float32Array(this.uvs),2):new r.BufferAttribute(new Float32Array(this.uvs),2)}},{key:"getCurrentVelocity",value:function(){return this.velocity[Math.abs(this.targetIndex-1)].texture}},{key:"getCurrentAcceleration",value:function(){return this.acceleration[Math.abs(this.targetIndex-1)].texture}},{key:"mergeAUniforms",value:function(e){this.aUniforms=Object.assign(this.aUniforms,e)}},{key:"mergeVUniforms",value:function(e){this.vUniforms=Object.assign(this.vUniforms,e)}},{key:"createDataTexture",value:function(e){for(var t=[],n=0;n<3*Math.pow(this.side,2);n+=3)null!=e[n]?(t[n+0]=e[n+0],t[n+1]=e[n+1],t[n+2]=e[n+2]):(t[n+0]=0,t[n+1]=0,t[n+2]=0);return new r.DataTexture(new Float32Array(t),this.side,this.side,r.RGBFormat,r.FloatType)}}])&&D(t.prototype,n),e}();function F(e){return(F="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})(e)}function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function G(e){return(G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=G(i);if(o){var n=G(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return B(this,e)});function c(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(e=a.call(this)).name="Mover",e.core=new P(5e3),e.trail=new C(5e3,5),e.physicsRenderers=[],e.multiTime=new r.Vector2(2*Math.random()-1,2*Math.random()-1),e}return t=c,(n=[{key:"start",value:function(e,t){for(var n=[],i=[],o=[],a=0;a<15e3;a+=3){var c=s().radians(360*Math.random());i[a+0]=300*Math.cos(c),i[a+1]=300*Math.sin(c),i[a+2]=2*Math.random()-1,o[a+0]=.02*Math.random()+.08,o[a+1]=.01*Math.random()+.02,o[a+2]=0}for(var u=0;u<5;u++)0===u?(this.physicsRenderers[u]=new k("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D noiseTex;\nuniform vec2 multiTime;\nuniform vec3 anchor;\nuniform sampler2D hookOptions;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 hook(vec3 velocity, vec3 anchor, float restLength, float k) {\n return normalize(velocity - anchor + PRECISION) * (-1.0 * k * (length(velocity - anchor) - restLength));\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 hopt = texture2D(hookOptions, vUv).xyz;\n vec3 d = drag(a, hopt.r);\n vec3 h = hook(v, anchor, 50.0, hopt.g);\n\n float texColorR = texture2D(noiseTex, v.zy * 0.0025 + step(vUv.x, 0.333) * 0.333 + step(vUv.x, 0.666) * 0.333 + time * 0.04 + multiTime).r;\n float texColorG = texture2D(noiseTex, v.xz * 0.0025 + step(vUv.x, 0.333) * 0.333 + step(vUv.x, 0.666) * 0.333 - time * 0.04 + multiTime).g;\n float texColorB = texture2D(noiseTex, v.yx * 0.0025 + step(vUv.x, 0.333) * 0.333 + step(vUv.x, 0.666) * 0.333 + time * 0.04 - multiTime).b;\n vec3 noise = vec3(\n texColorR * 2.0 - 1.0,\n texColorG * 2.0 - 1.0,\n texColorB * 2.0 - 1.0\n );\n vec3 f = noise * 0.85;\n\n vec3 f2 = a + d + f + h;\n\n gl_FragColor = vec4(f2, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 v2 = a + v;\n\n gl_FragColor = vec4(v2, 1.0);\n}\n"),this.physicsRenderers[u].start(e,n,i),this.physicsRenderers[u].mergeAUniforms({noiseTex:{value:t},multiTime:{value:this.multiTime},anchor:{value:new r.Vector3},hookOptions:{value:this.physicsRenderers[0].createDataTexture(o)}})):(this.physicsRenderers[u]=new k("#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D prevVelocity;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 hook(vec3 velocity, vec3 anchor, float restLength, float k) {\n return normalize(velocity - anchor + PRECISION) * (-1.0 * k * (length(velocity - anchor) - restLength));\n}\n\nvoid main(void) {\n vec3 pv = texture2D(prevVelocity, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 d = drag(a, 0.4);\n vec3 h = hook(v, pv, 1.0, 0.14);\n\n vec3 f = a + d + h;\n\n gl_FragColor = vec4(f, 1.0);\n}\n","#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n","precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n\n gl_FragColor = vec4(a + v, 1.0);\n}\n"),this.physicsRenderers[u].start(e,null,i),this.physicsRenderers[u].mergeAUniforms({prevVelocity:{value:this.physicsRenderers[u-1].getCurrentVelocity()}}));this.core.start(this.physicsRenderers[0]),this.trail.start(this.physicsRenderers),this.add(this.core),this.add(this.trail)}},{key:"update",value:function(e,t,n){for(var r=0;r<this.physicsRenderers.length;r++){var i=this.physicsRenderers[r];0===r?i.aUniforms.anchor.value.copy(n.position):i.aUniforms.prevVelocity.value=this.physicsRenderers[r-1].getCurrentVelocity(),i.update(e,t)}this.core.update(this.physicsRenderers[0],t),this.trail.update(this.physicsRenderers,t)}}])&&j(t.prototype,n),c}(r.Group);function H(e){return(H="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})(e)}function V(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e,t){return!t||"object"!==H(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Y,X=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=q(i);if(o){var n=q(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Z(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.PlaneGeometry(1,1),n=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},noiseTex:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main() {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D noiseTex;\n\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 updateUv = vec2(\n vUv.x * min(resolution.x / resolution.y, 1.0) + max(1.0 - resolution.x / resolution.y, 0.0) / 2.0,\n vUv.y * min(resolution.y / resolution.x, 1.0) + max(1.0 - resolution.y / resolution.x, 0.0) / 2.0\n );\n vec2 p = updateUv * 2.0 - 1.0;\n vec4 texColor1 = texture2D(noiseTex, updateUv + vec2(0.0, time * 0.01));\n vec4 texColor2 = texture2D(noiseTex, updateUv - vec2(0.0, time * 0.02));\n vec3 hsv1 = vec3(0.5 + time * 0.1 + vUv.y * 0.5, 0.4, 0.05);\n vec3 hsv2 = vec3(1.2 + time * 0.1 + vUv.y * 0.5, 0.4, 0.4);\n float hsvAlpha = pow((texColor1.r + texColor2.g) / 2.0, 3.0) * 2.0;\n vec3 color = convertHsvToRgb(mix(hsv1, hsv2, hsvAlpha) - (1.0 - smoothstep(0.0, 1.0, length(p))) * 0.3);\n\n gl_FragColor = vec4(color, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Background",e.position.z=-1e3,e}return t=c,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}},{key:"resize",value:function(e,t){var n=this.material.uniforms,r=Math.abs((e.position.z-this.position.z)*Math.tan(s().radians(e.fov)/2)*2),i=r*e.aspect;this.scale.set(i,r,1),n.resolution.value.copy(t)}}])&&V(t.prototype,n),c}(r.Mesh);function K(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var J=new r.Scene,$=new v,ee=new r.Clock({autoStart:!1}),te=new x,ne=new N,re=new X,ie=new r.TextureLoader,oe=new r.Vector2,ae=!1,se=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(Y=new r.WebGLRenderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),Y.setClearColor(921102,1),e.next=5,Promise.all([ie.loadAsync("/sketch-threejs/img/sketch/flow_field/noise.jpg")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,t.format=r.RGBFormat,t.type=r.FloatType,t.minFilter=r.NearestFilter,t.magFilter=r.NearestFilter,te.start(t),ne.start(Y,t),re.start(t)}));case 5:J.add(te),J.add(ne),J.add(re),$.start();case 9:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){K(o,n,r,a,s,"next",e)}function s(e){K(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){ee.start(),this.update()}},{key:"pause",value:function(){ee.stop()}},{key:"update",value:function(){if(!1!==ee.running){var e=ee.getDelta();$.update(e),te.update(e,$),ne.update(Y,e,te),re.update(e),Y.setRenderTarget(null),Y.render(J,$)}}},{key:"resize",value:function(e){$.resize(e),re.resize($,e),Y.setSize(e.x,e.y)}},{key:"setCoreAnchor",value:function(e){var t=150*(oe.x/e.x*2-1)+150*(oe.y/e.y*2-1),n=Math.abs(($.position.z-t)*Math.tan(s().radians($.fov)/2)*2),r=n*$.aspect;te.anchor.set((oe.x/e.x-.5)*r,-(oe.y/e.y-.5)*n,t)}},{key:"touchStart",value:function(e,t){e.touches||e.preventDefault(),oe.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),ae=!0,this.setCoreAnchor(t)}},{key:"touchMove",value:function(e,t){e.touches||e.preventDefault(),!0===ae&&(oe.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.setCoreAnchor(t))}},{key:"touchEnd",value:function(){te.anchor.set(0,0,0),ae=!1}}])&&Q(t.prototype,n),e}();function ce(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function ue(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ce(o,r,i,a,s,"next",e)}function s(e){ce(o,r,i,a,s,"throw",e)}a(void 0)}))}}function le(){return fe.apply(this,arguments)}function fe(){return(fe=ue(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new se,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){var e=function(e){t.touchStart(e,n)},r=function(e){t.touchMove(e,n)},a=function(){t.touchEnd()};i.addEventListener("mousedown",e,{passive:!1}),window.addEventListener("mousemove",r,{passive:!1}),window.addEventListener("mouseup",a),i.addEventListener("touchstart",e,{passive:!1}),window.addEventListener("touchmove",r,{passive:!1}),window.addEventListener("touchend",a),window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},30401:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},tex:{type:"t",value:null}},this.num=200,this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(e){var t=new i.InstancedBufferGeometry,r=new i.PlaneGeometry(1100,1100,20,20);t.copy(r);for(var o=new i.InstancedBufferAttribute(new Float32Array(3*this.num),3),a=new i.InstancedBufferAttribute(new Float32Array(this.num),1),s=new i.InstancedBufferAttribute(new Float32Array(this.num),1),c=0,u=this.num;c<u;c++)o.setXYZ(c,850*(2*Math.random()-1),0,300*(2*Math.random()-1)),a.setXYZ(c,Math.random()),s.setXYZ(c,2*Math.random()+1);t.setAttribute("instancePosition",o),t.setAttribute("delay",a),t.setAttribute("rotate",s);var l=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(94053).Z,fragmentShader:n(68773).Z,transparent:!0,depthWrite:!1,blending:i.AdditiveBlending});this.uniforms.tex.value=e,this.obj=new i.InstancedMesh(t,l,this.num)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},27751:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2212),i=n(38314),o=n(59170).Z,a=n(30401).Z;function s(){var e=new r.Vector2,t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t}),s=new r.Scene,c=new r.PerspectiveCamera,u=new r.Clock;c.far=5e4,c.setFocalLength(24);var l=new a,f=function e(){var t;t=u.getDelta(),l.render(t),n.render(s,c),requestAnimationFrame(e)},h=function(){e.set(document.body.clientWidth,window.innerHeight),t.width=e.x,t.height=e.y,c.aspect=e.x/e.y,c.updateProjectionMatrix(),n.setSize(e.x,e.y)};o({fog:"../img/sketch/fog/fog.png"},(function(e){l.createObj(e.fog),s.add(l.obj),n.setClearColor(1118481,1),c.position.set(0,0,1e3),c.lookAt(new r.Vector3),u.start(),window.addEventListener("resize",i(h,1e3)),h(),f()}))}},95432:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(69338),c=n.n(s),u=n(97719),l=n(5097),f=n(45695),h=n.n(f);function v(){var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!0,canvas:e}),n=new r.Scene,i=new u.Z(35,window.innerWidth/window.innerHeight,1,1e4),s=[],f=null,v=new r.Raycaster,d=-1,p=-1,m=!1,y=!1,g=!1,x=function(){this.rad=0,this.obj,this.is_entered=!1,c().call(this)},b=new r.PlaneGeometry(100,100);(x.prototype=Object.create(c().prototype)).constructor=x,x.prototype.init=function(e){var t=new r.MeshPhongMaterial({side:r.DoubleSide,map:(new r.TextureLoader).load("../img/sketch/gallery/image0"+h().getRandomInt(1,9)+".jpg")});this.obj=new r.Mesh(b,t),this.velocity=e.clone(),this.anchor=e.clone(),this.acceleration.set(0,0,0)};var w,M,_,S,P,T,R=function(e){var t;g||(v.setFromCamera(e,i),(t=v.intersectObjects(n.children)).length>0&&0==y?(document.body.classList.add("is-pointed"),d=t[0].object.id):z())},E=function(e,t){g=!0,e.force.position.anchor.set(780*Math.cos(t.rad),t.obj.position.y,780*Math.sin(t.rad)),e.force.look.anchor.copy(t.obj.position),z()},z=function(){document.body.classList.remove("is-pointed"),d=-1},L=function(){e.width=window.innerWidth,e.height=window.innerHeight,i.aspect=window.innerWidth/window.innerHeight,i.updateProjectionMatrix(),t.setSize(window.innerWidth,window.innerHeight)};t.setSize(window.innerWidth,window.innerHeight),t.setClearColor(1118481,1),i.position.set(1e3,1e3,1e3),i.lookAt(new r.Vector3),w=new r.Vector2,M=new r.Vector2,_=new r.Vector2,S=function(e,t,n){w.set(e,t),(0,a.Z)(w),R(w),m=!0},P=function(e,t,r){M.set(e,t),(0,a.Z)(M),R(n),m&&w.clone().sub(M).length()>.01&&(m=!1,y=!0),1==y&&0==g&&(i.rotate_rad1=i.rotate_rad1_base+h().getRadian(50*(w.y-M.y)),i.rotate_rad2=i.rotate_rad2_base+h().getRadian(50*(w.x-M.x)),i.rotate_rad1<h().getRadian(-50)&&(i.rotate_rad1=h().getRadian(-50)),i.rotate_rad1>h().getRadian(50)&&(i.rotate_rad1=h().getRadian(50)))},T=function(e,t,n){_.set(e,t),z(),g?(i.force.position.anchor.set(0,0,0),p=-1,g=!1):m&&p>-1?E(i,s[p]):y&&(i.rotate_rad1_base=i.rotate_rad1,i.rotate_rad2_base=i.rotate_rad2),m=!1,y=!1},window.addEventListener("resize",o()((function(){L()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),S(e.clientX,e.clientY)})),e.addEventListener("mousemove",(function(e){e.preventDefault(),P(e.clientX,e.clientY)})),e.addEventListener("mouseup",(function(e){e.preventDefault(),T(e.clientX,e.clientY)})),e.addEventListener("touchstart",(function(e){e.preventDefault(),S(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchmove",(function(e){e.preventDefault(),P(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchend",(function(e){e.preventDefault(),T(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),_.set(0,0),z(),g?(i.force.position.anchor.set(0,0,0),p=-1,g=!1):m&&p>-1?E(i,s[p]):y&&(i.rotate_rad1_base=i.rotate_rad1,i.rotate_rad2_base=i.rotate_rad2),m=!1,y=!1})),function(e){for(var t=0;t<300;t++){var n=null,i=h().getRadian(t%45*8+180),o=1e3*Math.cos(i),a=5*t-750,c=1e3*Math.sin(i),u=new r.Vector3(o,a,c);(n=new x).init(new r.Vector3),n.rad=i,n.obj.position.copy(u),e.add(n.obj),s.push(n)}}(n),f=new l.Z(16777215,16777215,1),n.add(f),i.force.position.anchor.set(0,0,0),i.rotate_rad1=h().getRadian(-35),i.rotate_rad1_base=i.rotate_rad1,i.rotate_rad2=h().getRadian(180),i.rotate_rad2_base=i.rotate_rad2,L(),function e(){!function(){for(var e=0;e<300;e++)s[e].applyHook(0,.14),s[e].applyDrag(.4),s[e].updateVelocity(),s[e].obj.lookAt(0,s[e].obj.position.y,0),s[e].obj.id==d&&0==y&&0==g?1==m?p=e:s[e].obj.material.color.set(11184810):s[e].obj.material.color.set(16777215);i.force.position.applyHook(0,.08),i.force.position.applyDrag(.4),i.force.position.updateVelocity(),i.updatePosition(),!1===g&&i.force.look.anchor.copy(h().getPolarCoord(i.rotate_rad1,i.rotate_rad2,1e3)),i.force.look.applyHook(0,.08),i.force.look.applyDrag(.4),i.force.look.updateVelocity(),i.updateLook(),t.render(n,i)}(),requestAnimationFrame(e)}()}},77010:function(e,t,n){"use strict";n.d(t,{Z:function(){return G}});var r=n(2212),i=n(38314),o=n.n(i),a=n(48840),s=n(52886);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(i);if(o){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o.isActive=!1,o}return t=s,(n=[{key:"start",value:function(){this.far=1e3,this.setFocalLength(50),this.position.set(0,0,11),this.lookAt(new r.Vector3),this.isActive=!0}},{key:"update",value:function(e){!1!==this.isActive&&(this.time+=e)}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&u(t.prototype,n),s}(r.PerspectiveCamera);function d(e){return(d="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})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g(i);if(o){var n=g(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return y(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var n=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},tScene:{value:null},tRoughness:{value:null},tNoise:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vNormal;\nvarying float vEdge;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n float angleToCamera = acos(dot(normalize(cameraPosition), (modelMatrix * vec4(normal, 1.0)).xyz));\n\n vPosition = mPosition.xyz;\n vUv = uv;\n vNormal = (viewMatrix * modelMatrix * vec4(normal, 1.0)).xyz;\n vEdge = pow(smoothstep(0.3, 1.0, abs(sin(angleToCamera))), 3.0);\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D tScene;\nuniform sampler2D tRoughness;\nuniform sampler2D tNoise;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vNormal;\nvarying float vEdge;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 uv = abs(gl_FragCoord.xy / resolution - vec2(0.0, 1.0));\n vec4 tSceneColor = texture2D(tScene, uv + vNormal.xy * (0.1 + vEdge * 0.9));\n vec4 tRoughnessColor = texture2D(tRoughness, vUv);\n vec4 tNoiseColor = texture2D(tNoise, vUv);\n float str =\n length(tRoughnessColor.r) * 0.8 +\n vEdge * 0.5;\n vec3 hsv = vec3(\n 0.45 + sin(radians(tNoiseColor.r * 360.0) + time) * 0.08 + cos(radians(tNoiseColor.g * 360.0) + time * 2.0) * 0.08,\n 0.35 - str * 0.34,\n 0.2 + str * 0.8\n );\n vec3 rgb = convertHsvToRgb(hsv);\n vec3 color = rgb + tSceneColor.rgb * tSceneColor.rgb * tSceneColor.rgb * 0.6 + 0.05;\n\n gl_FragColor = vec4(color, 1.0);\n}\n",transparent:!0});return(t=a.call(this,e,n)).name="Glass",t.isActive=!1,t}return t=s,(n=[{key:"start",value:function(e,t,n){var r=this.material.uniforms;r.tScene.value=e,r.tRoughness.value=t,r.tNoise.value=n,this.isActive=!0}},{key:"update",value:function(e){!1!==this.isActive&&(this.material.uniforms.time.value+=e)}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&p(t.prototype,n),s}(r.Mesh);function b(e){return(b="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})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P,T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(i);if(o){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(100,64,64),n=new r.RawShaderMaterial({uniforms:{texture:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main() {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main() {\n gl_FragColor = texture2D(texture, vUv);\n}\n",side:r.BackSide});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.texture.value=e}}])&&w(t.prototype,n),s}(r.Mesh);function R(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var z,L,C=new r.Scene,A=new v,O=new r.Clock({autoStart:!1}),D=new a.L,I=new r.TextureLoader,k=new T,F=new r.WebGLRenderTarget,j=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(P=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),P.setClearColor(921102,1),(L=new s.z(A,P.domElement)).dampingFactor=.1,L.enableDamping=!0,L.enablePan=!1,L.enableZoom=!1,e.next=10,Promise.all([D.loadAsync("/sketch-threejs/model/glass/glass.obj"),I.loadAsync("/sketch-threejs/img/sketch/glass/landscape.jpg"),I.loadAsync("/sketch-threejs/img/sketch/glass/roughness.jpg"),I.loadAsync("/sketch-threejs/img/sketch/glass/noise.jpg")]).then((function(e){e[2].wrapT=e[2].wrapS=r.RepeatWrapping,e[3].wrapT=e[3].wrapS=r.RepeatWrapping,(z=new x(e[0].children[0].geometry)).start(F.texture,e[2],e[3]),k.start(e[1])}));case 10:C.add(z),C.add(k),A.start();case 13:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){R(o,n,r,a,s,"next",e)}function s(e){R(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){O.start(),this.update()}},{key:"pause",value:function(){O.stop()}},{key:"update",value:function(){if(!1!==O.running){var e=O.getDelta();A.update(e),z.update(e),z.visible=!1,P.setRenderTarget(F),P.render(C,A),z.visible=!0,P.setRenderTarget(null),P.render(C,A),L.update()}}},{key:"resize",value:function(e){A.resize(e),z.resize(e),P.setSize(e.x,e.y),F.setSize(e.x,e.y)}}])&&E(t.prototype,n),e}();function U(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){U(o,r,i,a,s,"next",e)}function s(e){U(o,r,i,a,s,"throw",e)}a(void 0)}))}}function G(){return N.apply(this,arguments)}function N(){return(N=B(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new j,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},61962:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},imageResolution:{type:"v2",value:new i.Vector2(2048,1356)},texture:{type:"t",value:null}},this.obj}var t,o;return t=e,(o=[{key:"init",value:function(e){var t=this;(new i.TextureLoader).load("/sketch-threejs/img/sketch/glitch/osaka.jpg",(function(n){n.magFilter=i.NearestFilter,n.minFilter=i.NearestFilter,t.uniforms.texture.value=n,t.obj=t.createObj(),e()}))}},{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(2670).Z,fragmentShader:n(91481).Z}))}},{key:"resize",value:function(){this.uniforms.resolution.value.set(document.body.clientWidth,window.innerHeight)}}])&&r(t.prototype,o),e}()},35854:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},texture:{type:"t",value:t}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(79541).Z,fragmentShader:n(56521).Z}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}},{key:"resize",value:function(){this.uniforms.resolution.value.set(document.body.clientWidth,window.innerHeight)}}])&&r(t.prototype,o),e}()},49275:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(2212),i=n(38314),o=n(89813).Z,a=n(61962).Z,s=n(35854).Z;function c(){var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!1,canvas:e}),n=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),c=new r.Scene,u=new r.Scene,l=new r.OrthographicCamera(-1,1,1,-1,0,1),f=new r.PerspectiveCamera(45,document.body.clientWidth/window.innerHeight,1,2),h=new r.Clock,v=new r.Vector2,d=new r.Vector2,p=new r.Vector2,m=new a,y=new s(n.texture),g=function(){e.width=document.body.clientWidth,e.height=window.innerHeight,f.aspect=document.body.clientWidth/window.innerHeight,f.updateProjectionMatrix(),m.resize(),y.resize(),n.setSize(document.body.clientWidth,window.innerHeight),t.setSize(document.body.clientWidth,window.innerHeight)};t.setSize(document.body.clientWidth,window.innerHeight),t.setClearColor(5592405,1),m.init((function(){u.add(m.obj),c.add(y.obj)})),window.addEventListener("resize",i((function(){g()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),v.set(e.clientX,e.clientY),o(v)})),document.addEventListener("mousemove",(function(e){e.preventDefault(),d.set(e.clientX,e.clientY),o(d)})),document.addEventListener("mouseup",(function(e){e.preventDefault(),p.set(e.clientX,e.clientY),o(p)})),e.addEventListener("touchstart",(function(e){e.preventDefault(),v.set(e.touches[0].clientX,e.touches[0].clientY),o(v),e.touches[0].clientX,e.touches[0].clientY})),e.addEventListener("touchmove",(function(e){e.preventDefault(),d.set(e.touches[0].clientX,e.touches[0].clientY),o(d)})),e.addEventListener("touchend",(function(e){e.preventDefault(),p.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),o(p)})),g(),function e(){var r;r=h.getDelta(),t.setRenderTarget(n),t.render(u,f),y.render(r),t.setRenderTarget(null),t.render(c,l),requestAnimationFrame(e)}()}},97531:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(12390),c=n.n(s),u=n(97719),l=n(45695),f=n.n(l);function h(){var e,t,i,s,l,h,v,d,p=document.getElementById("canvas-webgl"),m=new r.WebGL1Renderer({antialias:!0,canvas:p}),y=new r.Scene,g=new u.Z(35,window.innerWidth/window.innerHeight,1,1e4),x=(new r.Clock,null),b=null,w=null,M=null,_=new r.DirectionalLight(16777215,1),S=new r.Scene,P=new u.Z(45,1,1,1e4),T=new r.WebGLRenderTarget(1200,1200),R=null,E=new r.Scene,z=new u.Z(45,1,1,1e4),L=new r.HemisphereLight(268435455,13421772,1),C=new r.WebGLRenderTarget(1200,1200),A=null,O=null,D=new(c()),I=function(){p.width=window.innerWidth,p.height=window.innerHeight,g.aspect=window.innerWidth/window.innerHeight,g.updateProjectionMatrix(),m.setSize(window.innerWidth,window.innerHeight),x.material.uniforms.resolution.value.set(window.innerWidth,window.innerHeight),R.material.uniforms.resolution.value.set(window.innerWidth,window.innerHeight)};m.setSize(window.innerWidth,window.innerHeight),m.setClearColor(15658734,0),g.position.set(1e3,1e3,1e3),g.lookAt(new r.Vector3),i=new r.Vector2,s=new r.Vector2,l=new r.Vector2,h=function(e,t,n){i.set(e,t),(0,a.Z)(i),D.anchor.set(2,30)},v=function(e,t,n){s.set(e,t),(0,a.Z)(s)},d=function(e,t,n){l.set(e,t),D.anchor.set(1,0)},window.addEventListener("resize",o()((function(){I()})),1e3),p.addEventListener("mousedown",(function(e){e.preventDefault(),h(e.clientX,e.clientY)})),p.addEventListener("mousemove",(function(e){e.preventDefault(),v(e.clientX,e.clientY)})),p.addEventListener("mouseup",(function(e){e.preventDefault(),d(e.clientX,e.clientY)})),p.addEventListener("touchstart",(function(e){e.preventDefault(),h(e.touches[0].clientX,e.touches[0].clientY)})),p.addEventListener("touchmove",(function(e){e.preventDefault(),v(e.touches[0].clientX,e.touches[0].clientY)})),p.addEventListener("touchend",(function(e){e.preventDefault(),d(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),l.set(0,0),D.anchor.set(1,0)})),D.anchor.set(1,0),z.force.position.anchor.set(1e3,300,0),z.force.look.anchor.set(0,0,0),e=new r.SphereGeometry(1e3,128,128),t=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:n(19160).Z,fragmentShader:n(53944).Z,side:r.BackSide}),A=new r.Mesh(e,t),O=function(){for(var e=new r.BufferGeometry,t=[],i=0;i<2e3;i++)t.push(f().getRadian(f().getRandomInt(0,120)+120),f().getRadian(f().getRandomInt(0,3600)/10),f().getRandomInt(200,1e3));var o=new Float32Array(t);e.setAttribute("position",new r.BufferAttribute(o,3));var a=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:n(14623).Z,fragmentShader:n(77644).Z});return new r.Points(e,a)}(),E.add(A),E.add(O),E.add(L),x=function(){for(var e=new r.BufferGeometry,t=[],i=[],o=0;o<32;o++){t.push(0,0,0);var a=f().getRadian(f().getRandomInt(0,360)),s=f().getRadian(f().getRandomInt(0,360)),c=f().getRadian(f().getRandomInt(0,360));i.push(a,s,c)}var u=new Float32Array(t);e.setAttribute("position",new r.BufferAttribute(u,3));var l=new Float32Array(i);e.setAttribute("radian",new r.BufferAttribute(l,3));var h=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0},resolution:{type:"v2",value:new r.Vector2(window.innerWidth,window.innerHeight)},size:{type:"f",value:28},force:{type:"v2",value:D.velocity}},vertexShader:n(12978).Z,fragmentShader:n(28408).Z,transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return new r.Points(e,h)}(),S.add(x),P.position.set(0,0,3e3),P.force.look.anchor.set(0,0,0),R=function(){var e=new r.PlaneGeometry(1e3,1e3),t=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0},resolution:{type:"v2",value:new r.Vector2(window.innerWidth,window.innerHeight)},texture:{type:"t",value:T.texture},texture2:{type:"t",value:C.texture}},vertexShader:n(8820).Z,fragmentShader:n(61187).Z,transparent:!0});return new r.Mesh(e,t)}(),y.add(R),b=function(){var e=new r.SphereGeometry(1200,64,64),t=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:n(45582).Z,fragmentShader:n(27444).Z,side:r.BackSide});return new r.Mesh(e,t)}(),y.add(b),w=function(){var e=new r.SphereGeometry(1100,64,64),t=new r.MeshBasicMaterial({color:14540253,wireframe:!0});return new r.Mesh(e,t)}(),y.add(w),M=function(){for(var e=new r.SphereGeometry(2,4,4),t=e.attributes,i=new r.BufferGeometry,o=[],a=[],s=[],c=[],u=[],l=function(n){for(y=f().getRandomInt(300,1e3),v=f().getRadian(f().getRandomInt(0,3600)/10),d=f().getRandomInt(60,120)/100,p=0;p<t.position.array.length;p+=3)o.push(t.position.array[p+0],t.position.array[p+1],t.position.array[p+2]),a.push(y),s.push(v),c.push(d);e.index.array.map((function(e){u.push(e+n*t.position.array.length/3)}))},h=0;h<16;h++){var v,d,p;l(h)}var m=new Float32Array(o);i.setAttribute("position",new r.BufferAttribute(m,3));var y=new Float32Array(a);i.setAttribute("radius",new r.BufferAttribute(y,1));var g=new Float32Array(s);i.setAttribute("radian",new r.BufferAttribute(g,1));var x=new Float32Array(c);i.setAttribute("scale",new r.BufferAttribute(x,1));var b=new Uint32Array(u);i.setIndex(new r.BufferAttribute(b,1));var w=new r.ShaderMaterial({uniforms:r.UniformsUtils.merge([r.UniformsLib.lights,{time:{type:"f",value:0}}]),vertexShader:n(33176).Z,fragmentShader:n(5402).Z,lights:!0});return new r.Mesh(i,w)}(),y.add(M),_.position.set(0,1,0),y.add(_),g.force.position.anchor.set(1e3,300,0),g.force.look.anchor.set(0,0,0),I(),function e(){x.material.uniforms.time.value++,R.lookAt(g.position),R.material.uniforms.time.value++,A.material.uniforms.time.value++,O.material.uniforms.time.value++,w.rotation.y=x.material.uniforms.time.value/1e3,M.material.uniforms.time.value++,D.applyHook(0,.12),D.applyDrag(.18),D.updateVelocity(),g.force.position.applyHook(0,.025),g.force.position.applyDrag(.2),g.force.position.updateVelocity(),g.updatePosition(),g.force.look.anchor.y=100*Math.sin(x.material.uniforms.time.value/100),g.force.look.applyHook(0,.2),g.force.look.applyDrag(.4),g.updateLook(),z.force.position.applyHook(0,.1),z.force.position.applyDrag(.2),z.force.position.updateVelocity(),z.updatePosition(),z.force.look.applyHook(0,.2),z.force.look.applyDrag(.4),z.force.look.updateVelocity(),z.updateLook(),m.setRenderTarget(C),m.render(E,z),m.setRenderTarget(T),m.render(S,P),m.setRenderTarget(null),m.render(y,g),requestAnimationFrame(e)}()}},4625:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(89813),i=n(97719),o=n(33286),a=n.n(o),s=n(7318),c=n.n(s),u=n(45695),l=n.n(u),f=n(2212),h=n(38314);function v(){var e,t,o,s,u,v,d=document.getElementById("canvas-webgl"),p=new f.WebGL1Renderer({antialias:!0,canvas:d}),m=new f.Scene,y=new i.Z(35,window.innerWidth/window.innerHeight,1,1e4),g=(new f.Clock,2e4),x=[],b=new(c()),w=new Float32Array(6e4),M=new Float32Array(6e4),_=new Float32Array(g),S=new Float32Array(g),P=new f.Vector3(1.5,0,0),T=Date.now(),R=!1,E=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=null,r=null;return e.width=256,e.height=256,(n=t.createRadialGradient(128,128,20,128,128,128)).addColorStop(.2,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.3)"),n.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=n,t.arc(128,128,128,0,Math.PI/180,!0),t.fill(),(r=new f.Texture(e)).needsUpdate=!0,r},z=function(){d.width=window.innerWidth,d.height=window.innerHeight,y.aspect=window.innerWidth/window.innerHeight,y.updateProjectionMatrix(),p.setSize(window.innerWidth,window.innerHeight)};p.setSize(window.innerWidth,window.innerHeight),p.setClearColor(0,1),y.position.set(1e3,1e3,1e3),y.lookAt(new f.Vector3),e=new f.Vector2,t=new f.Vector2,o=new f.Vector2,s=function(t,n,i){e.set(t,n),(0,r.Z)(e),R=!0},u=function(e,n,i){t.set(e,n),(0,r.Z)(t),y.force.position.anchor.z=120*t.x,y.force.position.anchor.y=-120*t.y},v=function(e,t,n){o.set(e,t),y.force.position.anchor.z=0,y.force.position.anchor.y=0,R=!1},window.addEventListener("resize",h((function(){z()})),1e3),d.addEventListener("mousedown",(function(e){e.preventDefault(),s(e.clientX,e.clientY)})),d.addEventListener("mousemove",(function(e){e.preventDefault(),u(e.clientX,e.clientY)})),d.addEventListener("mouseup",(function(e){e.preventDefault(),v(e.clientX,e.clientY)})),d.addEventListener("touchstart",(function(e){e.preventDefault(),s(e.touches[0].clientX,e.touches[0].clientY)})),d.addEventListener("touchmove",(function(e){e.preventDefault(),u(e.touches[0].clientX,e.touches[0].clientY)})),d.addEventListener("touchend",(function(e){e.preventDefault(),v(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),o.set(0,0),y.force.position.anchor.z=0,y.force.position.anchor.y=0})),function(){for(var e=0;e<g;e++){var t=new(a()),r=l().getRandomInt(60,210),i=l().getRandomInt(30,90),o=new f.Color("hsl("+r+", "+i+"%, 50%)");t.init(new f.Vector3(l().getRandomInt(-100,100),0,0)),x.push(t),w[3*e+0]=t.velocity.x,w[3*e+1]=t.velocity.y,w[3*e+2]=t.velocity.z,o.toArray(M,3*e),_[e]=t.a,S[e]=t.size}b.init({scene:m,vs:n(99173).Z,fs:n(77911).Z,positions:w,colors:M,opacities:_,sizes:S,texture:E(),blending:f.AdditiveBlending}),y.force.position.anchor.set(800,0,0)}(),z(),function e(){R?P.x<6&&(P.x+=.02):P.x>1.5&&(P.x-=.1),function(){var e=0;if(Date.now()-T>16*P.x){for(var t=0;t<x.length;t++){var n=x[t];if(!n.is_active){var r=l().getRadian(3*l().getRandomInt(0,120)),i=Math.log(l().getRandomInt(2,128))/Math.log(128)*160+60,o=Math.sin(r)*i,a=Math.cos(r)*i,s=new f.Vector3(-1e3,o,a);if(s.add(b.velocity),n.activate(),n.init(s),n.a=0,n.size=l().getRandomInt(5,60),++e>=Math.pow(3*P.x,.4*P.x))break}}T=Date.now()}}(),function(){for(var e=0;e<x.length;e++){var t=x[e];t.is_active&&(t.time++,t.applyForce(P),t.applyDrag(.1),t.updateVelocity(),t.a<.8&&(t.a+=.02),t.velocity.x>1e3&&(t.init(new f.Vector3(0,0,0)),t.time=0,t.a=0,t.inactivate())),w[3*e+0]=t.velocity.x,w[3*e+1]=t.velocity.y,w[3*e+2]=t.velocity.z,_[e]=t.a,S[e]=t.size}b.updatePoints()}(),y.force.position.applyHook(0,.008),y.force.position.applyDrag(.1),y.force.position.updateVelocity(),y.updatePosition(),y.lookAtCenter(),p.render(m,y),requestAnimationFrame(e)}()}},91614:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(33286),c=n.n(s),u=n(7318),l=n.n(u),f=n(97719),h=n(45695),v=n.n(h);function d(){var e,t,i,s,u,h,d,p=document.getElementById("canvas-webgl"),m=new r.WebGL1Renderer({antialias:!0,canvas:p}),y=new r.Scene,g=new f.Z(35,window.innerWidth/window.innerHeight,1,1e4),x=(new r.Clock,new Image),b=[],w=[],M=null,_=null,S=null,P=null,T=400,R=new(l()),E=!1,z=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=null,i=null;return e.width=200,e.height=200,(n=t.createRadialGradient(100,100,20,100,100,100)).addColorStop(.2,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.3)"),n.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=n,t.arc(100,100,100,0,Math.PI/180,!0),t.fill(),(i=new r.Texture(e)).minFilter=r.NearestFilter,i.needsUpdate=!0,i},L=function(){p.width=window.innerWidth,p.height=window.innerHeight,g.aspect=window.innerWidth/window.innerHeight,g.updateProjectionMatrix(),m.setSize(window.innerWidth,window.innerHeight)};m.setSize(window.innerWidth,window.innerHeight),m.setClearColor(1118481,1),g.position.set(1e3,1e3,1e3),g.lookAt(new r.Vector3),t=new r.Vector2,i=new r.Vector2,s=new r.Vector2,u=function(e,n,r){t.set(e,n),(0,a.Z)(t),function(){for(var e=0;e<w.length;e++){var t=w[e],n=v().getRadian(v().getRandomInt(0,360)),r=v().getRadian(v().getRandomInt(0,360)),i=v().getRandomInt(40,80);t.is_activate=!1,t.applyForce(v().getPolarCoord(n,r,i))}}()},h=function(e,t,n){i.set(e,t),(0,a.Z)(i),g.force.position.anchor.z=1e3*i.x,g.force.position.anchor.y=-1e3*i.y},d=function(e,t,n){s.set(e,t),g.force.position.anchor.z=0,g.force.position.anchor.y=0},window.addEventListener("resize",o()((function(){L()})),1e3),p.addEventListener("mousedown",(function(e){e.preventDefault(),u(e.clientX,e.clientY)})),p.addEventListener("mousemove",(function(e){e.preventDefault(),h(e.clientX,e.clientY)})),p.addEventListener("mouseup",(function(e){e.preventDefault(),d(e.clientX,e.clientY)})),p.addEventListener("touchstart",(function(e){e.preventDefault(),u(e.touches[0].clientX,e.touches[0].clientY)})),p.addEventListener("touchmove",(function(e){e.preventDefault(),h(e.touches[0].clientX,e.touches[0].clientY)})),p.addEventListener("touchend",(function(e){e.preventDefault(),d(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),s.set(0,0),g.force.position.anchor.z=0,g.force.position.anchor.y=0})),e=function(){!function(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=T,e.height=T,t.drawImage(x,0,0);for(var n=t.getImageData(0,0,T,T),r=0;r<T;r++)if(!(r%3>0))for(var i=0;i<T;i++)i%3>0||n.data[4*(i+r*T)]>0&&b.push(0,-1*(r-200),-1*(i-200))}(),function(e){M=new Float32Array(b),_=new Float32Array(b.length),S=new Float32Array(b.length/3),P=new Float32Array(b.length/3);for(var t=0;t<b.length/3;t++){var i=new(c()),o=new r.Color("hsl("+(b[3*t+2]+b[3*t+1]+T)/5+", 60%, 80%)");i.init(new r.Vector3(b[3*t],b[3*t+1],b[3*t+2])),i.is_activate=!0,w.push(i),o.toArray(_,3*t),S[t]=1,P[t]=12}R.init({scene:e,vs:n(99173).Z,fs:n(77911).Z,positions:M,colors:_,opacities:S,sizes:P,texture:z(),blending:r.NormalBlending}),E=!0}(y)},x.src="../img/sketch/image_data/elephant.png",x.onload=function(){e()},g.setPolarCoord(0,0,1400),L(),function e(){E&&(function(){for(var e=0;e<w.length;e++){var t=w[e];t.time++,t.acceleration.length()<1&&(t.is_activate=!0),t.is_activate?(t.applyHook(0,.18),t.applyDrag(.26)):t.applyDrag(.035),t.updateVelocity(),t.velocity.sub(R.velocity),M[3*e+0]=t.velocity.x-R.velocity.x,M[3*e+1]=t.velocity.y-R.velocity.x,M[3*e+2]=t.velocity.z-R.velocity.x,t.size=Math.log(v().getRandomInt(1,128))/Math.log(128)*Math.sqrt(document.body.clientWidth),P[e]=t.size}R.updatePoints()}(),R.updatePoints()),g.force.position.applyHook(0,.025),g.force.position.applyDrag(.2),g.force.position.updateVelocity(),g.updatePosition(),g.lookAtCenter(),m.render(y,g),requestAnimationFrame(e)}()}},60439:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}}),n(2212);var i=n(90887),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.camera=t,this.radian1=0,this.radian1Base=0,this.radian2=0,this.radian2Base=0,this.radius=2500,this.isZoom=!1}var t,n;return t=e,(n=[{key:"rotate",value:function(e,t){!0===this.isZoom&&(this.isZoom=!1),this.radian1=o.clamp(this.radian1Base+t,o.radians(-75),o.radians(75)),this.radian2=this.radian2Base-2*e}},{key:"zoom",value:function(e){e&&(!1===this.isZoom&&(this.isZoom=!0),this.radius,this.radius-=e/Math.abs(e)*200,this.radius=o.clamp(this.radius,700,8e3),this.radius)}},{key:"touchEnd",value:function(){this.radian1Base=this.radian1,this.radian2Base=this.radian2}},{key:"render",value:function(){this.camera.anchor=o.spherical(this.radian1,this.radian2,this.radius),this.camera.render()}},{key:"computeZoomLength",value:function(){return this.isZoom?.05*i.vec3.length(this.camera.acceleration):0}},{key:"computeAcceleration",value:function(){return.05*i.vec3.length(this.camera.acceleration)}}])&&r(t.prototype,n),e}()},90036:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},cubeTex:{type:"t",value:null}},this.instances=1e3,this.obj}var t,a;return t=e,(a=[{key:"init",value:function(e){this.uniforms.cubeTex.value=e,this.obj=this.createObj()}},{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(10,10,10);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),a=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),s=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),c=0,u=a.count;c<u;c++){var l=o.spherical(2*Math.random()*Math.PI,2*Math.random()*Math.PI,3e3*Math.random()+100);r.setXYZ(c,l[0],l[1],l[2]),a.setXYZ(c,100*Math.random()),s.setXYZ(c,Math.random()-.5,Math.random()-.5,Math.random()-.5)}return e.setAttribute("translate",r),e.setAttribute("offset",a),e.setAttribute("rotate",s),new i.InstancedMesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(58702).Z,fragmentShader:n(7034).Z,transparent:!0,side:i.DoubleSide}),this.instances)}},{key:"render",value:function(e){this.uniforms.time.value+=e,this.obj&&(this.obj.instanceMatrix.needsUpdate=!0)}}])&&r(t.prototype,a),e}()},41442:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},texture:{type:"t",value:t},strengthZoom:{type:"f",value:0},strengthGlitch:{type:"f",value:0}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(4998).Z,fragmentShader:n(64529).Z}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}},{key:"resize",value:function(){this.uniforms.resolution.value.set(document.body.clientWidth,window.innerHeight)}}])&&r(t.prototype,o),e}()},22668:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},cubeTex:{type:"t",value:null}},this.obj}var t,o;return t=e,(o=[{key:"init",value:function(e){this.uniforms.cubeTex.value=e,this.obj=this.createObj()}},{key:"createObj",value:function(){return new i.Mesh(new i.BoxGeometry(3e4,3e4,3e4,1,1,1),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(70301).Z,fragmentShader:n(67965).Z,side:i.BackSide}))}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}()},15758:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(2212),i=n(38314),o=n(89813).Z,a=n(97355).Z,s=n(60439).Z,c=n(90036).Z,u=n(22668).Z,l=n(41442).Z;function f(){var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!1,canvas:e,alpha:!0}),n=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),f=new r.Scene,h=new r.Scene,v=new r.OrthographicCamera(-1,1,1,-1,0,1),d=new a(45,document.body.clientWidth/window.innerHeight,1,1e5),p=new s(d),m=new r.Clock,y=new r.Vector2,g=new r.Vector2,x=new r.Vector2,b=!1,w=new r.CubeTextureLoader,M=new c,_=new u,S=new l(n.texture),P=function(){e.width=document.body.clientWidth,e.height=window.innerHeight,d.aspect=document.body.clientWidth/window.innerHeight,d.updateProjectionMatrix(),S.resize(),t.setSize(document.body.clientWidth,window.innerHeight),n.setSize(document.body.clientWidth,window.innerHeight)},T=function(e){b=!0},R=function(e){b&&p.rotate(y.x-g.x,y.y-g.y)},E=function(e){b=!1,p.touchEnd()};t.setSize(document.body.clientWidth,window.innerHeight),t.setClearColor(15658734,1),w.setPath("../static/image/instancing/").load(["cubemap_px.png","cubemap_nx.png","cubemap_py.png","cubemap_ny.png","cubemap_pz.png","cubemap_nz.png"],(function(e){M.init(e),_.init(e),f.add(S.obj),h.add(M.obj),h.add(_.obj)})),window.addEventListener("resize",i((function(){P()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),y.set(e.clientX,e.clientY),o(y),T()})),document.addEventListener("mousemove",(function(e){e.preventDefault(),g.set(e.clientX,e.clientY),o(g),R()})),document.addEventListener("mouseup",(function(e){e.preventDefault(),x.set(e.clientX,e.clientY),o(x),E()})),e.addEventListener("wheel",(function(e){e.preventDefault(),function(e){p.zoom(e.deltaY)}(e)})),e.addEventListener("touchstart",(function(e){e.preventDefault(),y.set(e.touches[0].clientX,e.touches[0].clientY),o(y),T(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchmove",(function(e){e.preventDefault(),g.set(e.touches[0].clientX,e.touches[0].clientY),o(g),R()})),e.addEventListener("touchend",(function(e){e.preventDefault(),x.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),o(x),E()})),P(),function e(){var r;r=m.getDelta(),p.render(),M.render(r),_.render(r),S.render(r),S.uniforms.strengthZoom.value=p.computeZoomLength(),S.uniforms.strengthGlitch.value=p.computeAcceleration(),t.setRenderTarget(n),t.render(h,d),t.setRenderTarget(null),t.render(f,v),requestAnimationFrame(e)}()}},48501:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.vTouchStart=new i.Vector2,this.vPrev=new i.Vector2,this.v=new i.Vector2,this.a=new i.Vector2,this.anchor=new i.Vector2,this.isTouched=!1}var t,n;return t=e,(n=[{key:"touchStart",value:function(e){e.touches||e.preventDefault(),this.vPrev.copy(this.v),this.a.set(0,0),this.vTouchStart.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.isTouched=!0}},{key:"touchMove",value:function(e){var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY;!1!==this.isTouched&&(this.anchor.set((t-this.vTouchStart.x)/10+this.vPrev.x,(n-this.vTouchStart.y)/10+this.vPrev.y),e.touches&&e.preventDefault())}},{key:"touchEnd",value:function(e){this.isTouched=!1,this.isDraging=!1}},{key:"render",value:function(){this.a.set((this.anchor.x-this.v.x)/10,(this.anchor.y-this.v.y)/10),this.v.add(this.a)}}])&&r(t.prototype,n),e}()},13490:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return s}});var i=n(2212),o=n(17393),a=n(91685),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},addH1:{type:"f",value:t-.5},addH2:{type:"f",value:t}},this.obj}var t,s;return t=e,(s=[{key:"createObj",value:function(){for(var e=new a(Math.random),t=new i.BoxGeometry(100,5,100,60,1,60),r=0;r<t.attributes.position.count;r++){var s=t.attributes.position.getX(r),c=t.attributes.position.getY(r),u=t.attributes.position.getZ(r),l=48*(.75*e.noise4D(s/80,c/80,u/80,1)+.25)+18*e.noise4D(s/48,c/32,u/32,1)+1.2*e.noise4D(s/6,c/6,u/6,1)+.6*e.noise4D(s/2,c/2,u/2,1),f=function(e,t,n){var r=o.clamp((n-0)/5,0,1);return r*r*(3-2*r)}(0,0,l),h=function(e,t){return t>=0?1:0}(0,c);t.attributes.position.setY(r,(c+l*f)*h)}var v=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(31382).Z,fragmentShader:n(72413).Z});this.obj=new i.Mesh(t,v)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,s),e}()},8189:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},addH:{type:"f",value:t-.5}},this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(100,100,60,60),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(40557).Z,fragmentShader:n(53822).Z,transparent:!0});this.obj=new i.Mesh(e,t),this.obj.translateY(8),this.obj.rotation.set(o.radians(-90),0,0)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},1867:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(2212),i=n(38314),o=n(17393),a=n(13490).Z,s=n(8189).Z,c=n(48501).Z;function u(){var e=new r.Vector2,t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t}),u=new r.Scene,l=new r.PerspectiveCamera,f=new r.Clock({autoStart:!1});l.far=1e3,l.setFocalLength(50);var h,v,d,p=Math.random(),m=new a(p),y=new s(p),g=new r.Group,x=new c,b=function(){e.set(document.body.clientWidth,window.innerHeight),t.width=e.x,t.height=e.y,l.aspect=e.x/e.y,l.updateProjectionMatrix(),n.setSize(e.x,e.y)};n.setClearColor(15658734,1),l.position.set(0,0,300),l.lookAt(new r.Vector3(0,0,0)),m.createObj(),y.createObj(),g.add(m.obj),g.add(y.obj),u.add(g),h=function(e){x.touchStart(e)},v=function(e){x.touchMove(e)},d=function(e){x.touchEnd(e)},t.addEventListener("mousedown",h,{passive:!1}),window.addEventListener("mousemove",v,{passive:!1}),window.addEventListener("mouseup",d),t.addEventListener("touchstart",h,{passive:!1}),window.addEventListener("touchmove",v,{passive:!1}),window.addEventListener("touchend",d),window.addEventListener("resize",i(b,1e3)),b(),f.start(),function t(){var r;r=f.getDelta(),x.render(e),g.rotation.set(o.radians(x.v.y/e.x*1e3+45),o.radians(x.v.x/e.y*1e3-30),0),m.render(r),y.render(r),n.render(u,l),requestAnimationFrame(t)}()}},73262:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2212),i=n(38314),o=n.n(i),a=n(89813),s=n(69338),c=n.n(s),u=n(97719),l=n(45695),f=n.n(l);function h(){var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!0,canvas:e}),i=new r.Scene,s=new u.Z(35,window.innerWidth/window.innerHeight,1,1e4),l=(new r.Clock,new r.Raycaster),h=null,v=new(c()),d=new(c()),p=null;v.mass=1.4;var m,y,g,x,b,w,M,_,S,P=(m=new r.PlaneGeometry(6,6),y=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0},time2:{type:"f",value:0},acceleration:{type:"f",value:0},resolution:{type:"v2",value:new r.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:n(30755).Z,fragmentShader:n(73845).Z,transparent:!0}),(g=new r.Mesh(m,y)).name="MetalCube",g),T=function(){var e=new r.OctahedronGeometry(30,4),t=new r.ShaderMaterial({uniforms:{time:{type:"f",value:0},acceleration:{type:"f",value:0}},vertexShader:n(30958).Z,fragmentShader:n(12294).Z,side:r.BackSide}),i=new r.Mesh(e,t);return i.name="Background",i}(),R=function(){e.width=window.innerWidth,e.height=window.innerHeight,s.aspect=window.innerWidth/window.innerHeight,s.updateProjectionMatrix(),t.setSize(window.innerWidth,window.innerHeight),P.material.uniforms.resolution.value.set(window.innerWidth,window.innerHeight)};t.setSize(window.innerWidth,window.innerHeight),t.setClearColor(15658734,1),s.position.set(1e3,1e3,1e3),s.lookAt(new r.Vector3),x=new r.Vector2,b=new r.Vector2,w=new r.Vector2,M=function(e,t,n){x.set(e,t),(0,a.Z)(x)},_=function(e,t,n){b.set(e,t),(0,a.Z)(b),p=b},S=function(e,t,n){w.set(e,t)},window.addEventListener("resize",o()((function(){R()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),M(e.clientX,e.clientY)})),e.addEventListener("mousemove",(function(e){e.preventDefault(),_(e.clientX,e.clientY)})),e.addEventListener("mouseup",(function(e){e.preventDefault(),S(e.clientX,e.clientY)})),e.addEventListener("touchstart",(function(e){e.preventDefault(),M(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchmove",(function(e){e.preventDefault(),_(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchend",(function(e){e.preventDefault(),S(e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),window.addEventListener("mouseout",(function(){event.preventDefault(),w.set(0,0)})),i.add(P),i.add(T),s.setPolarCoord(0,f().getRadian(90),24),R(),function e(){!function(e,t,n){v.acceleration.length()>.1||!n||(l.setFromCamera(n,t),(h=l.intersectObjects(e.children)[0])&&"MetalCube"==h.object.name&&(v.anchor.copy(f().getPolarCoord(f().getRadian(f().getRandomInt(-20,20)),f().getRadian(f().getRandomInt(0,360)),f().getRandomInt(30,90)/10)),d.applyForce(new r.Vector3(1,0,0))))}(i,s,p),v.applyHook(0,.12),v.applyDrag(.01),v.updateVelocity(),d.applyHook(0,.005),d.applyDrag(.2),d.updateVelocity(),P.position.copy(v.velocity),P.material.uniforms.time.value++,P.material.uniforms.time2.value+=1+Math.floor(4*v.acceleration.length()),P.material.uniforms.acceleration.value=v.acceleration.length(),T.material.uniforms.time.value++,T.material.uniforms.acceleration.value=d.velocity.length(),s.force.position.applyHook(0,.025),s.force.position.applyDrag(.2),s.force.position.updateVelocity(),s.updatePosition(),s.lookAtCenter(),t.render(i,s),requestAnimationFrame(e)}()}},56600:function(e,t,n){"use strict";n.d(t,{Z:function(){return Q}});var r=n(2212),i=n(48840),o=n(42238),a=n.n(o),s=n(38314),c=n.n(s),u=n(29130),l=n.n(u),f=n(17393),h=n.n(f);function v(e){return(v="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})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(c,e);var t,i,o,a,s=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(o);if(a){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function c(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var i=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:-2},drawBrightOnly:{type:"f",value:0},dissolveEdge:{type:"f",value:0}},vertexShader:n(30673).Z,fragmentShader:n(32450).Z,transparent:!0});return(t=s.call(this,e,i)).v=new r.Vector3(0,0,0),t.a=new r.Vector3,t.anchor=new r.Vector3(0,0,0),t.sv=new r.Vector3(0,0,0),t.sa=new r.Vector3,t.sanchor=new r.Vector3(0,0,0),t.isOvered=!1,t.isCoolDowned=!1,t}return t=c,(i=[{key:"rotate",value:function(e,t){this.anchor.set(e,t,0)}},{key:"render",value:function(e,t){this.material.uniforms.time.value+=e,this.material.uniforms.dissolveEdge.value=.0055*t,this.a.copy(this.anchor).sub(this.v).divideScalar(10),this.v.add(this.a),this.rotation.setFromVector3(this.v),this.sa.copy(this.sanchor).sub(this.sv).divideScalar(10),!1===this.isOvered&&this.sa.addScalar(.2*t),this.sv.add(this.sa);var n=.005*(this.sv.length()+1),r=5e-4*this.sv.length()+1;!1===this.isCoolDowned&&(this.scale.set(r,r,r),this.position.set((2*Math.random()-1)*n,(2*Math.random()-1)*n,(2*Math.random()-1)*n))}},{key:"over",value:function(){this.isOvered=!0}},{key:"coolDown",value:function(){this.isOvered=!1,this.isCoolDowned=!0}},{key:"returnFirstState",value:function(){this.sv.set(0,0,0),this.sa.set(0,0,0),this.isCoolDowned=!1}}])&&d(t.prototype,i),c}(r.Mesh);function x(e){return(x="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})(e)}function b(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t){return(M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=new r.TextureLoader,T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(l,e);var t,i,o,a,s,c,u=(s=l,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S(s);if(c){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _(this,e)});function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var t=new r.PlaneGeometry(36,36),i=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},time2:{type:"f",value:0},tex:{type:"t",value:null},drawBrightOnly:{type:"f",value:0}},vertexShader:n(59751).Z,fragmentShader:n(71949).Z,transparent:!0});return(e=u.call(this,t,i)).position.z=40,e.isOver=!1,e}return t=l,(i=[{key:"loadTexture",value:(o=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P.loadAsync("/sketch-threejs/img/sketch/newyear2019/typo.png");case 2:this.material.uniforms.tex.value=e.sent;case 3:case"end":return e.stop()}}),e,this)})),a=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){b(i,n,r,a,s,"next",e)}function s(e){b(i,n,r,a,s,"throw",e)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"render",value:function(e){this.material.uniforms.time.value+=e,!0===this.isOver&&(this.material.uniforms.time2.value+=e)}},{key:"over",value:function(e){this.material.uniforms.time2.value=0,this.isOver=!0}},{key:"coolDown",value:function(){this.isOver=!1}}])&&w(t.prototype,i),l}(r.Mesh);function R(e){return(R="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})(e)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(c,e);var t,i,o,a,s=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=C(o);if(a){var n=C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return L(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.InstancedBufferGeometry,i=new r.PlaneGeometry(1.2,1.2);t.copy(i);for(var o=new r.InstancedBufferAttribute(new Float32Array(1800),3),a=new r.InstancedBufferAttribute(new Float32Array(1800),3),u=new r.InstancedBufferAttribute(new Float32Array(1800),3),l=new r.InstancedBufferAttribute(new Float32Array(600),1),f=0;f<600;f++){var v=h().radians(360*Math.random()),d=50*Math.random()+25;o.setXYZ(f,Math.cos(v)*d,Math.sin(v)*d,250*Math.random()-150),f%2==1?a.setXYZ(f,.8,.1,.1):a.setXYZ(f,1,1,1),u.setXYZ(f,h().radians(360*Math.random()),h().radians(360*Math.random()),h().radians(360*Math.random())),l.setXYZ(f,Math.random())}t.setAttribute("iPosition",o),t.setAttribute("iColor",a),t.setAttribute("iRotate",u),t.setAttribute("iDelay",l);var p=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:n(58259).Z,fragmentShader:n(94914).Z,side:r.DoubleSide,transparent:!0});return(e=s.call(this,t,p,600)).name="InstanceMesh",e.frustumCulled=!1,e.isOver=!1,e}return t=c,(i=[{key:"render",value:function(e){!0===this.isOver&&(this.material.uniforms.time.value+=e)}},{key:"over",value:function(e){this.material.uniforms.time.value=0,this.isOver=!0}},{key:"coolDown",value:function(){this.isOver=!1}}])&&E(t.prototype,i),c}(r.InstancedMesh);function O(e){return(O="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})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(c,e);var t,i,o,a,s=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=F(o);if(a){var n=F(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return k(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var t=new r.SphereGeometry(100,128,128),i=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:n(37581).Z,fragmentShader:n(9628).Z,side:r.BackSide,depthWrite:!1});return(e=s.call(this,t,i)).position.y=16,e.isOvered=!1,e}return t=c,(i=[{key:"render",value:function(e){!0===this.isOvered?this.material.uniforms.time.value+=e:this.material.uniforms.time.value-=e,this.material.uniforms.time.value=h().clamp(this.material.uniforms.time.value,0,.8)}},{key:"over",value:function(){this.material.uniforms.time.value=0,this.isOvered=!0}},{key:"coolDown",value:function(){this.material.uniforms.time.value=.2,this.isOvered=!1}}])&&D(t.prototype,i),c}(r.Mesh);function U(e){return(U="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})(e)}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(c,e);var t,i,o,a,s=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=H(o);if(a){var n=H(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return N(this,e)});function c(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var i=new r.PlaneGeometry(2,2),o=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},texture1:{type:"t",value:e},texture2:{type:"t",value:t},resolution:{type:"v2",value:new r.Vector2}},vertexShader:n(7799).Z,fragmentShader:n(35382).Z});return s.call(this,i,o)}return t=c,(i=[{key:"resize",value:function(e,t){this.material.uniforms.resolution.value.set(e,t)}},{key:"render",value:function(e){this.material.uniforms.time.value+=e}}])&&B(t.prototype,i),c}(r.Mesh);function W(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var q=document.querySelector(".l-page"),Y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.os=t,this.btn=document.querySelector(".p-hold-button"),this.progress=document.querySelector(".p-hold-button__progress-in"),this.v=0,this.a=0,this.cv=new r.Vector2,this.ca=new r.Vector2,this.timeOver=0,this.state=0,this.isHolding=!1,this.isEnabled=!1}var t,n,i,o;return t=e,(n=[{key:"start",value:function(e){this.isEnabled=!0,"iOS"===this.os||"Android"===this.os?this.btn.classList.add("is-enabled","is-shown","is-smartphone"):(this.cv.set(e.x/2,e.y),this.btn.classList.add("is-pc"))}},{key:"on",value:function(e,t){var n=this;"iOS"===this.os||"Android"===this.os?(this.btn.addEventListener("touchstart",(function(e){e.preventDefault(),0===n.state&&(n.btn.classList.add("is-pressed"),n.btn.classList.remove("is-released"),n.isHolding=!0)}),{capture:!0}),this.btn.addEventListener("touchend",(function(e){e.preventDefault(),n.a=0,n.btn.classList.remove("is-pressed"),n.btn.classList.add("is-released"),n.isHolding=!1}),{capture:!0})):(e.addEventListener("mousedown",(function(t){t.preventDefault(),0===n.state&&(e.style="cursor: grabbing;",n.btn.classList.add("is-pressed"),n.btn.classList.remove("is-released"),n.isHolding=!0)}),{capture:!0}),window.addEventListener("mousemove",(function(r){!1===n.isHolding&&(e.style="cursor: grab;"),t.set(r.clientX,r.clientY)})),window.addEventListener("mouseup",(function(e){e.preventDefault(),n.a=0,n.btn.classList.remove("is-pressed"),n.btn.classList.add("is-released"),n.isHolding=!1}),{capture:!0}),e.addEventListener("mouseenter",(function(){n.btn.classList.add("is-shown"),n.btn.classList.remove("is-hidden")})),q.addEventListener("mouseleave",(function(){n.a=0,n.btn.classList.remove("is-shown","is-pressed","is-released"),n.btn.classList.add("is-hidden"),n.isHolding=!1})))}},{key:"render",value:(i=regeneratorRuntime.mark((function e(t,n){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==this.isEnabled){e.next=2;break}return e.abrupt("return");case 2:"iOS"!==this.os&&"Android"!==this.os&&(r=n.clone().sub(this.cv),this.ca.add(r.divideScalar(12)),i=this.ca.clone().multiplyScalar(-1).normalize().multiplyScalar(.28*this.ca.length()),this.ca.add(i),this.cv.add(this.ca),this.btn.style="transform: translate3d(".concat(this.cv.x+8,"px, ").concat(this.cv.y+8,"px, 0)")),0!==this.state&&2!==this.state||(!0===this.isHolding?this.a=(1.4*this.v+1)*t:this.a=-3*this.v*t,this.v+=this.a,this.v=h().clamp(this.v,0,100),this.progress.style="transform: skewX(-45deg) translateX(".concat(50-this.v,"%);")),e.t0=this.state,e.next=0===e.t0?7:1===e.t0?17:2===e.t0?25:33;break;case 7:if(!(this.v<100)){e.next=11;break}return e.abrupt("return",0);case 11:return this.state=1,this.a=0,this.btn.classList.remove("is-pressed"),this.btn.classList.add("is-released"),this.isHolding=!1,e.abrupt("return",1);case 17:if(this.timeOver+=t,!(this.timeOver<5)){e.next=22;break}return e.abrupt("return",2);case 22:return this.timeOver=0,this.state=2,e.abrupt("return",3);case 25:if(!(this.v>.5)){e.next=29;break}return e.abrupt("return",4);case 29:return this.state=0,this.v=0,this.a=0,e.abrupt("return",5);case 33:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){W(o,n,r,a,s,"next",e)}function s(e){W(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e,t){return o.apply(this,arguments)})}])&&Z(t.prototype,n),e}();function X(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function K(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){X(o,r,i,a,s,"next",e)}function s(e){X(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Q(){return J.apply(this,arguments)}function J(){return(J=K(regeneratorRuntime.mark((function e(){var t,n,o,s,u,f,v,d,p,m,y,x,b,w,M,_,S,P,R,E,z,L,C,O,D,I,k,F;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new(a()),n=t.getOS().name,o=new r.Vector2,s=new r.Vector2,u=document.getElementById("canvas-webgl"),f=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:u}),v=new r.Scene,d=new r.PerspectiveCamera,p=new r.Clock({autoStart:!1}),m=new i.L,y=new r.WebGLRenderTarget,x=new r.WebGLRenderTarget,b=new r.Scene,w=new r.OrthographicCamera(-1,1,1,-1,1,2),M=document.querySelector(".p-preloader"),_=null,S=new T,P=new A,R=new j,E=new V(y.texture,x.texture),z=new Y(n),L=function(){if(!1!==p.running){var e=p.getDelta();z.render(e,s).then((function(e){switch(e){case 1:_.over(),S.over(),P.over(),R.over();break;case 3:_.coolDown(),R.coolDown();break;case 5:_.returnFirstState(),S.coolDown(),P.coolDown()}})),_.render(e,z.v),S.render(e),P.render(e),R.render(e),_.material.uniforms.drawBrightOnly.value=0,S.material.uniforms.drawBrightOnly.value=0,P.visible=!0,R.visible=!0,f.setRenderTarget(y),f.render(v,d),_.material.uniforms.drawBrightOnly.value=1,S.material.uniforms.drawBrightOnly.value=1,P.visible=!1,R.visible=!1,f.setRenderTarget(x),f.render(v,d),E.render(e),f.setRenderTarget(null),f.render(b,w)}},C=function e(){L(),requestAnimationFrame(e)},O=function(){d.setFocalLength(50*Math.min(o.x/1200,1)*h().step(1,o.x/o.y)+50*Math.min(o.x/818,1)*h().step(1,o.y/o.x)),d.setViewOffset(1200,800,(o.x-1200)/-2,(o.y-800)/-2,o.x,o.y),d.updateProjectionMatrix()},D=function(){o.set(document.body.clientWidth,window.innerHeight),u.width=o.x,u.height=o.y,O(),f.setSize(o.x,o.y),y.setSize(o.x,o.y),x.setSize(o.x,o.y),E.resize(o.x,o.y)},I=function(){window.addEventListener("blur",(function(){p.stop(),z.isEnabled=!1})),window.addEventListener("focus",(function(){p.start(),z.isEnabled=!0})),window.addEventListener("resize",c()(D,100)),"iOS"===n||"Android"===n?window.addEventListener("deviceorientation",(function(e){var t=h().radians(.3*(90-e.beta)),n=h().radians(e.gamma)*Math.cos(h().radians(e.beta));_.rotate(t,n)})):(window.addEventListener("mousemove",(function(e){_.rotate(h().radians(-20*-(e.clientY/o.y*2-1)),h().radians(20*(e.clientX/o.x*2-1)))})),window.addEventListener("mouseout",(function(e){_.rotate(0,0)}))),z.on(u,s)},f.setClearColor(0,1),d.aspect=1.5,d.far=1e3,d.position.z=140,d.lookAt(new r.Vector3),e.next=33,m.loadAsync("/sketch-threejs/model/newyear2019/boar_head.obj");case 33:return k=e.sent,F=k.children[0].geometry,_=new g(F),e.next=38,S.loadTexture();case 38:return v.add(_),v.add(S),v.add(P),v.add(R),b.add(E),I(),D(),s.set(o.x/2,1.5*o.y),M.classList.add("is-hidden"),e.next=49,l()(200);case 49:z.start(o),p.start(),C();case 52:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},87420:function(e,t,n){"use strict";n.d(t,{Z:function(){return U}});var r=n(2212),i=n(38314),o=n.n(i),a=(n(29130),n(17393)),s=n.n(a);function c(e){return(c="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})(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=new r.Vector2,d=new r.Vector3,p=new r.Vector3,m=function(e){var t=e.fov*Math.PI/180,n=Math.abs(e.position.z*Math.tan(t/2)*2);v.set(n*e.aspect,n)},y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(c,e);var t,n,i,o,a=(i=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(i);if(o){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function c(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var n=new r.BufferGeometry,i=new r.BufferAttribute(new Float32Array(300),3),o=new r.BufferAttribute(new Float32Array(300),3),u=new r.BufferAttribute(new Float32Array(100),1);m(e);for(var l=0;l<100;l++){i.setXYZ(l,v.x*(Math.random()-.5),v.y*(Math.random()-.5),0);var f=6*Math.random()+1,h=s().radians(360*Math.random());o.setXYZ(l,Math.cos(h)*(.1-.01*f),Math.sin(h)*(.1-.01*f),0),u.setX(l,f)}n.setAttribute("position",i),n.setAttribute("acceralation",o),n.setAttribute("size",u);var d=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvoid main() {\n // coordinate transformation\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(position, 1.0);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 5.0 + size;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvoid main() {\n // Convert PointCoord to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // Draw circle\n float radius = length(p);\n float opacity = (1.0 - smoothstep(0.9, 1.0, radius));\n\n vec3 color = vec3(0.1);\n\n gl_FragColor = vec4(color, opacity);\n}\n",transparent:!0,depthTest:!1});return(t=a.call(this,n,d)).name="NodePoints",t}return t=c,(n=[{key:"start",value:function(){}},{key:"update",value:function(e,t){m(t);for(var n=0;n<100;n++)d.set(this.geometry.attributes.position.getX(n),this.geometry.attributes.position.getY(n),this.geometry.attributes.position.getZ(n)),p.set(this.geometry.attributes.acceralation.getX(n),this.geometry.attributes.acceralation.getY(n),this.geometry.attributes.acceralation.getZ(n)),d.add(p),d.x>=.6*v.x?d.x=.6*-v.x:d.x<-.6*v.x&&(d.x=.6*v.x),d.y>=.6*v.y?d.y=.6*-v.y:d.y<-.6*v.y&&(d.y=.6*v.y),this.geometry.attributes.position.setXYZ(n,d.x,d.y,d.z),this.geometry.attributes.acceralation.setXYZ(n,p.x,p.y,p.z);this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.acceralation.needsUpdate=!0}}])&&u(t.prototype,n),c}(r.Points);function g(e){return(g="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})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _=new r.Vector2,S=new r.Vector3,P=new r.Vector3,T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=M(i);if(o){var n=M(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=new r.BufferGeometry,n=new r.BufferAttribute(new Float32Array(6e3),3),i=new r.BufferAttribute(new Float32Array(2e3),1),o=[],c=0;c<2e3;c++)o.push(c);t.setAttribute("position",n),t.setAttribute("opacity",i),t.setIndex(new r.BufferAttribute(new Uint16Array(o),1));var u=new r.RawShaderMaterial({vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute float opacity;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying float vOpacity;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vOpacity = opacity;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying float vOpacity;\n\nvoid main() {\n vec3 color = vec3(0.1);\n\n gl_FragColor = vec4(color, vOpacity);\n}\n",transparent:!0,depthTest:!1,linewidth:1});return(e=a.call(this,t,u)).name="NodeLine",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e,t){!function(e){var t=e.fov*Math.PI/180,n=Math.abs(e.position.z*Math.tan(t/2)*2);_.set(n*e.aspect,n)}(t);for(var n=0,r=0;r<e.geometry.attributes.position.count;r++)for(var i=r+1;i<e.geometry.attributes.position.count;i++){S.set(e.geometry.attributes.position.getX(r),e.geometry.attributes.position.getY(r),e.geometry.attributes.position.getZ(r)),P.set(e.geometry.attributes.position.getX(i),e.geometry.attributes.position.getY(i),e.geometry.attributes.position.getZ(i));var o=S.distanceTo(P);o<.15*_.y&&(this.geometry.attributes.position.setXYZ(2*n,S.x,S.y,S.z),this.geometry.attributes.position.setXYZ(2*n+1,P.x,P.y,P.z),this.geometry.attributes.opacity.setXYZ(2*n,3-o),this.geometry.attributes.opacity.setXYZ(2*n+1,3-o),n++)}for(var a=2*(n+1);a<this.geometry.attributes.position.count;a++)this.geometry.attributes.position.setXYZ(a,0,0,0);this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.opacity.needsUpdate=!0}}])&&x(t.prototype,n),s}(r.LineSegments);function R(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var z,L,C=document.getElementById("canvas-webgl"),A=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:C}),O=new r.Scene,D=new r.PerspectiveCamera,I=(new r.Vector2,new r.Clock({autoStart:!1})),k=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"init",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:A.setClearColor(16762368,1),D.aspect=1.5,D.far=1e3,D.setFocalLength(50),D.position.set(0,0,50),D.lookAt(new r.Vector3),z=new y(D),L=new T,O.add(z),O.add(L),this.resize(t);case 11:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){R(o,n,r,a,s,"next",e)}function s(e){R(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"start",value:function(){this.play()}},{key:"stop",value:function(){this.pause()}},{key:"play",value:function(){I.start()}},{key:"pause",value:function(){I.stop()}},{key:"update",value:function(){if(!1!==I.running){var e=I.getDelta();z.update(e,D),L.update(z,D),A.render(O,D)}}},{key:"resize",value:function(e){C.width=e.x,C.height=e.y,function(e){D.aspect=e.x/e.y,D.updateProjectionMatrix()}(e),A.setSize(e.x,e.y)}}])&&E(t.prototype,n),e}();function F(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function j(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){F(o,r,i,a,s,"next",e)}function s(e){F(o,r,i,a,s,"throw",e)}a(void 0)}))}}function U(){return B.apply(this,arguments)}function B(){return(B=j(regeneratorRuntime.mark((function e(){var t,n,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new k,n=new r.Vector2,i=document.querySelector(".p-preloader"),a=function(){n.set(document.body.clientWidth,window.innerHeight),t.resize(n)},s=function e(){t.update(),requestAnimationFrame(e)},window.addEventListener("resize",o()(a,100)),a(),e.next=10,t.init(n);case 10:i.classList.add("is-hidden"),t.start(),s();case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},90339:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.SphereGeometry(1e4,128,128),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(67127).Z,fragmentShader:n(17203).Z,side:i.BackSide});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},46384:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.durationTransform=.8,this.uniforms={time:{type:"f",value:0},timeTransform:{type:"f",value:this.durationTransform},durationTransform:{type:"f",value:this.durationTransform},prevIndex:{type:"f",value:1},nextIndex:{type:"f",value:0}},this.isTransform=!1,this.obj,this.objWire=null,this.objPoints=null}var t,a;return t=e,(a=[{key:"createObj",value:function(e){var t={font:e,size:300,height:0,curveSegments:1},r=[new i.TextGeometry("HELLO",t),new i.TextGeometry("WORLD",t)],o=new i.BufferGeometry,a=0;r.map((function(e,t){e.center(),e.attributes.position.count>a&&(a=e.attributes.position.count)})),r.map((function(e,t){var n=t>0?t+1:"";if(e.attributes.position.count<a){for(var r=e.attributes.position.array,s=[],c=[],u=0;u<3*a;u+=3)if(u<(3*a-r.length)/2)s[u]=700*(2*Math.random()-1),s[u+1]=250*(2*Math.random()-1),s[u+2]=250*(2*Math.random()-1),c[u/3]=0;else if(u>=r.length+(3*a-r.length)/2)s[u]=700*(2*Math.random()-1),s[u+1]=250*(2*Math.random()-1),s[u+2]=250*(2*Math.random()-1),c[u/3]=0;else{var l=u-(3*a-r.length)/2;s[u]=e.attributes.position.array[l],s[u+1]=e.attributes.position.array[l+1],s[u+2]=e.attributes.position.array[l+2],c[u/3]=1}o.setAttribute("position".concat(n),new i.Float32BufferAttribute(s,3,1)),o.setAttribute("opacity".concat(n),new i.Float32BufferAttribute(c,1,1))}else{var f=[];for(u=0;u<a;u++)f[u]=1;o.setAttribute("position".concat(n),e.attributes.position),o.setAttribute("opacity".concat(n),new i.Float32BufferAttribute(f,1,1)),o.setAttribute("normal",e.attributes.normal),o.setAttribute("uv",e.attributes.uv),o.setIndex(e.index)}}));var s=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(58764).Z,fragmentShader:n(55643).Z,depthWrite:!1,transparent:!0}),c=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(58764).Z,fragmentShader:n(85530).Z,depthWrite:!1,transparent:!0,wireframe:!0}),u=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(99886).Z,fragmentShader:n(37094).Z,depthWrite:!1,transparent:!0});this.obj=new i.Mesh(o,s),this.objWire=new i.Mesh(o,c),this.objPoints=new i.Points(o,u)}},{key:"transform",value:function(){this.isTransform=!0,this.uniforms.timeTransform.value=0,this.uniforms.prevIndex.value=this.uniforms.prevIndex.value<1?this.uniforms.prevIndex.value+1:0,this.uniforms.nextIndex.value=this.uniforms.nextIndex.value<1?this.uniforms.nextIndex.value+1:0}},{key:"render",value:function(e){this.uniforms.time.value+=e,this.isTransform&&(this.uniforms.timeTransform.value=o.clamp(this.uniforms.timeTransform.value+e,0,this.durationTransform)),this.uniforms.timeTransform.value===this.durationTransform&&(this.isTransform=!1)}}])&&r(t.prototype,a),e}()},49363:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2212),i=n(38314),o=n(46384).Z,a=n(90339).Z;function s(){var e=new r.Vector2,t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t}),s=new r.Scene,c=new r.PerspectiveCamera,u=new r.Clock,l=new r.FontLoader;c.far=5e4,c.setFocalLength(24);var f=new o,h=new a,v=function e(){var t;t=u.getDelta(),f.render(t),n.render(s,c),requestAnimationFrame(e)},d=function(){e.set(document.body.clientWidth,window.innerHeight),t.width=e.x,t.height=e.y,c.aspect=e.x/e.y,c.updateProjectionMatrix(),n.setSize(e.x,e.y)};l.load("https://threejs.org/examples/fonts/helvetiker_bold.typeface.json",(function(e){f.createObj(e),h.createObj(),s.add(f.objWire),s.add(f.objPoints),s.add(h.obj),n.setClearColor(1118481,1),c.position.set(0,0,1e3),c.lookAt(new r.Vector3),u.start(),window.addEventListener("resize",i(d,1e3)),window.addEventListener("click",(function(){f.transform()})),d(),v()}))}},52262:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(46365).Z,a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},velocity:{type:"t",value:null},acceleration:{type:"t",value:null}},this.physicsRenderer=null,this.vectorTouchMove=new i.Vector2(0,0),this.vectorTouchMoveDiff=new i.Vector2(0,0),this.obj}var t,a;return t=e,(a=[{key:"init",value:function(e){this.obj=this.createObj(e)}},{key:"createObj",value:function(e){for(var t=window.innerWidth>768?200:150,r=new i.OctahedronGeometry(100,t),a=r.attributes.position.array,s=[],c=0;c<a.length;c+=3)s[c+0]=a[c+0]+10*(2*Math.random()-1),s[c+1]=a[c+1]+10*(2*Math.random()-1),s[c+2]=a[c+2]+10*(2*Math.random()-1);return this.physicsRenderer=new o(n(30231).Z,n(31180).Z,n(50474).Z,n(60791).Z),this.physicsRenderer.init(e,s),this.physicsRenderer.mergeAUniforms({vTouchMove:{type:"v2",value:this.vectorTouchMoveDiff}}),this.uniforms.velocity.value=this.physicsRenderer.getCurrentVelocity(),this.uniforms.acceleration.value=this.physicsRenderer.getCurrentAcceleration(),r.setAttribute("uvVelocity",this.physicsRenderer.getBufferAttributeUv()),new i.Points(r,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(8924).Z,fragmentShader:n(79511).Z,transparent:!0,depthWrite:!1,blending:i.AdditiveBlending}))}},{key:"render",value:function(e,t){this.physicsRenderer.render(e,t),this.uniforms.time.value+=t}},{key:"touchStart",value:function(e){this.vectorTouchMove.copy(e)}},{key:"touchMove",value:function(e){this.vectorTouchMoveDiff.set(e.x-this.vectorTouchMove.x,e.y-this.vectorTouchMove.y),this.vectorTouchMove.copy(e)}},{key:"touchEnd",value:function(){this.vectorTouchMove.set(0,0),this.vectorTouchMoveDiff.set(0,0)}},{key:"resize",value:function(){this.physicsRenderer&&this.physicsRenderer.resize()}}])&&r(t.prototype,a),e}()},8642:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={texture1:{type:"t",value:t},texture2:{type:"t",value:n}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(98640).Z,fragmentShader:n(58113).Z}))}}])&&r(t.prototype,o),e}()},86649:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={resolution:{type:"v2",value:new i.Vector2(document.body.clientWidth,window.innerHeight)},direction:{type:"v2",value:new i.Vector2(n,r)},texture:{type:"t",value:t}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(98640).Z,fragmentShader:n(143).Z}))}},{key:"resize",value:function(e,t){this.uniforms.resolution.value.set(e,t)}}])&&r(t.prototype,o),e}()},14683:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={minBright:{type:"f",value:.3},texture:{type:"t",value:t}},this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(2,2),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(98640).Z,fragmentShader:n(29336).Z}))}}])&&r(t.prototype,o),e}()},73552:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(2212),i=n(38314),o=n(89813).Z,a=n(14683).Z,s=n(86649).Z,c=n(8642).Z,u=n(52262).Z;function l(){var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!1,canvas:e}),n=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),l=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),f=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),h=new r.Scene,v=new r.Scene,d=new r.OrthographicCamera(-1,1,1,-1,0,1),p=new r.PerspectiveCamera(45,document.body.clientWidth/window.innerHeight,1,1e4),m=new r.Clock,y=new r.Vector2,g=new r.Vector2,x=new r.Vector2,b=!1,w=new u,M=new a(n.texture),_=new s(l.texture,1,0),S=new s(f.texture,0,1),P=new c(n.texture,l.texture);w.init(t);var T=function(){var r=document.body.clientWidth,i=window.innerHeight;e.width=r,e.height=i,p.aspect=r/i,p.updateProjectionMatrix(),_.resize(r,i),S.resize(r,i),n.setSize(r,i),l.setSize(r,i),f.setSize(r,i),t.setSize(r,i)},R=function(e){b=!0,w.touchStart(y)},E=function(e){b&&w.touchMove(g)},z=function(e){b=!1,w.touchEnd()};t.setSize(document.body.clientWidth,window.innerHeight),t.setClearColor(1118481,1),p.position.set(0,0,1e3),p.lookAt(new r.Vector3),v.add(w.obj),window.addEventListener("resize",i((function(){T()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),y.set(e.clientX,e.clientY),o(y),R()})),e.addEventListener("mousemove",(function(e){e.preventDefault(),g.set(e.clientX,e.clientY),o(g),E()})),e.addEventListener("mouseup",(function(e){e.preventDefault(),x.set(e.clientX,e.clientY),o(x),z()})),e.addEventListener("touchstart",(function(e){e.preventDefault(),y.set(e.touches[0].clientX,e.touches[0].clientY),o(y),R(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchmove",(function(e){e.preventDefault(),g.set(e.touches[0].clientX,e.touches[0].clientY),o(g),E()})),e.addEventListener("touchend",(function(e){e.preventDefault(),o(x),x.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),z()})),window.addEventListener("mouseout",(function(){event.preventDefault(),x.set(0,0),b=!1,w.touchEnd()})),T(),function e(){var r;r=m.getDelta(),w.render(t,r),t.setRenderTarget(n),t.render(v,p),h.add(M.obj),t.setRenderTarget(l),t.render(h,p),h.remove(M.obj),h.add(_.obj),t.setRenderTarget(f),t.render(h,p),h.remove(_.obj),h.add(S.obj),t.setRenderTarget(l),t.render(h,p),h.remove(S.obj),h.add(P.obj),t.setRenderTarget(null),t.render(h,d),h.remove(P.obj),requestAnimationFrame(e)}()}},99063:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},addH:{type:"f",value:t+.3}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.SphereGeometry(200,128,128),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(74766).Z,fragmentShader:n(48448).Z,side:i.BackSide});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},71773:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0}},this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(2,2,20,2,2,6);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(120),3),a=new i.InstancedBufferAttribute(new Float32Array(120),3),s=new i.InstancedBufferAttribute(new Float32Array(120),3),c=new i.InstancedBufferAttribute(new Float32Array(40),1),u=0;u<40;u++){var l=o.radians(30*(2*Math.random()-1)),f=o.radians(180*(2*Math.random()-1)),h=o.spherical(l,f,12*Math.random()+65);r.setXYZ(u,h[0],h[1],h[2]),a.setXYZ(u,0,f,-l),s.setXYZ(u,1,.2*Math.random()+1,.4*Math.random()+.8),c.setXYZ(u,.05*Math.random()+.01)}e.setAttribute("instancePosition",r),e.setAttribute("instanceRotate",a),e.setAttribute("instanceScale",s),e.setAttribute("speed",c);var v=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(23234).Z,fragmentShader:n(82636).Z});this.obj=new i.InstancedMesh(e,v,40),this.obj.frustumCulled=!1}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,a),e}()},89555:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolution=t,this.vTouchStart=new i.Vector2,this.vPrev=new i.Vector2,this.v=new i.Vector2,this.a=new i.Vector2,this.anchor=new i.Vector2,this.isTouched=!1}var t,n;return t=e,(n=[{key:"touchStart",value:function(e){e.touches||e.preventDefault(),this.vPrev.copy(this.v),this.a.set(0,0),this.vTouchStart.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.isTouched=!0}},{key:"touchMove",value:function(e){e.preventDefault();var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY;!1!==this.isTouched&&this.anchor.set((t-this.vTouchStart.x)/(this.resolution.x/200)+this.vPrev.x,o.clamp((n-this.vTouchStart.y)/(this.resolution.y/200)+this.vPrev.y,-90,90))}},{key:"touchEnd",value:function(e){this.isTouched=!1}},{key:"render",value:function(){this.a.set((this.anchor.x-this.v.x)/10,(this.anchor.y-this.v.y)/10),this.v.add(this.a)}}])&&r(t.prototype,n),e}()},60137:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return s}});var i=n(2212),o=n(17393),a=n(91685),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},addH1:{type:"f",value:t},addH2:{type:"f",value:t-.5}},this.obj}var t,s;return t=e,(s=[{key:"createObj",value:function(){for(var e=new a(Math.random),t=new i.OctahedronGeometry(50,30),r=0;r<t.attributes.position.count;r++){var s=new i.Vector3(t.attributes.position.getX(r),t.attributes.position.getY(r),t.attributes.position.getZ(r)),c=e.noise4D(s.x/72,s.y/64,s.z/72,1),u=e.noise4D(s.x/28,s.y/24,s.z/28,1),l=e.noise4D(s.x/4,s.y/4,s.z/4,1),f=(2*o.smoothstep(-.05,.05,c+u)-1)*(2+2*o.smoothstep(.1,.2,Math.pow(c+u,2))+6*o.smoothstep(.6,.7,Math.pow(c+u,2))+.2*l);s.add(s.clone().normalize().multiplyScalar(f)),t.attributes.position.setXYZ(r,s.x,s.y,s.z)}var h=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(59870).Z,fragmentShader:n(64557).Z});this.obj=new i.Mesh(t,h)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,s),e}()},53165:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},addH:{type:"f",value:t}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.OctahedronGeometry(50,30),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(78081).Z,fragmentShader:n(76161).Z,transparent:!0});this.obj=new i.Mesh(e,t)}},{key:"render",value:function(e){this.uniforms.time.value+=e}}])&&r(t.prototype,o),e}())},13532:function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,c,"next",e)}function c(e){r(a,i,o,s,c,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return v}});var o=n(2212),a=n(38314),s=n(17393),c=n(60137).Z,u=n(53165).Z,l=n(71773).Z,f=n(99063).Z,h=n(89555).Z;function v(){return d.apply(this,arguments)}function d(){return(d=i(regeneratorRuntime.mark((function e(){var t,n,r,i,v,d,p,m,y,g,x,b,w,M,_,S,P;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new o.Vector2,n=document.getElementById("canvas-webgl"),r=new o.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),i=new o.Scene,v=new o.PerspectiveCamera,d=new o.Clock({autoStart:!1}),p=Math.random(),m=new c(p),y=new u(p),g=new l,x=new f(p),b=new o.Group,w=new h(t),M=function(){var e=d.getDelta();w.render(t),b.rotation.set(s.radians(w.v.y),s.radians(w.v.x),0),m.render(e),y.render(e),g.render(e),x.render(e),r.render(i,v)},_=function e(){M(),requestAnimationFrame(e)},S=function(){v.aspect=t.x/t.y,v.updateProjectionMatrix(),v.setFocalLength(15*s.step(1,t.y/t.x)+35)},P=function(){t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,S(),r.setSize(t.x,t.y)},T=void 0,R=void 0,E=void 0,T=function(e){w.touchStart(e)},R=function(e){w.touchMove(e)},E=function(e){w.touchEnd(e)},n.addEventListener("mousedown",T,{passive:!1}),window.addEventListener("mousemove",R,{passive:!1}),window.addEventListener("mouseup",E),n.addEventListener("touchstart",T,{passive:!1}),window.addEventListener("touchmove",R,{passive:!1}),window.addEventListener("touchend",E),window.addEventListener("resize",a(P,1e3)),P(),r.setClearColor(15658734,1),v.far=1e3,v.setFocalLength(15*s.step(1,t.y/t.x)+35),v.position.set(0,0,300),v.lookAt(new o.Vector3(0,0,0)),m.createObj(),y.createObj(),g.createObj(),x.createObj(),b.add(m.obj),b.add(y.obj),b.add(g.obj),i.add(b),i.add(x.obj),d.start(),_(),e.abrupt("return");case 37:case"end":return e.stop()}var T,R,E}),e)})))).apply(this,arguments)}},65331:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},colorH:{type:"f",value:0},noiseRange:{type:"f",value:0}},this.obj=this.createObj(),this.obj.visible=!1}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(1500,1500),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(52402).Z,fragmentShader:n(29014).Z,transparent:!0}))}},{key:"show",value:function(e){this.uniforms.time.value=0,this.uniforms.colorH.value=Math.random(),this.uniforms.noiseRange.value=3*Math.random(),this.obj.visible=!0,this.obj.position.set((2*Math.random()-1)*window.innerWidth,(2*Math.random()-1)*window.innerHeight,0)}},{key:"render",value:function(e){this.obj.visible&&(this.uniforms.time.value+=e,this.obj.position.z-=3)}}])&&r(t.prototype,o),e}()},18388:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2212),i=n(38314),o=n(89813).Z,a=n(65331).Z;function s(){for(var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!1,canvas:e,alpha:!0}),n=new r.Scene,s=new r.PerspectiveCamera(90,document.body.clientWidth/window.innerHeight,1,1e4),c=new r.Clock,u=new r.Vector2,l=new r.Vector2,f=new r.Vector2,h=0,v=0,d=[],p=0;p<20;p++)d[p]=new a,n.add(d[p].obj);var m=function(){e.width=document.body.clientWidth,e.height=window.innerHeight,s.aspect=document.body.clientWidth/window.innerHeight,s.updateProjectionMatrix(),t.setSize(document.body.clientWidth,window.innerHeight)};t.setSize(document.body.clientWidth,window.innerHeight),t.setClearColor(15856113,1),s.position.set(0,0,1e3),s.lookAt(new r.Vector3),window.addEventListener("resize",i((function(){m()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),u.set(e.clientX,e.clientY),o(u)})),document.addEventListener("mousemove",(function(e){e.preventDefault(),l.set(e.clientX,e.clientY),o(l)})),document.addEventListener("mouseup",(function(e){e.preventDefault(),f.set(e.clientX,e.clientY),o(f)})),e.addEventListener("touchstart",(function(e){e.preventDefault(),u.set(e.touches[0].clientX,e.touches[0].clientY),o(u),e.touches[0].clientX,e.touches[0].clientY})),e.addEventListener("touchmove",(function(e){e.preventDefault(),l.set(e.touches[0].clientX,e.touches[0].clientY),o(l)})),e.addEventListener("touchend",(function(e){e.preventDefault(),f.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),o(f)})),m(),function e(){(function(){var e=c.getDelta();!function(e){(v+=e)>1&&(d[h].show(),h=h+1>=d.length-1?0:h+1,v=0)}(e);for(var r=0;r<d.length;r++)d[r].render(e);t.render(n,s)})(),requestAnimationFrame(e)}()}},66327:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return s}});var i=n(67084).Z,o=n(84544).Z,a=n(80767).Z,s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.velocity=[0,0,0],this.acceleration=[0,0,0],this.anchor=[0,0,0],this.instances=36,this.core=new o(this.instances),this.wire=new a(this.instances)}var t,n;return t=e,(n=[{key:"updateRotation",value:function(){i.applyHook(this.velocity,this.acceleration,this.anchor,0,.02),i.applyDrag(this.acceleration,.3),i.updateVelocity(this.velocity,this.acceleration,1),this.core.uniforms.rotate.value=this.velocity[0],this.wire.uniforms.rotate.value=this.velocity[0]}},{key:"rotate",value:function(e){e&&(this.anchor[0]-=.05*e)}},{key:"picked",value:function(e){this.core.uniforms.pickedId.value=e,this.wire.uniforms.pickedId.value=e,e<this.instances&&e>-1?document.body.classList.add("is-picked"):document.body.classList.remove("is-picked")}},{key:"render",value:function(e){this.core.uniforms.time.value+=e,this.wire.render(e),this.updateRotation()}}])&&r(t.prototype,n),e}()},84544:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},rotate:{type:"f",value:0},pickedId:{type:"f",value:-1}},this.instances=t,this.obj=this.createObj()}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.OctahedronGeometry(30,4);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),a=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),s=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),c=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),u=0;u<this.instances;u++)r.setXYZ(u,o.radians(u/this.instances*360)),a.setXYZ(u,u/this.instances-.25,.2,.9),s.setXYZ(u,Math.random()),c.setXYZ(u,.5*(Math.random()+1));return e.setAttribute("radian",r),e.setAttribute("hsv",a),e.setAttribute("noiseDiff",s),e.setAttribute("speed",c),new i.InstancedMesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(58754).Z,fragmentShader:n(54864).Z,transparent:!0}),this.instances)}}])&&r(t.prototype,a),e}()},75363:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mirrorCamera=new i.PerspectiveCamera(24,document.body.clientWidth/window.innerHeight,1,15e3),this.mirrorRender=new i.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),this.textureMatrix=new i.Matrix4,this.uniforms={time:{type:"f",value:0},texture:{type:"t",value:this.mirrorRender.texture},textureMatrix:{type:"m4",value:this.textureMatrix},mirrorPosition:{type:"v3",value:this.mirrorCamera.position}},this.mirrorCamera.up.set(0,-1,0),this.obj=this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){return new i.Mesh(new i.PlaneGeometry(4e3,4e3),new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(84450).Z,fragmentShader:n(71955).Z,transparent:!0}))}},{key:"updateTextureMatrix",value:function(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1),this.textureMatrix.multiply(this.mirrorCamera.projectionMatrix),this.textureMatrix.multiply(this.mirrorCamera.matrixWorldInverse)}},{key:"render",value:function(e,t,n){this.uniforms.time.value+=n,this.updateTextureMatrix(),this.obj.visible=!1,e.setRenderTarget(this.mirrorRender),e.render(t,this.mirrorCamera),this.obj.visible=!0}},{key:"resize",value:function(){this.mirrorCamera.aspect=document.body.clientWidth/window.innerHeight,this.mirrorCamera.updateProjectionMatrix(),this.mirrorRender.setSize(document.body.clientWidth,window.innerHeight)}}])&&r(t.prototype,o),e}()},47960:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var t=new i.WebGLCubeRenderTarget(128);this.cubeCamera=new i.CubeCamera(1,15e3,t),this.instances=6,this.uniforms={time:{type:"f",value:0}},this.obj=this.createObj(),this.obj.rotation.set(0,.3*Math.PI,0)}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(40,1,10);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),o=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),a=0,s=this.instances;a<s;a++)r.setXYZ(a,150*(a+1)+200),o.setXYZ(a,120*(a-(this.instances-1)/2));return e.setAttribute("height",r),e.setAttribute("offsetX",o),new i.InstancedMesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(8757).Z,fragmentShader:n(69805).Z}),this.instances)}},{key:"render",value:function(e,t,n){this.uniforms.time.value+=n,this.obj.visible=!1,this.cubeCamera.update(e,t),this.obj.visible=!0}}])&&r(t.prototype,o),e}()},80767:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.size=120,this.baseGeometry=new i.BoxGeometry(this.size,this.size,this.size),this.uniforms={time:{type:"f",value:0},rotate:{type:"f",value:0},pickedId:{type:"f",value:-1}},this.instances=t,this.obj=this.createObj(),this.objPicked=this.createObjPicked()}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry;e.copy(this.baseGeometry);for(var t=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),r=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),a=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),s=0;s<this.instances;s++)t.setXYZ(s,o.radians(s/this.instances*360)),r.setXYZ(s,s/this.instances-.25,.2,1),a.setXYZ(s,0);return e.setAttribute("radian",t),e.setAttribute("hsv",r),e.setAttribute("timeHover",a),new i.InstancedMesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(24192).Z,fragmentShader:n(46060).Z,depthWrite:!1,transparent:!0,side:i.DoubleSide}),this.instances)}},{key:"createObjPicked",value:function(){var e=new i.InstancedBufferGeometry;e.copy(this.baseGeometry);for(var t=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),r=new i.InstancedBufferAttribute(new Float32Array(3*this.instances),3),a=new i.Color,s=new i.InstancedBufferAttribute(new Float32Array(this.instances),1),c=0;c<this.instances;c++)t.setXYZ(c,o.radians(c/this.instances*360)),a.setHex(c),r.setXYZ(c,a.r,a.g,a.b),s.setXYZ(c,0);return e.setAttribute("radian",t),e.setAttribute("pickedColor",r),e.setAttribute("timeHover",s),new i.InstancedMesh(e,new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(22984).Z,fragmentShader:n(66977).Z}),this.instances)}},{key:"render",value:function(e){var t=this.obj.geometry.attributes.timeHover,n=this.objPicked.geometry.attributes.timeHover;this.uniforms.time.value+=e;for(var r=0;r<t.array.length;r++)this.uniforms.pickedId.value==r?(t.array[r]=Math.min(t.array[r]+e,.3),n.array[r]=Math.min(n.array[r]+e,.3)):(t.array[r]=Math.max(t.array[r]-e,0),n.array[r]=Math.max(n.array[r]-e,0));t.needsUpdate=!0,n.needsUpdate=!0}}])&&r(t.prototype,a),e}()},39990:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(2212),i=n(38314),o=n(66327).Z,a=n(75363).Z,s=n(47960).Z;function c(){var e=document.getElementById("canvas-webgl"),t=new r.WebGL1Renderer({antialias:!0,canvas:e}),n=new r.WebGLRenderTarget(document.body.clientWidth,window.innerHeight),c=new r.Scene,u=new r.Scene,l=new r.PerspectiveCamera(24,document.body.clientWidth/window.innerHeight,1,15e3),f=new r.Clock,h=new r.Vector2,v=new r.Vector2,d=new r.Vector2,p=new r.Vector2,m=new Uint8Array(4),y=!1,g=new o,x=new a,b=new s,w=function(){e.width=document.body.clientWidth,e.height=window.innerHeight,l.aspect=document.body.clientWidth/window.innerHeight,l.updateProjectionMatrix(),t.setSize(document.body.clientWidth,window.innerHeight),n.setSize(document.body.clientWidth,window.innerHeight),x.resize()},M=function(){y=!0},_=function(e){y?e&&g.rotate(2*(v.x-d.x)):(t.setClearColor(16777215,1),t.setRenderTarget(n),t.render(u,l),t.setRenderTarget(null),t.readRenderTargetPixels(n,v.x,n.height-v.y,1,1,m),g.picked(m[0]<<16|m[1]<<8|m[2]))},S=function(){y=!1};t.setSize(document.body.clientWidth,window.innerHeight),l.position.set(0,400,-3e3),l.lookAt(new r.Vector3(0,0,0)),x.mirrorCamera.position.set(0,-400,-3e3),x.mirrorCamera.lookAt(new r.Vector3(0,0,0)),g.core.obj.position.set(0,80,0),g.wire.obj.position.set(0,80,0),g.wire.objPicked.position.set(0,80,0),x.obj.rotation.set(-.5*Math.PI,0,0),c.add(g.core.obj),c.add(g.wire.obj),c.add(x.obj),c.add(b.obj),c.add(b.cubeCamera),u.add(g.wire.objPicked),window.addEventListener("resize",i((function(){w()})),1e3),e.addEventListener("mousedown",(function(e){e.preventDefault(),h.set(e.clientX,e.clientY),M()})),document.addEventListener("mousemove",(function(e){e.preventDefault(),v.set(e.clientX,e.clientY),_(!1)})),document.addEventListener("mouseup",(function(e){e.preventDefault(),p.set(e.clientX,e.clientY),S()})),e.addEventListener("wheel",(function(e){e.preventDefault(),function(e){g.rotate(e.deltaY)}(e)})),e.addEventListener("touchstart",(function(e){e.preventDefault(),h.set(e.touches[0].clientX,e.touches[0].clientY),v.set(e.touches[0].clientX,e.touches[0].clientY),d.set(e.touches[0].clientX,e.touches[0].clientY),M(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchmove",(function(e){e.preventDefault(),v.set(e.touches[0].clientX,e.touches[0].clientY),_(!0),d.set(e.touches[0].clientX,e.touches[0].clientY)})),e.addEventListener("touchend",(function(e){e.preventDefault(),p.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),S()})),w(),function e(){var n;n=f.getDelta(),t.setClearColor(15856113,1),g.render(n),x.render(t,c,n),b.render(t,c,n),t.setRenderTarget(null),t.render(c,l),requestAnimationFrame(e)}()}},43051:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},tex:{type:"t",value:null},mouse:{type:"v3",value:new i.Vector3}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(e){var t=new i.PlaneGeometry(800,800,200,200),r=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(78615).Z,fragmentShader:n(80170).Z,transparent:!0});this.uniforms.tex.value=e,this.obj=new i.Points(t,r)}},{key:"render",value:function(e,t,n){this.uniforms.time.value+=e;var r=new i.Vector3;r.set(n.x,n.y,-1),r.unproject(t);var o=r.sub(t.position).normalize(),a=-t.position.z/o.z,s=t.position.clone().add(o.multiplyScalar(a));this.uniforms.mouse.value.copy(s)}}])&&r(t.prototype,o),e}())},8141:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2212),i=n(38314),o=n(59170).Z,a=n(43051).Z;function s(){var e=new r.Vector2,t=new r.Vector2,n=document.getElementById("canvas-webgl"),s=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),c=new r.Scene,u=new r.PerspectiveCamera,l=new r.Clock;u.far=5e4,u.setFocalLength(24);var f=new a,h=function e(){var n;n=l.getDelta(),f.render(n,u,t),s.render(c,u),requestAnimationFrame(e)},v=function(){e.set(document.body.clientWidth,window.innerHeight),n.width=e.x,n.height=e.y,u.aspect=e.x/e.y,u.updateProjectionMatrix(),s.setSize(e.x,e.y)},d=function(n){t.set(n.clientX/e.x*2-1,-n.clientY/e.y*2+1)};o({points:"../img/sketch/image_data/elephant.png"},(function(e){s.setClearColor(8037324,1),u.position.set(0,0,1e3),u.lookAt(0,0,0),l.start(),f.createObj(e.points),c.add(f.obj),window.addEventListener("resize",i(v,1e3)),window.addEventListener("mousemove",d),v(),h()}))}},68993:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var r=n(2212),i=n(38314),o=n.n(i);function a(e){return(a="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})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(29130);var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(f,e);var t,n,i,o,a=(i=f,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(i);if(o){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function f(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o}return t=f,(n=[{key:"start",value:function(){this.aspect=1.5,this.far=1e3,this.setFocalLength(50),this.position.set(0,6,50),this.lookAt(new r.Vector3(0,6,0))}},{key:"update",value:function(e){}},{key:"resize",value:function(e){e.x>e.y?this.cameraResolution.set(e.x>=1200?1200:e.x,e.x>=1200?800:.66*e.x):this.cameraResolution.set(.6*(e.y>=1200?800:.66*e.y),.6*(e.y>=1200?1200:e.y)),this.setViewOffset(this.cameraResolution.x,this.cameraResolution.y,(e.x-this.cameraResolution.x)/-2,(e.y-this.cameraResolution.y)/-2,e.x,e.y),this.updateProjectionMatrix()}}])&&s(t.prototype,n),f}(r.PerspectiveCamera),h=n(17393),v=n.n(h);function d(e){return(d="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})(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var M=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=w(i);if(o){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return b(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.TorusKnotGeometry(2.4,.8,200,32),n=new r.RawShaderMaterial({uniforms:m(m({},r.UniformsLib.lights),{},{time:{type:"f",value:0}}),vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying mat4 invertMatrix;\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vNormal = normal;\n vUv = uv;\n vColor = vec3(1.0, 0.0, 0.0);\n invertMatrix = inverse(modelMatrix);\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 cameraPosition;\n\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n#endif\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying mat4 invertMatrix;\n\nvoid main() {\n // Phong Shading\n vec3 diff;\n vec3 specular;\n vec3 invLight;\n vec3 invEye;\n vec3 halfLE;\n\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n invLight = normalize(invertMatrix * vec4(directionalLights[ i ].direction, 0.0)).xyz;\n invEye = normalize(invertMatrix * vec4(cameraPosition, 0.0)).xyz;\n diff += clamp(dot(vNormal, invLight), 0.0, 1.0);\n\n halfLE = normalize(invLight + invEye);\n specular += directionalLights[ i ].color * pow(max(dot(vNormal, halfLE), 0.0), 30.0);\n }\n #endif\n\n vec4 destColor = vec4(vColor * diff + specular, 1.0);\n\n gl_FragColor = destColor;\n}\n",lights:!0});return(e=a.call(this,t,n)).name="Blob",e.position.set(0,8,0),e.castShadow=!0,e.receiveShadow=!1,e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e){this.material.uniforms.time.value+=e,this.rotation.set(this.material.uniforms.time.value,this.material.uniforms.time.value,0)}}])&&g(t.prototype,n),s}(r.Mesh);function _(e){return(_="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})(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=L(i);if(o){var n=L(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return z(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(30,30,128,128),n=new r.RawShaderMaterial({uniforms:P(P({},r.UniformsLib.lights),{},{time:{type:"f",value:0}}),vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat4 directionalShadowMatrix[NUM_DIR_LIGHT_SHADOWS];\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec4 vDirectionalShadowCoord[NUM_DIR_LIGHT_SHADOWS];\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + sin((uv.x + uv.y) * 10.0 + time) * 0.5, 1.0);\n\n vPosition = mPosition.xyz;\n vUv = uv;\n\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * mPosition;\n }\n #endif\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n#endif\n\nuniform sampler2D directionalShadowMap[NUM_DIR_LIGHT_SHADOWS];\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec4 vDirectionalShadowCoord[NUM_DIR_LIGHT_SHADOWS];\n\nvoid main() {\n // Phong Shading\n vec3 normal;\n vec3 diff;\n vec3 lightColor;\n\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n diff += (dot(normal, directionalLights[ i ].direction) + 1.0) / 2.0;\n lightColor += directionalLights[ i ].color;\n }\n #endif\n\n vec4 shadow;\n\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadow += texture2DProj(directionalShadowMap[ i ], vDirectionalShadowCoord[ i ]);\n }\n #endif\n\n gl_FragColor = vec4(lightColor * diff, 1.0) * shadow;\n}\n"});return(e=a.call(this,t,n)).name="Floor",e.rotation.set(v().radians(-90),0,0),e.receiveShadow=!0,e}return t=s,(n=[{key:"start",value:function(){console.log(this.material.uniforms)}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&R(t.prototype,n),s}(r.Mesh);function A(e){return(A="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})(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F,j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(r);if(i){var n=k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function a(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,16776960,.5)).name="Light",e.castShadow=!0,e.shadow.camera.left=e.shadow.camera.bottom=-10,e.shadow.camera.right=e.shadow.camera.top=10,e.time=0,e.isActive=!1,e}return t=a,(n=[{key:"start",value:function(){this.isActive=!0}},{key:"update",value:function(e){!1!==this.isActive&&(this.time+=e)}}])&&O(t.prototype,n),a}(r.DirectionalLight);function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var B=new r.Scene,G=new f,N=new r.Clock({autoStart:!1}),H=new M,V=new C,W=new j,Z=new j,q=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"start",value:function(e){(F=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:e})).setPixelRatio(window.devicePixelRatio),F.setClearColor(921102,1),F.shadowMap.enabled=!0,F.shadowMap.type=r.PCFSoftShadowMap,H.start(),V.start(),W.position.set(-10,16,10),Z.position.set(10,16,-10),B.add(H),B.add(V),B.add(W),B.add(Z),G.start()}},{key:"play",value:function(){N.start(),this.update()}},{key:"pause",value:function(){N.stop()}},{key:"update",value:function(){if(!1!==N.running){var e=N.getDelta();G.update(e),H.update(e),V.update(e),W.update(e),Z.update(e),F.render(B,G)}}},{key:"resize",value:function(e){G.resize(e),F.setSize(e.x,e.y)}}])&&U(t.prototype,n),e}();function Y(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Y(o,r,i,a,s,"next",e)}function s(e){Y(o,r,i,a,s,"throw",e)}a(void 0)}))}}function K(){return Q.apply(this,arguments)}function Q(){return(Q=X(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new q,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},29355:function(e,t,n){"use strict";n.d(t,{Z:function(){return we}});var r=n(2212),i=n(38314),o=n.n(i),a=n(48840);function s(e){return(s="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})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(i);if(o){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function s(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(i=a.call(this,e,t,n,r)).time=0,i.isActive=!1,i}return t=s,(n=[{key:"start",value:function(){this.aspect=1.5,this.far=1e3,this.setFocalLength(50),this.position.set(0,10,40),this.lookAt(new r.Vector3(0,0,0)),this.isActive=!0}},{key:"update",value:function(e){!1!==this.isActive&&(this.time+=e)}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&c(t.prototype,n),s}(r.PerspectiveCamera),v=n(17393),d=n.n(v);function p(e){return(p="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})(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=x(i);if(o){var n=x(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g(this,e)});function s(e,t,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(i=a.call(this,e,t,n,r)).distance=0,i}return t=s,(n=[{key:"start",value:function(){this.aspect=1,this.far=1e3,this.setFocalLength(50),this.distance=20*Math.abs(2*Math.tan(d().radians(this.fov)/2))*2}},{key:"update",value:function(e){this.position.copy(e.position).normalize().multiplyScalar(this.distance),this.lookAt(new r.Vector3)}}])&&m(t.prototype,n),s}(r.PerspectiveCamera);function w(e){return(w="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})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=P(i);if(o){var n=P(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return S(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this)).material=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},renderOutline:{type:"f",value:0},noiseTex:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\nuniform float time;\nuniform float renderOutline;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + normal * renderOutline * 0.5, 1.0);\n\n float angleToCamera = acos(dot(normalize(cameraPosition), normalize(mPosition.xyz)));\n\n vPosition = mPosition.xyz;\n vUv = uv;\n vColor = vec3(smoothstep(0.8, 1.0, abs(sin(angleToCamera))));\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float renderOutline;\nuniform sampler2D noiseTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, 0.2));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = dot(normal, light);\n\n float noiseR = texture2D(\n noiseTex,\n normal.yz * 0.2 + vec2(time * 0.02, 0.0)\n ).r * 2.0 - 1.0;\n float noiseG = texture2D(\n noiseTex,\n normal.zx * 0.2 + vec2(0.0, time * 0.02)\n ).g * 2.0 - 1.0;\n float noiseB = texture2D(\n noiseTex,\n normal.xy * 0.2 - time * 0.02\n ).b * 2.0 - 1.0;\n float noise = length(vec3(noiseR, noiseG, noiseB));\n\n vec3 hsvNoise = vec3(noise * 0.1, noise * 0.1, -noise * 0.1);\n vec3 hsv1 = vec3(0.55, 0.55, 0.8) + hsvNoise;\n vec3 hsv2 = vec3(0.88, 0.55, 1.0) + hsvNoise;\n vec3 rgb = mix(convertHsvToRgb(hsv1), convertHsvToRgb(hsv2), diff);\n\n vec3 hsv3 = vec3(0.55, 0.05, 0.95);\n vec3 color = (rgb * (1.0 - vColor) + convertHsvToRgb(hsv3) * vColor) * (1.0 - renderOutline);\n vec3 colorOutline = vec3(1.0) * renderOutline;\n\n gl_FragColor = vec4(color + colorOutline, 1.0);\n}\n"}),n.head=new r.Mesh(e,n.material),n.jaw=new r.Mesh(t,n.material),n.add(n.head),n.add(n.jaw),n.name="Skull",n.isActive=!1,n}return t=s,(n=[{key:"start",value:function(e){this.isActive=!0,this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e,t){!1!==this.isActive&&(this.material.uniforms.time.value+=e,this.head.rotation.set(d().radians(8*-(.7*Math.sin(this.material.uniforms.time.value)+.7)),0,0),this.jaw.rotation.set(d().radians(8*(.7*Math.sin(this.material.uniforms.time.value)+.7)),0,0))}}])&&M(t.prototype,n),s}(r.Group);function R(e){return(R="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})(e)}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=n(2212),O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=C(r);if(i){var n=C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return L(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var t=new A.PlaneGeometry(2,2),n=new A.RawShaderMaterial({uniforms:{resolution:{type:"v2",value:new A.Vector2(512,512)},direction:{type:"v2",value:new A.Vector2(0,0)},radius:{type:"f",value:1},texture:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 direction;\nuniform float radius;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvec4 gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 step = radius / resolution * direction;\n color += texture2D(texture, uv + -30.0 * step) * 0.000044463576696752694;\n color += texture2D(texture, uv + -29.0 * step) * 0.00007045416494915056;\n color += texture2D(texture, uv + -28.0 * step) * 0.0001099096126906708;\n color += texture2D(texture, uv + -27.0 * step) * 0.00016880723998699519;\n color += texture2D(texture, uv + -26.0 * step) * 0.00025525396029412817;\n color += texture2D(texture, uv + -25.0 * step) * 0.0003799964739478872;\n color += texture2D(texture, uv + -24.0 * step) * 0.0005569445069582366;\n color += texture2D(texture, uv + -23.0 * step) * 0.0008036541345232365;\n color += texture2D(texture, uv + -22.0 * step) * 0.0011416972770451463;\n color += texture2D(texture, uv + -21.0 * step) * 0.001596823459247415;\n color += texture2D(texture, uv + -20.0 * step) * 0.002198804676697693;\n color += texture2D(texture, uv + -19.0 * step) * 0.0029808483791945177;\n color += texture2D(texture, uv + -18.0 * step) * 0.003978472126807061;\n color += texture2D(texture, uv + -17.0 * step) * 0.005227760816555183;\n color += texture2D(texture, uv + -16.0 * step) * 0.006762976274064666;\n color += texture2D(texture, uv + -15.0 * step) * 0.008613559380852844;\n color += texture2D(texture, uv + -14.0 * step) * 0.010800652851120281;\n color += texture2D(texture, uv + -13.0 * step) * 0.013333369986564198;\n color += texture2D(texture, uv + -12.0 * step) * 0.016205128746770582;\n color += texture2D(texture, uv + -11.0 * step) * 0.01939044575559005;\n color += texture2D(texture, uv + -10.0 * step) * 0.022842624955526088;\n color += texture2D(texture, uv + -9.0 * step) * 0.02649276597348318;\n color += texture2D(texture, uv + -8.0 * step) * 0.030250448423666733;\n color += texture2D(texture, uv + -7.0 * step) * 0.03400631888443281;\n color += texture2D(texture, uv + -6.0 * step) * 0.037636625557126956;\n color += texture2D(texture, uv + -5.0 * step) * 0.0410095302098648;\n color += texture2D(texture, uv + -4.0 * step) * 0.04399280495100364;\n color += texture2D(texture, uv + -3.0 * step) * 0.04646232452009806;\n color += texture2D(texture, uv + -2.0 * step) * 0.048310624731385546;\n color += texture2D(texture, uv + -1.0 * step) * 0.04945474015528432;\n color += texture2D(texture, uv + 0.0 * step) * 0.049842336475142184;\n color += texture2D(texture, uv + 1.0 * step) * 0.04945474015528432;\n color += texture2D(texture, uv + 2.0 * step) * 0.048310624731385546;\n color += texture2D(texture, uv + 3.0 * step) * 0.04646232452009806;\n color += texture2D(texture, uv + 4.0 * step) * 0.04399280495100364;\n color += texture2D(texture, uv + 5.0 * step) * 0.0410095302098648;\n color += texture2D(texture, uv + 6.0 * step) * 0.037636625557126956;\n color += texture2D(texture, uv + 7.0 * step) * 0.03400631888443281;\n color += texture2D(texture, uv + 8.0 * step) * 0.030250448423666733;\n color += texture2D(texture, uv + 9.0 * step) * 0.02649276597348318;\n color += texture2D(texture, uv + 10.0 * step) * 0.022842624955526088;\n color += texture2D(texture, uv + 11.0 * step) * 0.01939044575559005;\n color += texture2D(texture, uv + 12.0 * step) * 0.016205128746770582;\n color += texture2D(texture, uv + 13.0 * step) * 0.013333369986564198;\n color += texture2D(texture, uv + 14.0 * step) * 0.010800652851120281;\n color += texture2D(texture, uv + 15.0 * step) * 0.008613559380852844;\n color += texture2D(texture, uv + 16.0 * step) * 0.006762976274064666;\n color += texture2D(texture, uv + 17.0 * step) * 0.005227760816555183;\n color += texture2D(texture, uv + 18.0 * step) * 0.003978472126807061;\n color += texture2D(texture, uv + 19.0 * step) * 0.0029808483791945177;\n color += texture2D(texture, uv + 20.0 * step) * 0.002198804676697693;\n color += texture2D(texture, uv + 21.0 * step) * 0.001596823459247415;\n color += texture2D(texture, uv + 22.0 * step) * 0.0011416972770451463;\n color += texture2D(texture, uv + 23.0 * step) * 0.0008036541345232365;\n color += texture2D(texture, uv + 24.0 * step) * 0.0005569445069582366;\n color += texture2D(texture, uv + 25.0 * step) * 0.0003799964739478872;\n color += texture2D(texture, uv + 26.0 * step) * 0.00025525396029412817;\n color += texture2D(texture, uv + 27.0 * step) * 0.00016880723998699519;\n color += texture2D(texture, uv + 28.0 * step) * 0.0001099096126906708;\n color += texture2D(texture, uv + 29.0 * step) * 0.00007045416494915056;\n color += texture2D(texture, uv + 30.0 * step) * 0.000044463576696752694;\n return color;\n}\n\nvoid main() {\n vec4 color = gaussianBlur(texture, vUv, radius, resolution, direction);\n gl_FragColor = color;\n}\n"});return(e=o.call(this,t,n)).name="AuraPostEffect",e}return t=a,(n=[{key:"setDirection",value:function(e,t){this.material.uniforms.direction.value.set(e,t)}},{key:"setTexture",value:function(e){this.material.uniforms.texture.value=e}},{key:"update",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&E(t.prototype,n),a}(A.Mesh);function D(e){return(D="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})(e)}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=j(i);if(o){var n=j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return F(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(20,20),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},postEffectTex:{type:"t",value:null},noiseTex:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 direction;\nuniform vec2 resolution;\nuniform float radius;\nuniform sampler2D postEffectTex;\nuniform sampler2D noiseTex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nconst float blurIteration = 12.0;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec4 texColor1 = texture2D(postEffectTex, vUv * 1.05 - 0.025);\n vec4 texColor2 = texture2D(postEffectTex, vUv * vec2(0.8, 0.75) + vec2(0.1, 0.075));\n vec4 texColor3 = texture2D(postEffectTex, vUv * vec2(0.6, 0.55) + vec2(0.2, 0.175));\n\n float noise1 = texture2D(noiseTex, vUv - vec2(0.0, time * 0.6)).r;\n float noise2 = texture2D(noiseTex, vUv * 2.0 - vec2(0.0, time * 0.7)).g;\n float noise3 = texture2D(noiseTex, vUv * 3.0 + vec2(0.0, time * 0.8)).b;\n float noise = (noise1 * 0.65 + noise2 * 0.3 + noise3 * 0.05);\n\n float mask1 = (texColor1.r + noise) / 2.0;\n float mask2 = (texColor2.r + (noise * 2.0 - 1.0)) * (1.0 - mask1);\n float mask3 = smoothstep(0.5, 1.0, texColor3.r + noise * 0.5);\n float mask = (mask1 * 2.0 + mask2) / 3.0 * mask3;\n\n float strength = smoothstep(0.05, 0.17, pow(mask, 3.0));\n vec3 hsv1 = vec3(0.84, 0.4, 0.85);\n vec3 hsv2 = vec3(0.55, 0.05, 0.95);\n vec3 rgb = convertHsvToRgb(mix(hsv1, hsv2, strength));\n\n float opacity = smoothstep(0.05, 0.055, pow(mask, 3.0));\n\n if (opacity < 0.01) {\n discard;\n }\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",transparent:!0});return(e=a.call(this,t,n)).name="Aura",e.isActive=!1,e}return t=s,(n=[{key:"start",value:function(e,t){this.isActive=!0,this.material.uniforms.postEffectTex.value=e,this.material.uniforms.noiseTex.value=t}},{key:"update",value:function(e,t){!1!==this.isActive&&(this.rotation.copy(t.rotation),this.material.uniforms.time.value+=e)}}])&&I(t.prototype,n),s}(r.Mesh);function B(e){return(B="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})(e)}function G(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e,t){return!t||"object"!==B(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var W=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=V(i);if(o){var n=V(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return H(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=new r.BufferGeometry,n=new r.BufferAttribute(new Float32Array(1080),3),i=new r.BufferAttribute(new Float32Array(360),1),o=0;o<360;o++){var c=d().radians(360*Math.random()),u=4*Math.random()+1;n.setXYZ(o,Math.cos(c)*u,0,Math.sin(c)*u),i.setX(o,4*Math.random())}t.setAttribute("position",n),t.setAttribute("delay",i);var l=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},duration:{type:"f",value:4},resolution:{type:"v2",value:new r.Vector2},pixelRatio:{type:"f",value:window.devicePixelRatio},noiseTex:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute float delay;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float duration;\nuniform vec2 resolution;\nuniform float pixelRatio;\nuniform sampler2D noiseTex;\n\nvarying vec3 vColor;\nvarying float vAlpha;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Coordinate transformation\n float alpha = mod(time - delay, duration) / duration;\n vec3 risePosition = vec3(0.0, alpha * 10.0 - 4.0, 0.0);\n\n float noiseR = texture2D(\n noiseTex,\n position.yz * 0.4 + vec2(time * 0.02, 0.0)\n ).r * 2.0 - 1.0;\n float noiseG = texture2D(\n noiseTex,\n position.zx * 0.4 + vec2(0.0, time * 0.02)\n ).g * 2.0 - 1.0;\n float noiseB = texture2D(\n noiseTex,\n position.xy * 0.4 - time * 0.02\n ).b * 2.0 - 1.0;\n vec3 noisePosition = vec3(noiseR, noiseG, noiseB) * alpha * 12.0;\n\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(position + noisePosition + risePosition, 1.0);\n float distanceFromCamera = length(mvPosition.xyz);\n\n // Define the point size.\n float pointSize = 7.0 * pixelRatio * 40.0 / distanceFromCamera * resolution.y / 1024.0;\n\n vColor = convertHsvToRgb(\n vec3(\n 0.55 + delay * 0.33,\n 0.8,\n 0.4\n )\n );\n vAlpha = alpha;\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = pointSize;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float alpha;\n\nvarying vec3 vColor;\nvarying float vAlpha;\n\nvoid main() {\n // Convert PointCoord to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // Draw circle\n float radius = length(p);\n float opacity = smoothstep(0.0, 0.2, vAlpha)\n * (1.0 - smoothstep(0.8, 1.0, vAlpha))\n * (1.0 - smoothstep(0.5, 1.0, radius))\n * 0.6;\n\n // Define Colors\n vec3 color = vColor;\n\n gl_FragColor = vec4(color, opacity);\n}\n",transparent:!0,blending:r.AdditiveBlending,depthWrite:!1});return(e=a.call(this,t,l)).name="Points",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e){this.material.uniforms.time.value+=e,this.rotation.set(0,.2*this.material.uniforms.time.value,0)}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&G(t.prototype,n),s}(r.Points);function Z(e){return(Z="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})(e)}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function X(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=K(i);if(o){var n=K(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return X(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).name="AuraSkull",e.skull,e.auraPostEffect,e.aura,e.points,e.renderTarget1=new r.WebGLRenderTarget(256,256),e.renderTarget2=new r.WebGLRenderTarget(256,256),e.time=0,e.isActive=!1,e}return t=s,(n=[{key:"start",value:function(e,t,n){this.skull=new T(e,t),this.auraPostEffect=new O,this.aura=new U,this.points=new W,this.add(this.skull),this.add(this.aura),this.add(this.points),this.skull.start(n),this.aura.start(this.renderTarget1.texture,n),this.points.start(n),this.isActive=!0}},{key:"update",value:function(e,t,n,r,i,o){!1!==this.isActive&&(this.time+=e,this.radian+=e,o&&this.skull.rotation.set(d().radians(o.v.y-15),d().radians(o.v.x+15),d().radians(-20)),this.skull.update(e,n),this.aura.update(e,n),this.points.update(e),t.setRenderTarget(this.renderTarget1),r.add(this.skull),this.skull.material.uniforms.renderOutline.value=1,t.render(r,i),t.setRenderTarget(this.renderTarget2),r.remove(this.skull),r.add(this.auraPostEffect),this.auraPostEffect.setDirection(1,0),this.auraPostEffect.setTexture(this.renderTarget1.texture),t.render(r,i),t.setRenderTarget(this.renderTarget1),this.auraPostEffect.setDirection(0,1),this.auraPostEffect.setTexture(this.renderTarget2.texture),t.render(r,i),t.setRenderTarget(null),r.remove(this.auraPostEffect),this.add(this.skull),this.skull.material.uniforms.renderOutline.value=0)}},{key:"resize",value:function(e){this.points.resize(e)}}])&&q(t.prototype,n),s}(r.Group);function J(e){return(J="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})(e)}function $(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e,t){return!t||"object"!==J(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var re,ie=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ee(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ne(i);if(o){var n=ne(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return te(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(100,12,12),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},hex:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float hex;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec3 rgb = mix(\n convertHsvToRgb(vec3(0.5, 0.8, 0.7)),\n convertHsvToRgb(vec3(0.0, 0.2, 0.95)),\n vUv.y * 4.0 - 1.15\n );\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n",side:r.BackSide});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(){}}])&&$(t.prototype,n),s}(r.Mesh);function oe(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var se=new r.Scene,ce=new h,ue=new r.Clock({autoStart:!1}),le=new r.Scene,fe=new b,he=new a.L,ve=new r.TextureLoader,de=new Q,pe=new ie,me=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(re=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),re.setClearColor(0,1),e.next=5,Promise.all([he.loadAsync("/sketch-threejs/model/skull/SkullHead.obj"),ve.loadAsync("/sketch-threejs/img/sketch/splash/noise.png")]).then((function(e){var t=e[0].children[1].geometry,n=e[0].children[0].geometry,i=e[1];i.wrapS=r.RepeatWrapping,i.wrapT=r.RepeatWrapping,ce.start(),fe.start(),de.start(t,n,i),pe.start(),se.add(de),se.add(pe)}));case 5:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){oe(o,n,r,a,s,"next",e)}function s(e){oe(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){ue.start(),this.update()}},{key:"pause",value:function(){ue.stop()}},{key:"update",value:function(e){if(!1!==ue.running){var t=ue.getDelta();ce.update(t),fe.update(ce),de.update(t,re,ce,le,fe,e),re.render(se,ce)}}},{key:"resize",value:function(e){ce.resize(e),de.resize(e),re.setSize(e.x,e.y)}}])&&ae(t.prototype,n),e}();function ye(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ge=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolution=t,this.vTouchStart=new r.Vector2,this.vPrev=new r.Vector2,this.v=new r.Vector2,this.a=new r.Vector2,this.anchor=new r.Vector2,this.isTouched=!1}var t,n;return t=e,(n=[{key:"touchStart",value:function(e){e.touches||e.preventDefault(),this.vPrev.copy(this.v),this.a.set(0,0),this.vTouchStart.set(e.touches?e.touches[0].clientX:e.clientX,e.touches?e.touches[0].clientY:e.clientY),this.isTouched=!0}},{key:"touchMove",value:function(e){e.touches&&e.preventDefault();var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY;!1!==this.isTouched&&this.anchor.set((t-this.vTouchStart.x)/(this.resolution.x/200)+this.vPrev.x,d().clamp((n-this.vTouchStart.y)/(this.resolution.y/200)+this.vPrev.y,-90,90))}},{key:"touchEnd",value:function(e){this.isTouched=!1}},{key:"update",value:function(){this.a.set((this.anchor.x-this.v.x)/10,(this.anchor.y-this.v.y)/10),this.v.add(this.a)}}])&&ye(t.prototype,n),e}();function xe(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function be(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){xe(o,r,i,a,s,"next",e)}function s(e){xe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function we(){return Me.apply(this,arguments)}function Me(){return(Me=be(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new me,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=new ge(n),c=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},u=function(){var e=function(e){s.touchStart(e)},n=function(e){s.touchMove(e)},r=function(e){s.touchEnd(e)};i.addEventListener("mousedown",e,{passive:!1}),window.addEventListener("mousemove",n,{passive:!1}),window.addEventListener("mouseup",r),i.addEventListener("touchstart",e,{passive:!1}),window.addEventListener("touchmove",n,{passive:!1}),window.addEventListener("touchend",r),window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(c,100))},l=function e(){s.update(n),t.update(s),requestAnimationFrame(e)},e.next=10,t.start(i);case 10:u(),c(),a.classList.add("is-hidden"),t.play(),l();case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},17194:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var r=n(2212),i=n(38314),o=n.n(i);function a(e){return(a="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})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(f,e);var t,n,i,o,a=(i=f,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(i);if(o){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function f(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o}return t=f,(n=[{key:"start",value:function(){this.aspect=1.5,this.far=1e3,this.setFocalLength(50),this.position.set(0,0,50),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){}},{key:"resize",value:function(e){e.x>e.y?this.cameraResolution.set(e.x>=1200?1200:e.x,e.x>=1200?800:.66*e.x):this.cameraResolution.set(.6*(e.y>=1200?800:.66*e.y),.6*(e.y>=1200?1200:e.y)),this.setViewOffset(this.cameraResolution.x,this.cameraResolution.y,(e.x-this.cameraResolution.x)/-2,(e.y-this.cameraResolution.y)/-2,e.x,e.y),this.updateProjectionMatrix()}}])&&s(t.prototype,n),f}(r.PerspectiveCamera);function h(e){return(h="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})(e)}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(17393);var y,g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=m(i);if(o){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return p(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.IcosahedronGeometry(1,100),n=new r.RawShaderMaterial({uniforms:{time:{value:0},alpha:{value:0},pixelRatio:{value:window.devicePixelRatio},noiseTex:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float alpha;\nuniform float pixelRatio;\nuniform sampler2D noiseTex;\n\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Coordinate transformation\n float noiseR = texture2D(\n noiseTex,\n position.yz * 0.4 + vec2(time * 0.1, 0.0)\n ).r * 2.0 - 1.0;\n float noiseG = texture2D(\n noiseTex,\n position.zx * 0.4 + vec2(0.0, time * 0.1)\n ).g * 2.0 - 1.0;\n float noiseB = texture2D(\n noiseTex,\n position.xy * 0.4 - time * 0.1\n ).b * 2.0 - 1.0;\n vec3 noisePosition = vec3(noiseR, noiseG, noiseB) * (alpha * 0.6 + 0.6);\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(position + noisePosition, 1.0);\n float distanceFromCamera = length(mvPosition.xyz);\n\n // Define the point size.\n float pointSize = pixelRatio * 240.0 / distanceFromCamera;\n\n vColor = convertHsvToRgb(\n vec3(\n (noiseR + noiseG + noiseB) * 0.2 + time * 0.1,\n 0.8,\n 0.4\n )\n );\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = pointSize;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float alpha;\n\nvarying vec3 vColor;\n\nvoid main() {\n // Convert PointCoord to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // Draw circle\n float radius = length(p);\n float opacity =\n (\n (1.0 - smoothstep(0.1, 0.2, radius)) * 0.2\n + (1.0 - smoothstep(0.2, 1.0, radius)) * 0.1\n )\n * smoothstep(0.0, 0.1, alpha)\n * (1.0 - smoothstep(0.1, 1.0, alpha));\n\n // Define Colors\n vec3 color = vColor;\n\n gl_FragColor = vec4(color, opacity);\n}\n",transparent:!0,blending:r.AdditiveBlending,depthWrite:!1});return(e=a.call(this,t,n)).name="Points",e.time=0,e.scale.set(10,10,10),e}return t=s,(n=[{key:"start",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.time=-4*t,this.material.uniforms.noiseTex.value=e}},{key:"update",value:function(e){this.time+=e;var t=this.time%4/4,n=30*t;this.scale.set(n,n,n),this.material.uniforms.time.value+=e,this.material.uniforms.alpha.value=t}}])&&v(t.prototype,n),s}(r.Points);function x(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var w=new r.Scene,M=new f,_=new r.Clock({autoStart:!1}),S=new r.TextureLoader,P=new g,T=new g,R=new g,E=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(y=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),y.setClearColor(921102,1),e.next=5,Promise.all([S.loadAsync("/sketch-threejs/img/sketch/splash/noise.png")]).then((function(e){var t=e[0];t.wrapS=r.RepeatWrapping,t.wrapT=r.RepeatWrapping,P.start(t),T.start(t,.33),R.start(t,.66),w.add(P),w.add(T),w.add(R)}));case 5:M.start();case 6:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){x(o,n,r,a,s,"next",e)}function s(e){x(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){_.start(),this.update()}},{key:"pause",value:function(){_.stop()}},{key:"update",value:function(){if(!1!==_.running){var e=_.getDelta();M.update(e),P.update(e),T.update(e),R.update(e),y.render(w,M)}}},{key:"resize",value:function(e){M.resize(e),y.setSize(e.x,e.y)}}])&&b(t.prototype,n),e}();function z(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){z(o,r,i,a,s,"next",e)}function s(e){z(o,r,i,a,s,"throw",e)}a(void 0)}))}}function C(){return A.apply(this,arguments)}function A(){return(A=L(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new E,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},4055:function(e,t,n){"use strict";n.d(t,{Z:function(){return X}});var r=n(2212),i=n(38314),o=n.n(i),a=n(29130),s=n.n(a),c=n(17393),u=n.n(c);function l(e){return(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})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(r);if(i){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return v(this,e)});function a(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this)).time=0,e.name="Sun",e}return t=a,(n=[{key:"start",value:function(){}},{key:"update",value:function(e){this.time+=e,this.rotation.set(0,u().radians(8*this.time),0)}}])&&f(t.prototype,n),a}(r.Group);function m(e){return(m="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})(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b(i);if(o){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return x(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(6,32,32),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},texture:{type:"t",value:null},textureNormal:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\nuniform float time;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n float angleToCamera = acos(dot(normalize(cameraPosition), normalize(mPosition.xyz)));\n\n vUv = uv;\n vColor = vec3(smoothstep(0.7, 1.0, abs(sin(angleToCamera)))) * 0.9;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\nuniform sampler2D textureNormal;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n vec2 normal = texture2D(textureNormal, vUv + vec2(0.5, 0.0)).xy;\n vec2 updateUv = vUv + vec2(\n cos(radians(normal.x * 360.0 + time * 60.0)) * 0.006,\n sin(radians(normal.y * 360.0 + time * 60.0)) * 0.006\n );\n\n vec4 texColor = texture2D(texture, updateUv);\n vec3 hsv = vec3(\n texColor.r * 0.14 + 0.03,\n 0.95 - texColor.r * 0.7,\n texColor.r * 0.4 + 0.8\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb + vColor, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Core",e}return t=s,(n=[{key:"start",value:function(e,t){this.material.uniforms.texture.value=e,this.material.uniforms.textureNormal.value=t}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&y(t.prototype,n),s}(r.Mesh);function M(e){return(M="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})(e)}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t){return(S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&S(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=T(i);if(o){var n=T(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return P(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(7.5,128,128),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},texture:{type:"t",value:null},textureNormal:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\nuniform float time;\n\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvoid main(void) {\n float wave1 = sin((position.x + position.y) * 0.8 + time * 0.4);\n float wave2 = sin((position.z - position.x) * 0.6 + time * 0.2);\n float wave = wave1 * 0.4 + wave2 * 0.6;\n vec3 wavePosition = normalize(position) * wave * 2.2;\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + wavePosition, 1.0);\n\n float angleToCamera = acos(dot(normalize(cameraPosition), normalize(mPosition.xyz)));\n\n vUv = uv + vec2(0.5, 0.0);\n vOpacity = smoothstep(0.1, 0.6, abs(sin(angleToCamera)));\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\nuniform sampler2D textureNormal;\n\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n vec2 normal = texture2D(textureNormal, vUv + vec2(0.5, 0.0)).xy;\n vec2 updateUv = vUv + vec2(\n cos(radians(normal.x * 360.0 + time * 60.0)) * 0.018,\n sin(radians(normal.y * 360.0 + time * 60.0)) * 0.018\n );\n\n vec4 texColor = texture2D(texture, updateUv);\n float opacity = texColor.r * vOpacity;\n vec3 hsv = vec3(\n opacity * 0.1 + 0.03,\n 0.95 - opacity * 0.7,\n opacity * 0.4 + 0.8\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, smoothstep(0.3, 0.9, opacity) * 0.9);\n}\n",transparent:!0,depthWrite:!1,side:r.DoubleSide});return(e=a.call(this,t,n)).name="Shell",e}return t=s,(n=[{key:"start",value:function(e,t){this.material.uniforms.texture.value=e,this.material.uniforms.textureNormal.value=t}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&_(t.prototype,n),s}(r.Mesh);function E(e){return(E="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})(e)}function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A(i);if(o){var n=A(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return C(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=new r.BufferGeometry,n=new r.BufferAttribute(new Float32Array(3600),3),i=new r.BufferAttribute(new Float32Array(1200),1,1),o=new r.BufferAttribute(new Float32Array(1200),1,1),c=0;c<1200;c++){var l=u().radians(u().randomArbitrary(0,150)-75),f=u().radians(u().randomArbitrary(0,360)),h=Math.random()*Math.random()*8+6,v=u().spherical(l,f,h);n.setXYZ(c,v[0],v[1],v[2]),i.setXYZ(c,Math.random()),o.setXYZ(c,u().randomArbitrary(5,10)*(2*u().randomInt(0,1)-1))}t.setAttribute("position",n),t.setAttribute("delay",i),t.setAttribute("speed",o);var d=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute float delay;\nattribute float speed;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nconst float duration = 3.0;\n\nvoid main() {\n // calculate interval time from 0 to 1\n float interval = mod(time + delay * duration, duration) / duration;\n\n // update position and size\n float size = 10.0 * sin(interval * 4.0);\n float blink = max(sin(interval * 4.0) * 2.0 - 1.0, 0.0);\n mat4 rotateMat = calcRotateMat4(vec3(\n radians(time * speed * 0.3),\n radians(time * speed),\n radians(time * speed * 0.3)\n ));\n\n // calculate colors\n vec3 hsv = vec3(0.1 + sin(delay + time) * 0.05, 0.6, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * rotateMat * vec4(position, 1.0);\n float distanceFromCamera = 20.0 / length(mvPosition.xyz);\n\n vColor = rgb;\n vOpacity = blink * clamp(distanceFromCamera, 0.1, 0.3);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = distanceFromCamera * size;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // convert PointCoord to range from -1.0 to 1.0\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // draw double circle\n float r = (1.0 - smoothstep(0.95, 1.0, length(p)));\n\n gl_FragColor = vec4(vColor * r, vOpacity);\n}\n",transparent:!0,depthWrite:!1,blending:r.AdditiveBlending});return(e=a.call(this,t,d)).name="Points",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&z(t.prototype,n),s}(r.Points);function D(e){return(D="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})(e)}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&k(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=j(i);if(o){var n=j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return F(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.RingGeometry(4,24,64),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0},texture:{type:"t",value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nmat3 calcRotateMat3(float radian) {\n return mat3(\n cos(radian), -sin(radian), 0.0,\n sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n vec2 rotateUv = (calcRotateMat3(time * 0.04) * vec3(p, 1.0)).xy * 0.5 + 0.5;\n vec4 texColor = texture2D(texture, rotateUv);\n\n float l = length(vPosition);\n vec2 rotateMask = (calcRotateMat3(time * -0.02) * vec3(p, 1.0)).xy;\n float opacityIn = pow(1.0 - smoothstep(6.0, 10.0, l), 2.0);\n float opacityOut = 1.0 - smoothstep(8.0, 24.0, l);\n float opacityRay = sin(acos(dot(normalize(rotateMask), vec2(1.0, 0.0))) * 2.4 + time) * 0.4 + 0.6;\n float opacity = opacityIn * 0.7 + opacityOut * 0.1 + opacityRay * texColor.r;\n\n vec3 hsv = vec3(\n opacity * 0.12 + 0.98,\n 1.0 - opacity * 0.8,\n opacity * 0.4 + 0.8\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, opacity);\n}\n",transparent:!0});return(e=a.call(this,t,n)).position.z=-5,e.name="SunShine",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.texture.value=e}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&I(t.prototype,n),s}(r.Mesh);function B(e){return(B="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})(e)}function G(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e,t){return!t||"object"!==B(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var W=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=V(i);if(o){var n=V(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return H(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(50,12,12),n=new r.RawShaderMaterial({uniforms:{time:{type:"f",value:0}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nconst vec3 rgb1 = vec3(24.0 / 255.0, 32.0 / 255.0, 76.0 / 255.0);\nconst vec3 rgb2 = vec3(5.0 / 255.0, 6.0 / 255.0, 15.0 / 255.0);\n\nvoid main() {\n vec3 rgb = mix(rgb1, rgb2, vUv.y * 4.0 - 1.0);\n float noise = random(vUv + vec2(0.0, time * 0.01)) * 0.04;\n\n gl_FragColor = vec4(rgb + noise, 1.0);\n}\n",side:r.BackSide});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(){}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}}])&&G(t.prototype,n),s}(r.Mesh);function Z(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function q(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Z(o,r,i,a,s,"next",e)}function s(e){Z(o,r,i,a,s,"throw",e)}a(void 0)}))}}var Y=new r.TextureLoader;function X(){return K.apply(this,arguments)}function K(){return(K=q(regeneratorRuntime.mark((function e(){var t,n,i,a,c,u,l,f,h,v,d,m,y,g,x,b,M,_,S,P;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new r.Vector2,n=document.getElementById("canvas-webgl"),(i=new r.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n})).setPixelRatio(window.devicePixelRatio),a=new r.Scene,c=new r.PerspectiveCamera,u=new r.Vector2,l=new r.Clock({autoStart:!1}),f=document.querySelector(".p-preloader"),h=new p,v=new w,d=new R,m=new O,y=new U,g=new W,b=function(){var e=l.getDelta();h.update(e),v.update(e),d.update(e),m.update(e),y.update(e),i.render(a,c)},M=function e(){b(),requestAnimationFrame(e)},_=function(){t.x>t.y?u.set(t.x>=1200?1200:t.x,t.x>=1200?800:.66*t.x):u.set(.6*(t.y>=1200?800:.66*t.y),.6*(t.y>=1200?1200:t.y)),c.setViewOffset(u.x,u.y,(t.x-u.x)/-2,(t.y-u.y)/-2,t.x,t.y),c.updateProjectionMatrix()},S=function(){t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,_(),i.setSize(t.x,t.y)},P=function(){window.addEventListener("blur",(function(){l.stop()})),window.addEventListener("focus",(function(){l.start()})),window.addEventListener("resize",o()(S,100))},i.setClearColor(15658734,1),c.aspect=1.5,c.far=1e3,c.setFocalLength(50),c.position.set(0,0,50),c.lookAt(new r.Vector3),P(),S(),e.next=30,Promise.all([Y.loadAsync("../img/sketch/sun/core.png"),Y.loadAsync("../img/sketch/sun/core_normal.png"),Y.loadAsync("../img/sketch/sun/sunshine.png")]).then((function(e){x=e}));case 30:return x&&(x[0].wrapS=r.RepeatWrapping,x[0].wrapT=r.RepeatWrapping,x[1].wrapS=r.RepeatWrapping,x[1].wrapT=r.RepeatWrapping,v.start(x[0],x[1]),d.start(x[0],x[1]),y.start(x[2])),h.add(v),h.add(d),a.add(h),a.add(m),a.add(y),a.add(g),f.classList.add("is-hidden"),e.next=40,s()(200);case 40:l.start(),M();case 42:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},84269:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.size=280,this.interval=1.2,this.uniforms={index:{type:"f",value:t},time:{type:"f",value:0},timeTransform:{type:"f",value:0},interval:{type:"f",value:this.interval},size:{type:"f",value:this.size},texButterfly:{type:"t",value:n},texPicture:{type:"t",value:r},colorH:{type:"f",value:.08}},this.obj,this.isTransform=!1,this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(this.size,this.size/2,64,32),t=new i.SphereGeometry(.1*this.size,64,32,-.5*Math.PI,2*Math.PI),r=new i.PlaneGeometry(1.1*this.size,.55*this.size,64,32);e.setAttribute("spherePosition",t.attributes.position),e.setAttribute("squarePosition",r.attributes.position);var o=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(70124).Z,fragmentShader:n(75473).Z,side:i.DoubleSide,transparent:!0});this.obj=new i.Mesh(e,o),this.obj.position.y=.3*this.size,this.obj.renderOrder=10}},{key:"render",value:function(e,t){this.uniforms.time.value+=t,this.uniforms.timeTransform.value<this.interval&&!0===this.isTransform?this.uniforms.timeTransform.value=Math.min(this.uniforms.timeTransform.value+t,this.interval):this.uniforms.timeTransform.value>0&&!1===this.isTransform&&(this.uniforms.timeTransform.value=Math.max(this.uniforms.timeTransform.value-t,0))}}])&&r(t.prototype,o),e}()},76947:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(41588).Z,a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mirrorCamera=new i.PerspectiveCamera(30,t.x/t.y,1,15e3),this.mirrorRender=new i.WebGLRenderTarget(t.x,t.y),this.textureMatrix=new i.Matrix4,this.uniforms={time:{type:"f",value:0},texture:{type:"t",value:this.mirrorRender.texture},textureMatrix:{type:"m4",value:this.textureMatrix}},this.renderBack1=new i.WebGLRenderTarget(t.x,t.y),this.renderBack2=new i.WebGLRenderTarget(t.x,t.y),this.postEffectBlurX=new o(this.renderBack1.texture,1,0,4),this.postEffectBlurY=new o(this.renderBack2.texture,0,1,4),this.mirrorCamera.up.set(0,-1,0),this.obj,this.createObj()}var t,a;return t=e,(a=[{key:"add",value:function(e,t){t.add(this.obj),e.add(this.postEffectBlurX.obj),e.add(this.postEffectBlurY.obj)}},{key:"createObj",value:function(){var e=new i.PlaneGeometry(4e3,4e3),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(47741).Z,fragmentShader:n(41639).Z,transparent:!0});this.obj=new i.Mesh(e,t),this.obj.rotation.set(-.5*Math.PI,0,0)}},{key:"updateTextureMatrix",value:function(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1),this.textureMatrix.multiply(this.mirrorCamera.projectionMatrix),this.textureMatrix.multiply(this.mirrorCamera.matrixWorldInverse)}},{key:"render",value:function(e,t,n,r,i){this.uniforms.time.value+=i,this.updateTextureMatrix(),this.obj.visible=!1,e.setRenderTarget(this.renderBack1),e.render(n,this.mirrorCamera),this.obj.visible=!0,this.postEffectBlurX.render(e,t,r,this.renderBack2),this.postEffectBlurY.render(e,t,r,this.mirrorRender)}},{key:"resize",value:function(e){this.mirrorCamera.aspect=e.x/e.y,this.mirrorCamera.updateProjectionMatrix(),this.mirrorRender.setSize(e.x,e.y),this.renderBack1.setSize(e.x,e.y),this.renderBack2.setSize(e.x,e.y),this.postEffectBlurX.resize(e),this.postEffectBlurY.resize(e)}}])&&r(t.prototype,a),e}()},5721:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.interval=4,this.attr={position:new i.BufferAttribute(new Float32Array(3*t),3),colorH:new i.BufferAttribute(new Float32Array(t),1),index:new i.BufferAttribute(new Float32Array(t),1),opacity:new i.BufferAttribute(new Float32Array(t),1),valid:new i.BufferAttribute(new Float32Array(t),1)},this.uniforms={size:{type:"f",value:t},interval:{type:"f",value:this.interval},time:{type:"f",value:0}},this.butterflies=null,this.butterfliesLengh=0,this.obj,this.createObj()}var t,a;return t=e,(a=[{key:"createObj",value:function(){for(var e=new i.BufferGeometry,t=0;t<this.uniforms.size.value;t++)this.attr.index.setX(t,t);e.setAttribute("position",this.attr.position),e.setAttribute("colorH",this.attr.colorH),e.setAttribute("i",this.attr.index),e.setAttribute("opacity",this.attr.opacity),e.setAttribute("valid",this.attr.valid);var r=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(8467).Z,fragmentShader:n(27558).Z,depthWrite:!1,transparent:!0});this.obj=new i.Points(e,r),this.obj.renderOrder=20}},{key:"addButterflies",value:function(e){this.butterflies=e,this.butterfliesLengh=e.length}},{key:"render",value:function(e){this.uniforms.time.value+=e;for(var t=0;t<this.uniforms.size.value;t++){var n=(this.uniforms.time.value+this.attr.index.getX(t)/this.uniforms.size.value*this.interval)%this.interval,r=this.attr.valid.getX(t);if(n>=.9*this.interval&&1==r)this.attr.valid.setX(t,0);else if(n<=.9*this.interval&&0==r){var i=Math.floor(Math.random()*this.butterfliesLengh),a=this.butterflies[i],s=(-90*Math.random()-90)*Math.PI/180,c=-180*Math.random()*Math.PI/180,u=Math.random()*a.uniforms.size.value/4+a.uniforms.size.value/8,l=o.spherical(s,c,u),f=a.uniforms.timeTransform.value>0?0:1;this.attr.position.setXYZ(t,l[0]+a.obj.position.x,.2*l[1]+a.obj.position.y+20*Math.sin(a.uniforms.time.value),.5*l[2]+a.obj.position.z),this.attr.colorH.setX(t,a.uniforms.colorH.value),this.attr.opacity.setX(t,f),this.attr.valid.setX(t,1)}}this.attr.position.needsUpdate=!0,this.attr.colorH.needsUpdate=!0,this.attr.opacity.needsUpdate=!0,this.attr.valid.needsUpdate=!0}}])&&r(t.prototype,a),e}()},67283:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={brightMin:{type:"f",value:t},texture1:{type:"t",value:n},texture2:{type:"t",value:r}},this.obj,this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(2,2),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(86169).Z,fragmentShader:n(45014).Z});this.obj=new i.Mesh(e,t),this.obj.visible=!1}},{key:"render",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&r(t.prototype,o),e}()},41588:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={resolution:{type:"v2",value:new i.Vector2},direction:{type:"v2",value:new i.Vector2(n,r)},radius:{type:"f",value:o},texture:{type:"t",value:t}},this.obj,this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(2,2),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(86169).Z,fragmentShader:n(60479).Z});this.obj=new i.Mesh(e,t),this.obj.visible=!1}},{key:"resize",value:function(e){this.uniforms.resolution.value.set(e.x,e.y)}},{key:"render",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&r(t.prototype,o),e}()},68131:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={brightMin:{type:"f",value:t},texture:{type:"t",value:n}},this.obj,this.createObj()}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.PlaneGeometry(2,2),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(86169).Z,fragmentShader:n(46045).Z});this.obj=new i.Mesh(e,t),this.obj.visible=!1}},{key:"render",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.obj.visible=!0,e.setRenderTarget(r),e.render(t,n),this.obj.visible=!1}}])&&r(t.prototype,o),e}()},82158:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2212),i=n(38314),o=n(89813).Z,a=n(84269).Z,s=n(5721).Z,c=n(76947).Z,u=n(68131).Z,l=n(41588).Z,f=n(67283).Z;function h(){var e={x:0,y:0},t=document.getElementById("canvas-webgl"),n=new r.WebGL1Renderer({antialias:!0,canvas:t,alpha:!0}),h=new r.WebGLRenderTarget(0,0),v=new r.WebGLRenderTarget(0,0),d=new r.WebGLRenderTarget(0,0),p=new r.Scene,m=new r.Scene,y=new r.OrthographicCamera(-1,1,1,-1,0,1),g=new r.PerspectiveCamera(30,1,1,15e3),x=new r.Clock,b=new r.TextureLoader,w=new r.Vector2,M=new r.Vector2,_=new r.Vector2,S=[],P=new s(32),T=new c(e),R=new u(.7,h.texture),E=new l(v.texture,1,0,1),z=new l(d.texture,0,1,1),L=new f(.7,h.texture,v.texture),C=["/sketch-threejs/img/sketch/transform/tex.png","/sketch-threejs/img/sketch/transform/flower.jpg"],A=[],O=function(){e.x=document.body.clientWidth,e.y=window.innerHeight,t.width=e.x,t.height=e.y,g.aspect=e.x/e.y,g.updateProjectionMatrix(),T.resize(e),E.resize(e),z.resize(e),h.setSize(e.x,e.y),v.setSize(e.x,e.y),d.setSize(e.x,e.y),n.setSize(e.x,e.y)},D=function e(){!function(){for(var e=x.getDelta(),t=0;t<S.length;t++)S[t].render(n,e);P.render(e),T.render(n,p,m,y,e),n.setRenderTarget(h),n.render(m,g),R.render(n,p,y,v),E.render(n,p,y,d),z.render(n,p,y,v),L.render(n,p,y)}(),requestAnimationFrame(e)},I=function(e){S[0].isTransform=!S[0].isTransform};!function(){O(),window.addEventListener("resize",i(O),1e3),t.addEventListener("mousedown",(function(e){e.preventDefault(),w.set(e.clientX,e.clientY),o(w),I()})),t.addEventListener("mousemove",(function(e){e.preventDefault(),M.set(e.clientX,e.clientY),o(M)})),t.addEventListener("mouseup",(function(e){e.preventDefault(),_.set(e.clientX,e.clientY),o(_)})),t.addEventListener("touchstart",(function(e){e.preventDefault(),w.set(e.touches[0].clientX,e.touches[0].clientY),o(w),I(e.touches[0].clientX,e.touches[0].clientY)})),t.addEventListener("touchmove",(function(e){e.preventDefault(),M.set(e.touches[0].clientX,e.touches[0].clientY),o(M)})),t.addEventListener("touchend",(function(e){e.preventDefault(),_.set(e.changedTouches[0].clientX,e.changedTouches[0].clientY),o(_)})),window.addEventListener("mouseout",(function(){event.preventDefault(),_.set(0,0)})),n.setClearColor(16382457,1),g.position.set(400.1,60,-400),T.mirrorCamera.position.set(g.position.x,-1*g.position.y,g.position.z),g.lookAt(new r.Vector3(0,60,0)),T.mirrorCamera.lookAt(new r.Vector3(0,-60,0));for(var e=0,s=function(){var t=c;b.load(C[c],(function(n){if(n.magFilter=r.NearestFilter,n.minFilter=r.NearestFilter,n.repeat=r.RepeatWrapping,A[t]=n,++e>=C.length){for(var i=0;i<1;i++)S[i]=new a(i,A[0],A[1]),m.add(S[i].obj);P.addButterflies(S),m.add(P.obj),T.add(p,m),p.add(R.obj),p.add(E.obj),p.add(z.obj),p.add(L.obj),D()}}))},c=0;c<C.length;c++)s()}()}},31547:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(2212),i=n(38314),o=n.n(i),a=n(52886);function s(e){return(s="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})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(i);if(o){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function s(e,t,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(o=a.call(this,e,t,n,i)).cameraResolution=new r.Vector2,o.time=0,o}return t=s,(n=[{key:"start",value:function(){this.far=1e3,this.setFocalLength(50),this.position.set(0,50,0),this.lookAt(new r.Vector3)}},{key:"update",value:function(e){this.time+=e}},{key:"resize",value:function(e){this.aspect=e.x/e.y,this.updateProjectionMatrix()}}])&&c(t.prototype,n),s}(r.PerspectiveCamera);function v(e){return(v="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})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(i);if(o){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(80,80),n=new r.RawShaderMaterial({uniforms:{time:{value:0},resolution:{value:new r.Vector2},tScene:{value:null},tNormal:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = mPosition.xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform mat4 modelMatrix;\nuniform vec3 cameraPosition;\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D tScene;\nuniform sampler2D tNormal;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n vec3 light = normalize(vec3(0.0, 1.0, 0.0));\n\n vec3 normal1 = texture2D(tNormal, (vUv + vec2(0.0, 0.2)) + vec2( time, time) * 0.02).xyz * 2.0 - 1.0;\n vec3 normal2 = texture2D(tNormal, (vUv + vec2(0.0, 0.4)) + vec2( time, -time) * 0.02).xyz * 2.0 - 1.0;\n vec3 normal3 = texture2D(tNormal, (vUv + vec2(0.0, 0.6)) + vec2(-time, time) * 0.02).xyz * 2.0 - 1.0;\n vec3 normal4 = texture2D(tNormal, (vUv + vec2(0.0, 0.8)) + vec2(-time, -time) * 0.02).xyz * 2.0 - 1.0;\n vec3 normal = normalize(normal1 + normal2 + normal3 + normal4);\n\n float angleToCamera = acos(dot(normalize(vPosition - cameraPosition), normal));\n float diffuse = clamp(dot(normal, light), 0.0, 1.0);\n\n vec3 hsv = vec3(0.52, 1.0, 0.0);\n vec3 rgb = convertHsvToRgb(hsv);\n float edgeGradual = (1.0 - smoothstep(0.5, 1.0, length(p)));\n\n vec2 uv = gl_FragCoord.xy / resolution;\n vec4 tSceneColor = texture2D(tScene, uv + normal.xy * 0.1);\n\n gl_FragColor = vec4((rgb + diffuse) * edgeGradual + tSceneColor.rgb, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Water",e.rotation.x=Math.PI/180*-90,e}return t=s,(n=[{key:"start",value:function(e,t){var n=this.material.uniforms;n.tScene.value=e,n.tNormal.value=t}},{key:"update",value:function(e){this.material.uniforms.time.value+=e}},{key:"resize",value:function(e){this.material.uniforms.resolution.value.copy(e)}}])&&d(t.prototype,n),s}(r.Mesh);function x(e){return(x="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})(e)}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_(i);if(o){var n=_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return M(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.PlaneGeometry(30,30),n=new r.RawShaderMaterial({uniforms:{time:{value:0},tImage:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = mPosition.xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D tImage;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec3 tImageColor = texture2D(tImage, vUv).xyz;\n gl_FragColor = vec4(tImageColor, 1.0);\n}\n"});return(e=a.call(this,t,n)).name="Image",e.rotation.x=Math.PI/180*-90,e.position.y=-5,e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.tImage.value=e}}])&&b(t.prototype,n),s}(r.Mesh);function P(e){return(P="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})(e)}function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e,t){return!t||"object"!==P(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var L,C=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}(s,e);var t,n,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=z(i);if(o){var n=z(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return E(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=new r.SphereGeometry(100,64,64),n=new r.RawShaderMaterial({uniforms:{texture:{value:null}},vertexShader:"#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\n\nvoid main() {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = mPosition.xyz;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n",fragmentShader:"precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float alpha = vPosition.z / 100.0 * 0.5 + 0.5;\n vec3 hsv1 = vec3(0.49, 0.5, 0.7);\n vec3 hsv2 = vec3(1.1, 0.1, 0.9);\n vec3 rgb = mix(convertHsvToRgb(hsv1), convertHsvToRgb(hsv2), alpha);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n",side:r.BackSide});return(e=a.call(this,t,n)).name="Background",e}return t=s,(n=[{key:"start",value:function(e){this.material.uniforms.texture.value=e}}])&&T(t.prototype,n),s}(r.Mesh);function A(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var D,I=new r.Scene,k=new h,F=new r.Clock({autoStart:!1}),j=new r.TextureLoader,U=new g,B=new S,G=new C,N=new r.WebGLRenderTarget,H=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i,o;return t=e,(n=[{key:"start",value:(i=regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(L=new r.WebGLRenderer({alpha:!0,antialias:!0,canvas:t})).setPixelRatio(window.devicePixelRatio),L.setClearColor(16382457,1),(D=new a.z(k,L.domElement)).dampingFactor=.1,D.enableDamping=!0,D.enablePan=!1,D.enableZoom=!1,D.maxPolarAngle=Math.PI/180*80,e.next=11,Promise.all([j.loadAsync("/sketch-threejs/img/sketch/water/normal.jpg"),j.loadAsync("/sketch-threejs/img/sketch/water/image.jpg")]).then((function(e){e[0].wrapT=e[0].wrapS=r.RepeatWrapping,U.start(N.texture,e[0]),B.start(e[1])}));case 11:k.start(),I.add(B),I.add(U),I.add(G);case 15:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=i.apply(e,t);function a(e){A(o,n,r,a,s,"next",e)}function s(e){A(o,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"play",value:function(){F.start(),this.update()}},{key:"pause",value:function(){F.stop()}},{key:"update",value:function(){if(!1!==F.running){var e=F.getDelta();k.update(e),U.update(e),U.visible=!1,L.setRenderTarget(N),L.render(I,k),U.visible=!0,L.setRenderTarget(null),L.render(I,k),D.update()}}},{key:"resize",value:function(e){k.resize(e),U.resize(e),L.setSize(e.x,e.y),N.setSize(e.x,e.y)}}])&&O(t.prototype,n),e}();function V(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){V(o,r,i,a,s,"next",e)}function s(e){V(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Z(){return q.apply(this,arguments)}function q(){return(q=W(regeneratorRuntime.mark((function e(){var t,n,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new H,n=new r.Vector2,i=document.getElementById("canvas-webgl"),a=document.querySelector(".p-preloader"),s=function(){n.set(document.body.clientWidth,window.innerHeight),i.width=n.x,i.height=n.y,t.resize(n)},c=function(){window.addEventListener("blur",(function(){t.pause()})),window.addEventListener("focus",(function(){t.play()})),window.addEventListener("resize",o()(s,100))},u=function e(){t.update(),requestAnimationFrame(e)},e.next=9,t.start(i);case 9:c(),s(),a.classList.add("is-hidden"),t.play(),u();case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},68154:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},force:{type:"f",value:0}},this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.SphereGeometry(150,128,128,0,6.3,0,1.6),t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(33491).Z,fragmentShader:n(77855).Z,side:i.BackSide});this.obj=new i.Mesh(e,t),this.obj.rotation.set(o.radians(-90),0,0)}},{key:"render",value:function(e,t){this.uniforms.force.value=t,this.uniforms.time.value+=e*(1.2*t)}}])&&r(t.prototype,a),e}()},87006:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.positions=void 0,this.uniforms={time:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(){var e=new i.BufferGeometry;this.positions=new i.BufferAttribute(new Float32Array(204),3),e.setAttribute("position",this.positions);var t=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(6214).Z,fragmentShader:n(90984).Z,transparent:!0,depthWrite:!1,blending:i.AdditiveBlending});this.obj=new i.Points(e,t)}},{key:"setPositions",value:function(e,t,n){var r="user"===n.facingMode?-1:1;if(this.obj.visible=t>=.3,!1!==e){for(var i=0;i<this.positions.count;i++)this.positions.setXYZ(i,25*(e[i][0]/n.resolution.x*2-1)*r,-25*(e[i][1]/n.resolution.y*2-1),10);this.positions.needsUpdate=!0}}},{key:"render",value:function(e,t,n,r){this.uniforms.time.value+=e*(1.2*r.force.v),this.setPositions(t,n,r)}}])&&r(t.prototype,o),e}())},19309:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(2212),o=(n(17393),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},texVideo:{type:"t",value:null},facing:{type:"f",value:0},resolution:{type:"v2",value:new i.Vector2},force:{type:"f",value:0}},this.obj}var t,o;return t=e,(o=[{key:"createObj",value:function(e){var t=new i.PlaneGeometry(50,50,2,2),r=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(3943).Z,fragmentShader:n(86607).Z,transparent:!0}),o=new i.VideoTexture(e.video);o.minFilter=i.LinearFilter,o.magFilter=i.LinearFilter,o.format=i.RGBFormat,this.uniforms.texVideo.value=o,this.uniforms.facing.value="user"===e.facingMode?1:0,this.uniforms.resolution.value.set(e.resolution.x,e.resolution.y),this.obj=new i.Mesh(t,r)}},{key:"resize",value:function(e){this.uniforms.resolution.value.set(e.resolution.x,e.resolution.y)}},{key:"render",value:function(e,t){var n=.008*t+1;this.uniforms.force.value=t,this.uniforms.time.value+=e*(1.2*t),this.obj.scale.set(n,n,n)}}])&&r(t.prototype,o),e}())},47067:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},force:{type:"f",value:0}},this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){for(var e=new i.BufferGeometry,t=[],r=[],a=0;a<600;a+=3){var s=Math.random()*Math.random()*60+20,c=o.radians(360*Math.random());t[a+0]=Math.cos(c)*s,t[a+1]=Math.sin(c)*s,t[a+2]=0,r[a/3]=8*Math.random()}var u=new i.BufferAttribute(new Float32Array(t),3),l=new i.BufferAttribute(new Float32Array(r),1);e.setAttribute("position",u),e.setAttribute("delay",l);var f=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(60121).Z,fragmentShader:n(99907).Z,transparent:!0,depthWrite:!1});this.obj=new i.Points(e,f)}},{key:"render",value:function(e,t){this.uniforms.force.value=t,this.uniforms.time.value+=e*(1.2*t)}}])&&r(t.prototype,a),e}()},86711:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(2212),o=n(17393),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.uniforms={time:{type:"f",value:0},force:{type:"f",value:0}},this.obj}var t,a;return t=e,(a=[{key:"createObj",value:function(){var e=new i.InstancedBufferGeometry,t=new i.BoxGeometry(1.2,1.2,18);e.copy(t);for(var r=new i.InstancedBufferAttribute(new Float32Array(360),3),a=new i.InstancedBufferAttribute(new Float32Array(120),1),s=0;s<120;s++){var c=Math.random()*Math.random()*40+40,u=o.radians(360*Math.random());r.setXYZ(s,Math.cos(u)*c,Math.sin(u)*c,0),a.setX(s,8*Math.random())}e.setAttribute("iPosition",r),e.setAttribute("iDelay",a);var l=new i.RawShaderMaterial({uniforms:this.uniforms,vertexShader:n(15337).Z,fragmentShader:n(19326).Z,transparent:!0,depthWrite:!1});this.obj=new i.InstancedMesh(e,l,120),this.obj.frustumCulled=!1}},{key:"render",value:function(e,t){this.uniforms.force.value=t,this.uniforms.time.value+=e*(1.2*t)}}])&&r(t.prototype,a),e}()},10988:function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return s}});var o=n(2212),a=n(29130),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.video=document.createElement("video"),this.facingMode=void 0,this.resolution={x:0,y:0},this.mouth=[new o.Vector2,new o.Vector2,new o.Vector2,new o.Vector2],this.force={a:0,v:1}}var t,n,s,c;return t=e,(n=[{key:"init",value:(s=regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.mediaDevices){e.next=2;break}return e.abrupt("return");case 2:return this.facingMode="user",e.next=5,navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:this.facingMode}}).then((function(e){t.video.srcObject=e})).catch((function(e){window.alert("It wasn't allowed to use WebCam.")}));case 5:return this.video.setAttribute("playsinline",!0),this.video.setAttribute("controls",!0),this.video.play(),e.next=10,a(1e3);case 10:return this.resolution.x=this.video.width=this.video.videoWidth,this.resolution.y=this.video.height=this.video.videoHeight,e.abrupt("return");case 13:case"end":return e.stop()}}),e,this)})),c=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=s.apply(e,t);function a(e){r(o,n,i,a,c,"next",e)}function c(e){r(o,n,i,a,c,"throw",e)}a(void 0)}))},function(){return c.apply(this,arguments)})},{key:"render",value:function(e,t){var n=0;if(t>=.3&&!1!==e){this.mouth[0].set(e[47][0],e[47][1]),this.mouth[1].set(e[60][0],e[60][1]),this.mouth[2].set(e[57][0],e[57][1]),this.mouth[3].set(e[53][0],e[53][1]);var r=this.mouth[0].distanceTo(this.mouth[1]),i=this.mouth[1].distanceTo(this.mouth[2]),o=this.mouth[2].distanceTo(this.mouth[3]);n=Math.max(i/(r+o)-1,0)}var a=.01*(1-this.force.v),s=.16*-this.force.a,c=.1*n;this.force.a+=a+s+c,this.force.v=this.force.v+this.force.a}}])&&i(t.prototype,n),e}()},89643:function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,c,"next",e)}function c(e){r(a,i,o,s,c,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return d}});var o=n(2212),a=n(38314),s=n(17393),c=n(10988).Z,u=n(19309).Z,l=n(47067).Z,f=n(86711).Z,h=n(87006).Z,v=n(68154).Z;function d(){return p.apply(this,arguments)}function p(){return(p=i(regeneratorRuntime.mark((function e(){var t,n,r,d,p,m,y,g,x,b,w,M,_,S,P,T,R,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new o.Vector2,n=document.getElementById("canvas-webgl"),r=new o.WebGL1Renderer({alpha:!0,antialias:!0,canvas:n}),d=new o.Scene,p=new o.PerspectiveCamera,m=new o.Clock({autoStart:!1}),y=new c,g=new u,x=new l,b=new f,w=new h,M=new v(0),_=new clm.tracker,S=function(){var e=i(regeneratorRuntime.mark((function e(){var t,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=m.getDelta(),n=_.getCurrentPosition(),i=_.getScore(),y.render(n,i),g.render(t,y.force.v),x.render(t,y.force.v),b.render(t,y.force.v),w.render(t,n,i,y),M.render(t,y.force.v),r.render(d,p),e.abrupt("return");case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:return requestAnimationFrame(P),e.abrupt("return");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){p.aspect=t.x/t.y,p.updateProjectionMatrix(),p.setFocalLength(15*s.step(1,t.y/t.x)+35)},R=function(){var e=i(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.set(document.body.clientWidth,window.innerHeight),n.width=t.x,n.height=t.y,T(),r.setSize(t.x,t.y),e.next=7,y.init();case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){window.addEventListener("resize",a((function(){R().then((function(){g.resize(y)}))}),500))},r.setClearColor(15658734,1),p.far=1e3,p.position.set(0,0,100),p.lookAt(new o.Vector3),m.start(),E(),e.next=26,R();case 26:g.createObj(y),x.createObj(),b.createObj(),w.createObj(),M.createObj(),g.obj.renderOrder=10,x.obj.renderOrder=2,b.obj.renderOrder=1,w.obj.renderOrder=20,d.add(g.obj),d.add(x.obj),d.add(b.obj),d.add(w.obj),d.add(M.obj),_.init(pModel),_.start(y.video),P();case 43:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},63424:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return o}});var i=n(67084).Z,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.velocity=[0,0,0],this.acceleration=[0,0,0],this.anchor=[0,0,0],this.k=t&&void 0!==t.k?t.k:.3,this.d=t&&void 0!==t.d?t.d:.7,this.m=t&&void 0!==t.m?t.m:1}var t,n;return t=e,(n=[{key:"render",value:function(){i.applyHook(this.velocity,this.acceleration,this.anchor,0,this.k),i.applyDrag(this.acceleration,this.d),i.updateVelocity(this.velocity,this.acceleration,this.m)}}])&&r(t.prototype,n),e}()},95070:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return a}});var i=n(17393),o=n(5833),a=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scrollManager=n,this.hookes=r,this.elm=t,this.height=0,this.top=0,this.rangeX=i&&i.rangeX?i.rangeX:1e4,this.ratioX=i&&i.ratioX?i.ratioX:0,this.unitX=i&&i.unitX?i.unitX:"px",this.rangeY=i&&i.rangeY?i.rangeY:10,this.ratioY=i&&i.ratioY?i.ratioY:.012,this.unitY=i&&i.unitY?i.unitY:"%"}var t,n;return t=e,(n=[{key:"init",value:function(e){this.elm.style.transform="";var t=this.elm.getBoundingClientRect();this.height=t.height,this.top=e+t.top,this.elm.style.backfaceVisibility="hidden",this.render()}},{key:"render",value:function(e){var t=e?i.clamp(this.hookes.velocity[0]*this.ratioX,-1*this.rangeX,this.rangeX):0,n=e?i.clamp((this.hookes.velocity[1]-(this.top+.5*this.height))*this.ratioY,-1*this.rangeY,this.rangeY):0;this.elm.style.transform=o()?"translate(".concat(t).concat(this.unitX,", ").concat(n).concat(this.unitY,")"):"translate3D(".concat(t).concat(this.unitX,", ").concat(n).concat(this.unitY,", 0)")}}])&&r(t.prototype,n),e}()},39378:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return i}});var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elm=t,this.elmChildren=t.querySelectorAll(".js-scroll-item-child"),this.top=0,this.bottom=0}var t,n;return t=e,(n=[{key:"init",value:function(e){var t=this.elm.getBoundingClientRect();this.top=e+t.top,this.bottom=this.top+t.height}},{key:"show",value:function(e,t){if(e>this.top&&t<this.bottom){this.elm.classList.add("is-shown");for(var n=0;n<this.elmChildren.length;n++)this.elmChildren[n].classList.add("is-shown")}}}])&&r(t.prototype,n),e}()},12908:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return s}});var i=n(39378).Z,o=n(32579).Z,a=n(95070).Z,s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scrollManager=t,this.scrollItems=[],this.smoothItems=[],this.parallaxItems=[]}var t,n;return t=e,(n=[{key:"init",value:function(){var e=document.querySelectorAll(".js-scroll-item"),t=document.querySelectorAll(".js-smooth-item"),n=document.querySelectorAll(".js-parallax-item");this.scrollItems=[],this.smoothItems=[],this.parallaxItems=[];for(var r=0;r<e.length;r++)this.scrollItems[r]=new i(e[r],this.scrollManager);for(r=0;r<t.length;r++)this.smoothItems[r]=new o(t[r],this.scrollManager,this.scrollManager.hookes.smooth,t[r].dataset);for(r=0;r<n.length;r++)this.parallaxItems[r]=new a(n[r],this.scrollManager,this.scrollManager.hookes.parallax,n[r].dataset)}},{key:"scroll",value:function(){for(var e=0;e<this.scrollItems.length;e++)this.scrollItems[e].show(this.scrollManager.scrollTop+this.scrollManager.resolution.y,this.scrollManager.scrollTop)}},{key:"resize",value:function(){for(var e=0;e<this.scrollItems.length;e++)this.scrollItems[e].init(this.scrollManager.scrollTop);for(e=0;e<this.smoothItems.length;e++)this.smoothItems[e].init(this.scrollManager.scrollTop);for(e=0;e<this.parallaxItems.length;e++)this.parallaxItems[e].init(this.scrollManager.scrollTop)}},{key:"render",value:function(e){for(var t=0;t<this.smoothItems.length;t++)this.smoothItems[t].render(e);for(t=0;t<this.parallaxItems.length;t++)this.parallaxItems[t].render(e)}}])&&r(t.prototype,n),e}()},32579:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return i}});var i=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scrollManager=n,this.hookes=r,this.elm=t,this.height=0,this.top=0,this.max=i&&i.max?i.max:null,this.min=i&&i.min?i.min:null,this.ratio=i&&i.ratio?i.ratio:.1,this.unit=i&&i.unit?i.unit:"px"}var t,n;return t=e,(n=[{key:"init",value:function(e){var t=this.elm.getBoundingClientRect();this.height=t.height,this.top=e+t.top,this.elm.style.backfaceVisibility="hidden"}},{key:"render",value:function(e){var t=0;e&&(t=this.hookes.velocity[1]*this.ratio,Math.abs(this.hookes.acceleration[1])<.01&&(this.hookes.velocity[1]=this.hookes.anchor[1]),this.min&&(t=Math.max(t,this.min)),this.max&&(t=Math.min(t,this.max))),this.elm.style.transform="translate3D(0, ".concat(t).concat(this.unit,", 0)")}}])&&r(t.prototype,n),e}()},93604:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{Z:function(){return f}});var i=n(38314),o=n(4679),a=n(71243),s=n(63424).Z,c=n(12908).Z,u=document.querySelector(".js-contents"),l=document.querySelector(".js-dummy-scroll"),f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scrollItems=new c(this),this.scrollTop=0,this.scrollFrame=0,this.scrollTopPause=0,this.resolution={x:0,y:0},this.bodyResolution={x:0,y:0},this.X_SWITCH_SMOOTH=1024,this.hookes={},this.scrollPrev=null,this.scrollNext=null,this.resizeReset=null,this.resizePrev=null,this.resizeNext=null,this.renderPrev=null,this.renderNext=null,this.isWorking=!1,this.isWorkingSmooth=!1,this.isAlreadyAddEvent=!1}var t,n;return t=e,(n=[{key:"start",value:function(e){var t=this;setTimeout((function(){t.scrollTop=window.pageYOffset,t.initHookes(),t.scrollItems.init();var n=location.hash,r=n?document.querySelector(n):null;if(r){var i=r.getBoundingClientRect();t.scrollTop,i.top}t.resize((function(){t.scroll(),t.isWorkingSmooth=!0,t.renderLoop(),t.on(),e&&e()}))}),100)}},{key:"pause",value:function(){this.isWorking=!1,u.style.position="fixed",this.hookes.contents.velocity[1]=this.hookes.contents.anchor[1]=-1*this.scrollTop,this.scrollTopPause=this.scrollTop,window.scrollTo(0,this.scrollTop)}},{key:"play",value:function(){u.style.position="",this.scrollTop=this.scrollTopPause,this.resolution.x<=this.X_SWITCH_SMOOTH&&(this.hookes.contents.velocity[1]=this.hookes.contents.anchor[1]=0),window.scrollTo(0,this.scrollTop),this.isWorking=!0}},{key:"initDummyScroll",value:function(){this.resolution.x<=this.X_SWITCH_SMOOTH?(u.style.transform="",u.classList.remove("is-fixed"),l.style.height="0"):(u.classList.add("is-fixed"),l.style.height="".concat(u.clientHeight,"px")),this.render()}},{key:"initHookes",value:function(){this.hookes={contents:new s({k:.575,d:.8}),smooth:new s({k:.18,d:.75}),parallax:new s({k:.28,d:.7})}}},{key:"scrollBasis",value:function(){this.resolution.x>this.X_SWITCH_SMOOTH&&(this.hookes.contents.anchor[1]=-1*this.scrollTop,this.hookes.smooth.velocity[1]+=this.scrollFrame,this.hookes.parallax.anchor[1]=this.scrollTop+.5*this.resolution.y),this.scrollItems.scroll()}},{key:"scroll",value:function(e){if(!1!==this.isWorking){var t=window.pageYOffset;this.scrollFrame=t-this.scrollTop,this.scrollTop=t,this.scrollPrev&&this.scrollPrev(),this.scrollBasis(),this.scrollNext&&this.scrollNext()}}},{key:"tilt",value:function(e){!1!==this.isWorking&&this.resolution.x>this.X_SWITCH_SMOOTH&&(this.hookes.parallax.anchor[0]=-100*(e.clientX/this.resolution.x*2-1))}},{key:"resizeBasis",value:function(){this.scrollItems.resize()}},{key:"resize",value:function(e){if(this.isWorking=!1,this.resizeReset&&this.resizeReset(),this.scrollTop=window.pageYOffset,this.resolution.x=window.innerWidth,this.resolution.y=window.innerHeight,this.bodyResolution.x=document.body.clientWidth,this.bodyResolution.y=document.body.clientHeight,this.resolution.x>this.X_SWITCH_SMOOTH)this.hookes.contents.velocity[1]=this.hookes.contents.anchor[1]=-this.scrollTop,this.hookes.parallax.velocity[1]=this.hookes.parallax.anchor[1]=this.scrollTop+.5*this.resolution.y;else for(var t in this.hookes)switch(t){case"contents":case"parallax":this.hookes[t].anchor[1]=this.hookes[t].velocity[1]=0;break;default:this.hookes[t].velocity[1]=0}this.resizePrev&&this.resizePrev(),this.initDummyScroll(),this.render(),window.scrollTo(0,this.scrollTop),this.resizeBasis(),this.resizeNext&&this.resizeNext(),this.isWorking=!0,e&&e()}},{key:"render",value:function(){this.renderPrev&&this.renderPrev();var e=Math.floor(1e3*this.hookes.contents.velocity[1])/1e3;for(var t in u.style.transform="translate3D(0, ".concat(e,"px, 0)"),this.hookes)this.hookes[t].render();this.scrollItems.render(this.isValidSmooth()),this.renderNext&&this.renderNext()}},{key:"renderLoop",value:function(){var e=this;this.render(),this.isWorkingSmooth&&requestAnimationFrame((function(){e.renderLoop()}))}},{key:"on",value:function(){var e=this;if(!this.isAlreadyAddEvent){var t=o()||a()?"orientationchange":"resize";window.addEventListener("scroll",(function(t){e.scroll(t)}),!1),window.addEventListener("mousemove",(function(t){e.tilt(t)}),!1),window.addEventListener(t,i((function(t){e.resize()}),400),!1),this.isAlreadyAddEvent=!0}}},{key:"off",value:function(){this.scrollPrev=null,this.scrollNext=null,this.resizeReset=null,this.resizePrev=null,this.resizeNext=null,this.renderPrev=null,this.renderNext=null}},{key:"isValidSmooth",value:function(){return this.isWorkingSmooth&&this.resolution.x>this.X_SWITCH_SMOOTH}}])&&r(t.prototype,n),e}()},91685:function(e,t,n){var r;!function(){"use strict";var i=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6,a=1/6,s=(Math.sqrt(5)-1)/4,c=(5-Math.sqrt(5))/20;function u(e){var t;t="function"==typeof e?e:e?function(){var e=0,t=0,n=0,r=1,i=f();e=i(" "),t=i(" "),n=i(" ");for(var o=0;o<arguments.length;o++)(e-=i(arguments[o]))<0&&(e+=1),(t-=i(arguments[o]))<0&&(t+=1),(n-=i(arguments[o]))<0&&(n+=1);return i=null,function(){var i=2091639*e+2.3283064365386963e-10*r;return e=t,t=n,n=i-(r=0|i)}}(e):Math.random,this.p=l(t),this.perm=new Uint8Array(512),this.permMod12=new Uint8Array(512);for(var n=0;n<512;n++)this.perm[n]=this.p[255&n],this.permMod12[n]=this.perm[n]%12}function l(e){var t,n=new Uint8Array(256);for(t=0;t<256;t++)n[t]=t;for(t=0;t<255;t++){var r=t+~~(e()*(256-t)),i=n[t];n[t]=n[r],n[r]=i}return n}function f(){var e=4022871197;return function(t){t=t.toString();for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)}}u.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(e,t){var n,r,a=this.permMod12,s=this.perm,c=this.grad3,u=0,l=0,f=0,h=(e+t)*i,v=Math.floor(e+h),d=Math.floor(t+h),p=(v+d)*o,m=e-(v-p),y=t-(d-p);m>y?(n=1,r=0):(n=0,r=1);var g=m-n+o,x=y-r+o,b=m-1+2*o,w=y-1+2*o,M=255&v,_=255&d,S=.5-m*m-y*y;if(S>=0){var P=3*a[M+s[_]];u=(S*=S)*S*(c[P]*m+c[P+1]*y)}var T=.5-g*g-x*x;if(T>=0){var R=3*a[M+n+s[_+r]];l=(T*=T)*T*(c[R]*g+c[R+1]*x)}var E=.5-b*b-w*w;if(E>=0){var z=3*a[M+1+s[_+1]];f=(E*=E)*E*(c[z]*b+c[z+1]*w)}return 70*(u+l+f)},noise3D:function(e,t,n){var r,i,o,s,c,u,l,f,h,v,d=this.permMod12,p=this.perm,m=this.grad3,y=.3333333333333333*(e+t+n),g=Math.floor(e+y),x=Math.floor(t+y),b=Math.floor(n+y),w=(g+x+b)*a,M=e-(g-w),_=t-(x-w),S=n-(b-w);M>=_?_>=S?(c=1,u=0,l=0,f=1,h=1,v=0):M>=S?(c=1,u=0,l=0,f=1,h=0,v=1):(c=0,u=0,l=1,f=1,h=0,v=1):_<S?(c=0,u=0,l=1,f=0,h=1,v=1):M<S?(c=0,u=1,l=0,f=0,h=1,v=1):(c=0,u=1,l=0,f=1,h=1,v=0);var P=M-c+a,T=_-u+a,R=S-l+a,E=M-f+2*a,z=_-h+2*a,L=S-v+2*a,C=M-1+.5,A=_-1+.5,O=S-1+.5,D=255&g,I=255&x,k=255&b,F=.6-M*M-_*_-S*S;if(F<0)r=0;else{var j=3*d[D+p[I+p[k]]];r=(F*=F)*F*(m[j]*M+m[j+1]*_+m[j+2]*S)}var U=.6-P*P-T*T-R*R;if(U<0)i=0;else{var B=3*d[D+c+p[I+u+p[k+l]]];i=(U*=U)*U*(m[B]*P+m[B+1]*T+m[B+2]*R)}var G=.6-E*E-z*z-L*L;if(G<0)o=0;else{var N=3*d[D+f+p[I+h+p[k+v]]];o=(G*=G)*G*(m[N]*E+m[N+1]*z+m[N+2]*L)}var H=.6-C*C-A*A-O*O;if(H<0)s=0;else{var V=3*d[D+1+p[I+1+p[k+1]]];s=(H*=H)*H*(m[V]*C+m[V+1]*A+m[V+2]*O)}return 32*(r+i+o+s)},noise4D:function(e,t,n,r){var i,o,a,u,l,f,h,v,d,p,m,y,g,x,b,w,M,_=this.perm,S=this.grad4,P=(e+t+n+r)*s,T=Math.floor(e+P),R=Math.floor(t+P),E=Math.floor(n+P),z=Math.floor(r+P),L=(T+R+E+z)*c,C=e-(T-L),A=t-(R-L),O=n-(E-L),D=r-(z-L),I=0,k=0,F=0,j=0;C>A?I++:k++,C>O?I++:F++,C>D?I++:j++,A>O?k++:F++,A>D?k++:j++,O>D?F++:j++;var U=C-(f=I>=3?1:0)+c,B=A-(h=k>=3?1:0)+c,G=O-(v=F>=3?1:0)+c,N=D-(d=j>=3?1:0)+c,H=C-(p=I>=2?1:0)+2*c,V=A-(m=k>=2?1:0)+2*c,W=O-(y=F>=2?1:0)+2*c,Z=D-(g=j>=2?1:0)+2*c,q=C-(x=I>=1?1:0)+3*c,Y=A-(b=k>=1?1:0)+3*c,X=O-(w=F>=1?1:0)+3*c,K=D-(M=j>=1?1:0)+3*c,Q=C-1+4*c,J=A-1+4*c,$=O-1+4*c,ee=D-1+4*c,te=255&T,ne=255&R,re=255&E,ie=255&z,oe=.6-C*C-A*A-O*O-D*D;if(oe<0)i=0;else{var ae=_[te+_[ne+_[re+_[ie]]]]%32*4;i=(oe*=oe)*oe*(S[ae]*C+S[ae+1]*A+S[ae+2]*O+S[ae+3]*D)}var se=.6-U*U-B*B-G*G-N*N;if(se<0)o=0;else{var ce=_[te+f+_[ne+h+_[re+v+_[ie+d]]]]%32*4;o=(se*=se)*se*(S[ce]*U+S[ce+1]*B+S[ce+2]*G+S[ce+3]*N)}var ue=.6-H*H-V*V-W*W-Z*Z;if(ue<0)a=0;else{var le=_[te+p+_[ne+m+_[re+y+_[ie+g]]]]%32*4;a=(ue*=ue)*ue*(S[le]*H+S[le+1]*V+S[le+2]*W+S[le+3]*Z)}var fe=.6-q*q-Y*Y-X*X-K*K;if(fe<0)u=0;else{var he=_[te+x+_[ne+b+_[re+w+_[ie+M]]]]%32*4;u=(fe*=fe)*fe*(S[he]*q+S[he+1]*Y+S[he+2]*X+S[he+3]*K)}var ve=.6-Q*Q-J*J-$*$-ee*ee;if(ve<0)l=0;else{var de=_[te+1+_[ne+1+_[re+1+_[ie+1]]]]%32*4;l=(ve*=ve)*ve*(S[de]*Q+S[de+1]*J+S[de+2]*$+S[de+3]*ee)}return 27*(i+o+a+u+l)}},u._buildPermutationTable=l,void 0===(r=function(){return u}.call(t,n,t,e))||(e.exports=r),t.SimplexNoise=u,e.exports=u}()},16266:function(e,t,n){n(95767),n(68132),n(48388),n(37470),n(94882),n(41520),n(27476),n(79622),n(89375),n(43533),n(84672),n(64157),n(35095),n(49892),n(75115),n(99176),n(68838),n(96253),n(39730),n(6059),n(48377),n(71084),n(64299),n(11246),n(30726),n(1901),n(75972),n(53403),n(92516),n(49371),n(86479),n(91736),n(51889),n(65177),n(81246),n(76503),n(66786),n(50932),n(57526),n(21591),n(9073),n(80347),n(30579),n(4669),n(67710),n(45789),n(33514),n(99978),n(58472),n(86946),n(35068),n(413),n(50191),n(98306),n(64564),n(39115),n(29539),n(96620),n(62850),n(10823),n(17732),n(40856),n(80703),n(91539),n(5292),n(45177),n(73694),n(37648),n(27795),n(4531),n(23605),n(6780),n(69937),n(10511),n(81822),n(19977),n(91031),n(46331),n(41560),n(20774),n(30522),n(58295),n(87842),n(50110),n(20075),n(24336),n(19371),n(98837),n(26773),n(15745),n(33057),n(3750),n(23369),n(99564),n(32e3),n(48977),n(52310),n(94899),n(31842),n(56997),n(83946),n(18269),n(66108),n(76774),n(21466),n(59357),n(76142),n(51876),n(40851),n(88416),n(98184),n(30147),n(59192),n(30142),n(1786),n(75368),n(46964),n(62152),n(74821),n(79103),n(81303),n(83318),n(70162),n(33834),n(21572),n(82139),n(10685),n(85535),n(17347),n(83049),n(96633),n(68989),n(78270),n(64510),n(73984),n(75769),n(50055),n(96014),e.exports=n(25645)},70911:function(e,t,n){n(1268),e.exports=n(25645).Array.flatMap},10990:function(e,t,n){n(62773),e.exports=n(25645).Array.includes},15434:function(e,t,n){n(83276),e.exports=n(25645).Object.entries},78051:function(e,t,n){n(98351),e.exports=n(25645).Object.getOwnPropertyDescriptors},38250:function(e,t,n){n(96409),e.exports=n(25645).Object.values},54952:function(e,t,n){"use strict";n(40851),n(9865),e.exports=n(25645).Promise.finally},6197:function(e,t,n){n(92770),e.exports=n(25645).String.padEnd},14160:function(e,t,n){n(41784),e.exports=n(25645).String.padStart},54039:function(e,t,n){n(94325),e.exports=n(25645).String.trimRight},96728:function(e,t,n){n(65869),e.exports=n(25645).String.trimLeft},93568:function(e,t,n){n(79665),e.exports=n(28787).f("asyncIterator")},40115:function(e,t,n){n(34579),e.exports=n(11327).global},85663:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},12159:function(e,t,n){var r=n(36727);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},11327:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},19216:function(e,t,n){var r=n(85663);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},89666:function(e,t,n){e.exports=!n(7929)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},97467:function(e,t,n){var r=n(36727),i=n(33938).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},83856:function(e,t,n){var r=n(33938),i=n(11327),o=n(19216),a=n(41818),s=n(27069),c=function(e,t,n){var u,l,f,h=e&c.F,v=e&c.G,d=e&c.S,p=e&c.P,m=e&c.B,y=e&c.W,g=v?i:i[t]||(i[t]={}),x=g.prototype,b=v?r:d?r[t]:(r[t]||{}).prototype;for(u in v&&(n=t),n)(l=!h&&b&&void 0!==b[u])&&s(g,u)||(f=l?b[u]:n[u],g[u]=v&&"function"!=typeof b[u]?n[u]:m&&l?o(f,r):y&&b[u]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):p&&"function"==typeof f?o(Function.call,f):f,p&&((g.virtual||(g.virtual={}))[u]=f,e&c.R&&x&&!x[u]&&a(x,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},7929:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},33938:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},27069:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},41818:function(e,t,n){var r=n(4743),i=n(83101);e.exports=n(89666)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},33758:function(e,t,n){e.exports=!n(89666)&&!n(7929)((function(){return 7!=Object.defineProperty(n(97467)("div"),"a",{get:function(){return 7}}).a}))},36727:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},4743:function(e,t,n){var r=n(12159),i=n(33758),o=n(33206),a=Object.defineProperty;t.f=n(89666)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},83101:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},33206:function(e,t,n){var r=n(36727);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},34579:function(e,t,n){var r=n(83856);r(r.G,{global:n(33938)})},24963:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},83365:function(e,t,n){var r=n(92032);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},17722:function(e,t,n){var r=n(86314)("unscopables"),i=Array.prototype;null==i[r]&&n(87728)(i,r,{}),e.exports=function(e){i[r][e]=!0}},76793:function(e,t,n){"use strict";var r=n(24496)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},83328:function(e){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},27007:function(e,t,n){var r=n(55286);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},5216:function(e,t,n){"use strict";var r=n(20508),i=n(92337),o=n(10875);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),s=i(e,a),c=i(t,a),u=arguments.length>2?arguments[2]:void 0,l=Math.min((void 0===u?a:i(u,a))-c,a-s),f=1;for(c<s&&s<c+l&&(f=-1,c+=l-1,s+=l-1);l-- >0;)c in n?n[s]=n[c]:delete n[s],s+=f,c+=f;return n}},46852:function(e,t,n){"use strict";var r=n(20508),i=n(92337),o=n(10875);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),c=a>2?arguments[2]:void 0,u=void 0===c?n:i(c,n);u>s;)t[s++]=e;return t}},79315:function(e,t,n){var r=n(22110),i=n(10875),o=n(92337);e.exports=function(e){return function(t,n,a){var s,c=r(t),u=i(c.length),l=o(a,u);if(e&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},10050:function(e,t,n){var r=n(741),i=n(49797),o=n(20508),a=n(10875),s=n(16886);e.exports=function(e,t){var n=1==e,c=2==e,u=3==e,l=4==e,f=6==e,h=5==e||f,v=t||s;return function(t,s,d){for(var p,m,y=o(t),g=i(y),x=r(s,d,3),b=a(g.length),w=0,M=n?v(t,b):c?v(t,0):void 0;b>w;w++)if((h||w in g)&&(m=x(p=g[w],w,y),e))if(n)M[w]=m;else if(m)switch(e){case 3:return!0;case 5:return p;case 6:return w;case 2:M.push(p)}else if(l)return!1;return f?-1:u||l?l:M}}},37628:function(e,t,n){var r=n(24963),i=n(20508),o=n(49797),a=n(10875);e.exports=function(e,t,n,s,c){r(t);var u=i(e),l=o(u),f=a(u.length),h=c?f-1:0,v=c?-1:1;if(n<2)for(;;){if(h in l){s=l[h],h+=v;break}if(h+=v,c?h<0:f<=h)throw TypeError("Reduce of empty array with no initial value")}for(;c?h>=0:f>h;h+=v)h in l&&(s=t(s,l[h],h,u));return s}},42736:function(e,t,n){var r=n(55286),i=n(4302),o=n(86314)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},16886:function(e,t,n){var r=n(42736);e.exports=function(e,t){return new(r(e))(t)}},34398:function(e,t,n){"use strict";var r=n(24963),i=n(55286),o=n(97242),a=[].slice,s={},c=function(e,t,n){if(!(t in s)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";s[t]=Function("F,a","return new F("+r.join(",")+")")}return s[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=a.call(arguments,1),s=function(){var r=n.concat(a.call(arguments));return this instanceof s?c(t,r.length,r):o(t,r,e)};return i(t.prototype)&&(s.prototype=t.prototype),s}},41488:function(e,t,n){var r=n(92032),i=n(86314)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},92032:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},9824:function(e,t,n){"use strict";var r=n(99275).f,i=n(42503),o=n(24408),a=n(741),s=n(83328),c=n(3531),u=n(42923),l=n(15436),f=n(2974),h=n(67057),v=n(84728).fastKey,d=n(1616),p=h?"_s":"size",m=function(e,t){var n,r=v(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,u){var l=e((function(e,r){s(e,l,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[p]=0,null!=r&&c(r,n,e[u],e)}));return o(l.prototype,{clear:function(){for(var e=d(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[p]=0},delete:function(e){var n=d(this,t),r=m(n,e);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[p]--}return!!r},forEach:function(e){d(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(d(this,t),e)}}),h&&r(l.prototype,"size",{get:function(){return d(this,t)[p]}}),l},def:function(e,t,n){var r,i,o=m(e,t);return o?o.v=n:(e._l=o={i:i=v(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[p]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){u(e,t,(function(e,n){this._t=d(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?l(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,l(1))}),n?"entries":"values",!n,!0),f(t)}}},23657:function(e,t,n){"use strict";var r=n(24408),i=n(84728).getWeak,o=n(27007),a=n(55286),s=n(83328),c=n(3531),u=n(10050),l=n(79181),f=n(1616),h=u(5),v=u(6),d=0,p=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},y=function(e,t){return h(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=v(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var u=e((function(e,r){s(e,u,t,"_i"),e._t=t,e._i=d++,e._l=void 0,null!=r&&c(r,n,e[o],e)}));return r(u.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?p(f(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?p(f(this,t)).has(e):n&&l(n,this._i)}}),u},def:function(e,t,n){var r=i(o(t),!0);return!0===r?p(e).set(t,n):r[e._i]=n,e},ufstore:p}},45795:function(e,t,n){"use strict";var r=n(3816),i=n(42985),o=n(77234),a=n(24408),s=n(84728),c=n(3531),u=n(83328),l=n(55286),f=n(74253),h=n(7462),v=n(22943),d=n(40266);e.exports=function(e,t,n,p,m,y){var g=r[e],x=g,b=m?"set":"add",w=x&&x.prototype,M={},_=function(e){var t=w[e];o(w,e,"delete"==e||"has"==e?function(e){return!(y&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!l(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof x&&(y||w.forEach&&!f((function(){(new x).entries().next()})))){var S=new x,P=S[b](y?{}:-0,1)!=S,T=f((function(){S.has(1)})),R=h((function(e){new x(e)})),E=!y&&f((function(){for(var e=new x,t=5;t--;)e[b](t,t);return!e.has(-0)}));R||((x=t((function(t,n){u(t,x,e);var r=d(new g,t,x);return null!=n&&c(n,m,r[b],r),r}))).prototype=w,w.constructor=x),(T||E)&&(_("delete"),_("has"),m&&_("get")),(E||P)&&_(b),y&&w.clear&&delete w.clear}else x=p.getConstructor(t,e,m,b),a(x.prototype,n),s.NEED=!0;return v(x,e),M[e]=x,i(i.G+i.W+i.F*(x!=g),M),y||p.setStrong(x,e,m),x}},25645:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},92811:function(e,t,n){"use strict";var r=n(99275),i=n(90681);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},741:function(e,t,n){var r=n(24963);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},53537:function(e,t,n){"use strict";var r=n(74253),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},870:function(e,t,n){"use strict";var r=n(27007),i=n(21689),o="number";e.exports=function(e){if("string"!==e&&e!==o&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),e!=o)}},91355:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},67057:function(e,t,n){e.exports=!n(74253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},62457:function(e,t,n){var r=n(55286),i=n(3816).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},74430:function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5541:function(e,t,n){var r=n(47184),i=n(64548),o=n(14682);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),c=o.f,u=0;s.length>u;)c.call(e,a=s[u++])&&t.push(a);return t}},42985:function(e,t,n){var r=n(3816),i=n(25645),o=n(87728),a=n(77234),s=n(741),c=function(e,t,n){var u,l,f,h,v=e&c.F,d=e&c.G,p=e&c.S,m=e&c.P,y=e&c.B,g=d?r:p?r[t]||(r[t]={}):(r[t]||{}).prototype,x=d?i:i[t]||(i[t]={}),b=x.prototype||(x.prototype={});for(u in d&&(n=t),n)f=((l=!v&&g&&void 0!==g[u])?g:n)[u],h=y&&l?s(f,r):m&&"function"==typeof f?s(Function.call,f):f,g&&a(g,u,f,e&c.U),x[u]!=f&&o(x,u,h),m&&b[u]!=f&&(b[u]=f)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},8852:function(e,t,n){var r=n(86314)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},74253:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},28082:function(e,t,n){"use strict";n(18269);var r=n(77234),i=n(87728),o=n(74253),a=n(91355),s=n(86314),c=n(21165),u=s("species"),l=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var h=s(e),v=!o((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),d=v?!o((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[u]=function(){return n}),n[h](""),!t})):void 0;if(!v||!d||"replace"===e&&!l||"split"===e&&!f){var p=/./[h],m=n(a,h,""[e],(function(e,t,n,r,i){return t.exec===c?v&&!i?{done:!0,value:p.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),y=m[0],g=m[1];r(String.prototype,e,y),i(RegExp.prototype,h,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},53218:function(e,t,n){"use strict";var r=n(27007);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},13325:function(e,t,n){"use strict";var r=n(4302),i=n(55286),o=n(10875),a=n(741),s=n(86314)("isConcatSpreadable");e.exports=function e(t,n,c,u,l,f,h,v){for(var d,p,m=l,y=0,g=!!h&&a(h,v,3);y<u;){if(y in c){if(d=g?g(c[y],y,n):c[y],p=!1,i(d)&&(p=void 0!==(p=d[s])?!!p:r(d)),p&&f>0)m=e(t,n,d,o(d.length),m,f-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=d}m++}y++}return m}},3531:function(e,t,n){var r=n(741),i=n(28851),o=n(86555),a=n(27007),s=n(10875),c=n(69002),u={},l={},f=e.exports=function(e,t,n,f,h){var v,d,p,m,y=h?function(){return e}:c(e),g=r(n,f,t?2:1),x=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(v=s(e.length);v>x;x++)if((m=t?g(a(d=e[x])[0],d[1]):g(e[x]))===u||m===l)return m}else for(p=y.call(e);!(d=p.next()).done;)if((m=i(p,g,d.value,t))===u||m===l)return m};f.BREAK=u,f.RETURN=l},40018:function(e,t,n){e.exports=n(3825)("native-function-to-string",Function.toString)},3816:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},79181:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},87728:function(e,t,n){var r=n(99275),i=n(90681);e.exports=n(67057)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},40639:function(e,t,n){var r=n(3816).document;e.exports=r&&r.documentElement},1734:function(e,t,n){e.exports=!n(67057)&&!n(74253)((function(){return 7!=Object.defineProperty(n(62457)("div"),"a",{get:function(){return 7}}).a}))},40266:function(e,t,n){var r=n(55286),i=n(27375).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},97242:function(e){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},49797:function(e,t,n){var r=n(92032);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},86555:function(e,t,n){var r=n(87234),i=n(86314)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},4302:function(e,t,n){var r=n(92032);e.exports=Array.isArray||function(e){return"Array"==r(e)}},18367:function(e,t,n){var r=n(55286),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},55286:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},55364:function(e,t,n){var r=n(55286),i=n(92032),o=n(86314)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},28851:function(e,t,n){var r=n(27007);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},49988:function(e,t,n){"use strict";var r=n(42503),i=n(90681),o=n(22943),a={};n(87728)(a,n(86314)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},42923:function(e,t,n){"use strict";var r=n(4461),i=n(42985),o=n(77234),a=n(87728),s=n(87234),c=n(49988),u=n(22943),l=n(468),f=n(86314)("iterator"),h=!([].keys&&"next"in[].keys()),v="keys",d="values",p=function(){return this};e.exports=function(e,t,n,m,y,g,x){c(n,t,m);var b,w,M,_=function(e){if(!h&&e in R)return R[e];switch(e){case v:case d:return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+" Iterator",P=y==d,T=!1,R=e.prototype,E=R[f]||R["@@iterator"]||y&&R[y],z=E||_(y),L=y?P?_("entries"):z:void 0,C="Array"==t&&R.entries||E;if(C&&(M=l(C.call(new e)))!==Object.prototype&&M.next&&(u(M,S,!0),r||"function"==typeof M[f]||a(M,f,p)),P&&E&&E.name!==d&&(T=!0,z=function(){return E.call(this)}),r&&!x||!h&&!T&&R[f]||a(R,f,z),s[t]=z,s[S]=p,y)if(b={values:P?z:_(d),keys:g?z:_(v),entries:L},x)for(w in b)w in R||o(R,w,b[w]);else i(i.P+i.F*(h||T),t,b);return b}},7462:function(e,t,n){var r=n(86314)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},15436:function(e){e.exports=function(e,t){return{value:t,done:!!e}}},87234:function(e){e.exports={}},4461:function(e){e.exports=!1},13086:function(e){var t=Math.expm1;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:t},34934:function(e,t,n){var r=n(61801),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),c=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),u=r(e);return i<c?u*(i/c/a+1/o-1/o)*c*a:(n=(t=(1+a/o)*i)-(t-i))>s||n!=n?u*(1/0):u*n}},46206:function(e){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},61801:function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},84728:function(e,t,n){var r=n(93953)("meta"),i=n(55286),o=n(79181),a=n(99275).f,s=0,c=Object.isExtensible||function(){return!0},u=!n(74253)((function(){return c(Object.preventExtensions({}))})),l=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return u&&f.NEED&&c(e)&&!o(e,r)&&l(e),e}}},14351:function(e,t,n){var r=n(3816),i=n(74193).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(92032)(a);e.exports=function(){var e,t,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(u)}}else n=function(){i.call(r,u)};else{var f=!0,h=document.createTextNode("");new o(u).observe(h,{characterData:!0}),n=function(){h.data=f=!f}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},43499:function(e,t,n){"use strict";var r=n(24963);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},35345:function(e,t,n){"use strict";var r=n(67057),i=n(47184),o=n(64548),a=n(14682),s=n(20508),c=n(49797),u=Object.assign;e.exports=!u||n(74253)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=s(e),u=arguments.length,l=1,f=o.f,h=a.f;u>l;)for(var v,d=c(arguments[l++]),p=f?i(d).concat(f(d)):i(d),m=p.length,y=0;m>y;)v=p[y++],r&&!h.call(d,v)||(n[v]=d[v]);return n}:u},42503:function(e,t,n){var r=n(27007),i=n(35588),o=n(74430),a=n(69335)("IE_PROTO"),s=function(){},c=function(){var e,t=n(62457)("iframe"),r=o.length;for(t.style.display="none",n(40639).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},99275:function(e,t,n){var r=n(27007),i=n(1734),o=n(21689),a=Object.defineProperty;t.f=n(67057)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},35588:function(e,t,n){var r=n(99275),i=n(27007),o=n(47184);e.exports=n(67057)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,c=0;s>c;)r.f(e,n=a[c++],t[n]);return e}},18693:function(e,t,n){var r=n(14682),i=n(90681),o=n(22110),a=n(21689),s=n(79181),c=n(1734),u=Object.getOwnPropertyDescriptor;t.f=n(67057)?u:function(e,t){if(e=o(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},39327:function(e,t,n){var r=n(22110),i=n(20616).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},20616:function(e,t,n){var r=n(60189),i=n(74430).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},64548:function(e,t){t.f=Object.getOwnPropertySymbols},468:function(e,t,n){var r=n(79181),i=n(20508),o=n(69335)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},60189:function(e,t,n){var r=n(79181),i=n(22110),o=n(79315)(!1),a=n(69335)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~o(u,n)||u.push(n));return u}},47184:function(e,t,n){var r=n(60189),i=n(74430);e.exports=Object.keys||function(e){return r(e,i)}},14682:function(e,t){t.f={}.propertyIsEnumerable},33160:function(e,t,n){var r=n(42985),i=n(25645),o=n(74253);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},51131:function(e,t,n){var r=n(67057),i=n(47184),o=n(22110),a=n(14682).f;e.exports=function(e){return function(t){for(var n,s=o(t),c=i(s),u=c.length,l=0,f=[];u>l;)n=c[l++],r&&!a.call(s,n)||f.push(e?[n,s[n]]:s[n]);return f}}},57643:function(e,t,n){var r=n(20616),i=n(64548),o=n(27007),a=n(3816).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},47743:function(e,t,n){var r=n(3816).parseFloat,i=n(29599).trim;e.exports=1/r(n(84644)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},55960:function(e,t,n){var r=n(3816).parseInt,i=n(29599).trim,o=n(84644),a=/^[-+]?0[xX]/;e.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(e,t){var n=i(String(e),3);return r(n,t>>>0||(a.test(n)?16:10))}:r},10188:function(e){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},50094:function(e,t,n){var r=n(27007),i=n(55286),o=n(43499);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},90681:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},24408:function(e,t,n){var r=n(77234);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},77234:function(e,t,n){var r=n(3816),i=n(87728),o=n(79181),a=n(93953)("src"),s=n(40018),c="toString",u=(""+s).split(c);n(25645).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,c,(function(){return"function"==typeof this&&this[a]||s.call(this)}))},27787:function(e,t,n){"use strict";var r=n(41488),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},21165:function(e,t,n){"use strict";var r,i,o=n(53218),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,u=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),l=void 0!==/()??/.exec("")[1];(u||l)&&(c=function(e){var t,n,r,i,c=this;return l&&(n=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),u&&(t=c.lastIndex),r=a.call(c,e),u&&r&&(c.lastIndex=c.global?r.index+r[0].length:t),l&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),e.exports=c},27195:function(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},27375:function(e,t,n){var r=n(55286),i=n(27007),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(741)(Function.call,n(18693).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},2974:function(e,t,n){"use strict";var r=n(3816),i=n(99275),o=n(67057),a=n(86314)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},22943:function(e,t,n){var r=n(99275).f,i=n(79181),o=n(86314)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},69335:function(e,t,n){var r=n(3825)("keys"),i=n(93953);e.exports=function(e){return r[e]||(r[e]=i(e))}},3825:function(e,t,n){var r=n(25645),i=n(3816),o="__core-js_shared__",a=i[o]||(i[o]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},58364:function(e,t,n){var r=n(27007),i=n(24963),o=n(86314)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)}},77717:function(e,t,n){"use strict";var r=n(74253);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},24496:function(e,t,n){var r=n(81467),i=n(91355);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},42094:function(e,t,n){var r=n(55364),i=n(91355);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},29395:function(e,t,n){var r=n(42985),i=n(74253),o=n(91355),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},75442:function(e,t,n){var r=n(10875),i=n(68595),o=n(91355);e.exports=function(e,t,n,a){var s=String(o(e)),c=s.length,u=void 0===n?" ":String(n),l=r(t);if(l<=c||""==u)return s;var f=l-c,h=i.call(u,Math.ceil(f/u.length));return h.length>f&&(h=h.slice(0,f)),a?h+s:s+h}},68595:function(e,t,n){"use strict";var r=n(81467),i=n(91355);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},29599:function(e,t,n){var r=n(42985),i=n(91355),o=n(74253),a=n(84644),s="["+a+"]",c=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),l=function(e,t,n){var i={},s=o((function(){return!!a[e]()||"
"!="
"[e]()})),c=i[e]=s?t(f):a[e];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},f=l.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(u,"")),e};e.exports=l},84644:function(e){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},74193:function(e,t,n){var r,i,o,a=n(741),s=n(97242),c=n(40639),u=n(62457),l=n(3816),f=l.process,h=l.setImmediate,v=l.clearImmediate,d=l.MessageChannel,p=l.Dispatch,m=0,y={},g=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},x=function(e){g.call(e.data)};h&&v||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},v=function(e){delete y[e]},"process"==n(92032)(f)?r=function(e){f.nextTick(a(g,e,1))}:p&&p.now?r=function(e){p.now(a(g,e,1))}:d?(o=(i=new d).port2,i.port1.onmessage=x,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",x,!1)):r="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),g.call(e)}}:function(e){setTimeout(a(g,e,1),0)}),e.exports={set:h,clear:v}},92337:function(e,t,n){var r=n(81467),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},94843:function(e,t,n){var r=n(81467),i=n(10875);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},81467:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},22110:function(e,t,n){var r=n(49797),i=n(91355);e.exports=function(e){return r(i(e))}},10875:function(e,t,n){var r=n(81467),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},20508:function(e,t,n){var r=n(91355);e.exports=function(e){return Object(r(e))}},21689:function(e,t,n){var r=n(55286);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},78440:function(e,t,n){"use strict";if(n(67057)){var r=n(4461),i=n(3816),o=n(74253),a=n(42985),s=n(89383),c=n(91125),u=n(741),l=n(83328),f=n(90681),h=n(87728),v=n(24408),d=n(81467),p=n(10875),m=n(94843),y=n(92337),g=n(21689),x=n(79181),b=n(41488),w=n(55286),M=n(20508),_=n(86555),S=n(42503),P=n(468),T=n(20616).f,R=n(69002),E=n(93953),z=n(86314),L=n(10050),C=n(79315),A=n(58364),O=n(56997),D=n(87234),I=n(7462),k=n(2974),F=n(46852),j=n(5216),U=n(99275),B=n(18693),G=U.f,N=B.f,H=i.RangeError,V=i.TypeError,W=i.Uint8Array,Z="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",X=Array.prototype,K=c.ArrayBuffer,Q=c.DataView,J=L(0),$=L(2),ee=L(3),te=L(4),ne=L(5),re=L(6),ie=C(!0),oe=C(!1),ae=O.values,se=O.keys,ce=O.entries,ue=X.lastIndexOf,le=X.reduce,fe=X.reduceRight,he=X.join,ve=X.sort,de=X.slice,pe=X.toString,me=X.toLocaleString,ye=z("iterator"),ge=z("toStringTag"),xe=E("typed_constructor"),be=E("def_constructor"),we=s.CONSTR,Me=s.TYPED,_e=s.VIEW,Se="Wrong length!",Pe=L(1,(function(e,t){return Le(A(e,e[be]),t)})),Te=o((function(){return 1===new W(new Uint16Array([1]).buffer)[0]})),Re=!!W&&!!W.prototype.set&&o((function(){new W(1).set({})})),Ee=function(e,t){var n=d(e);if(n<0||n%t)throw H("Wrong offset!");return n},ze=function(e){if(w(e)&&Me in e)return e;throw V(e+" is not a typed array!")},Le=function(e,t){if(!w(e)||!(xe in e))throw V("It is not a typed array constructor!");return new e(t)},Ce=function(e,t){return Ae(A(e,e[be]),t)},Ae=function(e,t){for(var n=0,r=t.length,i=Le(e,r);r>n;)i[n]=t[n++];return i},Oe=function(e,t,n){G(e,t,{get:function(){return this._d[n]}})},De=function(e){var t,n,r,i,o,a,s=M(e),c=arguments.length,l=c>1?arguments[1]:void 0,f=void 0!==l,h=R(s);if(null!=h&&!_(h)){for(a=h.call(s),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);s=r}for(f&&c>2&&(l=u(l,arguments[2],2)),t=0,n=p(s.length),i=Le(this,n);n>t;t++)i[t]=f?l(s[t],t):s[t];return i},Ie=function(){for(var e=0,t=arguments.length,n=Le(this,t);t>e;)n[e]=arguments[e++];return n},ke=!!W&&o((function(){me.call(new W(1))})),Fe=function(){return me.apply(ke?de.call(ze(this)):ze(this),arguments)},je={copyWithin:function(e,t){return j.call(ze(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return te(ze(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return F.apply(ze(this),arguments)},filter:function(e){return Ce(this,$(ze(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ne(ze(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return re(ze(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){J(ze(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return oe(ze(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return ie(ze(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return he.apply(ze(this),arguments)},lastIndexOf:function(e){return ue.apply(ze(this),arguments)},map:function(e){return Pe(ze(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return le.apply(ze(this),arguments)},reduceRight:function(e){return fe.apply(ze(this),arguments)},reverse:function(){for(var e,t=this,n=ze(t).length,r=Math.floor(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t},some:function(e){return ee(ze(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return ve.call(ze(this),e)},subarray:function(e,t){var n=ze(this),r=n.length,i=y(e,r);return new(A(n,n[be]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,p((void 0===t?r:y(t,r))-i))}},Ue=function(e,t){return Ce(this,de.call(ze(this),e,t))},Be=function(e){ze(this);var t=Ee(arguments[1],1),n=this.length,r=M(e),i=p(r.length),o=0;if(i+t>n)throw H(Se);for(;o<i;)this[t+o]=r[o++]},Ge={entries:function(){return ce.call(ze(this))},keys:function(){return se.call(ze(this))},values:function(){return ae.call(ze(this))}},Ne=function(e,t){return w(e)&&e[Me]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},He=function(e,t){return Ne(e,t=g(t,!0))?f(2,e[t]):N(e,t)},Ve=function(e,t,n){return!(Ne(e,t=g(t,!0))&&w(n)&&x(n,"value"))||x(n,"get")||x(n,"set")||n.configurable||x(n,"writable")&&!n.writable||x(n,"enumerable")&&!n.enumerable?G(e,t,n):(e[t]=n.value,e)};we||(B.f=He,U.f=Ve),a(a.S+a.F*!we,"Object",{getOwnPropertyDescriptor:He,defineProperty:Ve}),o((function(){pe.call({})}))&&(pe=me=function(){return he.call(this)});var We=v({},je);v(We,Ge),h(We,ye,Ge.values),v(We,{slice:Ue,set:Be,constructor:function(){},toString:pe,toLocaleString:Fe}),Oe(We,"buffer","b"),Oe(We,"byteOffset","o"),Oe(We,"byteLength","l"),Oe(We,"length","e"),G(We,ge,{get:function(){return this[Me]}}),e.exports=function(e,t,n,c){var u=e+((c=!!c)?"Clamped":"")+"Array",f="get"+e,v="set"+e,d=i[u],y=d||{},g=d&&P(d),x=!d||!s.ABV,M={},_=d&&d.prototype,R=function(e,n){G(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[f](n*t+r.o,Te)}(this,n)},set:function(e){return function(e,n,r){var i=e._d;c&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[v](n*t+i.o,r,Te)}(this,n,e)},enumerable:!0})};x?(d=n((function(e,n,r,i){l(e,d,u,"_d");var o,a,s,c,f=0,v=0;if(w(n)){if(!(n instanceof K||(c=b(n))==Z||c==q))return Me in n?Ae(d,n):De.call(d,n);o=n,v=Ee(r,t);var y=n.byteLength;if(void 0===i){if(y%t)throw H(Se);if((a=y-v)<0)throw H(Se)}else if((a=p(i)*t)+v>y)throw H(Se);s=a/t}else s=m(n),o=new K(a=s*t);for(h(e,"_d",{b:o,o:v,l:a,e:s,v:new Q(o)});f<s;)R(e,f++)})),_=d.prototype=S(We),h(_,"constructor",d)):o((function(){d(1)}))&&o((function(){new d(-1)}))&&I((function(e){new d,new d(null),new d(1.5),new d(e)}),!0)||(d=n((function(e,n,r,i){var o;return l(e,d,u),w(n)?n instanceof K||(o=b(n))==Z||o==q?void 0!==i?new y(n,Ee(r,t),i):void 0!==r?new y(n,Ee(r,t)):new y(n):Me in n?Ae(d,n):De.call(d,n):new y(m(n))})),J(g!==Function.prototype?T(y).concat(T(g)):T(y),(function(e){e in d||h(d,e,y[e])})),d.prototype=_,r||(_.constructor=d));var E=_[ye],z=!!E&&("values"==E.name||null==E.name),L=Ge.values;h(d,xe,!0),h(_,Me,u),h(_,_e,!0),h(_,be,d),(c?new d(1)[ge]==u:ge in _)||G(_,ge,{get:function(){return u}}),M[u]=d,a(a.G+a.W+a.F*(d!=y),M),a(a.S,u,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*o((function(){y.of.call(d,1)})),u,{from:De,of:Ie}),Y in _||h(_,Y,t),a(a.P,u,je),k(u),a(a.P+a.F*Re,u,{set:Be}),a(a.P+a.F*!z,u,Ge),r||_.toString==pe||(_.toString=pe),a(a.P+a.F*o((function(){new d(1).slice()})),u,{slice:Ue}),a(a.P+a.F*(o((function(){return[1,2].toLocaleString()!=new d([1,2]).toLocaleString()}))||!o((function(){_.toLocaleString.call([1,2])}))),u,{toLocaleString:Fe}),D[u]=z?E:L,r||z||h(_,ye,L)}}else e.exports=function(){}},91125:function(e,t,n){"use strict";var r=n(3816),i=n(67057),o=n(4461),a=n(89383),s=n(87728),c=n(24408),u=n(74253),l=n(83328),f=n(81467),h=n(10875),v=n(94843),d=n(20616).f,p=n(99275).f,m=n(46852),y=n(22943),g="ArrayBuffer",x="DataView",b="Wrong index!",w=r.ArrayBuffer,M=r.DataView,_=r.Math,S=r.RangeError,P=r.Infinity,T=w,R=_.abs,E=_.pow,z=_.floor,L=_.log,C=_.LN2,A="buffer",O="byteLength",D="byteOffset",I=i?"_b":A,k=i?"_l":O,F=i?"_o":D;function j(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,c=(1<<s)-1,u=c>>1,l=23===t?E(2,-24)-E(2,-77):0,f=0,h=e<0||0===e&&1/e<0?1:0;for((e=R(e))!=e||e===P?(i=e!=e?1:0,r=c):(r=z(L(e)/C),e*(o=E(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?l/o:l*E(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*E(2,t),r+=u):(i=e*E(2,u-1)*E(2,t),r=0));t>=8;a[f++]=255&i,i/=256,t-=8);for(r=r<<t|i,s+=t;s>0;a[f++]=255&r,r/=256,s-=8);return a[--f]|=128*h,a}function U(e,t,n){var r,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;s>0;l=256*l+e[c],c--,s-=8);for(r=l&(1<<-s)-1,l>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===l)l=1-a;else{if(l===o)return r?NaN:u?-P:P;r+=E(2,t),l-=a}return(u?-1:1)*r*E(2,l-t)}function B(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function G(e){return[255&e]}function N(e){return[255&e,e>>8&255]}function H(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function V(e){return j(e,52,8)}function W(e){return j(e,23,4)}function Z(e,t,n){p(e.prototype,t,{get:function(){return this[n]}})}function q(e,t,n,r){var i=v(+n);if(i+t>e[k])throw S(b);var o=e[I]._b,a=i+e[F],s=o.slice(a,a+t);return r?s:s.reverse()}function Y(e,t,n,r,i,o){var a=v(+n);if(a+t>e[k])throw S(b);for(var s=e[I]._b,c=a+e[F],u=r(+i),l=0;l<t;l++)s[c+l]=u[o?l:t-l-1]}if(a.ABV){if(!u((function(){w(1)}))||!u((function(){new w(-1)}))||u((function(){return new w,new w(1.5),new w(NaN),w.name!=g}))){for(var X,K=(w=function(e){return l(this,w),new T(v(e))}).prototype=T.prototype,Q=d(T),J=0;Q.length>J;)(X=Q[J++])in w||s(w,X,T[X]);o||(K.constructor=w)}var $=new M(new w(2)),ee=M.prototype.setInt8;$.setInt8(0,2147483648),$.setInt8(1,2147483649),!$.getInt8(0)&&$.getInt8(1)||c(M.prototype,{setInt8:function(e,t){ee.call(this,e,t<<24>>24)},setUint8:function(e,t){ee.call(this,e,t<<24>>24)}},!0)}else w=function(e){l(this,w,g);var t=v(e);this._b=m.call(new Array(t),0),this[k]=t},M=function(e,t,n){l(this,M,x),l(e,w,x);var r=e[k],i=f(t);if(i<0||i>r)throw S("Wrong offset!");if(i+(n=void 0===n?r-i:h(n))>r)throw S("Wrong length!");this[I]=e,this[F]=i,this[k]=n},i&&(Z(w,O,"_l"),Z(M,A,"_b"),Z(M,O,"_l"),Z(M,D,"_o")),c(M.prototype,{getInt8:function(e){return q(this,1,e)[0]<<24>>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e){var t=q(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=q(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return B(q(this,4,e,arguments[1]))},getUint32:function(e){return B(q(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return U(q(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return U(q(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){Y(this,1,e,G,t)},setUint8:function(e,t){Y(this,1,e,G,t)},setInt16:function(e,t){Y(this,2,e,N,t,arguments[2])},setUint16:function(e,t){Y(this,2,e,N,t,arguments[2])},setInt32:function(e,t){Y(this,4,e,H,t,arguments[2])},setUint32:function(e,t){Y(this,4,e,H,t,arguments[2])},setFloat32:function(e,t){Y(this,4,e,W,t,arguments[2])},setFloat64:function(e,t){Y(this,8,e,V,t,arguments[2])}});y(w,g),y(M,x),s(M.prototype,a.VIEW,!0),t.ArrayBuffer=w,t.DataView=M},89383:function(e,t,n){for(var r,i=n(3816),o=n(87728),a=n(93953),s=a("typed_array"),c=a("view"),u=!(!i.ArrayBuffer||!i.DataView),l=u,f=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=i[h[f++]])?(o(r.prototype,s,!0),o(r.prototype,c,!0)):l=!1;e.exports={ABV:u,CONSTR:l,TYPED:s,VIEW:c}},93953:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},30575:function(e,t,n){var r=n(3816).navigator;e.exports=r&&r.userAgent||""},1616:function(e,t,n){var r=n(55286);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},36074:function(e,t,n){var r=n(3816),i=n(25645),o=n(4461),a=n(28787),s=n(99275).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},28787:function(e,t,n){t.f=n(86314)},86314:function(e,t,n){var r=n(3825)("wks"),i=n(93953),o=n(3816).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},69002:function(e,t,n){var r=n(41488),i=n(86314)("iterator"),o=n(87234);e.exports=n(25645).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},32e3:function(e,t,n){var r=n(42985);r(r.P,"Array",{copyWithin:n(5216)}),n(17722)("copyWithin")},15745:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(4);r(r.P+r.F*!n(77717)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},48977:function(e,t,n){var r=n(42985);r(r.P,"Array",{fill:n(46852)}),n(17722)("fill")},98837:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(2);r(r.P+r.F*!n(77717)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},94899:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(17722)(o)},52310:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(5),o="find",a=!0;o in[]&&Array(1).find((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(17722)(o)},24336:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(0),o=n(77717)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},30522:function(e,t,n){"use strict";var r=n(741),i=n(42985),o=n(20508),a=n(28851),s=n(86555),c=n(10875),u=n(92811),l=n(69002);i(i.S+i.F*!n(7462)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,f,h=o(e),v="function"==typeof this?this:Array,d=arguments.length,p=d>1?arguments[1]:void 0,m=void 0!==p,y=0,g=l(h);if(m&&(p=r(p,d>2?arguments[2]:void 0,2)),null==g||v==Array&&s(g))for(n=new v(t=c(h.length));t>y;y++)u(n,y,m?p(h[y],y):h[y]);else for(f=g.call(h),n=new v;!(i=f.next()).done;y++)u(n,y,m?a(f,p,[i.value,y],!0):i.value);return n.length=y,n}})},23369:function(e,t,n){"use strict";var r=n(42985),i=n(79315)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(77717)(o)),"Array",{indexOf:function(e){return a?o.apply(this,arguments)||0:i(this,e,arguments[1])}})},20774:function(e,t,n){var r=n(42985);r(r.S,"Array",{isArray:n(4302)})},56997:function(e,t,n){"use strict";var r=n(17722),i=n(15436),o=n(87234),a=n(22110);e.exports=n(42923)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},87842:function(e,t,n){"use strict";var r=n(42985),i=n(22110),o=[].join;r(r.P+r.F*(n(49797)!=Object||!n(77717)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},99564:function(e,t,n){"use strict";var r=n(42985),i=n(22110),o=n(81467),a=n(10875),s=[].lastIndexOf,c=!!s&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(c||!n(77717)(s)),"Array",{lastIndexOf:function(e){if(c)return s.apply(this,arguments)||0;var t=i(this),n=a(t.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},19371:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(1);r(r.P+r.F*!n(77717)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},58295:function(e,t,n){"use strict";var r=n(42985),i=n(92811);r(r.S+r.F*n(74253)((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},3750:function(e,t,n){"use strict";var r=n(42985),i=n(37628);r(r.P+r.F*!n(77717)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},33057:function(e,t,n){"use strict";var r=n(42985),i=n(37628);r(r.P+r.F*!n(77717)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},50110:function(e,t,n){"use strict";var r=n(42985),i=n(40639),o=n(92032),a=n(92337),s=n(10875),c=[].slice;r(r.P+r.F*n(74253)((function(){i&&c.call(i)})),"Array",{slice:function(e,t){var n=s(this.length),r=o(this);if(t=void 0===t?n:t,"Array"==r)return c.call(this,e,t);for(var i=a(e,n),u=a(t,n),l=s(u-i),f=new Array(l),h=0;h<l;h++)f[h]="String"==r?this.charAt(i+h):this[i+h];return f}})},26773:function(e,t,n){"use strict";var r=n(42985),i=n(10050)(3);r(r.P+r.F*!n(77717)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},20075:function(e,t,n){"use strict";var r=n(42985),i=n(24963),o=n(20508),a=n(74253),s=[].sort,c=[1,2,3];r(r.P+r.F*(a((function(){c.sort(void 0)}))||!a((function(){c.sort(null)}))||!n(77717)(s)),"Array",{sort:function(e){return void 0===e?s.call(o(this)):s.call(o(this),i(e))}})},31842:function(e,t,n){n(2974)("Array")},81822:function(e,t,n){var r=n(42985);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},91031:function(e,t,n){var r=n(42985),i=n(53537);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},19977:function(e,t,n){"use strict";var r=n(42985),i=n(20508),o=n(21689);r(r.P+r.F*n(74253)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),n=o(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},41560:function(e,t,n){var r=n(86314)("toPrimitive"),i=Date.prototype;r in i||n(87728)(i,r,n(870))},46331:function(e,t,n){var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(77234)(r,"toString",(function(){var e=a.call(this);return e==e?o.call(this):i}))},39730:function(e,t,n){var r=n(42985);r(r.P,"Function",{bind:n(34398)})},48377:function(e,t,n){"use strict";var r=n(55286),i=n(468),o=n(86314)("hasInstance"),a=Function.prototype;o in a||n(99275).f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},6059:function(e,t,n){var r=n(99275).f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n(67057)&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},88416:function(e,t,n){"use strict";var r=n(9824),i=n(1616),o="Map";e.exports=n(45795)(o,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(e){var t=r.getEntry(i(this,o),e);return t&&t.v},set:function(e,t){return r.def(i(this,o),0===e?0:e,t)}},r,!0)},76503:function(e,t,n){var r=n(42985),i=n(46206),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},66786:function(e,t,n){var r=n(42985),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},50932:function(e,t,n){var r=n(42985),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},57526:function(e,t,n){var r=n(42985),i=n(61801);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},21591:function(e,t,n){var r=n(42985);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},9073:function(e,t,n){var r=n(42985),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},80347:function(e,t,n){var r=n(42985),i=n(13086);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},30579:function(e,t,n){var r=n(42985);r(r.S,"Math",{fround:n(34934)})},4669:function(e,t,n){var r=n(42985),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,o=0,a=0,s=arguments.length,c=0;a<s;)c<(n=i(arguments[a++]))?(o=o*(r=c/n)*r+1,c=n):o+=n>0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(o)}})},67710:function(e,t,n){var r=n(42985),i=Math.imul;r(r.S+r.F*n(74253)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var n=65535,r=+e,i=+t,o=n&r,a=n&i;return 0|o*a+((n&r>>>16)*a+o*(n&i>>>16)<<16>>>0)}})},45789:function(e,t,n){var r=n(42985);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},33514:function(e,t,n){var r=n(42985);r(r.S,"Math",{log1p:n(46206)})},99978:function(e,t,n){var r=n(42985);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},58472:function(e,t,n){var r=n(42985);r(r.S,"Math",{sign:n(61801)})},86946:function(e,t,n){var r=n(42985),i=n(13086),o=Math.exp;r(r.S+r.F*n(74253)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},35068:function(e,t,n){var r=n(42985),i=n(13086),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},413:function(e,t,n){var r=n(42985);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},11246:function(e,t,n){"use strict";var r=n(3816),i=n(79181),o=n(92032),a=n(40266),s=n(21689),c=n(74253),u=n(20616).f,l=n(18693).f,f=n(99275).f,h=n(29599).trim,v="Number",d=r.Number,p=d,m=d.prototype,y=o(n(42503)(m))==v,g="trim"in String.prototype,x=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=g?t.trim():h(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,c=t.slice(2),u=0,l=c.length;u<l;u++)if((a=c.charCodeAt(u))<48||a>i)return NaN;return parseInt(c,r)}}return+t};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof d&&(y?c((function(){m.valueOf.call(n)})):o(n)!=v)?a(new p(x(t)),n,d):x(t)};for(var b,w=n(67057)?u(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;w.length>M;M++)i(p,b=w[M])&&!i(d,b)&&f(d,b,l(p,b));d.prototype=m,m.constructor=d,n(77234)(r,v,d)}},75972:function(e,t,n){var r=n(42985);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},53403:function(e,t,n){var r=n(42985),i=n(3816).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},92516:function(e,t,n){var r=n(42985);r(r.S,"Number",{isInteger:n(18367)})},49371:function(e,t,n){var r=n(42985);r(r.S,"Number",{isNaN:function(e){return e!=e}})},86479:function(e,t,n){var r=n(42985),i=n(18367),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},91736:function(e,t,n){var r=n(42985);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},51889:function(e,t,n){var r=n(42985);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},65177:function(e,t,n){var r=n(42985),i=n(47743);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},81246:function(e,t,n){var r=n(42985),i=n(55960);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},30726:function(e,t,n){"use strict";var r=n(42985),i=n(81467),o=n(83365),a=n(68595),s=1..toFixed,c=Math.floor,u=[0,0,0,0,0,0],l="Number.toFixed: incorrect invocation!",f="0",h=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*u[n],u[n]=r%1e7,r=c(r/1e7)},v=function(e){for(var t=6,n=0;--t>=0;)n+=u[t],u[t]=c(n/e),n=n%e*1e7},d=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==u[e]){var n=String(u[e]);t=""===t?n:t+a.call(f,7-n.length)+n}return t},p=function(e,t,n){return 0===t?n:t%2==1?p(e,t-1,n*e):p(e*e,t/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(74253)((function(){s.call({})}))),"Number",{toFixed:function(e){var t,n,r,s,c=o(this,l),u=i(e),m="",y=f;if(u<0||u>20)throw RangeError(l);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(m="-",c=-c),c>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(c*p(2,69,1))-69)<0?c*p(2,-t,1):c/p(2,t,1),n*=4503599627370496,(t=52-t)>0){for(h(0,n),r=u;r>=7;)h(1e7,0),r-=7;for(h(p(10,r,1),0),r=t-1;r>=23;)v(1<<23),r-=23;v(1<<r),h(1,1),v(2),y=d()}else h(0,n),h(1<<-t,0),y=d()+a.call(f,u);return u>0?m+((s=y.length)<=u?"0."+a.call(f,u-s)+y:y.slice(0,s-u)+"."+y.slice(s-u)):m+y}})},1901:function(e,t,n){"use strict";var r=n(42985),i=n(74253),o=n(83365),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},75115:function(e,t,n){var r=n(42985);r(r.S+r.F,"Object",{assign:n(35345)})},68132:function(e,t,n){var r=n(42985);r(r.S,"Object",{create:n(42503)})},37470:function(e,t,n){var r=n(42985);r(r.S+r.F*!n(67057),"Object",{defineProperties:n(35588)})},48388:function(e,t,n){var r=n(42985);r(r.S+r.F*!n(67057),"Object",{defineProperty:n(99275).f})},89375:function(e,t,n){var r=n(55286),i=n(84728).onFreeze;n(33160)("freeze",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},94882:function(e,t,n){var r=n(22110),i=n(18693).f;n(33160)("getOwnPropertyDescriptor",(function(){return function(e,t){return i(r(e),t)}}))},79622:function(e,t,n){n(33160)("getOwnPropertyNames",(function(){return n(39327).f}))},41520:function(e,t,n){var r=n(20508),i=n(468);n(33160)("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},49892:function(e,t,n){var r=n(55286);n(33160)("isExtensible",(function(e){return function(t){return!!r(t)&&(!e||e(t))}}))},64157:function(e,t,n){var r=n(55286);n(33160)("isFrozen",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},35095:function(e,t,n){var r=n(55286);n(33160)("isSealed",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},99176:function(e,t,n){var r=n(42985);r(r.S,"Object",{is:n(27195)})},27476:function(e,t,n){var r=n(20508),i=n(47184);n(33160)("keys",(function(){return function(e){return i(r(e))}}))},84672:function(e,t,n){var r=n(55286),i=n(84728).onFreeze;n(33160)("preventExtensions",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},43533:function(e,t,n){var r=n(55286),i=n(84728).onFreeze;n(33160)("seal",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},68838:function(e,t,n){var r=n(42985);r(r.S,"Object",{setPrototypeOf:n(27375).set})},96253:function(e,t,n){"use strict";var r=n(41488),i={};i[n(86314)("toStringTag")]="z",i+""!="[object z]"&&n(77234)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},64299:function(e,t,n){var r=n(42985),i=n(47743);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},71084:function(e,t,n){var r=n(42985),i=n(55960);r(r.G+r.F*(parseInt!=i),{parseInt:i})},40851:function(e,t,n){"use strict";var r,i,o,a,s=n(4461),c=n(3816),u=n(741),l=n(41488),f=n(42985),h=n(55286),v=n(24963),d=n(83328),p=n(3531),m=n(58364),y=n(74193).set,g=n(14351)(),x=n(43499),b=n(10188),w=n(30575),M=n(50094),_="Promise",S=c.TypeError,P=c.process,T=P&&P.versions,R=T&&T.v8||"",E=c.Promise,z="process"==l(P),L=function(){},C=i=x.f,A=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(86314)("species")]=function(e){e(L,L)};return(z||"function"==typeof PromiseRejectionEvent)&&e.then(L)instanceof t&&0!==R.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),O=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},D=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a,s=i?t.ok:t.fail,c=t.resolve,u=t.reject,l=t.domain;try{s?(i||(2==e._h&&F(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?u(S("Promise-chain cycle")):(o=O(n))?o.call(n,c,u):c(n)):u(r)}catch(e){l&&!a&&l.exit(),u(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&I(e)}))}},I=function(e){y.call(c,(function(){var t,n,r,i=e._v,o=k(e);if(o&&(t=b((function(){z?P.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=z||k(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},k=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(e){y.call(c,(function(){var t;z?P.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},j=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),D(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=O(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,u(U,r,1),u(j,r,1))}catch(e){j.call(r,e)}})):(n._v=e,n._s=1,D(n,!1))}catch(e){j.call({_w:n,_d:!1},e)}}};A||(E=function(e){d(this,E,_,"_h"),v(e),r.call(this);try{e(u(U,this,1),u(j,this,1))}catch(e){j.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(24408)(E.prototype,{then:function(e,t){var n=C(m(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=z?P.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&D(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=u(U,e,1),this.reject=u(j,e,1)},x.f=C=function(e){return e===E||e===a?new o(e):i(e)}),f(f.G+f.W+f.F*!A,{Promise:E}),n(22943)(E,_),n(2974)(_),a=n(25645).Promise,f(f.S+f.F*!A,_,{reject:function(e){var t=C(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!A),_,{resolve:function(e){return M(s&&this===a?E:this,e)}}),f(f.S+f.F*!(A&&n(7462)((function(e){E.all(e).catch(L)}))),_,{all:function(e){var t=this,n=C(t),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,a=1;p(e,!1,(function(e){var s=o++,c=!1;n.push(void 0),a++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=C(t),r=n.reject,i=b((function(){p(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},21572:function(e,t,n){var r=n(42985),i=n(24963),o=n(27007),a=(n(3816).Reflect||{}).apply,s=Function.apply;r(r.S+r.F*!n(74253)((function(){a((function(){}))})),"Reflect",{apply:function(e,t,n){var r=i(e),c=o(n);return a?a(r,t,c):s.call(r,t,c)}})},82139:function(e,t,n){var r=n(42985),i=n(42503),o=n(24963),a=n(27007),s=n(55286),c=n(74253),u=n(34398),l=(n(3816).Reflect||{}).construct,f=c((function(){function e(){}return!(l((function(){}),[],e)instanceof e)})),h=!c((function(){l((function(){}))}));r(r.S+r.F*(f||h),"Reflect",{construct:function(e,t){o(e),a(t);var n=arguments.length<3?e:o(arguments[2]);if(h&&!f)return l(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(u.apply(e,r))}var c=n.prototype,v=i(s(c)?c:Object.prototype),d=Function.apply.call(e,v,t);return s(d)?d:v}})},10685:function(e,t,n){var r=n(99275),i=n(42985),o=n(27007),a=n(21689);i(i.S+i.F*n(74253)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(e,t,n){o(e),t=a(t,!0),o(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},85535:function(e,t,n){var r=n(42985),i=n(18693).f,o=n(27007);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=i(o(e),t);return!(n&&!n.configurable)&&delete e[t]}})},17347:function(e,t,n){"use strict";var r=n(42985),i=n(27007),o=function(e){this._t=i(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(49988)(o,"Object",(function(){var e,t=this,n=t._k;do{if(t._i>=n.length)return{value:void 0,done:!0}}while(!((e=n[t._i++])in t._t));return{value:e,done:!1}})),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},96633:function(e,t,n){var r=n(18693),i=n(42985),o=n(27007);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},68989:function(e,t,n){var r=n(42985),i=n(468),o=n(27007);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},83049:function(e,t,n){var r=n(18693),i=n(468),o=n(79181),a=n(42985),s=n(55286),c=n(27007);a(a.S,"Reflect",{get:function e(t,n){var a,u,l=arguments.length<3?t:arguments[2];return c(t)===l?t[n]:(a=r.f(t,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(l):void 0:s(u=i(t))?e(u,n,l):void 0}})},78270:function(e,t,n){var r=n(42985);r(r.S,"Reflect",{has:function(e,t){return t in e}})},64510:function(e,t,n){var r=n(42985),i=n(27007),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},73984:function(e,t,n){var r=n(42985);r(r.S,"Reflect",{ownKeys:n(57643)})},75769:function(e,t,n){var r=n(42985),i=n(27007),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},96014:function(e,t,n){var r=n(42985),i=n(27375);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},50055:function(e,t,n){var r=n(99275),i=n(18693),o=n(468),a=n(79181),s=n(42985),c=n(90681),u=n(27007),l=n(55286);s(s.S,"Reflect",{set:function e(t,n,s){var f,h,v=arguments.length<4?t:arguments[3],d=i.f(u(t),n);if(!d){if(l(h=o(t)))return e(h,n,s,v);d=c(0)}if(a(d,"value")){if(!1===d.writable||!l(v))return!1;if(f=i.f(v,n)){if(f.get||f.set||!1===f.writable)return!1;f.value=s,r.f(v,n,f)}else r.f(v,n,c(0,s));return!0}return void 0!==d.set&&(d.set.call(v,s),!0)}})},83946:function(e,t,n){var r=n(3816),i=n(40266),o=n(99275).f,a=n(20616).f,s=n(55364),c=n(53218),u=r.RegExp,l=u,f=u.prototype,h=/a/g,v=/a/g,d=new u(h)!==h;if(n(67057)&&(!d||n(74253)((function(){return v[n(86314)("match")]=!1,u(h)!=h||u(v)==v||"/a/i"!=u(h,"i")})))){u=function(e,t){var n=this instanceof u,r=s(e),o=void 0===t;return!n&&r&&e.constructor===u&&o?e:i(d?new l(r&&!o?e.source:e,t):l((r=e instanceof u)?e.source:e,r&&o?c.call(e):t),n?this:f,u)};for(var p=function(e){e in u||o(u,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},m=a(l),y=0;m.length>y;)p(m[y++]);f.constructor=u,u.prototype=f,n(77234)(r,"RegExp",u)}n(2974)("RegExp")},18269:function(e,t,n){"use strict";var r=n(21165);n(42985)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},76774:function(e,t,n){n(67057)&&"g"!=/./g.flags&&n(99275).f(RegExp.prototype,"flags",{configurable:!0,get:n(53218)})},21466:function(e,t,n){"use strict";var r=n(27007),i=n(10875),o=n(76793),a=n(27787);n(28082)("match",1,(function(e,t,n,s){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var c=r(e),u=String(this);if(!c.global)return a(c,u);var l=c.unicode;c.lastIndex=0;for(var f,h=[],v=0;null!==(f=a(c,u));){var d=String(f[0]);h[v]=d,""===d&&(c.lastIndex=o(u,i(c.lastIndex),l)),v++}return 0===v?null:h}]}))},59357:function(e,t,n){"use strict";var r=n(27007),i=n(20508),o=n(10875),a=n(81467),s=n(76793),c=n(27787),u=Math.max,l=Math.min,f=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,v=/\$([$&`']|\d\d?)/g;n(28082)("replace",2,(function(e,t,n,d){return[function(r,i){var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(e,t){var i=d(n,e,this,t);if(i.done)return i.value;var f=r(e),h=String(this),v="function"==typeof t;v||(t=String(t));var m=f.global;if(m){var y=f.unicode;f.lastIndex=0}for(var g=[];;){var x=c(f,h);if(null===x)break;if(g.push(x),!m)break;""===String(x[0])&&(f.lastIndex=s(h,o(f.lastIndex),y))}for(var b,w="",M=0,_=0;_<g.length;_++){x=g[_];for(var S=String(x[0]),P=u(l(a(x.index),h.length),0),T=[],R=1;R<x.length;R++)T.push(void 0===(b=x[R])?b:String(b));var E=x.groups;if(v){var z=[S].concat(T,P,h);void 0!==E&&z.push(E);var L=String(t.apply(void 0,z))}else L=p(S,h,P,T,E,t);P>=M&&(w+=h.slice(M,P)+L,M=P+S.length)}return w+h.slice(M)}];function p(e,t,r,o,a,s){var c=r+e.length,u=o.length,l=v;return void 0!==a&&(a=i(a),l=h),n.call(s,l,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(c);case"<":s=a[i.slice(1,-1)];break;default:var l=+i;if(0===l)return n;if(l>u){var h=f(l/10);return 0===h?n:h<=u?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):n}s=o[l-1]}return void 0===s?"":s}))}}))},76142:function(e,t,n){"use strict";var r=n(27007),i=n(27195),o=n(27787);n(28082)("search",1,(function(e,t,n,a){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var s=r(e),c=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var l=o(s,c);return i(s.lastIndex,u)||(s.lastIndex=u),null===l?-1:l.index}]}))},51876:function(e,t,n){"use strict";var r=n(55364),i=n(27007),o=n(58364),a=n(76793),s=n(10875),c=n(27787),u=n(21165),l=n(74253),f=Math.min,h=[].push,v=4294967295,d=!l((function(){RegExp(v,"y")}));n(28082)("split",2,(function(e,t,n,l){var p;return p="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var o,a,s,c=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,d=void 0===t?v:t>>>0,p=new RegExp(e.source,l+"g");(o=u.call(p,i))&&!((a=p.lastIndex)>f&&(c.push(i.slice(f,o.index)),o.length>1&&o.index<i.length&&h.apply(c,o.slice(1)),s=o[0].length,f=a,c.length>=d));)p.lastIndex===o.index&&p.lastIndex++;return f===i.length?!s&&p.test("")||c.push(""):c.push(i.slice(f)),c.length>d?c.slice(0,d):c}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,i,r):p.call(String(i),n,r)},function(e,t){var r=l(p,e,this,t,p!==n);if(r.done)return r.value;var u=i(e),h=String(this),m=o(u,RegExp),y=u.unicode,g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(d?"y":"g"),x=new m(d?u:"^(?:"+u.source+")",g),b=void 0===t?v:t>>>0;if(0===b)return[];if(0===h.length)return null===c(x,h)?[h]:[];for(var w=0,M=0,_=[];M<h.length;){x.lastIndex=d?M:0;var S,P=c(x,d?h:h.slice(M));if(null===P||(S=f(s(x.lastIndex+(d?0:M)),h.length))===w)M=a(h,M,y);else{if(_.push(h.slice(w,M)),_.length===b)return _;for(var T=1;T<=P.length-1;T++)if(_.push(P[T]),_.length===b)return _;M=w=S}}return _.push(h.slice(w)),_}]}))},66108:function(e,t,n){"use strict";n(76774);var r=n(27007),i=n(53218),o=n(67057),a="toString",s=/./.toString,c=function(e){n(77234)(RegExp.prototype,a,e,!0)};n(74253)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?c((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):s.name!=a&&c((function(){return s.call(this)}))},98184:function(e,t,n){"use strict";var r=n(9824),i=n(1616);e.exports=n(45795)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},40856:function(e,t,n){"use strict";n(29395)("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},80703:function(e,t,n){"use strict";n(29395)("big",(function(e){return function(){return e(this,"big","","")}}))},91539:function(e,t,n){"use strict";n(29395)("blink",(function(e){return function(){return e(this,"blink","","")}}))},5292:function(e,t,n){"use strict";n(29395)("bold",(function(e){return function(){return e(this,"b","","")}}))},29539:function(e,t,n){"use strict";var r=n(42985),i=n(24496)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},96620:function(e,t,n){"use strict";var r=n(42985),i=n(10875),o=n(42094),a="endsWith",s="".endsWith;r(r.P+r.F*n(8852)(a),"String",{endsWith:function(e){var t=o(this,e,a),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),c=void 0===n?r:Math.min(i(n),r),u=String(e);return s?s.call(t,u,c):t.slice(c-u.length,c)===u}})},45177:function(e,t,n){"use strict";n(29395)("fixed",(function(e){return function(){return e(this,"tt","","")}}))},73694:function(e,t,n){"use strict";n(29395)("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},37648:function(e,t,n){"use strict";n(29395)("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},50191:function(e,t,n){var r=n(42985),i=n(92337),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},62850:function(e,t,n){"use strict";var r=n(42985),i=n(42094),o="includes";r(r.P+r.F*n(8852)(o),"String",{includes:function(e){return!!~i(this,e,o).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},27795:function(e,t,n){"use strict";n(29395)("italics",(function(e){return function(){return e(this,"i","","")}}))},39115:function(e,t,n){"use strict";var r=n(24496)(!0);n(42923)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},4531:function(e,t,n){"use strict";n(29395)("link",(function(e){return function(t){return e(this,"a","href",t)}}))},98306:function(e,t,n){var r=n(42985),i=n(22110),o=n(10875);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},10823:function(e,t,n){var r=n(42985);r(r.P,"String",{repeat:n(68595)})},23605:function(e,t,n){"use strict";n(29395)("small",(function(e){return function(){return e(this,"small","","")}}))},17732:function(e,t,n){"use strict";var r=n(42985),i=n(10875),o=n(42094),a="startsWith",s="".startsWith;r(r.P+r.F*n(8852)(a),"String",{startsWith:function(e){var t=o(this,e,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return s?s.call(t,r,n):t.slice(n,n+r.length)===r}})},6780:function(e,t,n){"use strict";n(29395)("strike",(function(e){return function(){return e(this,"strike","","")}}))},69937:function(e,t,n){"use strict";n(29395)("sub",(function(e){return function(){return e(this,"sub","","")}}))},10511:function(e,t,n){"use strict";n(29395)("sup",(function(e){return function(){return e(this,"sup","","")}}))},64564:function(e,t,n){"use strict";n(29599)("trim",(function(e){return function(){return e(this,3)}}))},95767:function(e,t,n){"use strict";var r=n(3816),i=n(79181),o=n(67057),a=n(42985),s=n(77234),c=n(84728).KEY,u=n(74253),l=n(3825),f=n(22943),h=n(93953),v=n(86314),d=n(28787),p=n(36074),m=n(5541),y=n(4302),g=n(27007),x=n(55286),b=n(20508),w=n(22110),M=n(21689),_=n(90681),S=n(42503),P=n(39327),T=n(18693),R=n(64548),E=n(99275),z=n(47184),L=T.f,C=E.f,A=P.f,O=r.Symbol,D=r.JSON,I=D&&D.stringify,k=v("_hidden"),F=v("toPrimitive"),j={}.propertyIsEnumerable,U=l("symbol-registry"),B=l("symbols"),G=l("op-symbols"),N=Object.prototype,H="function"==typeof O&&!!R.f,V=r.QObject,W=!V||!V.prototype||!V.prototype.findChild,Z=o&&u((function(){return 7!=S(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=L(N,t);r&&delete N[t],C(e,t,n),r&&e!==N&&C(N,t,r)}:C,q=function(e){var t=B[e]=S(O.prototype);return t._k=e,t},Y=H&&"symbol"==typeof O.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof O},X=function(e,t,n){return e===N&&X(G,t,n),g(e),t=M(t,!0),g(n),i(B,t)?(n.enumerable?(i(e,k)&&e[k][t]&&(e[k][t]=!1),n=S(n,{enumerable:_(0,!1)})):(i(e,k)||C(e,k,_(1,{})),e[k][t]=!0),Z(e,t,n)):C(e,t,n)},K=function(e,t){g(e);for(var n,r=m(t=w(t)),i=0,o=r.length;o>i;)X(e,n=r[i++],t[n]);return e},Q=function(e){var t=j.call(this,e=M(e,!0));return!(this===N&&i(B,e)&&!i(G,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,k)&&this[k][e])||t)},J=function(e,t){if(e=w(e),t=M(t,!0),e!==N||!i(B,t)||i(G,t)){var n=L(e,t);return!n||!i(B,t)||i(e,k)&&e[k][t]||(n.enumerable=!0),n}},$=function(e){for(var t,n=A(w(e)),r=[],o=0;n.length>o;)i(B,t=n[o++])||t==k||t==c||r.push(t);return r},ee=function(e){for(var t,n=e===N,r=A(n?G:w(e)),o=[],a=0;r.length>a;)!i(B,t=r[a++])||n&&!i(N,t)||o.push(B[t]);return o};H||(s((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(n){this===N&&t.call(G,n),i(this,k)&&i(this[k],e)&&(this[k][e]=!1),Z(this,e,_(1,n))};return o&&W&&Z(N,e,{configurable:!0,set:t}),q(e)}).prototype,"toString",(function(){return this._k})),T.f=J,E.f=X,n(20616).f=P.f=$,n(14682).f=Q,R.f=ee,o&&!n(4461)&&s(N,"propertyIsEnumerable",Q,!0),d.f=function(e){return q(v(e))}),a(a.G+a.W+a.F*!H,{Symbol:O});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)v(te[ne++]);for(var re=z(v.store),ie=0;re.length>ie;)p(re[ie++]);a(a.S+a.F*!H,"Symbol",{for:function(e){return i(U,e+="")?U[e]:U[e]=O(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!H,"Object",{create:function(e,t){return void 0===t?S(e):K(S(e),t)},defineProperty:X,defineProperties:K,getOwnPropertyDescriptor:J,getOwnPropertyNames:$,getOwnPropertySymbols:ee});var oe=u((function(){R.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return R.f(b(e))}}),D&&a(a.S+a.F*(!H||u((function(){var e=O();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(x(t)||void 0!==e)&&!Y(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,I.apply(D,r)}}),O.prototype[F]||n(87728)(O.prototype,F,O.prototype.valueOf),f(O,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},30142:function(e,t,n){"use strict";var r=n(42985),i=n(89383),o=n(91125),a=n(27007),s=n(92337),c=n(10875),u=n(55286),l=n(3816).ArrayBuffer,f=n(58364),h=o.ArrayBuffer,v=o.DataView,d=i.ABV&&l.isView,p=h.prototype.slice,m=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(l!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,y,{isView:function(e){return d&&d(e)||u(e)&&m in e}}),r(r.P+r.U+r.F*n(74253)((function(){return!new h(2).slice(1,void 0).byteLength})),y,{slice:function(e,t){if(void 0!==p&&void 0===t)return p.call(a(this),e);for(var n=a(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),o=new(f(this,h))(c(i-r)),u=new v(this),l=new v(o),d=0;r<i;)l.setUint8(d++,u.getUint8(r++));return o}}),n(2974)(y)},1786:function(e,t,n){var r=n(42985);r(r.G+r.W+r.F*!n(89383).ABV,{DataView:n(91125).DataView})},70162:function(e,t,n){n(78440)("Float32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},33834:function(e,t,n){n(78440)("Float64",8,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},74821:function(e,t,n){n(78440)("Int16",2,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},81303:function(e,t,n){n(78440)("Int32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},75368:function(e,t,n){n(78440)("Int8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},79103:function(e,t,n){n(78440)("Uint16",2,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},83318:function(e,t,n){n(78440)("Uint32",4,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},46964:function(e,t,n){n(78440)("Uint8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}))},62152:function(e,t,n){n(78440)("Uint8",1,(function(e){return function(t,n,r){return e(this,t,n,r)}}),!0)},30147:function(e,t,n){"use strict";var r,i=n(3816),o=n(10050)(0),a=n(77234),s=n(84728),c=n(35345),u=n(23657),l=n(55286),f=n(1616),h=n(1616),v=!i.ActiveXObject&&"ActiveXObject"in i,d="WeakMap",p=s.getWeak,m=Object.isExtensible,y=u.ufstore,g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},x={get:function(e){if(l(e)){var t=p(e);return!0===t?y(f(this,d)).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(f(this,d),e,t)}},b=e.exports=n(45795)(d,g,x,u,!0,!0);h&&v&&(c((r=u.getConstructor(g,d)).prototype,x),s.NEED=!0,o(["delete","has","get","set"],(function(e){var t=b.prototype,n=t[e];a(t,e,(function(t,i){if(l(t)&&!m(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)}))})))},59192:function(e,t,n){"use strict";var r=n(23657),i=n(1616),o="WeakSet";n(45795)(o,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,o),e,!0)}},r,!1,!0)},1268:function(e,t,n){"use strict";var r=n(42985),i=n(13325),o=n(20508),a=n(10875),s=n(24963),c=n(16886);r(r.P,"Array",{flatMap:function(e){var t,n,r=o(this);return s(e),t=a(r.length),n=c(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(17722)("flatMap")},62773:function(e,t,n){"use strict";var r=n(42985),i=n(79315)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(17722)("includes")},83276:function(e,t,n){var r=n(42985),i=n(51131)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},98351:function(e,t,n){var r=n(42985),i=n(57643),o=n(22110),a=n(18693),s=n(92811);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),c=a.f,u=i(r),l={},f=0;u.length>f;)void 0!==(n=c(r,t=u[f++]))&&s(l,t,n);return l}})},96409:function(e,t,n){var r=n(42985),i=n(51131)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},9865:function(e,t,n){"use strict";var r=n(42985),i=n(25645),o=n(3816),a=n(58364),s=n(50094);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},92770:function(e,t,n){"use strict";var r=n(42985),i=n(75442),o=n(30575),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},41784:function(e,t,n){"use strict";var r=n(42985),i=n(75442),o=n(30575),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},65869:function(e,t,n){"use strict";n(29599)("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},94325:function(e,t,n){"use strict";n(29599)("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},79665:function(e,t,n){n(36074)("asyncIterator")},91181:function(e,t,n){for(var r=n(56997),i=n(47184),o=n(77234),a=n(3816),s=n(87728),c=n(87234),u=n(86314),l=u("iterator"),f=u("toStringTag"),h=c.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(v),p=0;p<d.length;p++){var m,y=d[p],g=v[y],x=a[y],b=x&&x.prototype;if(b&&(b[l]||s(b,l,h),b[f]||s(b,f,y),c[y]=h,g))for(m in r)b[m]||o(b,m,r[m],!0)}},84633:function(e,t,n){var r=n(42985),i=n(74193);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},32564:function(e,t,n){var r=n(3816),i=n(42985),o=n(30575),a=[].slice,s=/MSIE .\./.test(o),c=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},96337:function(e,t,n){n(32564),n(84633),n(91181),e.exports=n(25645)},31430:function(e,t,n){var r,i;void 0===(i="function"==typeof(r={easeInQuad:function(e){return Math.pow(e,2)},easeOutQuad:function(e){return-(Math.pow(e-1,2)-1)},easeInOutQuad:function(e){return(e/=.5)<1?.5*Math.pow(e,2):-.5*((e-=2)*e-2)},easeInCubic:function(e){return Math.pow(e,3)},easeOutCubic:function(e){return Math.pow(e-1,3)+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*Math.pow(e,3):.5*(Math.pow(e-2,3)+2)},easeInQuart:function(e){return Math.pow(e,4)},easeOutQuart:function(e){return-(Math.pow(e-1,4)-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*Math.pow(e,4):-.5*((e-=2)*Math.pow(e,3)-2)},easeInQuint:function(e){return Math.pow(e,5)},easeOutQuint:function(e){return Math.pow(e-1,5)+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2)},easeInSine:function(e){return 1-Math.cos(e*(Math.PI/2))},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-Math.pow(e-1,2))},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},elastic:function(e){return-1*Math.pow(4,-8*e)*Math.sin((6*e-1)*(2*Math.PI)/2)+1},swingFromTo:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},swingFrom:function(e){var t=1.70158;return e*e*((t+1)*e-t)},swingTo:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},bounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bouncePast:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?2-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?2-(7.5625*(e-=2.25/2.75)*e+.9375):2-(7.5625*(e-=2.625/2.75)*e+.984375)},easeFromTo:function(e){return(e/=.5)<1?.5*Math.pow(e,4):-.5*((e-=2)*Math.pow(e,3)-2)},easeFrom:function(e){return Math.pow(e,4)},easeTo:function(e){return Math.pow(e,.25)}})?r.call(t,n,t,e):r)||(e.exports=i)},90887:function(e,t,n){"use strict";n.r(t),n.d(t,{glMatrix:function(){return r},mat2:function(){return i},mat2d:function(){return o},mat3:function(){return a},mat4:function(){return s},quat:function(){return l},quat2:function(){return f},vec2:function(){return h},vec3:function(){return c},vec4:function(){return u}});var r={};n.r(r),n.d(r,{ARRAY_TYPE:function(){return d},EPSILON:function(){return v},RANDOM:function(){return p},equals:function(){return x},setMatrixArrayType:function(){return m},toRadian:function(){return g}});var i={};n.r(i),n.d(i,{LDU:function(){return F},add:function(){return j},adjoint:function(){return E},clone:function(){return w},copy:function(){return M},create:function(){return b},determinant:function(){return z},equals:function(){return G},exactEquals:function(){return B},frob:function(){return k},fromRotation:function(){return O},fromScaling:function(){return D},fromValues:function(){return S},identity:function(){return _},invert:function(){return R},mul:function(){return V},multiply:function(){return L},multiplyScalar:function(){return N},multiplyScalarAndAdd:function(){return H},rotate:function(){return C},scale:function(){return A},set:function(){return P},str:function(){return I},sub:function(){return W},subtract:function(){return U},transpose:function(){return T}});var o={};n.r(o),n.d(o,{add:function(){return ue},clone:function(){return q},copy:function(){return Y},create:function(){return Z},determinant:function(){return $},equals:function(){return de},exactEquals:function(){return ve},frob:function(){return ce},fromRotation:function(){return ie},fromScaling:function(){return oe},fromTranslation:function(){return ae},fromValues:function(){return K},identity:function(){return X},invert:function(){return J},mul:function(){return pe},multiply:function(){return ee},multiplyScalar:function(){return fe},multiplyScalarAndAdd:function(){return he},rotate:function(){return te},scale:function(){return ne},set:function(){return Q},str:function(){return se},sub:function(){return me},subtract:function(){return le},translate:function(){return re}});var a={};n.r(a),n.d(a,{add:function(){return Ge},adjoint:function(){return Te},clone:function(){return xe},copy:function(){return be},create:function(){return ye},determinant:function(){return Re},equals:function(){return Ze},exactEquals:function(){return We},frob:function(){return Be},fromMat2d:function(){return Ie},fromMat4:function(){return ge},fromQuat:function(){return ke},fromRotation:function(){return Oe},fromScaling:function(){return De},fromTranslation:function(){return Ae},fromValues:function(){return we},identity:function(){return _e},invert:function(){return Pe},mul:function(){return qe},multiply:function(){return Ee},multiplyScalar:function(){return He},multiplyScalarAndAdd:function(){return Ve},normalFromMat4:function(){return Fe},projection:function(){return je},rotate:function(){return Le},scale:function(){return Ce},set:function(){return Me},str:function(){return Ue},sub:function(){return Ye},subtract:function(){return Ne},translate:function(){return ze},transpose:function(){return Se}});var s={};n.r(s),n.d(s,{add:function(){return Dt},adjoint:function(){return rt},clone:function(){return Ke},copy:function(){return Qe},create:function(){return Xe},determinant:function(){return it},equals:function(){return Ut},exactEquals:function(){return jt},frob:function(){return Ot},fromQuat:function(){return Pt},fromQuat2:function(){return xt},fromRotation:function(){return dt},fromRotationTranslation:function(){return gt},fromRotationTranslationScale:function(){return _t},fromRotationTranslationScaleOrigin:function(){return St},fromScaling:function(){return vt},fromTranslation:function(){return ht},fromValues:function(){return Je},fromXRotation:function(){return pt},fromYRotation:function(){return mt},fromZRotation:function(){return yt},frustum:function(){return Tt},getRotation:function(){return Mt},getScaling:function(){return wt},getTranslation:function(){return bt},identity:function(){return et},invert:function(){return nt},lookAt:function(){return Lt},mul:function(){return Bt},multiply:function(){return ot},multiplyScalar:function(){return kt},multiplyScalarAndAdd:function(){return Ft},ortho:function(){return zt},perspective:function(){return Rt},perspectiveFromFieldOfView:function(){return Et},rotate:function(){return ct},rotateX:function(){return ut},rotateY:function(){return lt},rotateZ:function(){return ft},scale:function(){return st},set:function(){return $e},str:function(){return At},sub:function(){return Gt},subtract:function(){return It},targetTo:function(){return Ct},translate:function(){return at},transpose:function(){return tt}});var c={};n.r(c),n.d(c,{add:function(){return Yt},angle:function(){return Sn},bezier:function(){return mn},ceil:function(){return Jt},clone:function(){return Ht},copy:function(){return Zt},create:function(){return Nt},cross:function(){return vn},dist:function(){return On},distance:function(){return an},div:function(){return An},divide:function(){return Qt},dot:function(){return hn},equals:function(){return En},exactEquals:function(){return Rn},floor:function(){return $t},forEach:function(){return Fn},fromValues:function(){return Wt},hermite:function(){return pn},inverse:function(){return ln},len:function(){return In},length:function(){return Vt},lerp:function(){return dn},max:function(){return tn},min:function(){return en},mul:function(){return Cn},multiply:function(){return Kt},negate:function(){return un},normalize:function(){return fn},random:function(){return yn},rotateX:function(){return wn},rotateY:function(){return Mn},rotateZ:function(){return _n},round:function(){return nn},scale:function(){return rn},scaleAndAdd:function(){return on},set:function(){return qt},sqrDist:function(){return Dn},sqrLen:function(){return kn},squaredDistance:function(){return sn},squaredLength:function(){return cn},str:function(){return Tn},sub:function(){return Ln},subtract:function(){return Xt},transformMat3:function(){return xn},transformMat4:function(){return gn},transformQuat:function(){return bn},zero:function(){return Pn}});var u={};n.r(u),n.d(u,{add:function(){return Hn},ceil:function(){return qn},clone:function(){return Un},copy:function(){return Gn},create:function(){return jn},cross:function(){return cr},dist:function(){return br},distance:function(){return er},div:function(){return xr},divide:function(){return Zn},dot:function(){return sr},equals:function(){return mr},exactEquals:function(){return pr},floor:function(){return Yn},forEach:function(){return Sr},fromValues:function(){return Bn},inverse:function(){return or},len:function(){return Mr},length:function(){return nr},lerp:function(){return ur},max:function(){return Kn},min:function(){return Xn},mul:function(){return gr},multiply:function(){return Wn},negate:function(){return ir},normalize:function(){return ar},random:function(){return lr},round:function(){return Qn},scale:function(){return Jn},scaleAndAdd:function(){return $n},set:function(){return Nn},sqrDist:function(){return wr},sqrLen:function(){return _r},squaredDistance:function(){return tr},squaredLength:function(){return rr},str:function(){return dr},sub:function(){return yr},subtract:function(){return Vn},transformMat4:function(){return fr},transformQuat:function(){return hr},zero:function(){return vr}});var l={};n.r(l),n.d(l,{add:function(){return ti},calculateW:function(){return Dr},clone:function(){return Qr},conjugate:function(){return Gr},copy:function(){return $r},create:function(){return Pr},dot:function(){return ii},equals:function(){return hi},exactEquals:function(){return fi},exp:function(){return Ir},fromEuler:function(){return Hr},fromMat3:function(){return Nr},fromValues:function(){return Jr},getAngle:function(){return zr},getAxisAngle:function(){return Er},identity:function(){return Tr},invert:function(){return Br},len:function(){return si},length:function(){return ai},lerp:function(){return oi},ln:function(){return kr},mul:function(){return ni},multiply:function(){return Lr},normalize:function(){return li},pow:function(){return Fr},random:function(){return Ur},rotateX:function(){return Cr},rotateY:function(){return Ar},rotateZ:function(){return Or},rotationTo:function(){return vi},scale:function(){return ri},set:function(){return ei},setAxes:function(){return pi},setAxisAngle:function(){return Rr},slerp:function(){return jr},sqlerp:function(){return di},sqrLen:function(){return ui},squaredLength:function(){return ci},str:function(){return Vr}});var f={};n.r(f),n.d(f,{add:function(){return Ui},clone:function(){return yi},conjugate:function(){return Zi},copy:function(){return Si},create:function(){return mi},dot:function(){return Hi},equals:function(){return eo},exactEquals:function(){return $i},fromMat4:function(){return _i},fromRotation:function(){return Mi},fromRotationTranslation:function(){return bi},fromRotationTranslationValues:function(){return xi},fromTranslation:function(){return wi},fromValues:function(){return gi},getDual:function(){return Ei},getReal:function(){return Ri},getTranslation:function(){return Ci},identity:function(){return Pi},invert:function(){return Wi},len:function(){return Yi},length:function(){return qi},lerp:function(){return Vi},mul:function(){return Gi},multiply:function(){return Bi},normalize:function(){return Qi},rotateAroundAxis:function(){return ji},rotateByQuatAppend:function(){return ki},rotateByQuatPrepend:function(){return Fi},rotateX:function(){return Oi},rotateY:function(){return Di},rotateZ:function(){return Ii},scale:function(){return Ni},set:function(){return Ti},setDual:function(){return Li},setReal:function(){return zi},sqrLen:function(){return Ki},squaredLength:function(){return Xi},str:function(){return Ji},translate:function(){return Ai}});var h={};n.r(h),n.d(h,{add:function(){return ao},angle:function(){return Do},ceil:function(){return lo},clone:function(){return no},copy:function(){return io},create:function(){return to},cross:function(){return To},dist:function(){return Ho},distance:function(){return go},div:function(){return No},divide:function(){return uo},dot:function(){return Po},equals:function(){return jo},exactEquals:function(){return Fo},floor:function(){return fo},forEach:function(){return Zo},fromValues:function(){return ro},inverse:function(){return _o},len:function(){return Uo},length:function(){return bo},lerp:function(){return Ro},max:function(){return vo},min:function(){return ho},mul:function(){return Go},multiply:function(){return co},negate:function(){return Mo},normalize:function(){return So},random:function(){return Eo},rotate:function(){return Oo},round:function(){return po},scale:function(){return mo},scaleAndAdd:function(){return yo},set:function(){return oo},sqrDist:function(){return Vo},sqrLen:function(){return Wo},squaredDistance:function(){return xo},squaredLength:function(){return wo},str:function(){return ko},sub:function(){return Bo},subtract:function(){return so},transformMat2:function(){return zo},transformMat2d:function(){return Lo},transformMat3:function(){return Co},transformMat4:function(){return Ao},zero:function(){return Io}});var v=1e-6,d="undefined"!=typeof Float32Array?Float32Array:Array,p=Math.random;function m(e){d=e}var y=Math.PI/180;function g(e){return e*y}function x(e,t){return Math.abs(e-t)<=v*Math.max(1,Math.abs(e),Math.abs(t))}function b(){var e=new d(4);return d!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function w(e){var t=new d(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function M(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function S(e,t,n,r){var i=new d(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function P(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function T(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function R(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(a=1/a,e[0]=o*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null}function E(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e}function z(e){return e[0]*e[3]-e[2]*e[1]}function L(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],c=n[1],u=n[2],l=n[3];return e[0]=r*s+o*c,e[1]=i*s+a*c,e[2]=r*u+o*l,e[3]=i*u+a*l,e}function C(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*s,e[1]=i*c+a*s,e[2]=r*-s+o*c,e[3]=i*-s+a*c,e}function A(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],c=n[1];return e[0]=r*s,e[1]=i*s,e[2]=o*c,e[3]=a*c,e}function O(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=-n,e[3]=r,e}function D(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function I(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function k(e){return Math.hypot(e[0],e[1],e[2],e[3])}function F(e,t,n,r){return e[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-e[2]*n[1],[e,t,n]}function j(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function U(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function B(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function G(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=t[0],s=t[1],c=t[2],u=t[3];return Math.abs(n-a)<=v*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=v*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=v*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-u)<=v*Math.max(1,Math.abs(o),Math.abs(u))}function N(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function H(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var V=L,W=U;function Z(){var e=new d(6);return d!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e}function q(e){var t=new d(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function X(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function K(e,t,n,r,i,o){var a=new d(6);return a[0]=e,a[1]=t,a[2]=n,a[3]=r,a[4]=i,a[5]=o,a}function Q(e,t,n,r,i,o,a){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e}function J(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=n*o-r*i;return c?(c=1/c,e[0]=o*c,e[1]=-r*c,e[2]=-i*c,e[3]=n*c,e[4]=(i*s-o*a)*c,e[5]=(r*a-n*s)*c,e):null}function $(e){return e[0]*e[3]-e[1]*e[2]}function ee(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=n[0],l=n[1],f=n[2],h=n[3],v=n[4],d=n[5];return e[0]=r*u+o*l,e[1]=i*u+a*l,e[2]=r*f+o*h,e[3]=i*f+a*h,e[4]=r*v+o*d+s,e[5]=i*v+a*d+c,e}function te(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*u,e[1]=i*l+a*u,e[2]=r*-u+o*l,e[3]=i*-u+a*l,e[4]=s,e[5]=c,e}function ne(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=n[0],l=n[1];return e[0]=r*u,e[1]=i*u,e[2]=o*l,e[3]=a*l,e[4]=s,e[5]=c,e}function re(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=n[0],l=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=r*u+o*l+s,e[5]=i*u+a*l+c,e}function ie(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=-n,e[3]=r,e[4]=0,e[5]=0,e}function oe(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function ae(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function se(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function ce(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)}function ue(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e}function le(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e}function fe(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e}function he(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e}function ve(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function de(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=t[0],u=t[1],l=t[2],f=t[3],h=t[4],d=t[5];return Math.abs(n-c)<=v*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-u)<=v*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-l)<=v*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-f)<=v*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-h)<=v*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(s-d)<=v*Math.max(1,Math.abs(s),Math.abs(d))}var pe=ee,me=le;function ye(){var e=new d(9);return d!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ge(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function xe(e){var t=new d(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function be(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function we(e,t,n,r,i,o,a,s,c){var u=new d(9);return u[0]=e,u[1]=t,u[2]=n,u[3]=r,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u[8]=c,u}function Me(e,t,n,r,i,o,a,s,c,u){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=c,e[8]=u,e}function _e(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Se(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Pe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=t[8],f=l*a-s*u,h=-l*o+s*c,v=u*o-a*c,d=n*f+r*h+i*v;return d?(d=1/d,e[0]=f*d,e[1]=(-l*r+i*u)*d,e[2]=(s*r-i*a)*d,e[3]=h*d,e[4]=(l*n-i*c)*d,e[5]=(-s*n+i*o)*d,e[6]=v*d,e[7]=(-u*n+r*c)*d,e[8]=(a*n-r*o)*d,e):null}function Te(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=t[8];return e[0]=a*l-s*u,e[1]=i*u-r*l,e[2]=r*s-i*a,e[3]=s*c-o*l,e[4]=n*l-i*c,e[5]=i*o-n*s,e[6]=o*u-a*c,e[7]=r*c-n*u,e[8]=n*a-r*o,e}function Re(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8];return t*(u*o-a*c)+n*(-u*i+a*s)+r*(c*i-o*s)}function Ee(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8],h=n[0],v=n[1],d=n[2],p=n[3],m=n[4],y=n[5],g=n[6],x=n[7],b=n[8];return e[0]=h*r+v*a+d*u,e[1]=h*i+v*s+d*l,e[2]=h*o+v*c+d*f,e[3]=p*r+m*a+y*u,e[4]=p*i+m*s+y*l,e[5]=p*o+m*c+y*f,e[6]=g*r+x*a+b*u,e[7]=g*i+x*s+b*l,e[8]=g*o+x*c+b*f,e}function ze(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8],h=n[0],v=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=c,e[6]=h*r+v*a+u,e[7]=h*i+v*s+l,e[8]=h*o+v*c+f,e}function Le(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8],h=Math.sin(n),v=Math.cos(n);return e[0]=v*r+h*a,e[1]=v*i+h*s,e[2]=v*o+h*c,e[3]=v*a-h*r,e[4]=v*s-h*i,e[5]=v*c-h*o,e[6]=u,e[7]=l,e[8]=f,e}function Ce(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Ae(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Oe(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function De(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Ie(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function ke(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,c=i+i,u=n*a,l=r*a,f=r*s,h=i*a,v=i*s,d=i*c,p=o*a,m=o*s,y=o*c;return e[0]=1-f-d,e[3]=l-y,e[6]=h+m,e[1]=l+y,e[4]=1-u-d,e[7]=v-p,e[2]=h-m,e[5]=v+p,e[8]=1-u-f,e}function Fe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=t[8],f=t[9],h=t[10],v=t[11],d=t[12],p=t[13],m=t[14],y=t[15],g=n*s-r*a,x=n*c-i*a,b=n*u-o*a,w=r*c-i*s,M=r*u-o*s,_=i*u-o*c,S=l*p-f*d,P=l*m-h*d,T=l*y-v*d,R=f*m-h*p,E=f*y-v*p,z=h*y-v*m,L=g*z-x*E+b*R+w*T-M*P+_*S;return L?(L=1/L,e[0]=(s*z-c*E+u*R)*L,e[1]=(c*T-a*z-u*P)*L,e[2]=(a*E-s*T+u*S)*L,e[3]=(i*E-r*z-o*R)*L,e[4]=(n*z-i*T+o*P)*L,e[5]=(r*T-n*E-o*S)*L,e[6]=(p*_-m*M+y*w)*L,e[7]=(m*b-d*_-y*x)*L,e[8]=(d*M-p*b+y*g)*L,e):null}function je(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Ue(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Be(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Ge(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e}function Ne(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}function He(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e}function Ve(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e}function We(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function Ze(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=e[8],f=t[0],h=t[1],d=t[2],p=t[3],m=t[4],y=t[5],g=t[6],x=t[7],b=t[8];return Math.abs(n-f)<=v*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-h)<=v*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=v*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=v*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=v*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-y)<=v*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(c-g)<=v*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-x)<=v*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(l-b)<=v*Math.max(1,Math.abs(l),Math.abs(b))}var qe=Ee,Ye=Ne;function Xe(){var e=new d(16);return d!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Ke(e){var t=new d(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Qe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Je(e,t,n,r,i,o,a,s,c,u,l,f,h,v,p,m){var y=new d(16);return y[0]=e,y[1]=t,y[2]=n,y[3]=r,y[4]=i,y[5]=o,y[6]=a,y[7]=s,y[8]=c,y[9]=u,y[10]=l,y[11]=f,y[12]=h,y[13]=v,y[14]=p,y[15]=m,y}function $e(e,t,n,r,i,o,a,s,c,u,l,f,h,v,d,p,m){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=c,e[8]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=v,e[13]=d,e[14]=p,e[15]=m,e}function et(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function tt(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function nt(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=t[8],f=t[9],h=t[10],v=t[11],d=t[12],p=t[13],m=t[14],y=t[15],g=n*s-r*a,x=n*c-i*a,b=n*u-o*a,w=r*c-i*s,M=r*u-o*s,_=i*u-o*c,S=l*p-f*d,P=l*m-h*d,T=l*y-v*d,R=f*m-h*p,E=f*y-v*p,z=h*y-v*m,L=g*z-x*E+b*R+w*T-M*P+_*S;return L?(L=1/L,e[0]=(s*z-c*E+u*R)*L,e[1]=(i*E-r*z-o*R)*L,e[2]=(p*_-m*M+y*w)*L,e[3]=(h*M-f*_-v*w)*L,e[4]=(c*T-a*z-u*P)*L,e[5]=(n*z-i*T+o*P)*L,e[6]=(m*b-d*_-y*x)*L,e[7]=(l*_-h*b+v*x)*L,e[8]=(a*E-s*T+u*S)*L,e[9]=(r*T-n*E-o*S)*L,e[10]=(d*M-p*b+y*g)*L,e[11]=(f*b-l*M-v*g)*L,e[12]=(s*P-a*R-c*S)*L,e[13]=(n*R-r*P+i*S)*L,e[14]=(p*x-d*w-m*g)*L,e[15]=(l*w-f*x+h*g)*L,e):null}function rt(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=t[8],f=t[9],h=t[10],v=t[11],d=t[12],p=t[13],m=t[14],y=t[15];return e[0]=s*(h*y-v*m)-f*(c*y-u*m)+p*(c*v-u*h),e[1]=-(r*(h*y-v*m)-f*(i*y-o*m)+p*(i*v-o*h)),e[2]=r*(c*y-u*m)-s*(i*y-o*m)+p*(i*u-o*c),e[3]=-(r*(c*v-u*h)-s*(i*v-o*h)+f*(i*u-o*c)),e[4]=-(a*(h*y-v*m)-l*(c*y-u*m)+d*(c*v-u*h)),e[5]=n*(h*y-v*m)-l*(i*y-o*m)+d*(i*v-o*h),e[6]=-(n*(c*y-u*m)-a*(i*y-o*m)+d*(i*u-o*c)),e[7]=n*(c*v-u*h)-a*(i*v-o*h)+l*(i*u-o*c),e[8]=a*(f*y-v*p)-l*(s*y-u*p)+d*(s*v-u*f),e[9]=-(n*(f*y-v*p)-l*(r*y-o*p)+d*(r*v-o*f)),e[10]=n*(s*y-u*p)-a*(r*y-o*p)+d*(r*u-o*s),e[11]=-(n*(s*v-u*f)-a*(r*v-o*f)+l*(r*u-o*s)),e[12]=-(a*(f*m-h*p)-l*(s*m-c*p)+d*(s*h-c*f)),e[13]=n*(f*m-h*p)-l*(r*m-i*p)+d*(r*h-i*f),e[14]=-(n*(s*m-c*p)-a*(r*m-i*p)+d*(r*c-i*s)),e[15]=n*(s*h-c*f)-a*(r*h-i*f)+l*(r*c-i*s),e}function it(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8],l=e[9],f=e[10],h=e[11],v=e[12],d=e[13],p=e[14],m=e[15];return(t*a-n*o)*(f*m-h*p)-(t*s-r*o)*(l*m-h*d)+(t*c-i*o)*(l*p-f*d)+(n*s-r*a)*(u*m-h*v)-(n*c-i*a)*(u*p-f*v)+(r*c-i*s)*(u*d-l*v)}function ot(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8],h=t[9],v=t[10],d=t[11],p=t[12],m=t[13],y=t[14],g=t[15],x=n[0],b=n[1],w=n[2],M=n[3];return e[0]=x*r+b*s+w*f+M*p,e[1]=x*i+b*c+w*h+M*m,e[2]=x*o+b*u+w*v+M*y,e[3]=x*a+b*l+w*d+M*g,x=n[4],b=n[5],w=n[6],M=n[7],e[4]=x*r+b*s+w*f+M*p,e[5]=x*i+b*c+w*h+M*m,e[6]=x*o+b*u+w*v+M*y,e[7]=x*a+b*l+w*d+M*g,x=n[8],b=n[9],w=n[10],M=n[11],e[8]=x*r+b*s+w*f+M*p,e[9]=x*i+b*c+w*h+M*m,e[10]=x*o+b*u+w*v+M*y,e[11]=x*a+b*l+w*d+M*g,x=n[12],b=n[13],w=n[14],M=n[15],e[12]=x*r+b*s+w*f+M*p,e[13]=x*i+b*c+w*h+M*m,e[14]=x*o+b*u+w*v+M*y,e[15]=x*a+b*l+w*d+M*g,e}function at(e,t,n){var r,i,o,a,s,c,u,l,f,h,v,d,p=n[0],m=n[1],y=n[2];return t===e?(e[12]=t[0]*p+t[4]*m+t[8]*y+t[12],e[13]=t[1]*p+t[5]*m+t[9]*y+t[13],e[14]=t[2]*p+t[6]*m+t[10]*y+t[14],e[15]=t[3]*p+t[7]*m+t[11]*y+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8],h=t[9],v=t[10],d=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=c,e[6]=u,e[7]=l,e[8]=f,e[9]=h,e[10]=v,e[11]=d,e[12]=r*p+s*m+f*y+t[12],e[13]=i*p+c*m+h*y+t[13],e[14]=o*p+u*m+v*y+t[14],e[15]=a*p+l*m+d*y+t[15]),e}function st(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ct(e,t,n,r){var i,o,a,s,c,u,l,f,h,d,p,m,y,g,x,b,w,M,_,S,P,T,R,E,z=r[0],L=r[1],C=r[2],A=Math.hypot(z,L,C);return A<v?null:(z*=A=1/A,L*=A,C*=A,i=Math.sin(n),a=1-(o=Math.cos(n)),s=t[0],c=t[1],u=t[2],l=t[3],f=t[4],h=t[5],d=t[6],p=t[7],m=t[8],y=t[9],g=t[10],x=t[11],b=z*z*a+o,w=L*z*a+C*i,M=C*z*a-L*i,_=z*L*a-C*i,S=L*L*a+o,P=C*L*a+z*i,T=z*C*a+L*i,R=L*C*a-z*i,E=C*C*a+o,e[0]=s*b+f*w+m*M,e[1]=c*b+h*w+y*M,e[2]=u*b+d*w+g*M,e[3]=l*b+p*w+x*M,e[4]=s*_+f*S+m*P,e[5]=c*_+h*S+y*P,e[6]=u*_+d*S+g*P,e[7]=l*_+p*S+x*P,e[8]=s*T+f*R+m*E,e[9]=c*T+h*R+y*E,e[10]=u*T+d*R+g*E,e[11]=l*T+p*R+x*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ut(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],c=t[7],u=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+u*r,e[5]=a*i+l*r,e[6]=s*i+f*r,e[7]=c*i+h*r,e[8]=u*i-o*r,e[9]=l*i-a*r,e[10]=f*i-s*r,e[11]=h*i-c*r,e}function lt(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],c=t[3],u=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-u*r,e[1]=a*i-l*r,e[2]=s*i-f*r,e[3]=c*i-h*r,e[8]=o*r+u*i,e[9]=a*r+l*i,e[10]=s*r+f*i,e[11]=c*r+h*i,e}function ft(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],c=t[3],u=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+u*r,e[1]=a*i+l*r,e[2]=s*i+f*r,e[3]=c*i+h*r,e[4]=u*i-o*r,e[5]=l*i-a*r,e[6]=f*i-s*r,e[7]=h*i-c*r,e}function ht(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function vt(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dt(e,t,n){var r,i,o,a=n[0],s=n[1],c=n[2],u=Math.hypot(a,s,c);return u<v?null:(a*=u=1/u,s*=u,c*=u,r=Math.sin(t),o=1-(i=Math.cos(t)),e[0]=a*a*o+i,e[1]=s*a*o+c*r,e[2]=c*a*o-s*r,e[3]=0,e[4]=a*s*o-c*r,e[5]=s*s*o+i,e[6]=c*s*o+a*r,e[7]=0,e[8]=a*c*o+s*r,e[9]=s*c*o-a*r,e[10]=c*c*o+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function pt(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function mt(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function yt(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function gt(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,c=i+i,u=o+o,l=r*s,f=r*c,h=r*u,v=i*c,d=i*u,p=o*u,m=a*s,y=a*c,g=a*u;return e[0]=1-(v+p),e[1]=f+g,e[2]=h-y,e[3]=0,e[4]=f-g,e[5]=1-(l+p),e[6]=d+m,e[7]=0,e[8]=h+y,e[9]=d-m,e[10]=1-(l+v),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function xt(e,t){var n=new d(3),r=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+l*r+c*o-u*i)/f,n[1]=2*(c*a+l*i+u*r-s*o)/f,n[2]=2*(u*a+l*o+s*i-c*r)/f):(n[0]=2*(s*a+l*r+c*o-u*i),n[1]=2*(c*a+l*i+u*r-s*o),n[2]=2*(u*a+l*o+s*i-c*r)),gt(e,t,n),e}function bt(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function wt(e,t){var n=t[0],r=t[1],i=t[2],o=t[4],a=t[5],s=t[6],c=t[8],u=t[9],l=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(o,a,s),e[2]=Math.hypot(c,u,l),e}function Mt(e,t){var n=new d(3);wt(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,s=t[1]*i,c=t[2]*o,u=t[4]*r,l=t[5]*i,f=t[6]*o,h=t[8]*r,v=t[9]*i,p=t[10]*o,m=a+l+p,y=0;return m>0?(y=2*Math.sqrt(m+1),e[3]=.25*y,e[0]=(f-v)/y,e[1]=(h-c)/y,e[2]=(s-u)/y):a>l&&a>p?(y=2*Math.sqrt(1+a-l-p),e[3]=(f-v)/y,e[0]=.25*y,e[1]=(s+u)/y,e[2]=(h+c)/y):l>p?(y=2*Math.sqrt(1+l-a-p),e[3]=(h-c)/y,e[0]=(s+u)/y,e[1]=.25*y,e[2]=(f+v)/y):(y=2*Math.sqrt(1+p-a-l),e[3]=(s-u)/y,e[0]=(h+c)/y,e[1]=(f+v)/y,e[2]=.25*y),e}function _t(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3],c=i+i,u=o+o,l=a+a,f=i*c,h=i*u,v=i*l,d=o*u,p=o*l,m=a*l,y=s*c,g=s*u,x=s*l,b=r[0],w=r[1],M=r[2];return e[0]=(1-(d+m))*b,e[1]=(h+x)*b,e[2]=(v-g)*b,e[3]=0,e[4]=(h-x)*w,e[5]=(1-(f+m))*w,e[6]=(p+y)*w,e[7]=0,e[8]=(v+g)*M,e[9]=(p-y)*M,e[10]=(1-(f+d))*M,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function St(e,t,n,r,i){var o=t[0],a=t[1],s=t[2],c=t[3],u=o+o,l=a+a,f=s+s,h=o*u,v=o*l,d=o*f,p=a*l,m=a*f,y=s*f,g=c*u,x=c*l,b=c*f,w=r[0],M=r[1],_=r[2],S=i[0],P=i[1],T=i[2],R=(1-(p+y))*w,E=(v+b)*w,z=(d-x)*w,L=(v-b)*M,C=(1-(h+y))*M,A=(m+g)*M,O=(d+x)*_,D=(m-g)*_,I=(1-(h+p))*_;return e[0]=R,e[1]=E,e[2]=z,e[3]=0,e[4]=L,e[5]=C,e[6]=A,e[7]=0,e[8]=O,e[9]=D,e[10]=I,e[11]=0,e[12]=n[0]+S-(R*S+L*P+O*T),e[13]=n[1]+P-(E*S+C*P+D*T),e[14]=n[2]+T-(z*S+A*P+I*T),e[15]=1,e}function Pt(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,c=i+i,u=n*a,l=r*a,f=r*s,h=i*a,v=i*s,d=i*c,p=o*a,m=o*s,y=o*c;return e[0]=1-f-d,e[1]=l+y,e[2]=h-m,e[3]=0,e[4]=l-y,e[5]=1-u-d,e[6]=v+p,e[7]=0,e[8]=h+m,e[9]=v-p,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Tt(e,t,n,r,i,o,a){var s=1/(n-t),c=1/(i-r),u=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*c,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*c,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e}function Rt(e,t,n,r,i){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(o=1/(r-i),e[10]=(i+r)*o,e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e}function Et(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),c=2/(a+s),u=2/(i+o);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(a-s)*c*.5,e[9]=(i-o)*u*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function zt(e,t,n,r,i,o,a){var s=1/(t-n),c=1/(r-i),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(a+o)*u,e[15]=1,e}function Lt(e,t,n,r){var i,o,a,s,c,u,l,f,h,d,p=t[0],m=t[1],y=t[2],g=r[0],x=r[1],b=r[2],w=n[0],M=n[1],_=n[2];return Math.abs(p-w)<v&&Math.abs(m-M)<v&&Math.abs(y-_)<v?et(e):(l=p-w,f=m-M,h=y-_,i=x*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),o=b*(l*=d)-g*h,a=g*f-x*l,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-l*a,u=l*o-f*i,(d=Math.hypot(s,c,u))?(s*=d=1/d,c*=d,u*=d):(s=0,c=0,u=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=o,e[5]=c,e[6]=f,e[7]=0,e[8]=a,e[9]=u,e[10]=h,e[11]=0,e[12]=-(i*p+o*m+a*y),e[13]=-(s*p+c*m+u*y),e[14]=-(l*p+f*m+h*y),e[15]=1,e)}function Ct(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=r[0],c=r[1],u=r[2],l=i-n[0],f=o-n[1],h=a-n[2],v=l*l+f*f+h*h;v>0&&(l*=v=1/Math.sqrt(v),f*=v,h*=v);var d=c*h-u*f,p=u*l-s*h,m=s*f-c*l;return(v=d*d+p*p+m*m)>0&&(d*=v=1/Math.sqrt(v),p*=v,m*=v),e[0]=d,e[1]=p,e[2]=m,e[3]=0,e[4]=f*m-h*p,e[5]=h*d-l*m,e[6]=l*p-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=h,e[11]=0,e[12]=i,e[13]=o,e[14]=a,e[15]=1,e}function At(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Ot(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Dt(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function It(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function kt(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function Ft(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function jt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Ut(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],y=e[14],g=e[15],x=t[0],b=t[1],w=t[2],M=t[3],_=t[4],S=t[5],P=t[6],T=t[7],R=t[8],E=t[9],z=t[10],L=t[11],C=t[12],A=t[13],O=t[14],D=t[15];return Math.abs(n-x)<=v*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(r-b)<=v*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-w)<=v*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-M)<=v*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(a-_)<=v*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(s-S)<=v*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(c-P)<=v*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(u-T)<=v*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(l-R)<=v*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(f-E)<=v*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-z)<=v*Math.max(1,Math.abs(h),Math.abs(z))&&Math.abs(d-L)<=v*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-C)<=v*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(m-A)<=v*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(y-O)<=v*Math.max(1,Math.abs(y),Math.abs(O))&&Math.abs(g-D)<=v*Math.max(1,Math.abs(g),Math.abs(D))}var Bt=ot,Gt=It;function Nt(){var e=new d(3);return d!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Ht(e){var t=new d(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Vt(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Wt(e,t,n){var r=new d(3);return r[0]=e,r[1]=t,r[2]=n,r}function Zt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function qt(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function Yt(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Xt(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Kt(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Qt(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function Jt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function $t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function en(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function tn(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function nn(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function rn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function on(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function an(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function sn(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}function cn(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r}function un(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function ln(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function fn(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function hn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function vn(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],c=n[2];return e[0]=i*c-o*s,e[1]=o*a-r*c,e[2]=r*s-i*a,e}function dn(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e}function pn(e,t,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,c=a*(o-2)+o,u=a*(o-1),l=a*(3-2*o);return e[0]=t[0]*s+n[0]*c+r[0]*u+i[0]*l,e[1]=t[1]*s+n[1]*c+r[1]*u+i[1]*l,e[2]=t[2]*s+n[2]*c+r[2]*u+i[2]*l,e}function mn(e,t,n,r,i,o){var a=1-o,s=a*a,c=o*o,u=s*a,l=3*o*s,f=3*c*a,h=c*o;return e[0]=t[0]*u+n[0]*l+r[0]*f+i[0]*h,e[1]=t[1]*u+n[1]*l+r[1]*f+i[1]*h,e[2]=t[2]*u+n[2]*l+r[2]*f+i[2]*h,e}function yn(e,t){t=t||1;var n=2*p()*Math.PI,r=2*p()-1,i=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(n)*i,e[1]=Math.sin(n)*i,e[2]=r*t,e}function gn(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}function xn(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e}function bn(e,t,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=t[0],c=t[1],u=t[2],l=i*u-o*c,f=o*s-r*u,h=r*c-i*s,v=i*h-o*f,d=o*l-r*h,p=r*f-i*l,m=2*a;return l*=m,f*=m,h*=m,v*=2,d*=2,p*=2,e[0]=s+l+v,e[1]=c+f+d,e[2]=u+h+p,e}function wn(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function Mn(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function _n(e,t,n,r){var i=[],o=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function Sn(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2],c=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),u=c&&hn(e,t)/c;return Math.acos(Math.min(Math.max(u,-1),1))}function Pn(e){return e[0]=0,e[1]=0,e[2]=0,e}function Tn(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function Rn(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function En(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(n-o)<=v*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=v*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=v*Math.max(1,Math.abs(i),Math.abs(s))}var zn,Ln=Xt,Cn=Kt,An=Qt,On=an,Dn=sn,In=Vt,kn=cn,Fn=(zn=Nt(),function(e,t,n,r,i,o){var a,s;for(t||(t=3),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a<s;a+=t)zn[0]=e[a],zn[1]=e[a+1],zn[2]=e[a+2],i(zn,zn,o),e[a]=zn[0],e[a+1]=zn[1],e[a+2]=zn[2];return e});function jn(){var e=new d(4);return d!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Un(e){var t=new d(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Bn(e,t,n,r){var i=new d(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function Gn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Nn(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Hn(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function Vn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e}function Wn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function Zn(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e}function qn(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function Yn(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function Xn(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e}function Kn(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e}function Qn(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function Jn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function $n(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e}function er(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return Math.hypot(n,r,i,o)}function tr(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return n*n+r*r+i*i+o*o}function nr(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.hypot(t,n,r,i)}function rr(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}function ir(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function or(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function ar(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e}function sr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function cr(e,t,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],c=n[1]*r[3]-n[3]*r[1],u=n[2]*r[3]-n[3]*r[2],l=t[0],f=t[1],h=t[2],v=t[3];return e[0]=f*u-h*c+v*s,e[1]=-l*u+h*a-v*o,e[2]=l*c-f*a+v*i,e[3]=-l*s+f*o-h*i,e}function ur(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e[3]=s+r*(n[3]-s),e}function lr(e,t){var n,r,i,o,a,s;t=t||1;do{a=(n=2*p()-1)*n+(r=2*p()-1)*r}while(a>=1);do{s=(i=2*p()-1)*i+(o=2*p()-1)*o}while(s>=1);var c=Math.sqrt((1-a)/s);return e[0]=t*n,e[1]=t*r,e[2]=t*i*c,e[3]=t*o*c,e}function fr(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}function hr(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],c=n[2],u=n[3],l=u*r+s*o-c*i,f=u*i+c*r-a*o,h=u*o+a*i-s*r,v=-a*r-s*i-c*o;return e[0]=l*u+v*-a+f*-c-h*-s,e[1]=f*u+v*-s+h*-a-l*-c,e[2]=h*u+v*-c+l*-s-f*-a,e[3]=t[3],e}function vr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function dr(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function pr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function mr(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=t[0],s=t[1],c=t[2],u=t[3];return Math.abs(n-a)<=v*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=v*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=v*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-u)<=v*Math.max(1,Math.abs(o),Math.abs(u))}var yr=Vn,gr=Wn,xr=Zn,br=er,wr=tr,Mr=nr,_r=rr,Sr=function(){var e=jn();return function(t,n,r,i,o,a){var s,c;for(n||(n=4),r||(r=0),c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();function Pr(){var e=new d(4);return d!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Tr(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Rr(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function Er(e,t){var n=2*Math.acos(t[3]),r=Math.sin(n/2);return r>v?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),n}function zr(e,t){var n=ii(e,t);return Math.acos(2*n*n-1)}function Lr(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],c=n[1],u=n[2],l=n[3];return e[0]=r*l+a*s+i*u-o*c,e[1]=i*l+a*c+o*s-r*u,e[2]=o*l+a*u+r*c-i*s,e[3]=a*l-r*s-i*c-o*u,e}function Cr(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+a*s,e[1]=i*c+o*s,e[2]=o*c-i*s,e[3]=a*c-r*s,e}function Ar(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c-o*s,e[1]=i*c+a*s,e[2]=o*c+r*s,e[3]=a*c-i*s,e}function Or(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+i*s,e[1]=i*c-r*s,e[2]=o*c+a*s,e[3]=a*c-o*s,e}function Dr(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e}function Ir(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),c=a>0?s*Math.sin(a)/a:0;return e[0]=n*c,e[1]=r*c,e[2]=i*c,e[3]=s*Math.cos(a),e}function kr(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return e[0]=n*s,e[1]=r*s,e[2]=i*s,e[3]=.5*Math.log(n*n+r*r+i*i+o*o),e}function Fr(e,t,n){return kr(e,t),ri(e,e,n),Ir(e,e),e}function jr(e,t,n,r){var i,o,a,s,c,u=t[0],l=t[1],f=t[2],h=t[3],d=n[0],p=n[1],m=n[2],y=n[3];return(o=u*d+l*p+f*m+h*y)<0&&(o=-o,d=-d,p=-p,m=-m,y=-y),1-o>v?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/a):(s=1-r,c=r),e[0]=s*u+c*d,e[1]=s*l+c*p,e[2]=s*f+c*m,e[3]=s*h+c*y,e}function Ur(e){var t=p(),n=p(),r=p(),i=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=i*Math.sin(2*Math.PI*n),e[1]=i*Math.cos(2*Math.PI*n),e[2]=o*Math.sin(2*Math.PI*r),e[3]=o*Math.cos(2*Math.PI*r),e}function Br(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e}function Gr(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Nr(e,t){var n,r=t[0]+t[4]+t[8];if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*o+a]-t[3*a+o])*n,e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e}function Hr(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var o=Math.sin(t),a=Math.cos(t),s=Math.sin(n),c=Math.cos(n),u=Math.sin(r),l=Math.cos(r);return e[0]=o*c*l-a*s*u,e[1]=a*s*l+o*c*u,e[2]=a*c*u-o*s*l,e[3]=a*c*l+o*s*u,e}function Vr(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var Wr,Zr,qr,Yr,Xr,Kr,Qr=Un,Jr=Bn,$r=Gn,ei=Nn,ti=Hn,ni=Lr,ri=Jn,ii=sr,oi=ur,ai=nr,si=ai,ci=rr,ui=ci,li=ar,fi=pr,hi=mr,vi=(Wr=Nt(),Zr=Wt(1,0,0),qr=Wt(0,1,0),function(e,t,n){var r=hn(t,n);return r<-.999999?(vn(Wr,Zr,t),In(Wr)<1e-6&&vn(Wr,qr,t),fn(Wr,Wr),Rr(e,Wr,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(vn(Wr,t,n),e[0]=Wr[0],e[1]=Wr[1],e[2]=Wr[2],e[3]=1+r,li(e,e))}),di=(Yr=Pr(),Xr=Pr(),function(e,t,n,r,i,o){return jr(Yr,t,i,o),jr(Xr,n,r,o),jr(e,Yr,Xr,2*o*(1-o)),e}),pi=(Kr=ye(),function(e,t,n,r){return Kr[0]=n[0],Kr[3]=n[1],Kr[6]=n[2],Kr[1]=r[0],Kr[4]=r[1],Kr[7]=r[2],Kr[2]=-t[0],Kr[5]=-t[1],Kr[8]=-t[2],li(e,Nr(e,Kr))});function mi(){var e=new d(8);return d!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e}function yi(e){var t=new d(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function gi(e,t,n,r,i,o,a,s){var c=new d(8);return c[0]=e,c[1]=t,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c}function xi(e,t,n,r,i,o,a){var s=new d(8);s[0]=e,s[1]=t,s[2]=n,s[3]=r;var c=.5*i,u=.5*o,l=.5*a;return s[4]=c*r+u*n-l*t,s[5]=u*r+l*e-c*n,s[6]=l*r+c*t-u*e,s[7]=-c*e-u*t-l*n,s}function bi(e,t,n){var r=.5*n[0],i=.5*n[1],o=.5*n[2],a=t[0],s=t[1],c=t[2],u=t[3];return e[0]=a,e[1]=s,e[2]=c,e[3]=u,e[4]=r*u+i*c-o*s,e[5]=i*u+o*a-r*c,e[6]=o*u+r*s-i*a,e[7]=-r*a-i*s-o*c,e}function wi(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e}function Mi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function _i(e,t){var n=Pr();Mt(n,t);var r=new d(3);return bt(r,t),bi(e,n,r),e}function Si(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Pi(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function Ti(e,t,n,r,i,o,a,s,c){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=c,e}var Ri=$r;function Ei(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}var zi=$r;function Li(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function Ci(e,t){var n=t[4],r=t[5],i=t[6],o=t[7],a=-t[0],s=-t[1],c=-t[2],u=t[3];return e[0]=2*(n*u+o*a+r*c-i*s),e[1]=2*(r*u+o*s+i*a-n*c),e[2]=2*(i*u+o*c+n*s-r*a),e}function Ai(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=.5*n[0],c=.5*n[1],u=.5*n[2],l=t[4],f=t[5],h=t[6],v=t[7];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=a*s+i*u-o*c+l,e[5]=a*c+o*s-r*u+f,e[6]=a*u+r*c-i*s+h,e[7]=-r*s-i*c-o*u+v,e}function Oi(e,t,n){var r=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=s*a+l*r+c*o-u*i,h=c*a+l*i+u*r-s*o,v=u*a+l*o+s*i-c*r,d=l*a-s*r-c*i-u*o;return Cr(e,t,n),r=e[0],i=e[1],o=e[2],a=e[3],e[4]=f*a+d*r+h*o-v*i,e[5]=h*a+d*i+v*r-f*o,e[6]=v*a+d*o+f*i-h*r,e[7]=d*a-f*r-h*i-v*o,e}function Di(e,t,n){var r=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=s*a+l*r+c*o-u*i,h=c*a+l*i+u*r-s*o,v=u*a+l*o+s*i-c*r,d=l*a-s*r-c*i-u*o;return Ar(e,t,n),r=e[0],i=e[1],o=e[2],a=e[3],e[4]=f*a+d*r+h*o-v*i,e[5]=h*a+d*i+v*r-f*o,e[6]=v*a+d*o+f*i-h*r,e[7]=d*a-f*r-h*i-v*o,e}function Ii(e,t,n){var r=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=s*a+l*r+c*o-u*i,h=c*a+l*i+u*r-s*o,v=u*a+l*o+s*i-c*r,d=l*a-s*r-c*i-u*o;return Or(e,t,n),r=e[0],i=e[1],o=e[2],a=e[3],e[4]=f*a+d*r+h*o-v*i,e[5]=h*a+d*i+v*r-f*o,e[6]=v*a+d*o+f*i-h*r,e[7]=d*a-f*r-h*i-v*o,e}function ki(e,t,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=t[0],c=t[1],u=t[2],l=t[3];return e[0]=s*a+l*r+c*o-u*i,e[1]=c*a+l*i+u*r-s*o,e[2]=u*a+l*o+s*i-c*r,e[3]=l*a-s*r-c*i-u*o,s=t[4],c=t[5],u=t[6],l=t[7],e[4]=s*a+l*r+c*o-u*i,e[5]=c*a+l*i+u*r-s*o,e[6]=u*a+l*o+s*i-c*r,e[7]=l*a-s*r-c*i-u*o,e}function Fi(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],c=n[1],u=n[2],l=n[3];return e[0]=r*l+a*s+i*u-o*c,e[1]=i*l+a*c+o*s-r*u,e[2]=o*l+a*u+r*c-i*s,e[3]=a*l-r*s-i*c-o*u,s=n[4],c=n[5],u=n[6],l=n[7],e[4]=r*l+a*s+i*u-o*c,e[5]=i*l+a*c+o*s-r*u,e[6]=o*l+a*u+r*c-i*s,e[7]=a*l-r*s-i*c-o*u,e}function ji(e,t,n,r){if(Math.abs(r)<v)return Si(e,t);var i=Math.hypot(n[0],n[1],n[2]);r*=.5;var o=Math.sin(r),a=o*n[0]/i,s=o*n[1]/i,c=o*n[2]/i,u=Math.cos(r),l=t[0],f=t[1],h=t[2],d=t[3];e[0]=l*u+d*a+f*c-h*s,e[1]=f*u+d*s+h*a-l*c,e[2]=h*u+d*c+l*s-f*a,e[3]=d*u-l*a-f*s-h*c;var p=t[4],m=t[5],y=t[6],g=t[7];return e[4]=p*u+g*a+m*c-y*s,e[5]=m*u+g*s+y*a-p*c,e[6]=y*u+g*c+p*s-m*a,e[7]=g*u-p*a-m*s-y*c,e}function Ui(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e}function Bi(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[4],c=n[5],u=n[6],l=n[7],f=t[4],h=t[5],v=t[6],d=t[7],p=n[0],m=n[1],y=n[2],g=n[3];return e[0]=r*g+a*p+i*y-o*m,e[1]=i*g+a*m+o*p-r*y,e[2]=o*g+a*y+r*m-i*p,e[3]=a*g-r*p-i*m-o*y,e[4]=r*l+a*s+i*u-o*c+f*g+d*p+h*y-v*m,e[5]=i*l+a*c+o*s-r*u+h*g+d*m+v*p-f*y,e[6]=o*l+a*u+r*c-i*s+v*g+d*y+f*m-h*p,e[7]=a*l-r*s-i*c-o*u+d*g-f*p-h*m-v*y,e}var Gi=Bi;function Ni(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e}var Hi=ii;function Vi(e,t,n,r){var i=1-r;return Hi(t,n)<0&&(r=-r),e[0]=t[0]*i+n[0]*r,e[1]=t[1]*i+n[1]*r,e[2]=t[2]*i+n[2]*r,e[3]=t[3]*i+n[3]*r,e[4]=t[4]*i+n[4]*r,e[5]=t[5]*i+n[5]*r,e[6]=t[6]*i+n[6]*r,e[7]=t[7]*i+n[7]*r,e}function Wi(e,t){var n=Xi(t);return e[0]=-t[0]/n,e[1]=-t[1]/n,e[2]=-t[2]/n,e[3]=t[3]/n,e[4]=-t[4]/n,e[5]=-t[5]/n,e[6]=-t[6]/n,e[7]=t[7]/n,e}function Zi(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e}var qi=ai,Yi=qi,Xi=ci,Ki=Xi;function Qi(e,t){var n=Xi(t);if(n>0){n=Math.sqrt(n);var r=t[0]/n,i=t[1]/n,o=t[2]/n,a=t[3]/n,s=t[4],c=t[5],u=t[6],l=t[7],f=r*s+i*c+o*u+a*l;e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=(s-r*f)/n,e[5]=(c-i*f)/n,e[6]=(u-o*f)/n,e[7]=(l-a*f)/n}return e}function Ji(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function $i(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]}function eo(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=t[0],f=t[1],h=t[2],d=t[3],p=t[4],m=t[5],y=t[6],g=t[7];return Math.abs(n-l)<=v*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-f)<=v*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-h)<=v*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(o-d)<=v*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=v*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-m)<=v*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-y)<=v*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-g)<=v*Math.max(1,Math.abs(u),Math.abs(g))}function to(){var e=new d(2);return d!=Float32Array&&(e[0]=0,e[1]=0),e}function no(e){var t=new d(2);return t[0]=e[0],t[1]=e[1],t}function ro(e,t){var n=new d(2);return n[0]=e,n[1]=t,n}function io(e,t){return e[0]=t[0],e[1]=t[1],e}function oo(e,t,n){return e[0]=t,e[1]=n,e}function ao(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function so(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function co(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function uo(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function lo(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function fo(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function ho(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function vo(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function po(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function mo(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function yo(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e}function go(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.hypot(n,r)}function xo(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function bo(e){var t=e[0],n=e[1];return Math.hypot(t,n)}function wo(e){var t=e[0],n=e[1];return t*t+n*n}function Mo(e,t){return e[0]=-t[0],e[1]=-t[1],e}function _o(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function So(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function Po(e,t){return e[0]*t[0]+e[1]*t[1]}function To(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e}function Ro(e,t,n,r){var i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e}function Eo(e,t){t=t||1;var n=2*p()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e}function zo(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e}function Lo(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function Co(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e}function Ao(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}function Oo(e,t,n,r){var i=t[0]-n[0],o=t[1]-n[1],a=Math.sin(r),s=Math.cos(r);return e[0]=i*s-o*a+n[0],e[1]=i*a+o*s+n[1],e}function Do(e,t){var n=e[0],r=e[1],i=t[0],o=t[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function Io(e){return e[0]=0,e[1]=0,e}function ko(e){return"vec2("+e[0]+", "+e[1]+")"}function Fo(e,t){return e[0]===t[0]&&e[1]===t[1]}function jo(e,t){var n=e[0],r=e[1],i=t[0],o=t[1];return Math.abs(n-i)<=v*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=v*Math.max(1,Math.abs(r),Math.abs(o))}var Uo=bo,Bo=so,Go=co,No=uo,Ho=go,Vo=xo,Wo=wo,Zo=function(){var e=to();return function(t,n,r,i,o,a){var s,c;for(n||(n=2),r||(r=0),c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],o(e,e,a),t[s]=e[0],t[s+1]=e[1];return t}}()},58679:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},4575:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform sampler2D velocity;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = texture2D(velocity, vUv);\n}\n"},85458:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec3 hsv = vec3(0.5 + time * 0.1, 0.4, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n gl_FragColor = vec4(rgb, 0.25);\n}\n"},38577:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float rotate;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main(void) {\n mat4 rotateMat = calcRotateMat4(vec3(time * 0.1 + rotate));\n vec4 updatePosition = rotateMat * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n"},5860:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\n\nconst float duration = 8.0;\nconst float delay = 4.0;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float now = clamp((time - delay) / duration, 0.0, 1.0);\n float opacity = (1.0 - length(vPosition.xy / vec2(512.0))) * 0.6 * now;\n vec3 v = normalize(vPosition);\n vec3 rgb = convertHsvToRgb(vec3(0.5 + (v.x + v.y + v.x) / 40.0 + time * 0.1, 0.4, 1.0));\n gl_FragColor = vec4(rgb, opacity);\n}\n"},72406:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\n\nvoid main() {\n float sin1 = sin((position.x + position.y) * 0.2 + time * 0.5);\n float sin2 = sin((position.x - position.y) * 0.4 + time * 2.0);\n float sin3 = sin((position.x + position.y) * -0.6 + time);\n vec3 updatePosition = vec3(position.x, position.y, position.z + sin1 * 50.0 + sin2 * 10.0 + sin3 * 8.0);\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(updatePosition, 1.0);\n}\n"},6595:function(e,t){"use strict";t.Z='precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nconst float duration = 8.0;\nconst float delay = 4.0;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float now = clamp((time - delay) / duration, 0.0, 1.0);\n\n // ホワイトノイズ\n float whiteNoise = random(vUv.xy * time) * 0.1 - 0.1;\n\n // モニターエフェクト\n float monitor1 = abs(sin(vUv.y * resolution.y * 2.4 + time * 10.0)) * 0.04;\n float monitor2 = abs(sin(vUv.y * resolution.y * 1.0 + time * 3.0)) * 0.04;\n float monitor = monitor1 - monitor2;\n\n // ヴィネット\n float vignetteMask = smoothstep(0.8, 1.4, length(vUv * 2.0 - 1.0));\n vec3 vignetteColor = convertHsvToRgb(vec3(0.5 + (vUv.x + vUv.y) / 40.0 + time * 0.1, 0.4, 1.0));\n vec3 vignette = vignetteMask * vignetteColor * 0.1;\n\n // RGBズレ\n float r = texture2D(texture, vUv - vec2(2.0, 0.0) / resolution).r;\n float g = texture2D(texture, vUv).g;\n float b = texture2D(texture, vUv + vec2(2.0, 0.0) / resolution).b;\n\n gl_FragColor = vec4((vec3(r, g, b) + whiteNoise) + monitor + vignette, 1.0);\n}\n'},47925:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},1483:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nuniform mat3 normalMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying float vNoise;\nvarying float vNow;\n\nconst vec3 lightDirection = vec3(1.0, -1.0, -1.0);\nconst float duration = 2.0;\nconst float delayAll = 1.0;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float now = clamp((time - delayAll - 1.5) / duration, 0.0, 1.0);\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n vec3 light = normalize(normalMatrix * lightDirection);\n float diff = (dot(normal, light) + 1.0) / 2.0 * 0.2;\n float opacity = smoothstep(0.1, 0.2, vNow);\n vec3 v = normalize(vPosition);\n vec3 rgb = (1.0 - now) * vec3(1.0) + convertHsvToRgb(vec3(0.5 + (v.x + v.y + v.x) / 40.0 + time * 0.1, 0.8, 0.4 + sin(time) * 0.05 + vNoise * 0.02));\n gl_FragColor = vec4(rgb + diff, opacity);\n}\n"},33821:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 faceNormal;\nattribute vec3 center;\nattribute float delay;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying float vNoise;\nvarying float vNow;\n\nconst float duration = 2.0;\nconst float delayAll = 1.0;\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvoid main() {\n float now = exponentialOut(max((time - delayAll - delay - (faceNormal.x + 1.0) / 2.0 - (faceNormal.y + 1.0) / 2.0) / duration, 0.0));\n mat4 translateMat = calcTranslateMat4(vec3(faceNormal) * 1200.0 * (1.0 - now) + vec3(0.0, sin(time) * 10.0 + 210.0, 0.0));\n mat4 rotateMat = calcRotateMat4(vec3(0.0, radians((1.0 - now) * faceNormal.y * 4320.0), 0.0));\n float rotateRadian = radians((time + faceNormal.x + faceNormal.y) * 1440.0);\n mat4 rotateMatSelf = calcRotateMat4(vec3(rotateRadian, rotateRadian, 0.0));\n float noise = smoothstep(-0.4, 0.4,\n cnoise(vec3(position.x * 0.035 - time, position.y * 0.035 - time, position.z * 0.035 + time))\n ) * 2.0 - 1.0;\n vec3 updatePositionSelf = (rotateMatSelf * vec4(position - center, 1.0)).xyz * (1.0 - now) + position\n + normalize(position) * noise ;\n vec4 updatePosition = rotateMat * translateMat * vec4(updatePositionSelf, 1.0);\n vPosition = updatePosition.xyz;\n vNoise = noise;\n vNow = now;\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n'},99133:function(e,t){"use strict";t.Z='precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\nvarying float vOpacity;\n\nconst float duration = 4.0;\nconst float delay = 3.0;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvoid main() {\n float now = clamp((time - delay) / duration, 0.0, 1.0);\n float noise1 = cnoise(vec3((vPosition * vec3(0.4, 2.0, -0.6) * 2.0 + time))) * 7.0 - (1.0 + (1.0 - now) * 7.0);\n float noise2 = cnoise(vec3((vPosition * 42.0 + time)));\n float noise3 = cnoise(vec3((vPosition * 7.0 + time))) * 2.0;\n float bright = smoothstep(-0.2, 1.0, (noise1 + noise2 + noise3) * now);\n vec3 v = normalize(vPosition);\n vec3 rgb = (1.0 - now) * vec3(1.0) + convertHsvToRgb(vec3(0.5 + (v.x + v.y + v.x) / 40.0 + time * 0.1, 0.4, 1.0));\n float whiteNoise = random(vPosition.xy);\n if (bright < 0.4) discard;\n gl_FragColor = vec4(rgb * vec3(1.0 - bright + 0.6) + whiteNoise * 0.2, 0.4 + vOpacity * 0.5 + sin(time * 2.0) * 0.1);\n}\n'},14595:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying float vOpacity;\n\nconst float duration = 4.0;\nconst float delay = 3.0;\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main() {\n float now = clamp((time - delay) / duration, 0.0, 1.0);\n mat4 translateMat = calcTranslateMat4(vec3(0.0, sin(time) * 10.0 + 210.0, 0.0));\n mat4 scaleMat = calcScaleMat4(vec3(exponentialOut(now) * 0.6 + 0.4 + sin(time * 2.0) * 0.04));\n mat4 rotateMat = calcRotateMat4(vec3(radians(45.0), radians(time * 2.0), radians(-time * 2.0)));\n float noise = smoothstep(-0.4, 0.4, cnoise(position * 0.035 - time)) * 2.0 - 1.0;\n vec4 updatePosition = translateMat * rotateMat * scaleMat * vec4(position + normalize(position) * noise * 2.0, 1.0);\n vPosition = normalize(position);\n vOpacity = normalize(updatePosition).z;\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n'},47272:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nconst float interval = 3.0;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nfloat cubicOut(float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n\nvoid main() {\n float now = cubicOut(min(time / interval, 1.0));\n float noise = (snoise(vec3(vUv.x * 4.0, vUv.y * 4.0, 1.0)) + 1.0) / 2.0;\n float opacity = smoothstep(0.4, 0.6, ((noise - 1.0) + now * interval) - vUv.x);\n gl_FragColor = texture2D(texture, vUv) * vec4(vec3(1.0), opacity);\n}\n"},47807:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\n\nvarying vec2 vUv;\n\nconst float interval = 3.0;\n\nfloat cubicOut(float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n\nvoid main() {\n float now = cubicOut(min(time / interval, 1.0));\n vec3 updatePosition = vec3(\n position.x * (1.2 - now * 0.2),\n position.y * (1.2 - now * 0.2),\n position.z\n );\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(updatePosition, 1.0);\n}\n"},77911:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform vec3 color;\nuniform sampler2D texture;\n\nvarying vec3 vColor;\nvarying float fOpacity;\n\nvoid main() {\n gl_FragColor = vec4(color * vColor, fOpacity);\n gl_FragColor = gl_FragColor * texture2D(texture, gl_PointCoord);\n}\n"},99173:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 customColor;\nattribute float vertexOpacity;\nattribute float size;\n\nvarying vec3 vColor;\nvarying float fOpacity;\n\nvoid main() {\n vColor = customColor;\n fOpacity = vertexOpacity;\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = size * (300.0 / length(mvPosition.xyz));\n gl_Position = projectionMatrix * mvPosition;\n}\n"},64928:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform vec2 resolution;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform vec2 anchor;\n\nvarying vec2 vUv;\n\n#define PRECISION 0.000001\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 a2 = a + normalize(vec3(\n anchor.x * resolution.x / 6.0 + PRECISION,\n 0.0,\n anchor.y * resolution.y / -2.0 + PRECISION\n ) - v) / 2.0;\n vec3 a3 = a2 + drag(a2, 0.003);\n gl_FragColor = vec4(a3, 1.0);\n}\n"},47347:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},95669:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n gl_FragColor = vec4(texture2D(acceleration, vUv).xyz + texture2D(velocity, vUv).xyz, 1.0);\n}\n"},40354:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},46663:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying float vAcceleration;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nuniform float time;\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n vec3 n;\n n.xy = gl_PointCoord * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n gl_FragColor = vec4(hsv2rgb(vec3(vColor.x + time / 3600.0, vColor.y, vColor.z)), vOpacity);\n}\n"},33524:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec2 uv2;\nattribute vec3 color;\nattribute float mass;\n\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\n\nvarying float vAcceleration;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main(void) {\n vec4 update_position = modelViewMatrix * texture2D(velocity, uv2);\n vAcceleration = length(texture2D(acceleration, uv2).xyz) * mass;\n vColor = color;\n vOpacity = 0.6 * (300.0 / length(update_position.xyz));\n gl_PointSize = 2.0 * (300.0 / length(update_position.xyz));\n gl_Position = projectionMatrix * update_position;\n}\n"},71883:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDelay;\nvarying vec3 vColor;\n\nconst float duration = 3.0;\n\nvoid main() {\n float now = mod(time + vDelay * duration, duration) / duration;\n float opacityBothEnds = smoothstep(-500.0, -400.0, vPosition.y) * (1.0 - smoothstep(400.0, 500.0, vPosition.y));\n float opacity = smoothstep(0.95, 1.0, mod(vUv.y - now, 1.0));\n\n gl_FragColor = vec4(vColor, opacity * opacityBothEnds * 0.9);\n}\n"},61915:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 instancePosition;\nattribute float rotate;\nattribute float delay;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDelay;\nvarying vec3 vColor;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // calculate posiitons of instances.\n vec3 wavePosition = vec3(0.0, 0.0, sin(radians(position.y / 3.6) + time * 0.1 + delay * 9.0) * 50.0);\n vec3 updatePosition = position + instancePosition + wavePosition;\n mat4 rotateMat = calcRotateMat4(vec3(radians(90.0), 0.0, radians(rotate)));\n vec4 mvPosition = modelViewMatrix * rotateMat * vec4(updatePosition, 1.0);\n\n // calculate interval for uv animation and setting color.\n float noise = cnoise(updatePosition / 100.0) * 0.5 + time * 0.1;\n vec3 hsv = vec3(noise, 0.45, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n vPosition = position;\n vUv = uv;\n vDelay = delay;\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n'},7401:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // to round.\n vec3 n;\n n.xy = gl_PointCoord * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n\n gl_FragColor = vec4(vColor, vOpacity);\n}\n"},61765:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform vec3 cameraPosition;\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n float noise1 = snoise(mvPosition.xyz * 0.046 + vec3(-time, time, time) * 0.3);\n float noise2 = snoise(mvPosition.xyz * 0.0012 + vec3(time, -time, time) * 0.01);\n\n vec3 hsv = vec3(noise2 * 0.2 + time * 0.1, 1.0, 0.6);\n vec3 rgb = convertHsvToRgb(hsv);\n\n vColor = rgb;\n vOpacity = pow(40.0 / length(mvPosition.xyz) * noise1, 2.0);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 600.0 / length(mvPosition.xyz) * noise1;\n}\n"},29608:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec3 hsv = vec3(0.13, 0.3, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, vOpacity);\n}\n"},42832:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvoid main(void) {\n vec2 p = uv * 2.0 - 1.0;\n\n float circle = quadraticOut(clamp(1.0 - length(p), 0.0, 1.0));\n float noise = cnoise(position * 0.05 + vec3(0.0, 0.0, time) * 0.1);\n vec3 noisePosition = normalize(position) * noise * 0.0;\n\n float noiseA = cnoise(vec3(p.x + cos(time), length(p) * 20.0, p.y + sin(time)));\n\n // coordinate transformation\n vec3 updatePosition = noisePosition + position;\n vec4 mPosition = modelMatrix * vec4(updatePosition, 1.0);\n vec4 mvPosition = viewMatrix * mPosition;\n\n vPosition = updatePosition;\n vUv = uv;\n vOpacity = circle * noiseA * 2.0;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n'},51261:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},6834:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n vec2 p = uv * 2.0 - 1.0;\n // calculate gradation\n vec3 hsv = vec3(0.13, 0.8, p.y * 0.8 + 0.04);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},34566:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D tex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(0.5, 0.5, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float d = (dot(normal, light) + 1.0) / 2.0;\n float glow = smoothstep(0.85, 1.0, d);\n float shadow = d;\n\n // define colors.\n vec3 hsv = vec3(0.13, 1.0 - glow * 0.8, (shadow + glow * 6.0) / 8.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n vec4 texColor = texture2D(tex, vUv);\n gl_FragColor = vec4(rgb, 1.0) * texColor;\n}\n"},11530:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat3 normalMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvoid main(void) {\n //\n float noise = cnoise(position * 0.8 + time * 0.4) * (sin(position.y - time * 0.8) * 1.4 + sin(position.y - time * 2.0) * 0.6) / 2.0;\n vec3 noisePosition = normalize(position * vec3(1.0, 0.0, 1.0)) * pow(noise, 2.0) * 0.8;\n\n // coordinate transformation\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(position + noisePosition, 1.0);\n\n vPosition = (modelMatrix * vec4(position + noisePosition, 0.0)).xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n'},29808:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // Convert PointCoord to a range from -1.0 to 1.0\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // Draw double circle\n float radius = length(p);\n float opacity = (1.0 - smoothstep(0.2, 1.0, radius)) * vOpacity;\n\n gl_FragColor = vec4(vColor, opacity);\n}\n"},47869:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float delay1;\nattribute float delay2;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float duration = 120.0;\n\nvoid main() {\n // Loop animation\n float interval = mod(time + delay1, duration) / duration;\n vec3 move = vec3(\n cos(time * 0.5 + delay1) * 2.0,\n interval * 100.0,\n sin(time * 0.5 + delay2) * 2.0\n );\n\n // calculate gradation with position.y\n vec3 hsv = vec3(0.14, 0.65, 0.85);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // calculate opacity.\n float fadeIn = smoothstep(0.0, 10.0, move.y);\n float blink = sin(time * 0.1 + delay2);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position + move, 1.0);\n float distanceFromCamera = 1000.0 / length(mvPosition.xyz);\n\n vColor = rgb;\n vOpacity = fadeIn * blink;\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = distanceFromCamera;\n}\n"},16918:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\nuniform vec2 resolution;\n\nvarying vec2 vUv;\n\nconst float godrayIteration = 60.0;\nconst float godrayStrength = 20.0;\n\nfloat random2(vec2 c){\n return fract(sin(dot(c.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\nfloat randomNoise(vec2 p) {\n return (random2(p - vec2(sin(time))) * 2.0 - 1.0) * 0.04;\n}\n\nvoid main() {\n // Convert uv to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = vUv * 2.0 - 1.0;\n vec2 ratio = 1.0 / resolution;\n\n // Random Noise\n float rNoise = randomNoise(vUv);\n\n // RGB Shift\n float texColorR = texture2D(texture, vUv - vec2((2.0 * abs(p.x) + 1.0) * ratio.x, 0.0)).r;\n float texColorG = texture2D(texture, vUv + vec2((2.0 * abs(p.x) + 1.0) * ratio.x, 0.0)).g;\n float texColorB = texture2D(texture, vUv).b;\n\n // godray\n vec2 godrayCenter = vec2(0.5);\n vec3 godrayDestColor = vec3(0.0);\n float godrayTotalWeight = 0.0;\n\n for (float i = 0.0; i < 60.0; i++) {\n float alpha = i / godrayIteration; // step in loop [0, 1].\n float weight = alpha - alpha * alpha; // conic curve [0, 0.25, 0].\n vec2 shiftUv = vUv - (vUv - godrayCenter) * alpha * godrayStrength / godrayIteration; // define a range of to shift UV.\n godrayDestColor += texture2D(texture, shiftUv).rgb * weight; // draw gradation.\n godrayTotalWeight += weight;\n }\n vec3 godray = godrayDestColor / godrayTotalWeight;\n\n // Sum total of colors.\n vec3 color = vec3(texColorR, texColorG, texColorB) + rNoise + godray;\n\n gl_FragColor = vec4(color, 1.0);\n}\n"},59933:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n gl_Position = vec4(position, 1.0);\n}\n"},83257:function(e,t){"use strict";t.Z='precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texHannyaShingyo;\n\nvarying vec3 vPositionNoise;\nvarying vec2 vUv;\nvarying vec2 vUvBase;\nvarying float vOpacity;\nvarying float vStep;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // coordinate tex color.\n vec4 texColor = texture2D(texHannyaShingyo, vUv);\n\n // coordinate cross fade alpha value with delay.\n float dRange = 0.1;\n float crossFadeDelay = vUvBase.y * dRange;\n float crossFade = smoothstep(crossFadeDelay, crossFadeDelay + 0.3, vStep)\n * (1.0 - smoothstep(crossFadeDelay + 0.7 - dRange, crossFadeDelay + 1.0 - dRange, vStep));\n\n // dissolve effect.\n float noise1 = cnoise(vec3(vPositionNoise * 0.7));\n float noise2 = cnoise(vec3(vPositionNoise * 1.8));\n float noiseAll = (noise1 * 2.0 + noise2 * 0.4) / 2.4;\n float noise = (noiseAll * 0.5 + 0.5) + (crossFade * 2.0 - 1.0);\n float disolveMask = smoothstep(0.28, 0.3, noise);\n vec4 disolve = vec4(convertHsvToRgb(vec3(0.13, 0.9, 0.75)), 1.0) * disolveMask;\n float disolveEdgeMask = smoothstep(0.0, 0.02, noise) * (1.0 - smoothstep(0.28, 0.3, noise));\n vec4 disolveEdge = vec4(convertHsvToRgb(vec3(0.13, 0.4, 1.0)), 1.0) * disolveEdgeMask;\n\n // glow\n float glow = cnoise(vPositionNoise * 0.25 + time) * 0.5;\n\n gl_FragColor = (disolve + disolveEdge + vec4(vec3(glow), 0.0)) * vOpacity * texColor.a;\n}\n'},46301:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 iPosition;\nattribute vec2 iUv;\nattribute float iId;\nattribute float iTime;\nattribute float iIsAnimated;\nattribute float iScale;\nattribute float iMove;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float unitUv;\nuniform float duration;\n\nvarying vec3 vPositionNoise;\nvarying vec2 vUv;\nvarying vec2 vUvBase;\nvarying float vOpacity;\nvarying float vStep;\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main(void) {\n vec3 move = vec3(0.0, iTime / duration * iMove, 0.0);\n mat4 scaleMat = calcScaleMat4(vec3(iScale));\n mat4 rotateMat = calcRotateMat4(vec3(\n radians(sin(time * 0.3 + iId * 30.0) * 30.0),\n radians(cos(time * 0.3 + iId * 30.0) * 45.0),\n radians(cos(time * 0.3 + iId * 30.0) * 30.0)\n ));\n vec3 updatePosition = (rotateMat * scaleMat * vec4(position, 1.0)).xyz;\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(iPosition + move + updatePosition, 1.0);\n\n vPositionNoise = position + iId;\n vUv = uv * unitUv + iUv;\n vUvBase = uv;\n vOpacity = iIsAnimated;\n vStep = iTime / duration;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},76100:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(0.5, 0.5, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n float glow = smoothstep(0.9, 1.0, diff);\n\n vec3 hsv = vec3(0.13, 1.0 - glow * 0.8, 0.05 + glow * 0.95);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, vOpacity);\n}\n"},67467:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat3 normalMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvoid main(void) {\n vec2 p = uv * 2.0 - 1.0;\n\n // wave motion.\n float force = pow(smoothstep(0.0, 0.5, length(p)) * (1.0 - smoothstep(0.5, 1.0, length(p))), 2.0) * 1.8;\n vec3 wave = vec3(0.0, 0.0, (sin(-time * 4.0 + length(p.xy) * 24.0) * 0.5 + 0.5) * force);\n\n // coordinate transformation\n vec3 updatePosition = position + wave;\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(updatePosition, 1.0);\n\n vPosition = updatePosition;\n vUv = uv;\n vOpacity = 1.0 - smoothstep(0.9, 1.0, length(p));\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},34326:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float size;\nuniform sampler2D texture;\nuniform float colorH;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec4 texColor = texture2D(texture, vUv);\n\n float noise = snoise(vPosition / vec3(size * 0.25) + vec3(0.0, 0.0, time));\n vec3 hsv = vec3(colorH + noise * 0.2, 0.4, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n if (texColor.a < 0.5) discard;\n\n gl_FragColor = vec4(rgb, vOpacity) * texColor;\n}\n"},72648:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float index;\nuniform float time;\nuniform float size;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvoid main() {\n float flapTime = radians(sin(time * 4.0 - length(position.xy) / size * 2.0 + index * 2.0) * 45.0 + 30.0);\n float hovering = cos(time * 2.0 + index * 3.0) * size / 16.0;\n vec3 updatePosition = vec3(\n cos(flapTime) * position.x,\n position.y + hovering,\n sin(flapTime) * abs(position.x) + hovering\n );\n\n vPosition = position;\n vUv = uv;\n vOpacity = (1.0 - smoothstep(0.75, 1.0, abs((modelMatrix * vec4(updatePosition, 1.0)).z) / 900.0)) * 0.85;\n\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(updatePosition, 1.0);\n}\n"},3410:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\n\nvarying vec4 vUv;\n\nvoid main() {\n vec4 projectorColor;\n if (all(bvec4(vUv.x >= 0.0, vUv.y >= 0.0, vUv.x <= vUv.z, vUv.y <= vUv.z))) {\n projectorColor = texture2DProj(texture, vUv);\n }\n gl_FragColor = vec4(vec3(1.0), 0.3) * projectorColor;\n}\n"},440:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat4 textureMatrix;\n\nvarying vec4 vUv;\n\nvoid main(void) {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n vUv = textureMatrix * worldPosition;\n gl_Position = projectionMatrix * viewMatrix * worldPosition;\n}\n"},13190:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // to round.\n vec3 n;\n n.xy = gl_PointCoord * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n\n gl_FragColor = vec4(vColor, vOpacity * 0.5);\n}\n"},13677:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float colorH;\nattribute float i;\nattribute float valid;\n\nuniform vec3 cameraPosition;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float size;\nuniform float interval;\nuniform float time;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float thisTime = mod(time + i / size * interval, interval);\n\n vec3 updatePosition = position + vec3(\n cos(thisTime * 3.0 + i) * 3.0,\n thisTime * -16.0,\n sin(thisTime * 3.0 + i) * 3.0\n );\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(updatePosition, 1.0);\n\n vec3 hsv = vec3(colorH + sin(i) * 0.075, 0.8, 1.0);\n\n vColor = convertHsvToRgb(hsv);\n vOpacity = smoothstep(interval * 0.0, interval * 0.1, thisTime)\n * (1.0 - smoothstep(interval * 0.2, interval * 0.9, thisTime));\n\n gl_PointSize = 12000.0 / length(mvPosition.xyz);\n gl_Position = projectionMatrix * mvPosition;\n}\n"},56500:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},50413:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture1;\nuniform sampler2D texture2;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color1 = texture2D(texture1, vUv);\n vec4 color2 = texture2D(texture2, vUv);\n gl_FragColor = color1 * 0.5 + color2;\n}\n"},92586:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 direction;\nuniform float radius;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvec4 gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 step = radius / resolution * direction;\n color += texture2D(texture, uv - 4.0 * step) * 0.02699548325659403;\n color += texture2D(texture, uv - 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv - 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv - 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv) * 0.19947114020071635;\n color += texture2D(texture, uv + 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv + 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv + 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv + 4.0 * step) * 0.02699548325659403;\n return color;\n}\n\nvoid main() {\n vec4 color = gaussianBlur(texture, vUv, radius, resolution, direction);\n gl_FragColor = color;\n}\n"},38913:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float minBright;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 bright = max(vec4(0.0), (texture2D(texture, vUv) - minBright));\n gl_FragColor = bright;\n}\n"},83528:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDelay;\nvarying vec3 vColor;\n\nconst float duration = 10.0;\n\nvoid main() {\n // calculate interval time from 0 to 1\n float now = mod(time + vDelay * duration, duration) / duration;\n\n float opacityBothEnds = smoothstep(-2000.0, -1800.0, vPosition.y) * (1.0 - smoothstep(1800.0, 2000.0, vPosition.y));\n float opacity = smoothstep(0.85, 1.0, mod(vUv.y - now, 1.0));\n\n gl_FragColor = vec4(vColor, opacity * opacityBothEnds * 0.08);\n}\n"},75923:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 instancePosition;\nattribute float delay;\nattribute float h;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDelay;\nvarying vec3 vColor;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // update positions\n vec3 updatePosition = position + instancePosition;\n mat4 rotateMat = calcRotateMat4(vec3(radians(90.0), 0.0, radians(180.0)));\n\n // calculate colors\n vec3 hsv = vec3(h + time * 0.1, 0.35, 0.6);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * rotateMat * vec4(updatePosition, 1.0);\n\n vPosition = position;\n vUv = uv;\n vDelay = delay;\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},63819:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // calculate colors\n vec3 hsv = vec3(time * 0.1 + 0.5, 1.0, (1.0 - abs(vPosition.y / 10000.0)) * 0.08);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n"},97550:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec3 vPosition;\n\nvoid main() {\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vPosition = position;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},57139:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float wave1;\nuniform float wave2;\nuniform float wave3;\nuniform float wave4;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main() {\n // draw lines\n float v1 = sin(vUv.y * wave1 + time * 0.2);\n float v2 = sin(vUv.y * wave2 + time * 0.2);\n float v3 = sin(vUv.y * wave3 + time * 0.2);\n float v4 = sin(vUv.y * wave4 + time * 0.2);\n float v = smoothstep(0.65, 0.7, (v1 + v2 + v3 + v4) / 4.0);\n vec3 color = vec3(v);\n\n gl_FragColor = vec4(color, v * 0.08);\n}\n"},21750:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},80261:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\n\nvarying vec3 vColor1;\nvarying vec3 vColor2;\nvarying float vOpacity;\n\nvoid main() {\n // convert PointCoord to range from -1.0 to 1.0\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // draw double circle\n float radius = length(p);\n float r1 = (1.0 - smoothstep(0.95, 1.0, radius));\n float r2 = (1.0 - smoothstep(0.45, 0.5, radius));\n vec3 color1 = vColor1 * (r1 - r2);\n vec3 color2 = vColor2 * r2;\n vec3 color = color1 + color2;\n float opacity = ((r1 - r2) * 0.25 + r2 * 0.5) * vOpacity;\n\n gl_FragColor = vec4(color, opacity);\n}\n"},51263:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float delay;\nattribute float speed;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vColor1;\nvarying vec3 vColor2;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nconst float duration = 3.0;\n\nvoid main() {\n // calculate interval time from 0 to 1\n float interval = mod(time + delay * duration, duration) / duration;\n\n // update position and size\n float size = 10.0 * sin(interval * 4.0);\n float blink = max(sin(interval * 4.0) * 2.0 - 1.0, 0.0);\n mat4 rotateMat = calcRotateMat4(vec3(\n radians(time * speed * 0.3),\n radians(time * speed),\n radians(time * speed * 0.3)\n ));\n\n // calculate colors\n vec3 hsv1 = vec3(time * 0.1, 0.6, 1.0);\n vec3 rgb1 = convertHsvToRgb(hsv1);\n vec3 hsv2 = vec3(time * 0.1 + 0.2, 0.6, 1.0);\n vec3 rgb2 = convertHsvToRgb(hsv2);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * rotateMat * vec4(position, 1.0);\n float distanceFromCamera = 1000.0 / length(mvPosition.xyz);\n\n vColor1 = rgb1;\n vColor2 = rgb2;\n vOpacity = blink * clamp(distanceFromCamera, 0.1, 0.8);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = distanceFromCamera * size;\n}\n"},54691:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vRotate1;\nvarying float vRotate2;\nvarying float vRotate3;\n\nmat3 rotateMat3(float radian) {\n return mat3(\n cos(radian), -sin(radian), 0.0,\n sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 1.0\n );\n}\n\nvoid main() {\n // rotate textures\n vec2 uv1 = ((vec3(vUv - 0.5, 1.0) * rotateMat3(time * vRotate1)).xy + 0.5);\n vec2 uv2 = ((vec3(vUv - 0.5, 1.0) * rotateMat3(time * vRotate2)).xy + 0.5);\n vec2 uv3 = ((vec3(vUv - 0.5, 1.0) * rotateMat3(time * vRotate3)).xy + 0.5);\n vec4 texColor1 = texture2D(texture1, uv1);\n vec4 texColor2 = texture2D(texture2, uv2);\n vec4 texColor3 = texture2D(texture3, uv3);\n vec4 color = texColor1 + texColor2 + texColor3;\n\n // discard low alpha value\n if (color.a <= 0.1) discard;\n\n gl_FragColor = vec4(vColor, color.a * 0.35);\n}\n"},40233:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nattribute vec3 instancePosition;\nattribute float rotate1;\nattribute float rotate2;\nattribute float rotate3;\nattribute float h;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vRotate1;\nvarying float vRotate2;\nvarying float vRotate3;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // calculate colors\n vec3 hsv = vec3(h + time * 0.1 + 0.5, 0.4, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position + instancePosition, 1.0);\n\n vPosition = position;\n vUv = uv;\n vColor = rgb;\n vRotate1 = rotate1;\n vRotate2 = rotate2;\n vRotate3 = rotate3;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},45943:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\n\nvoid main() {\n // flat shading\n vec3 light = normalize(vec3(0.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = pow((dot(normal, light) + 1.0) / 2.0, 10.0);\n\n gl_FragColor = vec4(vColor, diff * 0.4 + 0.03);\n}\n"},85345:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float timeShow;\nuniform float durationShow;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // convert uv to range from -1.0 to 1.0\n vec2 resolution = uv * 2.0 - 1.0;\n\n // update rotation\n float rotateX = resolution.x * 100.0 + time / 2.0;\n float rotateY = resolution.y * 200.0 + time / 2.0;\n float rotateZ = length(resolution.xy) * 150.0 + time / 2.0;\n mat4 rotateMat = calcRotateMat4(vec3(rotateX, rotateY, rotateZ));\n vec3 rotatePosition = (rotateMat * vec4(vec3(sin(time * 0.1 + resolution.x * 10.0) * 150.0), 1.0)).xyz;\n\n // update position\n vec3 wavePosition = vec3(0.0, 0.0, sin(time * 0.1 + (resolution.x + resolution.y) * 5.6) * 300.0);\n vec3 updatePosition = position + rotatePosition + wavePosition;\n\n // calculate colors\n vec3 hsv = vec3(time * 0.1 + 0.5, 0.35, 0.6);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(updatePosition, 1.0);\n\n vPosition = updatePosition;\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},97125:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n // make round\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n float radius = length(p);\n float r = 1.0 - smoothstep(0.95, 1.0, radius);\n\n gl_FragColor = vec4(vColor, r * 0.1);\n}\n"},4798:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float timeShow;\nuniform float durationShow;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\n\nvoid main() {\n // convert uv to range from -1.0 to 1.0\n vec2 p = uv * 2.0 - 1.0;\n\n // update rotation\n float rotateX = p.x * 100.0 + time / 2.0;\n float rotateY = p.y * 200.0 + time / 2.0;\n float rotateZ = length(p.xy) * 150.0 + time / 2.0;\n mat4 rotateMat = calcRotateMat4(vec3(rotateX, rotateY, rotateZ));\n vec3 rotatePosition = (rotateMat * vec4(vec3(sin(time * 0.1 + p.x * 10.0) * 150.0), 1.0)).xyz;\n\n // update position\n vec3 wavePosition = vec3(0.0, 0.0, sin(time * 0.1 + (p.x + p.y) * 5.6) * 300.0);\n vec3 updatePosition = position + rotatePosition + wavePosition;\n\n // update size\n float size = (pow(sin(rotateX * 10.0), 3.0) + 1.0) * 2.0 + 3.0;\n\n // calculate colors\n vec3 hsv = vec3(time * 0.1, 0.35, 0.6);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(updatePosition, 1.0);\n\n vPosition = updatePosition;\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = size;\n}\n"},2766:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 0.15);\n}\n"},88940:function(e,t){"use strict";t.Z='precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float interval;\nuniform float duration;\nuniform sampler2D textures[5];\n\nvarying vec2 vUv;\n\nfloat cubicInOut(float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvec4 getTexColor(float index, vec2 uv) {\n vec4 color;\n color += texture2D(textures[0], uv) * (1.0 - step(0.9, index));\n color += texture2D(textures[1], uv) * step(1.0, index) * (1.0 - step(1.9, index));\n color += texture2D(textures[2], uv) * step(2.0, index) * (1.0 - step(2.9, index));\n color += texture2D(textures[3], uv) * step(3.0, index) * (1.0 - step(3.9, index));\n color += texture2D(textures[4], uv) * step(4.0, index) * (1.0 - step(4.9, index));\n return color;\n}\n\nvoid main(void) {\n vec2 p = vUv * 2.0 - 1.0;\n\n float alpha = cubicInOut(clamp(mod(time, interval) / duration - (interval / duration - 1.0), 0.0, 1.0));\n float noise1 = cnoise(vec3(vUv * vec2(12.0), time * 0.1));\n float noise2 = cnoise(vec3(vUv * vec2(12.0), time * 0.1 + 100.0));\n float noise3 = cnoise(vec3(vUv * vec2(48.0), time * 0.3));\n float noiseA = noise1 * 0.85 + noise3 * 0.15;\n float noiseB = noise2 * 0.85 + noise3 * 0.15;\n\n float mask = clamp(alpha * 2.0 - (noiseA * 0.5 + 0.5), 0.0, 1.0);\n float mask1 = smoothstep(0.5, 1.0, mask);\n float mask2 = smoothstep(0.0, 0.5, mask);\n\n vec2 uvPrev = (vUv + p * 0.15 * alpha) + vec2(0.2) * vec2(noiseA, noiseB) * length(p) * alpha;\n vec2 uvNext = (vUv - p * 0.15 * (1.0 - alpha)) + vec2(0.2) * vec2(noiseA, noiseB) * length(p) * (1.0 - alpha);\n\n float indexPrev = floor(mod(time, interval * 5.0) / interval);\n float indexNext = floor(mod(time + interval, interval * 5.0) / interval);\n\n vec4 texColorPrev = getTexColor(indexPrev, uvPrev) * (1.0 - mask1);\n vec4 texColorNext = getTexColor(indexNext, uvNext) * mask2;\n\n gl_FragColor = texColorPrev + texColorNext;\n}\n'},54312:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform vec2 resolution;\nuniform vec2 imageResolution;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 ratio = vec2(\n min((resolution.x / resolution.y) / (imageResolution.x / imageResolution.y), 1.0),\n min((resolution.y / resolution.x) / (imageResolution.y / imageResolution.x), 1.0)\n );\n\n vec2 updateUv = vec2(\n uv.x * ratio.x + (1.0 - ratio.x) * 0.5,\n uv.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n\n vUv = updateUv;\n gl_Position = vec4(position, 1.0);\n}\n"},61786:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec3 vColor;\nvarying vec3 vNormal;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nstruct HemisphereLight {\n vec3 direction;\n vec3 groundColor;\n vec3 skyColor;\n};\nuniform HemisphereLight hemisphereLights[NUM_HEMI_LIGHTS];\n\nvoid main() {\n vec3 light = vec3(0.0);\n light += (dot(hemisphereLights[0].direction, vNormal) + 1.0) * hemisphereLights[0].skyColor * 0.5;\n light += (-dot(hemisphereLights[0].direction, vNormal) + 1.0) * hemisphereLights[0].groundColor * 0.5;\n gl_FragColor = vec4(vColor * light, 1.0);\n}\n"},67112:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nuniform float time;\nuniform float radius;\nuniform float distort;\n\nvarying vec3 vColor;\nvarying vec3 vNormal;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float updateTime = time / 1000.0;\n float noise = cnoise(vec3(position / 200.1 + updateTime * 10.0));\n vec4 mvPosition = modelViewMatrix * vec4(position * (noise * pow(distort, 2.0) + radius), 1.0);\n\n vColor = hsv2rgb(vec3(noise * distort * 0.3 + updateTime, 0.2, 1.0));\n vNormal = normal;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n'},19820:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\nuniform vec2 resolution;\nuniform float acceleration;\nuniform sampler2D texture;\n\nconst float blur = 16.0;\n\nvarying vec2 vUv;\n\nfloat random2(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n// First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n// Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n// Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n// Gradients: 41 points uniformly over a line, mapped onto a diamond.\n// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n// Normalise gradients implicitly by scaling m\n// Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n// Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nvec2 diffUv(float v, float diff) {\n return vUv + (vec2(v + snoise(vec2(gl_FragCoord.y + time) / 100.0), 0.0) * diff + vec2(v * 3.0, 0.0)) / resolution;\n}\n\nfloat randomNoise(vec2 p) {\n return (random2(p - vec2(sin(time))) * 2.0 - 1.0) * max(length(acceleration), 0.08);\n}\n\nvoid main() {\n float diff = 300.0 * length(acceleration);\n vec2 uv_r = diffUv(0.0, diff);\n vec2 uv_g = diffUv(1.0, diff);\n vec2 uv_b = diffUv(-1.0, diff);\n float r = texture2D(texture, uv_r).r + randomNoise(uv_r);\n float g = texture2D(texture, uv_g).g + randomNoise(uv_g);\n float b = texture2D(texture, uv_b).b + randomNoise(uv_b);\n gl_FragColor = vec4(r, g, b, 1.0);\n}\n"},11697:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},90217:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n // Convert PointCoord to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // Draw circle\n float radius = length(p);\n float opacity1 = (1.0 - smoothstep(0.5, 0.7, radius));\n float opacity2 = smoothstep(0.8, 1.0, radius) * (1.0 - smoothstep(1.0, 1.2, radius));\n\n gl_FragColor = vec4(vColor, (opacity1 + opacity2) * 0.5);\n}\n"},29277:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float radian;\nattribute float radius;\nattribute float delay;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vColor;\n\nvoid main() {\n // coordinate transformation\n vec3 updatePosition = position\n + vec3(\n sin(time * 4.0 + delay),\n sin(radian + time * 0.4) * (radius + sin(time * 4.0 + delay)),\n cos(radian + time * 0.4) * (radius + sin(time * 4.0 + delay))\n );\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(updatePosition, 1.0);\n float distanceFromCamera = length(mvPosition.xyz);\n float pointSize = 1000.0 / distanceFromCamera * 1.6;\n\n vColor = vec3(0.8 - delay * 0.1, 0.6, 0.6);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = pointSize;\n}\n"},59339:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture;\nuniform vec2 resolution;\n\nvarying vec2 vUv;\n\nfloat random2(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nfloat randomNoise(vec2 p) {\n return (random2(p - vec2(sin(time))) * 2.0 - 1.0) * 0.04;\n}\n\nvoid main() {\n // Convert uv to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = vUv * 2.0 - 1.0;\n vec2 ratio = 1.0 / resolution;\n\n // Random Noise\n float rNoise = randomNoise(vUv);\n\n // RGB Shift\n float texColorR = texture2D(texture, vUv - vec2((2.0 * abs(p.x) + 1.0) * ratio.x, 0.0)).r;\n float texColorG = texture2D(texture, vUv + vec2((2.0 * abs(p.x) + 1.0) * ratio.x, 0.0)).g;\n float texColorB = texture2D(texture, vUv).b;\n\n // Sum total of colors.\n vec3 color = vec3(texColorR, texColorG, texColorB) + rNoise;\n\n gl_FragColor = vec4(vec3(texColorR, texColorG, texColorB) + rNoise, 1.0);\n}\n"},60125:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n gl_Position = vec4(position, 1.0);\n}\n"},24678:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 cameraPosition;\nuniform float time;\nuniform float noiseRange;\nuniform sampler2D texEgg1;\nuniform sampler2D texEgg2;\nuniform sampler2D texDiffSpace;\n\nuniform float speed;\nuniform float circleOutStepMin;\nuniform float circleOutStepMax;\nuniform float circleInStepMin;\nuniform float circleInStepMax;\nuniform float noisePosition;\nuniform float noiseSize;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvoid main() {\n float t1 = exponentialOut(min(time, 2.0) / 2.0);\n float t2 = (1.0 - exponentialOut(min(time, 2.0) / 2.0)) * 3.0;\n vec2 pos = vUv * 2.0 - vec2(1.0);\n\n float circleOut = smoothstep(circleOutStepMin, circleOutStepMax, t1 - length(pos));\n float circleIn = smoothstep(circleInStepMin, circleInStepMax, t1 * 0.5 - length(pos)) * 0.5;\n float circleLight = smoothstep(0.0, 0.1, (t1 - t2) * 0.3 - length(pos)) * smoothstep(0.0, 0.1, (t1 - t2) * 0.2 - length(pos + vec2(0.2, -0.2)));\n\n float noiseTime = time * speed + t2;\n float noise = (\n snoise(\n vec3(pos * (noisePosition + noiseRange * 0.1) + vec2(sin(noiseTime),\n cos(noiseTime)),\n noiseTime + noiseRange * 100.0\n )\n ) + 1.0) / 2.0 * noiseSize;\n\n float mask = circleOut * noise + circleIn;\n float maskHighLight = circleLight * (noise + 0.12);\n float mask0 = 1.0 - step(maskHighLight, 0.13);\n float mask1 = (1.0 - step(mask, 0.6)) * step(maskHighLight, 0.13);\n float mask2 = (1.0 - step(mask, 0.28)) * step(mask, 0.6) * step(maskHighLight, 0.23);\n float mask3 = (1.0 - step(mask, 0.014)) * step(mask, 0.28);\n float mask4 = (1.0 - step(mask, 0.01)) * step(mask, 0.014);\n\n vec4 rgba0 = vec4(convertHsvToRgb(vec3(0.125, 0.2, 1.0)), 1.0) * mask0;\n vec4 rgba1 = vec4(convertHsvToRgb(vec3(0.125, 0.76, 1.0)), 1.0) * mask1;\n vec4 rgba2 = vec4(convertHsvToRgb(vec3(0.108, 0.91, 1.0)), 1.0) * mask2;\n vec4 rgba3 = vec4(convertHsvToRgb(vec3(0.1, 0.02, 0.99)), 1.0) * mask3;\n vec4 rgba4 = vec4(convertHsvToRgb(vec3(0.1, 0.2, 0.9)), 1.0) * mask4;\n\n float patternNoise1 = step(0.0, snoise(vPosition * 0.015 + vec3(0.0, 0.0, time * 0.1))) * 0.05;\n float patternNoise2 = step(0.2, snoise(vPosition * 0.025 + vec3(0.0, 1.0, time * 0.3))) * 0.03;\n vec4 patternColor = vec4(vec3(patternNoise1), 1.0) * mask1 + vec4(vec3(patternNoise2), 1.0) * mask2;\n\n vec4 eggColor = rgba0 + rgba1 + rgba2 + rgba3 + rgba4 + patternColor;\n\n gl_FragColor = eggColor;\n}\n"},28914:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main() {\n vPosition = position;\n vUv = uv;\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);\n}\n"},33274:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D tex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvoid main() {\n float noise = random(vUv) * 0.08;\n\n gl_FragColor = vec4(vColor + noise, 1.0);\n}\n"},44873:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nconst vec3 hsv1 = vec3(0.98, 0.9, 0.05);\nconst vec3 hsv2 = vec3(1.13, 0.9, 0.8);\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // calculate gradation with position.y\n vec3 rgb = convertHsvToRgb(mix(hsv1, hsv2, (normalize(position).y + 1.0) / 2.0));\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},97459:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nconst vec3 light = vec3(0.0, 1.0, 0.0);\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n vec3 hsv = vec3(0.88 + diff * 0.2, 1.0 - diff * 0.4, pow(diff, 3.0) * 0.88 + 0.12);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n"},92665:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},4653:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float noise = snoise(\n vPosition * vec3(0.005, 0.002, 0.004) + vec3(time * 2.6, -time * 3.6, time * 2.6)\n );\n float opacity = smoothstep(0.3, 0.8, (noise + 1.0) / 2.0 - (1.0 - smoothstep(0.0, 0.3, vUv.y) * (1.0 - smoothstep(0.3, 1.0, vUv.y))));\n vec3 hsv = vec3(0.98 + opacity * 0.2, 1.0 - opacity * 0.6, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, opacity);\n}\n"},44202:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvoid main(void) {\n float roundRadius = (1.0 - smoothstep(0.1, 1.0, uv.y)* 1.2) * 480.0;\n vec3 roundPosition = vec3(\n sin(radians(uv.x * 360.0)) * roundRadius,\n position.y + 900.0,\n cos(radians(uv.x * 360.0)) * roundRadius\n );\n\n float noise = (snoise(roundPosition * vec3(0.01, 0.0001, 0.01) + time * 0.8) + 0.5);\n float noiseRadius = noise * smoothstep(0.2, 0.3, uv.y) * 70.0;\n vec3 noisePosition = vec3(\n sin(radians(uv.x * 360.0)) * noiseRadius,\n 0.0,\n cos(radians(uv.x * 360.0)) * noiseRadius\n );\n\n vec4 mvPosition = modelViewMatrix * vec4(roundPosition + noisePosition, 1.0);\n\n vPosition = roundPosition;\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},13292:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDistance;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(-vPosition);\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n vec3 hsv = vec3(\n 0.86 + diff * 0.24,\n 1.0 - diff * 0.4,\n (diff * 0.88 + 0.12) * vDistance\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n"},25746:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 instancePosition;\nattribute float scale;\nattribute float rotate;\nattribute float speed;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vDistance;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvoid main(void) {\n mat4 scaleMat = calcScaleMat4(vec3(scale));\n mat4 rotateMatWorld = calcRotateMat4(vec3(0.0, rotate + time * speed * 0.2, 0.0));\n vec3 updatePosition = (scaleMat * vec4(position, 1.0)).xyz;\n vec4 mvPosition = modelViewMatrix * rotateMatWorld * vec4(updatePosition + instancePosition, 1.0);\n float distanceFromCenter = 1.0 - clamp(length(instancePosition) / 6000.0, 0.0, 0.8);\n\n vPosition = updatePosition + instancePosition;\n vUv = uv;\n vDistance = distanceFromCenter;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},68773:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D tex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vBlink;\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n\n vec4 texColor = texture2D(tex, vUv);\n vec3 color = (texColor.rgb - vBlink * length(p) * 0.8) * vColor;\n float opacity = texColor.a * 0.36;\n\n gl_FragColor = vec4(color, opacity);\n}\n"},94053:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 instancePosition;\nattribute float delay;\nattribute float rotate;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvarying float vBlink;\n\nconst float duration = 200.0;\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n float now = mod(time + delay * duration, duration) / duration;\n\n mat4 rotateMat = calcRotateMat4Z(radians(rotate * 360.0) + time * 0.1);\n vec3 rotatePosition = (rotateMat * vec4(position, 1.0)).xyz;\n\n vec3 moveRise = vec3(\n (now * 2.0 - 1.0) * (2500.0 - (delay * 2.0 - 1.0) * 2000.0),\n (now * 2.0 - 1.0) * 2000.0,\n sin(radians(time * 50.0 + delay + length(position))) * 30.0\n );\n vec3 updatePosition = instancePosition + moveRise + rotatePosition;\n\n vec3 hsv = vec3(time * 0.1 + delay * 0.2 + length(instancePosition) * 100.0, 0.5 , 0.8);\n vec3 rgb = convertHsvToRgb(hsv);\n float blink = (sin(radians(now * 360.0 * 20.0)) + 1.0) * 0.88;\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(updatePosition, 1.0);\n\n vPosition = position;\n vUv = uv;\n vColor = rgb;\n vBlink = blink;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},91481:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 imageResolution;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 ratio = vec2(\n min((resolution.x / resolution.y) / (imageResolution.x / imageResolution.y), 1.0),\n min((resolution.y / resolution.x) / (imageResolution.y / imageResolution.x), 1.0)\n );\n\n vec2 uv = vec2(\n vUv.x * ratio.x + (1.0 - ratio.x) * 0.5,\n vUv.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n gl_FragColor = texture2D(texture, uv);\n}\n"},2670:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},56521:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g_0 = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g_0;\n vec3 i1 = min( g_0.xyz, l.zxy );\n vec3 i2 = max( g_0.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nconst float interval = 3.0;\n\nvoid main(void){\n float strength = smoothstep(interval * 0.5, interval, interval - mod(time, interval));\n vec2 shake = vec2(strength * 8.0 + 0.5) * vec2(\n random(vec2(time)) * 2.0 - 1.0,\n random(vec2(time * 2.0)) * 2.0 - 1.0\n ) / resolution;\n\n float y = vUv.y * resolution.y;\n float rgbWave = (\n snoise(vec3(0.0, y * 0.01, time * 400.0)) * (2.0 + strength * 32.0)\n * snoise(vec3(0.0, y * 0.02, time * 200.0)) * (1.0 + strength * 4.0)\n + step(0.9995, sin(y * 0.005 + time * 1.6)) * 12.0\n + step(0.9999, sin(y * 0.005 + time * 2.0)) * -18.0\n ) / resolution.x;\n float rgbDiff = (6.0 + sin(time * 500.0 + vUv.y * 40.0) * (20.0 * strength + 1.0)) / resolution.x;\n float rgbUvX = vUv.x + rgbWave;\n float r = texture2D(texture, vec2(rgbUvX + rgbDiff, vUv.y) + shake).r;\n float g = texture2D(texture, vec2(rgbUvX, vUv.y) + shake).g;\n float b = texture2D(texture, vec2(rgbUvX - rgbDiff, vUv.y) + shake).b;\n\n float whiteNoise = (random(vUv + mod(time, 10.0)) * 2.0 - 1.0) * (0.15 + strength * 0.15);\n\n float bnTime = floor(time * 20.0) * 200.0;\n float noiseX = step((snoise(vec3(0.0, vUv.x * 3.0, bnTime)) + 1.0) / 2.0, 0.12 + strength * 0.3);\n float noiseY = step((snoise(vec3(0.0, vUv.y * 3.0, bnTime)) + 1.0) / 2.0, 0.12 + strength * 0.3);\n float bnMask = noiseX * noiseY;\n float bnUvX = vUv.x + sin(bnTime) * 0.2 + rgbWave;\n float bnR = texture2D(texture, vec2(bnUvX + rgbDiff, vUv.y)).r * bnMask;\n float bnG = texture2D(texture, vec2(bnUvX, vUv.y)).g * bnMask;\n float bnB = texture2D(texture, vec2(bnUvX - rgbDiff, vUv.y)).b * bnMask;\n vec4 blockNoise = vec4(bnR, bnG, bnB, 1.0);\n\n float bnTime2 = floor(time * 25.0) * 300.0;\n float noiseX2 = step((snoise(vec3(0.0, vUv.x * 2.0, bnTime2)) + 1.0) / 2.0, 0.12 + strength * 0.5);\n float noiseY2 = step((snoise(vec3(0.0, vUv.y * 8.0, bnTime2)) + 1.0) / 2.0, 0.12 + strength * 0.3);\n float bnMask2 = noiseX2 * noiseY2;\n float bnR2 = texture2D(texture, vec2(bnUvX + rgbDiff, vUv.y)).r * bnMask2;\n float bnG2 = texture2D(texture, vec2(bnUvX, vUv.y)).g * bnMask2;\n float bnB2 = texture2D(texture, vec2(bnUvX - rgbDiff, vUv.y)).b * bnMask2;\n vec4 blockNoise2 = vec4(bnR2, bnG2, bnB2, 1.0);\n\n float waveNoise = (sin(vUv.y * 1200.0) + 1.0) / 2.0 * (0.15 + strength * 0.2);\n\n gl_FragColor = vec4(r, g, b, 1.0) * (1.0 - bnMask - bnMask2) + (whiteNoise + blockNoise + blockNoise2 - waveNoise);\n}\n"},79541:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},27444:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},45582:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\n\nvarying vec3 vColor;\n\nvoid main() {\n vColor = vec3((position.y / 1000.0 + 1.0) * 0.12 + 0.88);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},61187:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D texture;\nuniform sampler2D texture2;\n\nconst float blur = 20.0;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color = vec4(0.0);\n for (float x = 0.0; x < blur; x++){\n for (float y = 0.0; y < blur; y++){\n color += texture2D(texture, vUv - (vec2(x, y) - vec2(blur / 2.0)) / resolution);\n }\n }\n vec4 color2 = color / pow(blur, 2.0);\n vec4 color3 = texture2D(texture2, vUv);\n gl_FragColor = vec4(color3.rgb, floor(length(color2.rgb)));\n}\n"},8820:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},53944:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},19160:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\n\nvarying vec3 vColor;\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvoid main() {\n float noise = snoise(\n vec3(position.x + time * 10.0, position.y + cos(time / 20.0) * 100.0, position.z + time * 10.0) / 800.0\n );\n vColor = hsv2rgb(vec3(noise * 0.2 + 0.75, 0.4, noise * 0.3 + 0.5));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},77644:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvoid main() {\n vec3 n;\n n.xy = gl_PointCoord.xy * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n gl_FragColor = vec4(1.0);\n}\n"},14623:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\n\nvec3 getPolarCoord(float rad1, float rad2, float r) {\n return vec3(\n cos(rad1) * cos(rad2) * r,\n sin(rad1) * r,\n cos(rad1) * sin(rad2) * r\n );\n}\n\nvoid main() {\n vec3 update_position = getPolarCoord(\n position.x,\n position.y + radians(time / 2.0),\n position.z + sin(radians(time * 2.0) + position.x + position.y) * position.z / 4.0\n );\n vec4 mv_position = modelViewMatrix * vec4(update_position, 1.0);\n\n gl_PointSize = 2.0 * (1000.0 / length(mv_position.xyz));\n gl_Position = projectionMatrix * mv_position;\n}\n"},5402:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\n#define GLSLIFY 1\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\nuniform DirectionalLight directionalLights[1];\n\nvarying vec3 vPosition;\nvarying mat4 vInvertMatrix;\n\nvoid main() {\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n vec3 inv_light = normalize(vInvertMatrix * vec4(directionalLights[0].direction, 1.0)).xyz;\n float diff = (dot(normal, inv_light) + 1.0) / 2.0 * 0.25 + 0.75;\n gl_FragColor = vec4(vec3(1.0) * diff, 1.0);\n}\n"},33176:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute float radius;\nattribute float radian;\nattribute float scale;\n\nuniform float time;\n\nvarying vec3 vPosition;\nvarying mat4 vInvertMatrix;\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nmat4 translateMatrix(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 rotationMatrixX(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 rotationMatrixY(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 rotationMatrixZ(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 rotationMatrix(float radian_x, float radian_y, float radian_z) {\n return rotationMatrixX(radian_x) * rotationMatrixY(radian_y) * rotationMatrixZ(radian_z);\n}\n\nmat4 scaleMatrix(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvec4 move(vec3 position) {\n return translateMatrix(\n vec3(\n cos(radians(time * 0.5) + radian) * radius,\n sin(radians(time * 0.5) + radian * 10.0) * radius * 0.3,\n sin(radians(time * 0.5) + radian) * radius\n )\n ) * rotationMatrix(\n radians(time * radian) + radian, radians(time) + radian, radians(time) + radian\n ) * scaleMatrix(\n vec3(20.0 * scale) + vec3(10.0) * snoise((position + sin(radian)))\n ) * vec4(position, 1.0);\n}\n\nvoid main() {\n vec4 update_position = move(position);\n vPosition = position;\n vInvertMatrix = inverse(rotationMatrix(\n radians(time * radian) + radian, radians(time) + radian, radians(time) + radian\n ));\n gl_Position = projectionMatrix * modelViewMatrix * update_position;\n}\n"},28408:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float size;\n\nvoid main() {\n vec3 n;\n n.xy = gl_PointCoord.xy * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n gl_FragColor = vec4(1.0);\n}\n"},12978:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 radian;\n\nuniform float time;\nuniform vec2 resolution;\nuniform float size;\nuniform vec2 force;\n\nvoid main() {\n float radius = 300.0;\n float radian_base = radians(time * 2.0);\n vec3 update_positon = position + vec3(\n cos(radian_base + radian.x) * cos(radian_base + radian.y) * radius,\n cos(radian_base + radian.x) * sin(radian_base + radian.y) * radius,\n sin(radian_base + radian.x) * radius\n ) * force.x;\n vec4 mvPosition = modelViewMatrix * vec4(update_positon, 1.0);\n\n gl_PointSize = (size + force.y) * (abs(sin(radian_base + radian.z))) * (size / length(mvPosition.xyz)) * 480.0;\n gl_Position = projectionMatrix * mvPosition;\n}\n"},7034:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 cameraPosition;\nuniform float time;\nuniform samplerCube cubeTex;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\n\nvoid main() {\n vec3 ref = reflect(vPosition - cameraPosition, vNormal);\n vec4 envColor = textureCube(cubeTex, ref);\n gl_FragColor = envColor * vec4(0.8, 1.0, 0.95, 0.7);\n}\n"},58702:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 translate;\nattribute float offset;\nattribute vec3 rotate;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main(void) {\n float radian = radians(time);\n mat4 rotateWorld = calcRotateMat4(vec3(radian) * vec3(5.0, 20.0, 1.0) + rotate);\n mat4 rotateSelf = calcRotateMat4(vec3(radian) * rotate * 100.0);\n vec4 updatePosition =\n rotateWorld\n * calcTranslateMat4(translate)\n * rotateSelf\n * vec4(position + normalize(position) * offset, 1.0);\n vPosition = (modelMatrix * updatePosition).xyz;\n vNormal = (modelMatrix * rotateWorld * rotateSelf * vec4(normal, 0.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n"},64529:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec2 resolution;\nuniform sampler2D texture;\nuniform float strengthZoom;\nuniform float strengthGlitch;\n\nvarying vec2 vUv;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvoid main(void){\n // zoom blur\n vec2 tFrag = 1.0 / resolution;\n float nFrag = 1.0 / 30.0;\n vec2 centerOffset = resolution / 2.0;\n vec3 destColor = vec3(0.0);\n vec2 fcc = gl_FragCoord.xy - centerOffset;\n float totalWeight = 0.0;\n\n for(float i = 0.0; i <= 30.0; i++){\n float percent = (i + random(gl_FragCoord.xy)) * nFrag;\n float weight = percent - percent * percent;\n vec2 t = gl_FragCoord.xy - fcc * percent * strengthZoom * nFrag;\n destColor += texture2D(texture, t * tFrag).rgb * weight;\n totalWeight += weight;\n }\n vec4 zoomColor = vec4(destColor / totalWeight, 1.0);\n\n // glitch\n float strengthWhiteNoise = min(strengthGlitch * 0.05, 0.1);\n float whiteNoise = (random(gl_FragCoord.xy + time) * 2.0 - 1.0) * (0.05 + strengthWhiteNoise);\n\n float strengthBlockNoise = min(strengthGlitch * 0.15, 1.2);\n float noiseX = step((snoise(vec3(0.0, gl_FragCoord.x / resolution.x * 1.0, time * 600.0)) + 1.0) / 2.0, strengthBlockNoise * 0.6);\n float noiseY = step((snoise(vec3(0.0, gl_FragCoord.y / resolution.y * 3.0, time * 200.0)) + 1.0) / 2.0, strengthBlockNoise * 0.3);\n float blockNoiseMask = noiseX * noiseY;\n vec4 blockNoise = texture2D(texture, 1.0 - vUv) * blockNoiseMask;\n\n gl_FragColor = zoomColor + whiteNoise + blockNoise;\n}\n"},4998:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},67965:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform samplerCube cubeTex;\n\nvarying vec3 vPosition;\n\nvoid main() {\n vec3 normal = normalize(vPosition);\n vec4 color = textureCube(cubeTex, normal);\n gl_FragColor = color;\n}\n"},70301:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\n\nvoid main(void) {\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},72413:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float addH1;\nuniform float addH2;\n\nvarying vec3 vPosition;\nvarying vec3 vMPosition;\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float edge1 = 48.0;\nconst float edge2 = 24.0;\nconst float edge3 = 8.0;\nconst float range = 14.0;\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vMPosition), dFdy(vMPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n float stepTop = smoothstep(edge1, edge1 + range, vPosition.y);\n float stepMiddle1 = smoothstep(edge2, edge2 + range, vPosition.y) * (1.0 - smoothstep(edge1, edge1 + range, vPosition.y));\n float stepMiddle2 = smoothstep(edge3, edge3 + range, vPosition.y) * (1.0 - smoothstep(edge2, edge2 + range, vPosition.y));\n float stepBottom = 1.0 - smoothstep(edge3, edge3 + range, vPosition.y);\n\n vec4 colorTop = vec4(convertHsvToRgb(vec3( 0.1 + addH1, 0.1, 0.8)), 1.0) * stepTop;\n vec4 colorMiddle1 = vec4(convertHsvToRgb(vec3(0.25 + addH2, 0.4, 0.6)), 1.0) * stepMiddle1;\n vec4 colorMiddle2 = vec4(convertHsvToRgb(vec3(0.25 + addH2, 0.25, 0.8)), 1.0) * stepMiddle2;\n vec4 colorBottom = vec4(convertHsvToRgb(vec3( 0.1 + addH1, 0.4, 0.3)), 1.0) * stepBottom;\n\n vec4 colorAll = (colorTop + colorMiddle1 + colorMiddle2 + colorBottom) * diff;\n\n gl_FragColor = colorAll;\n}\n"},31382:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying vec3 vMPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vMPosition = mPosition.xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n"},53822:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float addH;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vSinAll;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = dot(normal, light);\n\n vec4 color = vec4(convertHsvToRgb(vec3(0.2 + vSinAll * 0.15 + addH, 0.2, 1.0)), 0.4);\n\n gl_FragColor = color * vec4(vec3(diff), 1.0);\n}\n"},40557:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vSinAll;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nvoid main(void) {\n float sin1 = sin(time + position.x / 16.0);\n float sin2 = sin(time + position.y / 8.0);\n float sin3 = sin(time - length(position.xy + 50.0) / 4.0);\n float sinAll = (sin1 + sin2 * 0.5 + sin3 * 0.2) / 1.7;\n mat4 waveMat = calcTranslateMat4(vec3(0.0, 0.0, sinAll * 1.5));\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * waveMat * vec4(position, 1.0);\n\n vPosition = mPosition.xyz;\n vUv = uv;\n vSinAll = sinAll;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n"},12294:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\n#define GLSLIFY 1\n\nuniform float time;\nuniform float acceleration;\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\nvarying mat4 invertMatrix;\n\nvoid main() {\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n vec3 inv_light = normalize(invertMatrix * vec4(0.7, -0.7, 0.7, 1.0)).xyz;\n float diff = (dot(normal, inv_light) + 1.0) / 4.0 + 0.4;\n gl_FragColor = vec4(vColor * diff, 1.0);\n}\n"},30958:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\nuniform float acceleration;\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\nvarying mat4 invertMatrix;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvec3 rotate(vec3 p, float radian_x, float radian_y, float radian_z) {\n mat3 mx = mat3(\n 1.0, 0.0, 0.0,\n 0.0, cos(radian_x), -sin(radian_x),\n 0.0, sin(radian_x), cos(radian_x)\n );\n mat3 my = mat3(\n cos(radian_y), 0.0, sin(radian_y),\n 0.0, 1.0, 0.0,\n -sin(radian_y), 0.0, cos(radian_y)\n );\n mat3 mz = mat3(\n cos(radian_z), -sin(radian_z), 0.0,\n sin(radian_z), cos(radian_z), 0.0,\n 0.0, 0.0, 1.0\n );\n return mx * my * mz * p;\n}\n\nvec3 getRotate(vec3 p) {\n return rotate(p, radians(time / 6.0), radians(time / 7.0), radians(time / 8.0));\n}\n\nvoid main() {\n float updateTime = time / 400.0;\n vec3 p_rotate = getRotate(position);\n float noise = snoise(vec3(p_rotate / 12.1 + updateTime * 0.5));\n vec3 p_noise = p_rotate + p_rotate * noise / 20.0 * (min(acceleration, 6.0) + 1.0);\n\n vPosition = p_noise;\n vColor = hsv2rgb(vec3(updateTime + position.y / 400.0, 0.05 + min(acceleration / 10.0, 0.25), 1.0));\n invertMatrix = inverse(modelMatrix);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(p_noise, 1.0);\n}\n"},73845:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform float time;\nuniform float time2;\nuniform float acceleration;\nuniform vec2 resolution;\n\nvarying mat4 m_matrix;\n\n// const vec3 cPos = vec3(0.0, 0.0, 10.0);\nconst float targetDepth = 3.5;\nconst vec3 lightDir = vec3(0.577, -0.577, 0.577);\n\nvec3 hsv2rgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 rotate(vec3 p, float radian_x, float radian_y, float radian_z) {\n mat3 mx = mat3(\n 1.0, 0.0, 0.0,\n 0.0, cos(radian_x), -sin(radian_x),\n 0.0, sin(radian_x), cos(radian_x)\n );\n mat3 my = mat3(\n cos(radian_y), 0.0, sin(radian_y),\n 0.0, 1.0, 0.0,\n -sin(radian_y), 0.0, cos(radian_y)\n );\n mat3 mz = mat3(\n cos(radian_z), -sin(radian_z), 0.0,\n sin(radian_z), cos(radian_z), 0.0,\n 0.0, 0.0, 1.0\n );\n return mx * my * mz * p;\n}\n\nfloat dBox(vec3 p, vec3 size) {\n return length(max(abs(p) - size, 0.0));\n}\n\nfloat getNoise(vec3 p) {\n return snoise(p * (0.4 + acceleration * 0.1) + time / 100.0);\n}\n\nvec3 getRotate(vec3 p) {\n return rotate(p, radians(time2), radians(time2 * 2.0), radians(time2));\n}\n\nfloat distanceFunc(vec3 p) {\n vec4 p1 = m_matrix * vec4(p, 1.0);\n float n1 = getNoise(p1.xyz);\n vec3 p2 = getRotate(p1.xyz);\n float d1 = dBox(p2, vec3(0.8 - min(acceleration, 0.8))) - 0.2;\n float d2 = dBox(p2, vec3(1.0)) - n1;\n float d3 = dBox(p2, vec3(0.5 + acceleration * 0.4)) - n1;\n return min(max(d1, -d2), d3);\n}\n\nfloat distanceFuncForFill(vec3 p) {\n vec4 p1 = m_matrix * vec4(p, 1.0);\n float n = getNoise(p1.xyz);\n vec3 p2 = getRotate(p1.xyz);\n return dBox(p2, vec3(0.5 + acceleration * 0.4)) - n;\n}\n\nvec3 getNormal(vec3 p) {\n const float d = 0.1;\n return normalize(vec3(\n distanceFunc(p + vec3(d, 0.0, 0.0)) - distanceFunc(p + vec3(-d, 0.0, 0.0)),\n distanceFunc(p + vec3(0.0, d, 0.0)) - distanceFunc(p + vec3(0.0, -d, 0.0)),\n distanceFunc(p + vec3(0.0, 0.0, d)) - distanceFunc(p + vec3(0.0, 0.0, -d))\n ));\n}\n\nvoid main() {\n vec2 p = (gl_FragCoord.xy * 2.0 - resolution) / min(resolution.x, resolution.y);\n\n vec3 cDir = normalize(cameraPosition * -1.0);\n vec3 cUp = vec3(0.0, 1.0, 0.0);\n vec3 cSide = cross(cDir, cUp);\n\n vec3 ray = normalize(cSide * p.x + cUp * p.y + cDir * targetDepth);\n\n float distance = 0.0;\n float rLen = 0.0;\n vec3 rPos = cameraPosition;\n for(int i = 0; i < 64; i++){\n distance = distanceFunc(rPos);\n rLen += distance;\n rPos = cameraPosition + ray * rLen * 0.2;\n }\n\n vec3 normal = getNormal(rPos);\n if(abs(distance) < 0.5){\n if (distanceFuncForFill(rPos) > 0.5) {\n gl_FragColor = vec4(hsv2rgb(vec3(dot(normal, cUp) * 0.8 + time / 400.0, 0.2, dot(normal, cUp) * 0.8 + 0.1)), 1.0);\n } else {\n gl_FragColor = vec4(hsv2rgb(vec3(dot(normal, cUp) * 0.1 + time / 400.0, 0.8, dot(normal, cUp) * 0.2 + 0.8)), 1.0);\n }\n } else {\n gl_FragColor = vec4(0.0);\n }\n}\n"},30755:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying mat4 m_matrix;\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvoid main(void) {\n m_matrix = inverse(modelMatrix);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},9628:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},37581:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvoid main(void) {\n vec2 p = uv * 2.0 - 1.0;\n float show = min(time, 0.2) / 0.2;\n\n // calculate gradation\n vec3 hsv = vec3(\n p.y * 0.1 + 0.07,\n 1.0 - show * 0.2,\n 0.1 + show * 0.8\n );\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},32450:function(e,t){"use strict";t.Z='#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float drawBrightOnly;\nuniform float dissolveEdge;\n\nvarying vec3 vPosition;\nvarying vec3 vMPosition;\nvarying vec2 vUv;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvoid main() {\n // Flat Shading\n vec3 normal = normalize(cross(dFdx(vMPosition), dFdy(vMPosition)));\n\n vec3 light1 = normalize(vec3(0.0, 0.333, 1.0));\n float d1 = (dot(normal, light1) + 1.0) / 2.0;\n float glow1A = smoothstep(0.875, 1.0, d1);\n float glow1B = smoothstep(0.75, 1.0, d1) * 0.8;\n\n vec3 light2 = normalize(vec3(-0.0, -0.333, 1.0));\n float d2 = (dot(normal, light2) + 1.0) / 2.0;\n float glow2A = smoothstep(0.875, 1.0, d2);\n float glow2B = smoothstep(0.75, 1.0, d2) * 0.8;\n\n // dissolve\n float show1 = exponentialOut(min(time - 1.0, 6.0) / 6.0);\n float show2 = exponentialOut(clamp(time - 3.0, 0.0, 3.0) / 3.0);\n float dissolveA = cnoise(\n vec3(\n vPosition.x * 0.06,\n (vPosition.y - vPosition.x * 0.5 + vPosition.z * 0.5) * 0.18,\n vPosition.z * 0.06\n ) + time * 0.02\n ) * 0.5 + 0.5;\n float dissolveB = cnoise(\n vec3(\n vPosition.x * 0.4,\n (vPosition.y - vPosition.x * 0.5 + vPosition.z * 0.5) * .9,\n vPosition.z * 0.4\n )\n ) * 0.5 + 0.5;\n float dissolve1 = smoothstep(\n 0.01 + show2 * 0.35 + dissolveEdge,\n 0.015 + show2 * 0.35 + dissolveEdge,\n dissolveA * 0.8 + dissolveB * 0.2\n );\n float dissolve2 = smoothstep(\n 0.0 + show2 * 0.35 + dissolveEdge,\n 0.005 + show2 * 0.35 + dissolveEdge,\n dissolveA * 0.8 + dissolveB * 0.2\n );\n float dissolve3 = smoothstep(\n show1 - 0.05,\n show1 - 0.04,\n dissolveA * 0.8 + dissolveB * 0.2\n );\n float dissolve4 = smoothstep(\n show1 - 0.01,\n show1,\n dissolveA * 0.8 + dissolveB * 0.2\n );\n\n // define colors.\n float h = dissolveA * 0.2 - 0.02;\n vec3 hsv1 = vec3(\n h,\n (glow1A + glow2A) * 0.8 + 0.2,\n (glow1A + glow2A) * 0.25 + 0.05\n );\n vec3 rgb1 = convertHsvToRgb(hsv1);\n\n // define colors.\n vec3 hsv2 = vec3(\n h + (glow1B + glow2B) * 0.1 - 0.05,\n 0.7,\n (glow1B + glow2B) * 0.7 + 0.22\n );\n vec3 rgb2 = convertHsvToRgb(hsv2);\n\n gl_FragColor = vec4(rgb1 * dissolve1 * (1.0 - dissolve3) * (1.0 - drawBrightOnly) + rgb2 * (1.0 - dissolve2) + rgb2 * dissolve3, 1.0 - dissolve4);\n}\n'},30673:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat3 normalMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec3 vMPosition;\nvarying vec2 vUv;\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvoid main(void) {\n float show = exponentialOut(min(time - 1.0, 4.0) / 4.0);\n\n // coordinate transformation\n mat4 scaleMat = calcScaleMat4(vec3(0.5 + show * 0.5));\n vec4 mPosition = modelMatrix * scaleMat * vec4(position, 1.0);\n vec4 mvPosition = viewMatrix *mPosition;\n\n vPosition = position;\n vMPosition = mPosition.xyz;\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},94914:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main() {\n gl_FragColor = vColor;\n}\n"},58259:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 iPosition;\nattribute vec3 iColor;\nattribute vec3 iRotate;\nattribute float iDelay;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nconst float DURATION = 5.5;\n\nvoid main(void) {\n float alpha = clamp(time, 0.0, DURATION) / DURATION;\n\n // coordinate transformation\n mat4 rotateMat1 = calcRotateMat4(iRotate);\n mat4 rotateMat2 = calcRotateMat4(vec3(0.0, (time + iDelay) * 14.0, 0.0));\n vec3 rotate = (rotateMat1 * rotateMat2 * vec4(position, 1.0)).xyz;\n vec3 move = vec3(0.0, 0.0, exponentialOut(alpha) * 40.0 + time * 4.0);\n vec4 mPosition = modelMatrix * vec4(iPosition + rotate + move, 1.0);\n\n float opacity = smoothstep(0.0, 0.05, alpha) * (1.0 - smoothstep(0.9, 1.0, alpha));\n\n vPosition = position;\n vUv = uv;\n vColor = vec4(iColor, opacity);\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n"},35382:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform vec2 resolution;\n\nvarying vec2 vUv;\n\nconst float godrayIteration = 60.0;\nconst float godrayStrength = 24.0;\n\nfloat random2(vec2 c){\n return fract(sin(dot(c.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\nfloat randomNoise(vec2 p) {\n return (random2(p - vec2(sin(time))) * 2.0 - 1.0) * 0.02;\n}\n\nvoid main() {\n // Convert uv to the other vec2 has a range from -1.0 to 1.0.\n vec2 p = vUv * 2.0 - 1.0;\n vec2 ratio = 1.0 / resolution;\n\n // Random Noise\n float rNoise = randomNoise(vUv);\n\n // get texture color.\n vec4 texColor = texture2D(texture1, vUv);\n\n // godray\n vec2 godrayCenter = vec2(0.5);\n vec3 godrayDestColor = vec3(0.0);\n float godrayTotalWeight = 0.0;\n\n for (float i = 0.0; i < 60.0; i++) {\n float alpha = i / godrayIteration; // step in loop [0, 1].\n float weight = alpha - alpha * alpha; // conic curve [0, 0.25, 0].\n vec2 shiftUv = vUv - (vUv - godrayCenter) * alpha * godrayStrength / godrayIteration; // define a range of to shift UV.\n godrayDestColor += texture2D(texture2, shiftUv).rgb * weight; // draw gradation.\n godrayTotalWeight += weight;\n }\n vec3 godray = godrayDestColor / godrayTotalWeight;\n\n // Sum total of colors.\n vec3 color = texColor.rgb + rNoise + godray * 0.5;\n\n gl_FragColor = vec4(color, 1.0);\n}\n"},7799:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n gl_Position = vec4(position, 1.0);\n}\n"},71949:function(e,t){"use strict";t.Z='precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D tex;\nuniform float drawBrightOnly;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vTime1;\nvarying float vTime2;\nvarying float vTime3;\nvarying float vTime4;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvoid main() {\n vec2 p = vUv * 2.0 - 1.0;\n vec4 texColor = texture2D(tex, vUv);\n\n float noise = cnoise(vPosition * vec3(1.6)) * 0.5 + 0.5;\n float opacity1 = smoothstep(0.0, 0.01, (1.2 - length(p)) + noise * 0.8 + vTime1 * 2.0 - 2.0);\n float opacity2 = smoothstep(0.0, 0.01, (1.2 - length(p)) + noise * 0.8 + vTime2 * 2.0 - 2.0);\n float opacity3 = smoothstep(0.0, 0.01, (1.2 - length(p)) + noise * 0.8 + vTime3 * 2.0 - 2.0);\n float opacity4 = smoothstep(0.0, 0.01, (1.2 - length(p)) + noise * 0.8 + vTime4 * 2.0 - 2.0);\n\n vec4 color1 = vec4(vec3(1.0, 1.0, 0.9), 0.9) * (opacity1 - opacity2);\n vec4 color2 = vec4(vec3(1.0, 1.0, 0.9), 0.05) * (opacity2 - opacity3);\n vec4 color3 = vec4(vec3(0.7, 0.1, 0.1), 0.9) * (opacity3 - opacity4);\n vec4 color4 = vec4(vec3(1.0, 1.0, 0.9), 0.05) * opacity4;\n\n if (texColor.a < 0.5) discard;\n gl_FragColor =\n (\n (color1 + color2 + color3 + color4) * (1.0 - drawBrightOnly)\n + vec4(vec3(0.0), opacity3 - opacity4) * drawBrightOnly\n )\n * vec4(vec3(1.0), texColor.a);\n}\n'},59751:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float time2;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vTime1;\nvarying float vTime2;\nvarying float vTime3;\nvarying float vTime4;\n\nfloat circularOut(float t) {\n return sqrt((2.0 - t) * t);\n}\n\nvoid main(void) {\n // Defined several timers.\n float timeA = circularOut(clamp(time - 1.0, 0.0, 2.0) / 2.0);\n float timeB = circularOut(clamp(time - 3.0, 0.0, 2.0) / 2.0);\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position + vec3(0.0, 0.0, (1.0 - timeA) * 20.0), 1.0);\n\n vPosition = position;\n vUv = uv;\n vTime1 = timeA;\n vTime2 = timeB;\n vTime3 = circularOut(smoothstep(0.0, 0.8, time2));\n vTime4 = circularOut(smoothstep(5.0, 7.0, time2));\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n"},17203:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D tex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvoid main() {\n float noise = random(vUv) * 0.08;\n\n gl_FragColor = vec4(vColor + noise, 1.0);\n}\n"},67127:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying vec3 vColor;\n\nconst vec3 hsv1 = vec3(0.0, 0.6, 0.4);\nconst vec3 hsv2 = vec3(0.24, 0.6, 0.4);\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // calculate gradation with position.y\n vec3 rgb = convertHsvToRgb(mix(hsv1, hsv2, (normalize(position).y + 1.0) / 2.0));\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},55643:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvoid main() {\n gl_FragColor = vec4(vec3(1.0), vOpacity);\n}\n"},58764:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 position2;\nattribute vec2 uv;\nattribute float opacity;\nattribute float opacity2;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float timeTransform;\nuniform float durationTransform;\nuniform float prevIndex;\nuniform float nextIndex;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main(void) {\n // transform\n vec3 prevPosition =\n position * (1.0 - step(1.0, prevIndex))\n + position2 * step(1.0, prevIndex) * (1.0 - step(2.0, prevIndex));\n vec3 nextPosition =\n position * (1.0 - step(1.0, nextIndex))\n + position2 * step(1.0, nextIndex) * (1.0 - step(2.0, nextIndex));\n float prevOpacity =\n opacity * (1.0 - step(1.0, prevIndex))\n + opacity2 * step(1.0, prevIndex) * (1.0 - step(2.0, prevIndex));\n float nextOpacity =\n opacity * (1.0 - step(1.0, nextIndex))\n + opacity2 * step(1.0, nextIndex) * (1.0 - step(2.0, nextIndex));\n float ease = exponentialOut(min(timeTransform / 1.0, durationTransform) / durationTransform);\n vec3 mixPosition = mix(prevPosition, nextPosition, ease);\n float mixOpacity = mix(prevOpacity, nextOpacity, ease);\n\n // calculate shake moving.\n float now = time * 10.0 + length(mixPosition);\n mat4 rotateMat = calcRotateMat4(vec3(now));\n vec3 shake = (rotateMat * vec4(vec3(0.0, sin(now) * 5.0, 0.0), 1.0)).xyz;\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(mixPosition + shake, 1.0);\n\n vPosition = mixPosition;\n vUv = uv;\n vOpacity = mixOpacity;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},37094:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying float vOpacity;\n\nvoid main() {\n // Round the point\n vec3 n;\n n.xy = gl_PointCoord * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n\n gl_FragColor = vec4(vec3(1.0), vOpacity);\n}\n"},99886:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 position2;\nattribute float opacity;\nattribute float opacity2;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float timeTransform;\nuniform float durationTransform;\nuniform float prevIndex;\nuniform float nextIndex;\n\nvarying float vOpacity;\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main() {\n // transform\n vec3 prevPosition =\n position * (1.0 - step(1.0, prevIndex))\n + position2 * step(1.0, prevIndex) * (1.0 - step(2.0, prevIndex));\n vec3 nextPosition =\n position * (1.0 - step(1.0, nextIndex))\n + position2 * step(1.0, nextIndex) * (1.0 - step(2.0, nextIndex));\n float prevOpacity =\n opacity * (1.0 - step(1.0, prevIndex))\n + opacity2 * step(1.0, prevIndex) * (1.0 - step(2.0, prevIndex));\n float nextOpacity =\n opacity * (1.0 - step(1.0, nextIndex))\n + opacity2 * step(1.0, nextIndex) * (1.0 - step(2.0, nextIndex));\n float ease = exponentialOut(min(timeTransform / 1.0, durationTransform) / durationTransform);\n vec3 mixPosition = mix(prevPosition, nextPosition, ease);\n float mixOpacity = mix(prevOpacity, nextOpacity, ease);\n\n // calculate shake moving.\n float now = time * 10.0 + length(mixPosition);\n mat4 rotateMat = calcRotateMat4(vec3(now));\n vec3 shake = (rotateMat * vec4(vec3(0.0, sin(now) * 5.0, 0.0), 1.0)).xyz;\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(mixPosition + shake, 1.0);\n\n vOpacity = mixOpacity;\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 8.0;\n}\n"},85530:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\n\nvoid main() {\n gl_FragColor = vec4(vec3(1.0), vOpacity);\n}\n"},31180:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nuniform vec2 resolution;\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform float time;\nuniform vec2 vTouchMove;\n\nvarying vec2 vUv;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\n#ifndef PRECISION\n#define PRECISION 0.000001\n#endif\n\nvec3 drag(vec3 a, float value) {\n return normalize(a * -1.0 + PRECISION) * length(a) * value;\n}\n\nvoid main(void) {\n vec3 v = texture2D(velocity, vUv).xyz;\n vec3 a = texture2D(acceleration, vUv).xyz;\n float noise = sqrt(length(v)) * 10.0;\n vec3 d = drag(a, 0.028);\n float fx = cnoise(vec3(time * 0.1, v.y / noise, v.z / noise));\n float fy = cnoise(vec3(v.x / noise, time * 0.1, v.z / noise));\n float fz = cnoise(vec3(v.x / noise, v.y / noise, time * 0.1));\n vec3 f1 = vec3(fx, fy, fz) * 0.24;\n vec3 f2 = vec3(vTouchMove * 16.0 * (resolution / 640.0), 0.0);\n vec3 f3 = a + f1 + f2 + d;\n float vStep = 1.0 - step(1000.0, length(v + f3));\n gl_FragColor = vec4(f3 * vStep, 1.0);\n}\n'},30231:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},60791:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nuniform sampler2D velocity;\nuniform sampler2D acceleration;\nuniform float time;\n\nvarying vec2 vUv;\n\nvec3 spherical(float radian1, float radian2, float radius) {\n return vec3(\n cos(radian1) * cos(radian2) * radius,\n sin(radian1) * radius,\n cos(radian1) * sin(radian2) * radius\n );\n}\n\nconst float radius = 100.0;\n\nvoid main(void) {\n vec3 a = texture2D(acceleration, vUv).xyz;\n vec3 v = texture2D(velocity, vUv).xyz;\n float vStep = step(0.000001, length(a));\n gl_FragColor = vec4(\n (a + v) * vStep + normalize(v + spherical(time, -time, 1.0)) * radius * (1.0 - vStep),\n 1.0\n );\n}\n"},50474:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nvarying vec2 vUv;\n\nvoid main(void) {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},79511:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vAcceleration;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float start = smoothstep(time, 0.0, 1.0);\n vec3 n;\n n.xy = gl_PointCoord * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n float aLength = length(vAcceleration);\n vec3 color = convertHsvToRgb(vec3(aLength * 0.08 + time * 0.05, 0.5, 0.8));\n gl_FragColor = vec4(color, 0.15 * start);\n}\n"},8924:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uvVelocity;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float time;\nuniform sampler2D acceleration;\nuniform sampler2D velocity;\n\nvarying vec3 vAcceleration;\n\nvoid main() {\n vec3 a = texture2D(acceleration, uvVelocity).xyz;\n vec3 v = texture2D(velocity, uvVelocity).xyz;\n vec4 mvPosition = modelViewMatrix * vec4(v, 1.0);\n vAcceleration = a;\n gl_PointSize = 500.0 / length(mvPosition.xyz);\n gl_Position = projectionMatrix * mvPosition;\n}\n"},98640:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},58113:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture1;\nuniform sampler2D texture2;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color1 = texture2D(texture1, vUv);\n vec4 color2 = texture2D(texture2, vUv);\n gl_FragColor = color1 * 0.6 + color2;\n}\n"},143:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 direction;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvec4 gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 step = radius / resolution * direction;\n color += texture2D(texture, uv - 4.0 * step) * 0.02699548325659403;\n color += texture2D(texture, uv - 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv - 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv - 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv) * 0.19947114020071635;\n color += texture2D(texture, uv + 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv + 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv + 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv + 4.0 * step) * 0.02699548325659403;\n return color;\n}\n\nvoid main() {\n vec4 color = gaussianBlur(texture, vUv, 1.0, resolution, direction);\n gl_FragColor = color;\n}\n"},29336:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float minBright;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 bright = max(vec4(0.0), (texture2D(texture, vUv) - minBright));\n gl_FragColor = bright;\n}\n"},48448:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D tex;\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},74766:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float addH;\n\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // calculate gradation with position.y\n vec3 hsv1 = vec3(addH + 0.22, 0.12, 0.96);\n vec3 hsv2 = vec3(addH - 0.22, 0.12, 0.96);\n vec3 rgb = convertHsvToRgb(mix(hsv1, hsv2, (normalize(position).y + 1.0) / 2.0));\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},82636:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n vec3 hsv = vec3(0.0, 0.0, 0.8 + diff * 0.2);\n vec3 rgb = convertHsvToRgb(hsv);\n\n gl_FragColor = vec4(rgb, 1.0);\n}\n"},23234:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 instancePosition;\nattribute vec3 instanceRotate;\nattribute vec3 instanceScale;\nattribute float speed;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvoid main(void) {\n // added Noise to form like a cloud.\n float noise = snoise(position + instancePosition);\n vec3 noiseEasePos = normalize(vec3(position.x, position.y, 0.01)) * exponentialOut(1.0 - abs(position.z / 10.0)) * vec3(0.4, 1.0, 1.0);\n vec3 noisePosition = (noise + 1.0) / 2.0 * noiseEasePos * 3.0 + noiseEasePos * 1.0;\n\n // coordinate transformation\n mat4 translateMat = calcTranslateMat4(instancePosition);\n mat4 rotateMat = calcRotateMat4(instanceRotate);\n mat4 scaleMat = calcScaleMat4(instanceScale);\n mat4 worldRotateMat = calcRotateMat4(vec3(0.0, -time * speed, 0.0));\n vec4 mvPosition = modelViewMatrix * worldRotateMat * translateMat * rotateMat * scaleMat * vec4(position + noisePosition, 1.0);\n\n vPosition = mvPosition.xyz;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},64557:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float addH1;\nuniform float addH2;\n\nvarying vec3 vMPosition;\nvarying float vHeight;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float edge1 = 56.0;\nconst float edge2 = 52.0;\nconst float edge3 = 50.0;\nconst float range = 2.0;\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vMPosition), dFdy(vMPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n float stepTop = smoothstep(edge1, edge1 + range, vHeight);\n float stepMiddle1 = smoothstep(edge2, edge2 + range, vHeight) * (1.0 - smoothstep(edge1, edge1 + range, vHeight));\n float stepMiddle2 = smoothstep(edge3, edge3 + range, vHeight) * (1.0 - smoothstep(edge2, edge2 + range, vHeight));\n float stepBottom = 1.0 - smoothstep(edge3, edge3 + range, vHeight);\n\n vec4 colorTop = vec4(convertHsvToRgb(vec3(0.25 + addH1, 0.05, 1.0)), 1.0) * stepTop;\n vec4 colorMiddle1 = vec4(convertHsvToRgb(vec3(0.25 + addH2, 0.05, 1.0)), 1.0) * stepMiddle1;\n vec4 colorMiddle2 = vec4(convertHsvToRgb(vec3(0.25 + addH2, 0.1, 0.9)), 1.0) * stepMiddle2;\n vec4 colorBottom = vec4(convertHsvToRgb(vec3(0.25 + addH1, 0.1, 0.9)), 1.0) * stepBottom;\n\n vec4 colorAll = (colorTop + colorMiddle1 + colorMiddle2 + colorBottom) * diff;\n\n gl_FragColor = colorAll;\n}\n"},59870:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vMPosition;\nvarying float vHeight;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n\n vHeight = length(position);\n vMPosition = mPosition.xyz;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n"},76161:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float addH;\n\nvarying vec3 vPosition;\nvarying float vSinAll;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(-1.0, 1.0, 1.0));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n vec4 color = vec4(convertHsvToRgb(vec3(0.2 + vSinAll * 0.08 + addH, 0.4, 1.0)), 0.8);\n\n gl_FragColor = color * vec4(vec3(diff), 1.0);\n}\n"},78081:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying float vSinAll;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nvoid main(void) {\n float sin1 = sin(time + position.x / 16.0);\n float sin2 = sin(time + position.y / 8.0);\n float sin3 = sin(time - length(position.xy + 50.0) / 4.0);\n float sinAll = (sin1 + sin2 * 0.5 + sin3 * 0.2) / 1.7;\n mat4 waveMat = calcTranslateMat4(vec3(0.0, 0.0, sinAll * 1.5));\n\n // coordinate transformation\n vec4 mPosition = modelMatrix * waveMat * vec4(position, 1.0);\n\n vPosition = mPosition.xyz;\n vSinAll = sinAll;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n}\n"},29014:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float colorH;\nuniform float noiseRange;\n\nvarying vec2 vUv;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nfloat exponentialOut(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvoid main() {\n float t1 = exponentialOut(min(time, 1.0) / 1.0);\n float t2 = exponentialOut(clamp(time - 14.0, 0.0, 1.0) / 1.0);\n vec2 pos = vUv * 2.0 - vec2(1.0);\n float circleOut = smoothstep(0.0, 0.5, t1 - t2 - length(pos));\n float circleIn = smoothstep(0.0, 0.5, (t1 - t2) * 0.5 - length(pos));\n float noise = (snoise(vec3(pos * (1.4 + noiseRange * 0.1) + vec2(sin(time), cos(time)), time + noiseRange * 100.0)) + 1.0) / 2.0;\n float mask = circleOut * noise + circleIn;\n float opacity = 1.0 - step(mask, 0.3);\n float h1 = step(mask, 0.99) * 0.4 - time * 0.05;\n float h2 = step(mask, 0.4) * 0.5;\n vec3 hsv = vec3(h1 - h2 + colorH, 0.45, 0.8);\n vec3 rgb = convertHsvToRgb(hsv);\n gl_FragColor = vec4(rgb, opacity);\n}\n"},52402:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);\n}\n"},54864:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec3 cameraPosition;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec3 vColor;\n\nconst vec3 light = vec3(0.7);\n\nvoid main() {\n float diff = (dot(vNormal, light) + 1.0) / 2.0 * 0.25 + 0.75;\n float opacity = (1.0 - (vPosition.z / 1000.0)) * 0.8 + 0.2;\n gl_FragColor = vec4(vColor * diff, opacity);\n}\n"},58754:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute float radian;\nattribute vec3 hsv;\nattribute float noiseDiff;\nattribute float speed;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float rotate;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec3 vColor;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvoid main(void) {\n float noise = snoise(position * 0.02 + time * speed + noiseDiff);\n mat4 rotateMatWorld = calcRotateMat4(vec3(0.0, radian + radians(rotate), 0.0));\n mat4 translateMat = calcTranslateMat4(vec3(1000.0, 0.0, 0.0));\n vec4 updatePosition = rotateMatWorld * translateMat * vec4(\n position + normalize(position) * noise * 5.0,\n 1.0\n );\n vPosition = updatePosition.xyz;\n vNormal = normal;\n vColor = convertHsvToRgb(hsv);\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n"},71955:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec4 vUv;\nvarying mat4 vInvertMatrix;\n\nvoid main() {\n vec4 projectorColor;\n if (all(bvec4(vUv.x >= 0.0, vUv.y >= 0.0, vUv.x <= vUv.z, vUv.y <= vUv.z))) {\n projectorColor = texture2DProj(texture, vUv);\n }\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0.35) * projectorColor;\n}\n"},84450:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat3 normalMatrix;\nuniform mat4 textureMatrix;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec4 vUv;\nvarying mat4 vInvertMatrix;\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvoid main(void) {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n vPosition = worldPosition.xyz;\n vNormal = normal;\n vUv = textureMatrix * worldPosition;\n vInvertMatrix = inverse(modelMatrix);\n gl_Position = projectionMatrix * viewMatrix * worldPosition;\n}\n"},69805:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform vec3 cameraPosition;\nuniform float time;\n\nvarying vec3 vPosition;\nvarying mat4 vInvertMatrix;\n\nvoid main() {\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n vec3 light = vec3(-0.7, 0.7, -0.7);\n float diff = (dot(normal, light) + 1.0) / 2.0 * 0.2 + 0.8;\n gl_FragColor = vec4(vec3(0.98) * diff, 1.0);\n}\n"},8757:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute float height;\nattribute float offsetX;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vPosition;\nvarying mat4 vInvertMatrix;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvoid main(void) {\n mat4 translateMat = calcTranslateMat4(vec3(offsetX, 0.0, 0.0));\n mat4 scaleMat = calcScaleMat4(vec3(1.0, (position.y + 0.5) * height, 1.0));\n vec4 updatePosition = scaleMat * translateMat * vec4(position, 1.0);\n vPosition = (modelMatrix * updatePosition).xyz;\n vInvertMatrix = inverse(modelMatrix);\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n"},46060:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform vec3 cameraPosition;\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\nvarying mat4 vInvertMatrix;\n\nconst vec3 color = vec3(0.9);\n\nvoid main() {\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n if(!gl_FrontFacing) {\n normal = -normal;\n }\n vec3 light = normalize(vInvertMatrix * vec4(vec3(-1000.0, 1000.0, -1000.0), 1.0)).xyz;\n float diff = (dot(normal, light) + 1.0) / 2.0 * 0.2 + 0.8;\n float opacity = (1.0 - (vPosition.z / 1000.0)) * 0.1 + 0.1;\n gl_FragColor = vec4(color * diff * vColor, opacity);\n}\n"},24192:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\nattribute float radian;\nattribute vec3 hsv;\nattribute float timeHover;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float rotate;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec3 vColor;\nvarying mat4 vInvertMatrix;\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nfloat circularOut(float t) {\n return sqrt((2.0 - t) * t);\n}\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n float easeStep = circularOut(timeHover / 0.3);\n mat4 rotateMatWorld = calcRotateMat4(vec3(0.0, radian + radians(rotate), 0.0));\n mat4 scaleMat = calcScaleMat4(vec3(1.0 + easeStep * 0.2));\n mat4 translateMat = calcTranslateMat4(vec3(1000.0, 0.0, 0.0));\n vec4 updatePosition = rotateMatWorld * translateMat * scaleMat * vec4(position, 1.0);\n vPosition = updatePosition.xyz;\n vInvertMatrix = inverse(rotateMatWorld * translateMat);\n vColor = convertHsvToRgb(hsv * vec3(1.0, 1.0 - easeStep, 1.0));\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n"},66977:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},22984:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float radian;\nattribute vec3 pickedColor;\nattribute float timeHover;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float rotate;\n\nvarying vec3 vColor;\n\nfloat circularOut(float t) {\n return sqrt((2.0 - t) * t);\n}\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nmat4 calcScaleMat4(vec3 scale) {\n return mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nvoid main(void) {\n float easeStep = circularOut(timeHover / 0.3);\n mat4 rotateMatWorld = calcRotateMat4(vec3(0.0, radian + radians(rotate), 0.0));\n mat4 scaleMat = calcScaleMat4(vec3(1.0 + easeStep * 0.2));\n mat4 translateMat = calcTranslateMat4(vec3(1000.0, 0.0, 0.0));\n vec4 updatePosition = rotateMatWorld * translateMat * scaleMat * vec4(position, 1.0);\n vColor = pickedColor;\n gl_Position = projectionMatrix * modelViewMatrix * updatePosition;\n}\n"},80170:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D tex;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 texColor = texture2D(tex, vUv);\n gl_FragColor = texColor;\n}\n"},78615:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform vec3 mouse;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUv;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n // coordinate transformation\n vec4 mPosition = modelMatrix * vec4(position, 1.0);\n vec3 subPosition = mouse - mPosition.xyz;\n float force = (1000.0 - clamp(length(subPosition), 0.0, 1000.0)) / 4.0;\n mPosition = vec4(mPosition.xyz + force * normalize(-subPosition), 1.0);\n\n vUv = uv;\n\n gl_Position = projectionMatrix * viewMatrix * mPosition;\n gl_PointSize = 3.0;\n}\n"},75473:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform float size;\nuniform sampler2D texButterfly;\nuniform sampler2D texPicture;\nuniform float colorH;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\nvarying float vStep1;\nvarying float vStep2;\nvarying float vStep3;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nfloat random(vec2 c){\n return fract(sin(dot(c.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float rgbDiff = 0.01;\n\nvoid main() {\n // Glitch Noise.\n float bnStrength = sin(time) * 0.05;\n float bnTime = floor(time * 18.0) * 200.0;\n float noiseX = step(0.87 + bnStrength, (snoise(vec3(0.0, vUv.x * 1.8, bnTime)) + 1.0) / 2.0);\n float noiseY = step(0.87 + bnStrength, (snoise(vec3(0.0, vUv.y * 4.2, bnTime)) + 1.0) / 2.0);\n float bnMask = noiseX * noiseY;\n float bnUvX = mod(vUv.x + sin(bnTime) + rgbDiff, 1.0);\n vec4 bnDiff = (1.0 - texture2D(texPicture, vec2(bnUvX, vUv.y))) * bnMask;\n\n // White Noise.\n float whiteNoise = (random(vUv + mod(time, 10.0)) * 2.0 - 1.0) * 0.15;\n vec4 wnColor = vec4(vec3(whiteNoise), 0.0);\n\n // Color Noise for BUterfly.\n float noise = snoise(vPosition / vec3(size * 0.25) + vec3(0.0, 0.0, time));\n vec3 hsv = vec3(colorH + noise * 0.2, 0.4, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // Butterly Color.\n vec4 texButterflyColor = texture2D(texButterfly, vUv);\n vec4 color1 = vec4(rgb, 1.0) * texButterflyColor;\n\n // Sphere color on transforming.\n vec4 color2 = vec4(rgb, 1.0) * vec4((1.0 - texButterflyColor.rgb * 0.5), texButterflyColor.a) + wnColor;\n\n // Picture Color.\n vec2 pictUv = vUv * 1.1 - 0.05;\n vec4 texPictureColor = texture2D(texPicture, pictUv);\n float pictAlpha = step(0.0, pictUv.x) * (1.0 - step(1.0, pictUv.x)) * step(0.0, pictUv.y) * (1.0 - step(1.0, pictUv.y));\n vec4 pictColor = texPictureColor * (1.0 - bnMask) * vec4(vec3(1.0), pictAlpha);\n vec4 bnColor = vec4(bnDiff.rgb * 1.2, bnMask);\n vec4 color3 = pictColor + bnColor + wnColor;\n\n // total of colors.\n vec4 color = (color1 * vStep1 + color2 * vStep2) + color3 * vStep3;\n\n if (color.a < 0.5) discard;\n\n gl_FragColor = color;\n}\n"},70124:function(e,t){"use strict";t.Z='#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 spherePosition;\nattribute vec3 squarePosition;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float index;\nuniform float time;\nuniform float timeTransform;\nuniform float interval;\nuniform float size;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\nvarying float vOpacity;\nvarying float vStep1;\nvarying float vStep2;\nvarying float vStep3;\n\nfloat exponentialInOut(float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nmat4 calcRotateMat4X(float radian) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, cos(radian), -sin(radian), 0.0,\n 0.0, sin(radian), cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Y(float radian) {\n return mat4(\n cos(radian), 0.0, sin(radian), 0.0,\n 0.0, 1.0, 0.0, 0.0,\n -sin(radian), 0.0, cos(radian), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4Z(float radian) {\n return mat4(\n cos(radian), -sin(radian), 0.0, 0.0,\n sin(radian), cos(radian), 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n\nmat4 calcRotateMat4(vec3 radian) {\n return calcRotateMat4X(radian.x) * calcRotateMat4Y(radian.y) * calcRotateMat4Z(radian.z);\n}\n\nvoid main() {\n // Calcurate time of tranforming\n float t = timeTransform / interval;\n float transformTime1 = max((1.0 - t) * 2.0 - 1.0, 0.0);\n float transformTime2 = min((t) * 2.0, 1.0) * min((1.0 - t) * 2.0, 1.0);\n float transformTime3 = max((t) * 2.0 - 1.0, 0.0);\n\n // Position of Butterfly\n float flapTime = radians(sin(time * 4.0 - length(position.xy) / size * 2.0 + index * 2.0) * 45.0 + 30.0);\n vec3 flapPosition = vec3(\n cos(flapTime) * position.x,\n position.y + sin(time) * 10.0,\n sin(flapTime) * abs(position.x) + sin(time) * 10.0\n );\n mat4 flapRotateMat = calcRotateMat4(vec3(radians(45.0), 0.0, 0.0));\n vec3 position1 = (flapRotateMat * vec4(flapPosition, 1.0)).xyz;\n\n // Position of Sphere on transforming\n float sphereNoise = cnoise(spherePosition * 0.02 + time * 2.4);\n vec3 sphereNoisePosition = normalize(spherePosition) * sphereNoise * 30.0;\n mat4 sphereRotateMat = calcRotateMat4(vec3(t * 4.0, 0.0, 0.0));\n vec3 position2 = (sphereRotateMat * vec4(spherePosition + sphereNoisePosition, 1.0)).xyz;\n\n // Position of Picture\n mat4 pictureRotateMat = calcRotateMat4(vec3(0.0, radians(45.0), 0.0));\n vec3 position3 = (pictureRotateMat * vec4(squarePosition, 1.0)).xyz;;\n\n // Total of All Position\n vec3 updatePosition = position1 * exponentialInOut(transformTime1) + position2 * exponentialInOut(transformTime2) + position3 * exponentialInOut(transformTime3);\n\n // varying\n vPosition = updatePosition;\n vUv = uv;\n vStep1 = clamp((1.0 - t) * 6.0 - 2.0, 0.0, 1.0);\n vStep2 = clamp((t) * 6.0 - 1.0, 0.0, 1.0) * clamp((1.0 - t) * 6.0 - 1.0, 0.0, 1.0);\n vStep3 = clamp((t) * 6.0 - 3.0, 0.0, 1.0);\n\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(updatePosition, 1.0);\n}\n'},41639:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 cameraPosition;\nuniform sampler2D texture;\n\nvarying vec3 vPosition;\nvarying vec4 vUv;\n\nconst float mirrorOpacity = 0.2;\n\nvoid main() {\n float opacity = 1.0 - length(vPosition - cameraPosition) / 700.0;\n\n vec4 mirrorColor = vec4(vec3(0.9), 1.0) * (1.0 - mirrorOpacity);\n\n vec4 projectorColor = texture2DProj(texture, vUv) * mirrorOpacity;\n\n gl_FragColor = (mirrorColor + projectorColor) * vec4(vec3(1.0), opacity);\n}\n"},47741:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform mat4 textureMatrix;\n\nvarying vec3 vPosition;\nvarying vec4 vUv;\n\nvoid main(void) {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vPosition = worldPosition.xyz;\n vUv = textureMatrix * worldPosition;\n\n gl_Position = projectionMatrix * viewMatrix * worldPosition;\n}\n"},27558:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // to round.\n vec3 n;\n n.xy = gl_PointCoord * 2.0 - 1.0;\n n.z = 1.0 - dot(n.xy, n.xy);\n if (n.z < 0.0) discard;\n\n gl_FragColor = vec4(vColor, vOpacity * 0.5);\n}\n"},8467:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float colorH;\nattribute float i;\nattribute float opacity;\nattribute float valid;\n\nuniform vec3 cameraPosition;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float size;\nuniform float interval;\nuniform float time;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n float thisTime = mod(time + i / size * interval, interval);\n\n vec3 updatePosition = position + vec3(\n cos(thisTime * 3.0 + i) * 3.0,\n thisTime * -20.0,\n sin(thisTime * 3.0 + i) * 3.0\n );\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(updatePosition, 1.0);\n\n vec3 hsv = vec3(colorH + sin(i) * 0.075, 0.8, 1.0);\n\n vColor = convertHsvToRgb(hsv);\n vOpacity = (\n smoothstep(interval * 0.0, interval * 0.1, thisTime)\n * (1.0 - smoothstep(interval * 0.2, interval * 0.9, thisTime))\n ) * opacity;\n\n gl_PointSize = 5000.0 / length(mvPosition.xyz);\n gl_Position = projectionMatrix * mvPosition;\n}\n"},86169:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position, 1.0);\n}\n"},45014:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float brightMin;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 color1 = texture2D(texture1, vUv);\n vec4 color2 = texture2D(texture2, vUv);\n gl_FragColor = color1 * brightMin + color2;\n}\n"},60479:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform vec2 resolution;\nuniform vec2 direction;\nuniform float radius;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvec4 gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction) {\n vec4 color = vec4(0.0);\n vec2 step = radius / resolution * direction;\n color += texture2D(texture, uv - 4.0 * step) * 0.02699548325659403;\n color += texture2D(texture, uv - 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv - 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv - 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv) * 0.19947114020071635;\n color += texture2D(texture, uv + 1.0 * step) * 0.17603266338214976;\n color += texture2D(texture, uv + 2.0 * step) * 0.12098536225957168;\n color += texture2D(texture, uv + 3.0 * step) * 0.06475879783294587;\n color += texture2D(texture, uv + 4.0 * step) * 0.02699548325659403;\n return color;\n}\n\nvoid main() {\n vec4 color = gaussianBlur(texture, vUv, radius, resolution, direction);\n gl_FragColor = color;\n}\n"},46045:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nuniform float brightMin;\nuniform sampler2D texture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 bright = max(vec4(0.0), (texture2D(texture, vUv) - brightMin));\n gl_FragColor = bright;\n}\n"},77855:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n gl_FragColor = vec4(vColor, 1.0);\n}\n"},33491:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float force;\n\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main(void) {\n // calculate gradation\n vec3 hsv = vec3(0.1 + sin(radians(uv.y * 180.0 * 4.0)) * 0.12 - time * 0.1, 0.12 + force * 0.03, 0.96 - force * 0.03);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},90984:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\n\nvoid main() {\n // convert PointCoord to range from -1.0 to 1.0\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n float r = 1.0 - smoothstep(0.5, 1.0, length(p));\n\n gl_FragColor = vec4(vColor, r);\n}\n"},6214:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\n\nvarying vec3 vColor;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float duration = 3.0;\n\nvoid main() {\n // calculate colors\n vec3 hsv = vec3(0.45 + time * 0.1, 0.6, 1.0);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vColor = rgb;\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = 7.0;\n}\n"},86607:function(e,t){"use strict";t.Z='precision highp float;\n#define GLSLIFY 1\n\nuniform float time;\nuniform sampler2D texVideo;\nuniform float facing;\nuniform vec2 resolution;\nuniform float force;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\n//\n// GLSL textureless classic 3D noise "cnoise",\n// with an RSL-style periodic variant "pnoise".\n// Author: Stefan Gustavson (stefan.gustavson@liu.se)\n// Version: 2011-10-11\n//\n// Many thanks to Ian McEwan of Ashima Arts for the\n// ideas for permutation and gradient selection.\n//\n// Copyright (c) 2011 Stefan Gustavson. All rights reserved.\n// Distributed under the MIT license. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x)\n{\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\n// Classic Perlin noise\nfloat cnoise(vec3 P)\n{\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvoid main() {\n vec2 p = (vUv * 2.0 - 1.0);\n float grad = 1.0 - smoothstep(0.5, 1.0, length(p));\n float noise1 = cnoise(vec3(p * (1.4 + force * 0.5), time * 0.4)) * (0.15 + smoothstep(0.5, 0.75, length(p)) * (1.0 - smoothstep(0.75, 1.0, length(p))));\n float noise2 = cnoise(vec3(p * (5.4 + force * 0.3), time * 0.4)) * (0.15 + smoothstep(0.3, 0.4, length(p)) * (1.0 - smoothstep(0.9, 1.0, length(p))));\n float noiseSum = (noise1 + noise2) / 2.0;\n\n vec2 adjustUv = vec2(\n min(resolution.y / resolution.x, 1.0) * (1.0 + force * 0.03),\n min(resolution.x / resolution.y, 1.0) * (1.0 + force * 0.03)\n );\n vec2 updateUv = vec2(\n abs(vUv.x - facing) * adjustUv.x + (1.0 - adjustUv.x) * 0.5,\n vUv.y * adjustUv.y + (1.0 - adjustUv.y) * 0.5\n );\n vec4 texColor1 = texture2D(texVideo, updateUv - vec2(noise1 * noise2 - abs(p.x) / 50.0));\n vec4 texColor2 = texture2D(texVideo, updateUv - vec2(noise1 * noise2));\n vec4 texColor3 = texture2D(texVideo, updateUv - vec2(noise1 * noise2 + abs(p.x) / 50.0));\n vec3 texColorSum = vec3(texColor1.r, texColor2.g, texColor3.b);\n\n vec3 addColor = convertHsvToRgb(vec3((grad + noiseSum + updateUv.x * 0.5) / 2.0 + time * 0.1, 0.8, 0.6));\n\n float mask1 = smoothstep(0.19, 0.2, grad + noiseSum);\n vec4 color1 = vec4(texColorSum * vec3(1.2) + addColor * 0.24, 1.0) * mask1;\n\n float mask2 = smoothstep(0.15, 0.16, grad + noiseSum) * (1.0 - smoothstep(0.7, 0.71, grad + noiseSum));\n vec4 color2 = vec4(texColorSum * 0.1 + addColor * 0.7, 1.0) * mask2;\n\n gl_FragColor = color1 + color2;\n}\n'},3943:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec3 vPosition;\nvarying vec2 vUv;\n\nvoid main(void) {\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n\n vPosition = position;\n vUv = uv;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},99907:function(e,t){"use strict";t.Z="precision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // convert PointCoord to range from -1.0 to 1.0\n vec2 p = gl_PointCoord * 2.0 - 1.0;\n\n // draw double circle\n float radius = length(p);\n float opacity = (1.0 - smoothstep(0.9, 1.0, radius)) * vOpacity;\n\n gl_FragColor = vec4(vColor, opacity);\n}\n"},60121:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute float delay;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float time;\nuniform float force;\n\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float duration = 8.0;\n\nvoid main() {\n // Loop animation\n float interval = mod(time + delay, duration) / duration;\n vec3 move = vec3(0.0, 0.0, (interval * 2.0 - 1.0) * 100.0);\n\n // calculate gradation with position.y\n vec3 hsv = vec3(0.3 + time * 0.1, 0.65 - force * 0.01, 0.85 + force * 0.01);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n vec4 mvPosition = modelViewMatrix * vec4(position + move, 1.0);\n float distanceFromCamera = 1000.0 / length(mvPosition.xyz);\n\n vColor = rgb;\n vOpacity = smoothstep(-100.0, 100.0, move.z);\n\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = distanceFromCamera;\n}\n"},19326:function(e,t){"use strict";t.Z="#extension GL_OES_standard_derivatives : enable\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nvoid main() {\n // Flat Shading\n vec3 light = normalize(vec3(0.0, 1.0, 0.5));\n vec3 normal = normalize(cross(dFdx(vPosition), dFdy(vPosition)));\n float diff = (dot(normal, light) + 1.0) / 2.0;\n\n vec3 color = vColor + diff * 0.1;\n\n gl_FragColor = vec4(color, vOpacity);\n}\n"},15337:function(e,t){"use strict";t.Z="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec2 uv;\nattribute vec3 iPosition;\nattribute float iDelay;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\nuniform float time;\nuniform float force;\n\nvarying vec3 vPosition;\nvarying vec3 vColor;\nvarying float vOpacity;\n\nmat4 calcTranslateMat4(vec3 v) {\n return mat4(\n 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n v.x, v.y, v.z, 1.0\n );\n}\n\nvec3 convertHsvToRgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nconst float duration = 8.0;\n\nvoid main(void) {\n // Loop animation\n float interval = mod(time + iDelay, duration) / duration;\n vec3 move = vec3(0.0, 0.0, (interval * 2.0 - 1.0) * 100.0);\n\n // calculate gradation with position.y\n vec3 hsv = vec3(0.3 + time * 0.1, 0.3 - force * 0.01, 0.85 + force * 0.01);\n vec3 rgb = convertHsvToRgb(hsv);\n\n // coordinate transformation\n mat4 translateMat = calcTranslateMat4(iPosition);\n vec4 mPosition = modelMatrix * translateMat * vec4(position + move, 1.0);\n vec4 mvPosition = viewMatrix * mPosition;\n\n vPosition = mPosition.xyz;\n vColor = rgb;\n vOpacity = smoothstep(-100.0, 0.0, move.z);\n\n gl_Position = projectionMatrix * mvPosition;\n}\n"},17393:function(e){e.exports={degrees:function(e){return e/Math.PI*180},radians:function(e){return e*Math.PI/180},clamp:function(e,t,n){return Math.min(Math.max(e,t),n)},mix:function(e,t,n){return e*(1-n)+t*n},step:function(e,t){return t>=e?1:0},smoothstep:function(e,t,n){if(!(e>=t)){var r=Math.min(Math.max((n-e)/(t-e),0),1);return r*r*(3-2*r)}},spherical:function(e,t,n){return[Math.cos(e)*Math.cos(t)*n,Math.sin(e)*n,Math.cos(e)*Math.sin(t)*n]},randomArbitrary:function(e,t){return Math.random()*(t-e)+e},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},38314:function(e){e.exports=function(e,t){var n;return function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)}}},71243:function(e){e.exports=function(){return navigator.userAgent.indexOf("Android")>=0}},5833:function(e){e.exports=function(){var e=navigator.userAgent;return e.indexOf("MSIE")>-1||e.indexOf("rv:11.0")>-1}},4679:function(e){e.exports=function(){var e=navigator.userAgent;return e.indexOf("iPhone")>=0||e.indexOf("iPod")>=0||e.indexOf("iPad")>=0}},29130:function(e){e.exports=function(e){return new Promise((function(t){setTimeout(t,e)}))}},35666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(e,t,n){var r=f;return function(i,o){if(r===v)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return L()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=P(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?d:h,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=d,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",h="suspendedYield",v="executing",d="completed",p={};function m(){}function y(){}function g(){}var x={};x[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(z([])));w&&w!==n&&r.call(w,o)&&(x=w);var M=g.prototype=m.prototype=Object.create(x);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(i,o,a,s){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function P(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function z(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:L}}function L(){return{value:t,done:!0}}return y.prototype=M.constructor=g,g.constructor=y,y.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(M),e},e.awrap=function(e){return{__await:e}},_(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new S(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(M),c(M,s,"Generator"),M[o]=function(){return this},M.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=z,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},2212:function(e,t,n){"use strict";n.r(t),n.d(t,{ACESFilmicToneMapping:function(){return ne},AddEquation:function(){return P},AddOperation:function(){return Q},AdditiveAnimationBlendMode:function(){return Zt},AdditiveBlending:function(){return w},AlphaFormat:function(){return ke},AlwaysDepth:function(){return N},AlwaysStencilFunc:function(){return Sn},AmbientLight:function(){return Af},AmbientLightProbe:function(){return eh},AnimationClip:function(){return Al},AnimationLoader:function(){return Bl},AnimationMixer:function(){return Ch},AnimationObjectGroup:function(){return zh},AnimationUtils:function(){return xl},ArcCurve:function(){return Yl},ArrayCamera:function(){return qs},ArrowHelper:function(){return wv},Audio:function(){return fh},AudioAnalyser:function(){return yh},AudioContext:function(){return Qf},AudioListener:function(){return lh},AudioLoader:function(){return Jf},AxesHelper:function(){return Mv},AxisHelper:function(){return xd},BackSide:function(){return p},BasicDepthPacking:function(){return on},BasicShadowMap:function(){return l},BinaryTextureLoader:function(){return Sd},Bone:function(){return Ac},BooleanKeyframeTrack:function(){return Pl},BoundingBoxHelper:function(){return bd},Box2:function(){return Gh},Box3:function(){return ur},Box3Helper:function(){return mv},BoxBufferGeometry:function(){return So},BoxGeometry:function(){return So},BoxHelper:function(){return pv},BufferAttribute:function(){return ki},BufferGeometry:function(){return ro},BufferGeometryLoader:function(){return Bf},ByteType:function(){return Pe},Cache:function(){return Dl},Camera:function(){return zo},CameraHelper:function(){return hv},CanvasRenderer:function(){return Td},CanvasTexture:function(){return su},CatmullRomCurve3:function(){return ef},CineonToneMapping:function(){return te},CircleBufferGeometry:function(){return uu},CircleGeometry:function(){return uu},ClampToEdgeWrapping:function(){return he},Clock:function(){return ih},Color:function(){return Ai},ColorKeyframeTrack:function(){return Tl},CompressedTexture:function(){return au},CompressedTextureLoader:function(){return Gl},ConeBufferGeometry:function(){return fu},ConeGeometry:function(){return fu},CubeCamera:function(){return Ao},CubeReflectionMapping:function(){return oe},CubeRefractionMapping:function(){return ae},CubeTexture:function(){return Oo},CubeTextureLoader:function(){return Hl},CubeUVReflectionMapping:function(){return ue},CubeUVRefractionMapping:function(){return le},CubicBezierCurve:function(){return of},CubicBezierCurve3:function(){return af},CubicInterpolant:function(){return wl},CullFaceBack:function(){return s},CullFaceFront:function(){return c},CullFaceFrontBack:function(){return u},CullFaceNone:function(){return a},Curve:function(){return Zl},CurvePath:function(){return vf},CustomBlending:function(){return S},CustomToneMapping:function(){return re},CylinderBufferGeometry:function(){return lu},CylinderGeometry:function(){return lu},Cylindrical:function(){return Uh},DataTexture:function(){return Io},DataTexture2DArray:function(){return oa},DataTexture3D:function(){return aa},DataTextureLoader:function(){return Vl},DataUtils:function(){return Pv},DecrementStencilOp:function(){return vn},DecrementWrapStencilOp:function(){return pn},DefaultLoadingManager:function(){return kl},DepthFormat:function(){return Ne},DepthStencilFormat:function(){return He},DepthTexture:function(){return cu},DirectionalLight:function(){return Cf},DirectionalLightHelper:function(){return uv},DiscreteInterpolant:function(){return _l},DodecahedronBufferGeometry:function(){return vu},DodecahedronGeometry:function(){return vu},DoubleSide:function(){return m},DstAlphaFactor:function(){return k},DstColorFactor:function(){return j},DynamicBufferAttribute:function(){return ud},DynamicCopyUsage:function(){return An},DynamicDrawUsage:function(){return Tn},DynamicReadUsage:function(){return zn},EdgesGeometry:function(){return gu},EdgesHelper:function(){return wd},EllipseCurve:function(){return ql},EqualDepth:function(){return W},EqualStencilFunc:function(){return xn},EquirectangularReflectionMapping:function(){return se},EquirectangularRefractionMapping:function(){return ce},Euler:function(){return qr},EventDispatcher:function(){return kn},ExtrudeBufferGeometry:function(){return Zu},ExtrudeGeometry:function(){return Zu},FaceColors:function(){return Jv},FileLoader:function(){return Ul},FlatShading:function(){return y},Float16BufferAttribute:function(){return Vi},Float32Attribute:function(){return yd},Float32BufferAttribute:function(){return Wi},Float64Attribute:function(){return gd},Float64BufferAttribute:function(){return Zi},FloatType:function(){return Le},Fog:function(){return nc},FogExp2:function(){return tc},Font:function(){return qf},FontLoader:function(){return Xf},FrontSide:function(){return d},Frustum:function(){return jo},GLBufferAttribute:function(){return Dh},GLSL1:function(){return Dn},GLSL3:function(){return In},GammaEncoding:function(){return Jt},GreaterDepth:function(){return q},GreaterEqualDepth:function(){return Z},GreaterEqualStencilFunc:function(){return _n},GreaterStencilFunc:function(){return wn},GridHelper:function(){return iv},Group:function(){return Ys},HalfFloatType:function(){return Ce},HemisphereLight:function(){return yf},HemisphereLightHelper:function(){return rv},HemisphereLightProbe:function(){return $f},IcosahedronBufferGeometry:function(){return Yu},IcosahedronGeometry:function(){return Yu},ImageBitmapLoader:function(){return Wf},ImageLoader:function(){return Nl},ImageUtils:function(){return Jn},ImmediateRenderObject:function(){return Wh},IncrementStencilOp:function(){return hn},IncrementWrapStencilOp:function(){return dn},InstancedBufferAttribute:function(){return Uf},InstancedBufferGeometry:function(){return jf},InstancedInterleavedBuffer:function(){return Oh},InstancedMesh:function(){return Bc},Int16Attribute:function(){return vd},Int16BufferAttribute:function(){return Bi},Int32Attribute:function(){return pd},Int32BufferAttribute:function(){return Ni},Int8Attribute:function(){return ld},Int8BufferAttribute:function(){return Fi},IntType:function(){return Ee},InterleavedBuffer:function(){return ic},InterleavedBufferAttribute:function(){return ac},Interpolant:function(){return bl},InterpolateDiscrete:function(){return Ut},InterpolateLinear:function(){return Bt},InterpolateSmooth:function(){return Gt},InvertStencilOp:function(){return mn},JSONLoader:function(){return Rd},KeepStencilOp:function(){return ln},KeyframeTrack:function(){return Sl},LOD:function(){return Pc},LatheBufferGeometry:function(){return Xu},LatheGeometry:function(){return Xu},Layers:function(){return Yr},LensFlare:function(){return zd},LessDepth:function(){return H},LessEqualDepth:function(){return V},LessEqualStencilFunc:function(){return bn},LessStencilFunc:function(){return gn},Light:function(){return mf},LightProbe:function(){return If},Line:function(){return qc},Line3:function(){return Vh},LineBasicMaterial:function(){return Gc},LineCurve:function(){return sf},LineCurve3:function(){return cf},LineDashedMaterial:function(){return yl},LineLoop:function(){return Qc},LinePieces:function(){return Kv},LineSegments:function(){return Kc},LineStrip:function(){return Xv},LinearEncoding:function(){return Kt},LinearFilter:function(){return xe},LinearInterpolant:function(){return Ml},LinearMipMapLinearFilter:function(){return _e},LinearMipMapNearestFilter:function(){return we},LinearMipmapLinearFilter:function(){return Me},LinearMipmapNearestFilter:function(){return be},LinearToneMapping:function(){return $},Loader:function(){return Fl},LoaderUtils:function(){return Ff},LoadingManager:function(){return Il},LogLuvEncoding:function(){return en},LoopOnce:function(){return kt},LoopPingPong:function(){return jt},LoopRepeat:function(){return Ft},LuminanceAlphaFormat:function(){return Be},LuminanceFormat:function(){return Ue},MOUSE:function(){return i},Material:function(){return Pi},MaterialLoader:function(){return kf},Math:function(){return Yn},MathUtils:function(){return Yn},Matrix3:function(){return Kn},Matrix4:function(){return Fr},MaxEquation:function(){return z},Mesh:function(){return Mo},MeshBasicMaterial:function(){return Oi},MeshDepthMaterial:function(){return Gs},MeshDistanceMaterial:function(){return Ns},MeshFaceMaterial:function(){return ed},MeshLambertMaterial:function(){return pl},MeshMatcapMaterial:function(){return ml},MeshNormalMaterial:function(){return dl},MeshPhongMaterial:function(){return hl},MeshPhysicalMaterial:function(){return fl},MeshStandardMaterial:function(){return ll},MeshToonMaterial:function(){return vl},MinEquation:function(){return E},MirroredRepeatWrapping:function(){return ve},MixOperation:function(){return K},MultiMaterial:function(){return td},MultiplyBlending:function(){return _},MultiplyOperation:function(){return X},NearestFilter:function(){return de},NearestMipMapLinearFilter:function(){return ge},NearestMipMapNearestFilter:function(){return me},NearestMipmapLinearFilter:function(){return ye},NearestMipmapNearestFilter:function(){return pe},NeverDepth:function(){return G},NeverStencilFunc:function(){return yn},NoBlending:function(){return x},NoColors:function(){return Qv},NoToneMapping:function(){return J},NormalAnimationBlendMode:function(){return Wt},NormalBlending:function(){return b},NotEqualDepth:function(){return Y},NotEqualStencilFunc:function(){return Mn},NumberKeyframeTrack:function(){return Rl},Object3D:function(){return ci},ObjectLoader:function(){return Gf},ObjectSpaceNormalMap:function(){return cn},OctahedronBufferGeometry:function(){return Ku},OctahedronGeometry:function(){return Ku},OneFactor:function(){return C},OneMinusDstAlphaFactor:function(){return F},OneMinusDstColorFactor:function(){return U},OneMinusSrcAlphaFactor:function(){return I},OneMinusSrcColorFactor:function(){return O},OrthographicCamera:function(){return zf},PCFShadowMap:function(){return f},PCFSoftShadowMap:function(){return h},PMREMGenerator:function(){return Nv},ParametricBufferGeometry:function(){return Qu},ParametricGeometry:function(){return Qu},Particle:function(){return rd},ParticleBasicMaterial:function(){return ad},ParticleSystem:function(){return id},ParticleSystemMaterial:function(){return sd},Path:function(){return df},PerspectiveCamera:function(){return Lo},Plane:function(){return hi},PlaneBufferGeometry:function(){return Go},PlaneGeometry:function(){return Go},PlaneHelper:function(){return yv},PointCloud:function(){return nd},PointCloudMaterial:function(){return od},PointLight:function(){return Ef},PointLightHelper:function(){return $h},Points:function(){return ru},PointsMaterial:function(){return Jc},PolarGridHelper:function(){return ov},PolyhedronBufferGeometry:function(){return hu},PolyhedronGeometry:function(){return hu},PositionalAudio:function(){return mh},PropertyBinding:function(){return Eh},PropertyMixer:function(){return gh},QuadraticBezierCurve:function(){return uf},QuadraticBezierCurve3:function(){return lf},Quaternion:function(){return or},QuaternionKeyframeTrack:function(){return zl},QuaternionLinearInterpolant:function(){return El},REVISION:function(){return r},RGBADepthPacking:function(){return an},RGBAFormat:function(){return je},RGBAIntegerFormat:function(){return Xe},RGBA_ASTC_10x10_Format:function(){return gt},RGBA_ASTC_10x5_Format:function(){return pt},RGBA_ASTC_10x6_Format:function(){return mt},RGBA_ASTC_10x8_Format:function(){return yt},RGBA_ASTC_12x10_Format:function(){return xt},RGBA_ASTC_12x12_Format:function(){return bt},RGBA_ASTC_4x4_Format:function(){return st},RGBA_ASTC_5x4_Format:function(){return ct},RGBA_ASTC_5x5_Format:function(){return ut},RGBA_ASTC_6x5_Format:function(){return lt},RGBA_ASTC_6x6_Format:function(){return ft},RGBA_ASTC_8x5_Format:function(){return ht},RGBA_ASTC_8x6_Format:function(){return vt},RGBA_ASTC_8x8_Format:function(){return dt},RGBA_BPTC_Format:function(){return wt},RGBA_ETC2_EAC_Format:function(){return at},RGBA_PVRTC_2BPPV1_Format:function(){return rt},RGBA_PVRTC_4BPPV1_Format:function(){return nt},RGBA_S3TC_DXT1_Format:function(){return Qe},RGBA_S3TC_DXT3_Format:function(){return Je},RGBA_S3TC_DXT5_Format:function(){return $e},RGBDEncoding:function(){return rn},RGBEEncoding:function(){return $t},RGBEFormat:function(){return Ge},RGBFormat:function(){return Fe},RGBIntegerFormat:function(){return Ye},RGBM16Encoding:function(){return nn},RGBM7Encoding:function(){return tn},RGB_ETC1_Format:function(){return it},RGB_ETC2_Format:function(){return ot},RGB_PVRTC_2BPPV1_Format:function(){return tt},RGB_PVRTC_4BPPV1_Format:function(){return et},RGB_S3TC_DXT1_Format:function(){return Ke},RGFormat:function(){return Ze},RGIntegerFormat:function(){return qe},RawShaderMaterial:function(){return ul},Ray:function(){return kr},Raycaster:function(){return Ih},RectAreaLight:function(){return Of},RedFormat:function(){return Ve},RedIntegerFormat:function(){return We},ReinhardToneMapping:function(){return ee},RepeatWrapping:function(){return fe},ReplaceStencilOp:function(){return fn},ReverseSubtractEquation:function(){return R},RingBufferGeometry:function(){return Ju},RingGeometry:function(){return Ju},SRGB8_ALPHA8_ASTC_10x10_Format:function(){return Ot},SRGB8_ALPHA8_ASTC_10x5_Format:function(){return Lt},SRGB8_ALPHA8_ASTC_10x6_Format:function(){return Ct},SRGB8_ALPHA8_ASTC_10x8_Format:function(){return At},SRGB8_ALPHA8_ASTC_12x10_Format:function(){return Dt},SRGB8_ALPHA8_ASTC_12x12_Format:function(){return It},SRGB8_ALPHA8_ASTC_4x4_Format:function(){return Mt},SRGB8_ALPHA8_ASTC_5x4_Format:function(){return _t},SRGB8_ALPHA8_ASTC_5x5_Format:function(){return St},SRGB8_ALPHA8_ASTC_6x5_Format:function(){return Pt},SRGB8_ALPHA8_ASTC_6x6_Format:function(){return Tt},SRGB8_ALPHA8_ASTC_8x5_Format:function(){return Rt},SRGB8_ALPHA8_ASTC_8x6_Format:function(){return Et},SRGB8_ALPHA8_ASTC_8x8_Format:function(){return zt},Scene:function(){return rc},SceneUtils:function(){return Ed},ShaderChunk:function(){return No},ShaderLib:function(){return Vo},ShaderMaterial:function(){return Eo},ShadowMaterial:function(){return cl},Shape:function(){return pf},ShapeBufferGeometry:function(){return $u},ShapeGeometry:function(){return $u},ShapePath:function(){return Zf},ShapeUtils:function(){return Hu},ShortType:function(){return Te},Skeleton:function(){return Ic},SkeletonHelper:function(){return Qh},SkinnedMesh:function(){return Cc},SmoothShading:function(){return g},Sphere:function(){return Er},SphereBufferGeometry:function(){return el},SphereGeometry:function(){return el},Spherical:function(){return jh},SphericalHarmonics3:function(){return Df},SplineCurve:function(){return ff},SpotLight:function(){return _f},SpotLightHelper:function(){return qh},Sprite:function(){return wc},SpriteMaterial:function(){return sc},SrcAlphaFactor:function(){return D},SrcAlphaSaturateFactor:function(){return B},SrcColorFactor:function(){return A},StaticCopyUsage:function(){return Cn},StaticDrawUsage:function(){return Pn},StaticReadUsage:function(){return En},StereoCamera:function(){return rh},StreamCopyUsage:function(){return On},StreamDrawUsage:function(){return Rn},StreamReadUsage:function(){return Ln},StringKeyframeTrack:function(){return Ll},SubtractEquation:function(){return T},SubtractiveBlending:function(){return M},TOUCH:function(){return o},TangentSpaceNormalMap:function(){return sn},TetrahedronBufferGeometry:function(){return tl},TetrahedronGeometry:function(){return tl},TextBufferGeometry:function(){return nl},TextGeometry:function(){return nl},Texture:function(){return er},TextureLoader:function(){return Wl},TorusBufferGeometry:function(){return rl},TorusGeometry:function(){return rl},TorusKnotBufferGeometry:function(){return il},TorusKnotGeometry:function(){return il},Triangle:function(){return _i},TriangleFanDrawMode:function(){return Xt},TriangleStripDrawMode:function(){return Yt},TrianglesDrawMode:function(){return qt},TubeBufferGeometry:function(){return ol},TubeGeometry:function(){return ol},UVMapping:function(){return ie},Uint16Attribute:function(){return dd},Uint16BufferAttribute:function(){return Gi},Uint32Attribute:function(){return md},Uint32BufferAttribute:function(){return Hi},Uint8Attribute:function(){return fd},Uint8BufferAttribute:function(){return ji},Uint8ClampedAttribute:function(){return hd},Uint8ClampedBufferAttribute:function(){return Ui},Uniform:function(){return Ah},UniformsLib:function(){return Ho},UniformsUtils:function(){return Ro},UnsignedByteType:function(){return Se},UnsignedInt248Type:function(){return Ie},UnsignedIntType:function(){return ze},UnsignedShort4444Type:function(){return Ae},UnsignedShort5551Type:function(){return Oe},UnsignedShort565Type:function(){return De},UnsignedShortType:function(){return Re},VSMShadowMap:function(){return v},Vector2:function(){return Xn},Vector3:function(){return ar},Vector4:function(){return nr},VectorKeyframeTrack:function(){return Cl},Vertex:function(){return cd},VertexColors:function(){return $v},VideoTexture:function(){return ou},WebGL1Renderer:function(){return ec},WebGLCubeRenderTarget:function(){return Do},WebGLMultisampleRenderTarget:function(){return ir},WebGLRenderTarget:function(){return rr},WebGLRenderTargetCube:function(){return Pd},WebGLRenderer:function(){return $s},WebGLUtils:function(){return Zs},WireframeGeometry:function(){return al},WireframeHelper:function(){return Md},WrapAroundEnding:function(){return Vt},XHRLoader:function(){return _d},ZeroCurvatureEnding:function(){return Nt},ZeroFactor:function(){return L},ZeroSlopeEnding:function(){return Ht},ZeroStencilOp:function(){return un},sRGBEncoding:function(){return Qt}});const r="128",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a=0,s=1,c=2,u=3,l=0,f=1,h=2,v=3,d=0,p=1,m=2,y=1,g=2,x=0,b=1,w=2,M=3,_=4,S=5,P=100,T=101,R=102,E=103,z=104,L=200,C=201,A=202,O=203,D=204,I=205,k=206,F=207,j=208,U=209,B=210,G=0,N=1,H=2,V=3,W=4,Z=5,q=6,Y=7,X=0,K=1,Q=2,J=0,$=1,ee=2,te=3,ne=4,re=5,ie=300,oe=301,ae=302,se=303,ce=304,ue=306,le=307,fe=1e3,he=1001,ve=1002,de=1003,pe=1004,me=1004,ye=1005,ge=1005,xe=1006,be=1007,we=1007,Me=1008,_e=1008,Se=1009,Pe=1010,Te=1011,Re=1012,Ee=1013,ze=1014,Le=1015,Ce=1016,Ae=1017,Oe=1018,De=1019,Ie=1020,ke=1021,Fe=1022,je=1023,Ue=1024,Be=1025,Ge=je,Ne=1026,He=1027,Ve=1028,We=1029,Ze=1030,qe=1031,Ye=1032,Xe=1033,Ke=33776,Qe=33777,Je=33778,$e=33779,et=35840,tt=35841,nt=35842,rt=35843,it=36196,ot=37492,at=37496,st=37808,ct=37809,ut=37810,lt=37811,ft=37812,ht=37813,vt=37814,dt=37815,pt=37816,mt=37817,yt=37818,gt=37819,xt=37820,bt=37821,wt=36492,Mt=37840,_t=37841,St=37842,Pt=37843,Tt=37844,Rt=37845,Et=37846,zt=37847,Lt=37848,Ct=37849,At=37850,Ot=37851,Dt=37852,It=37853,kt=2200,Ft=2201,jt=2202,Ut=2300,Bt=2301,Gt=2302,Nt=2400,Ht=2401,Vt=2402,Wt=2500,Zt=2501,qt=0,Yt=1,Xt=2,Kt=3e3,Qt=3001,Jt=3007,$t=3002,en=3003,tn=3004,nn=3005,rn=3006,on=3200,an=3201,sn=0,cn=1,un=0,ln=7680,fn=7681,hn=7682,vn=7683,dn=34055,pn=34056,mn=5386,yn=512,gn=513,xn=514,bn=515,wn=516,Mn=517,_n=518,Sn=519,Pn=35044,Tn=35048,Rn=35040,En=35045,zn=35049,Ln=35041,Cn=35046,An=35050,On=35042,Dn="100",In="300 es";class kn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const Fn=[];for(let e=0;e<256;e++)Fn[e]=(e<16?"0":"")+e.toString(16);let jn=1234567;const Un=Math.PI/180,Bn=180/Math.PI;function Gn(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Fn[255&e]+Fn[e>>8&255]+Fn[e>>16&255]+Fn[e>>24&255]+"-"+Fn[255&t]+Fn[t>>8&255]+"-"+Fn[t>>16&15|64]+Fn[t>>24&255]+"-"+Fn[63&n|128]+Fn[n>>8&255]+"-"+Fn[n>>16&255]+Fn[n>>24&255]+Fn[255&r]+Fn[r>>8&255]+Fn[r>>16&255]+Fn[r>>24&255]).toUpperCase()}function Nn(e,t,n){return Math.max(t,Math.min(n,e))}function Hn(e,t){return(e%t+t)%t}function Vn(e,t,n){return(1-n)*e+n*t}function Wn(e){return 0==(e&e-1)&&0!==e}function Zn(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function qn(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var Yn=Object.freeze({__proto__:null,DEG2RAD:Un,RAD2DEG:Bn,generateUUID:Gn,clamp:Nn,euclideanModulo:Hn,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Vn,damp:function(e,t,n,r){return Vn(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(Hn(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(jn=e%2147483647),jn=16807*jn%2147483647,(jn-1)/2147483646},degToRad:function(e){return e*Un},radToDeg:function(e){return e*Bn},isPowerOfTwo:Wn,ceilPowerOfTwo:Zn,floorPowerOfTwo:qn,setQuaternionFromProperEuler:function(e,t,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),c=a(n/2),u=o((t+r)/2),l=a((t+r)/2),f=o((t-r)/2),h=a((t-r)/2),v=o((r-t)/2),d=a((r-t)/2);switch(i){case"XYX":e.set(s*l,c*f,c*h,s*u);break;case"YZY":e.set(c*h,s*l,c*f,s*u);break;case"ZXZ":e.set(c*f,c*h,s*l,s*u);break;case"XZX":e.set(s*l,c*d,c*v,s*u);break;case"YXY":e.set(c*v,s*l,c*d,s*u);break;case"ZYZ":e.set(c*d,c*v,s*l,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}});class Xn{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}Xn.prototype.isVector2=!0;class Kn{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,o,a,s,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],u=n[4],l=n[7],f=n[2],h=n[5],v=n[8],d=r[0],p=r[3],m=r[6],y=r[1],g=r[4],x=r[7],b=r[2],w=r[5],M=r[8];return i[0]=o*d+a*y+s*b,i[3]=o*p+a*g+s*w,i[6]=o*m+a*x+s*M,i[1]=c*d+u*y+l*b,i[4]=c*p+u*g+l*w,i[7]=c*m+u*x+l*M,i[2]=f*d+h*y+v*b,i[5]=f*p+h*g+v*w,i[8]=f*m+h*x+v*M,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*i*u+n*a*s+r*i*c-r*o*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8],l=u*o-a*c,f=a*s-u*i,h=c*i-o*s,v=t*l+n*f+r*h;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);const d=1/v;return e[0]=l*d,e[1]=(r*c-u*n)*d,e[2]=(a*n-r*o)*d,e[3]=f*d,e[4]=(u*t-r*s)*d,e[5]=(r*i-a*t)*d,e[6]=h*d,e[7]=(n*s-c*t)*d,e[8]=(o*t-n*i)*d,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,o,a){const s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*o+c*a)+o+e,-r*c,r*s,-r*(-c*o+s*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],c=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*c,r[6]=t*a+n*u,r[1]=-n*i+t*s,r[4]=-n*o+t*c,r[7]=-n*a+t*u,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}let Qn;Kn.prototype.isMatrix3=!0;class Jn{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Qn&&(Qn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Qn.width=e.width,Qn.height=e.height;const n=Qn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Qn}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}let $n=0;class er extends kn{constructor(e=er.DEFAULT_IMAGE,t=er.DEFAULT_MAPPING,n=he,r=he,i=xe,o=Me,a=je,s=Se,c=1,u=Kt){super(),Object.defineProperty(this,"id",{value:$n++}),this.uuid=Gn(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=s,this.offset=new Xn(0,0),this.repeat=new Xn(1,1),this.center=new Xn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Kn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=Gn()),!t&&void 0===e.images[r.uuid]){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e<n;e++)r[e].isDataTexture?t.push(tr(r[e].image)):t.push(tr(r[e]))}else t=tr(r);e.images[r.uuid]={uuid:r.uuid,url:t}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ie)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fe:e.x=e.x-Math.floor(e.x);break;case he:e.x=e.x<0?0:1;break;case ve:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case fe:e.y=e.y-Math.floor(e.y);break;case he:e.y=e.y<0?0:1;break;case ve:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&this.version++}}function tr(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Jn.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}er.DEFAULT_IMAGE=void 0,er.DEFAULT_MAPPING=ie,er.prototype.isTexture=!0;class nr{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const o=.01,a=.1,s=e.elements,c=s[0],u=s[4],l=s[8],f=s[1],h=s[5],v=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(u-f)<o&&Math.abs(l-d)<o&&Math.abs(v-p)<o){if(Math.abs(u+f)<a&&Math.abs(l+d)<a&&Math.abs(v+p)<a&&Math.abs(c+h+m-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(c+1)/2,s=(h+1)/2,y=(m+1)/2,g=(u+f)/4,x=(l+d)/4,b=(v+p)/4;return e>s&&e>y?e<o?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=g/n,i=x/n):s>y?s<o?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=g/r,i=b/r):y<o?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(y),n=x/i,r=b/i),this.set(n,r,i,t),this}let y=Math.sqrt((p-v)*(p-v)+(l-d)*(l-d)+(f-u)*(f-u));return Math.abs(y)<.001&&(y=1),this.x=(p-v)/y,this.y=(l-d)/y,this.z=(f-u)/y,this.w=Math.acos((c+h+m-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}nr.prototype.isVector4=!0;class rr extends kn{constructor(e,t,n){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new nr(0,0,e,t),this.scissorTest=!1,this.viewport=new nr(0,0,e,t),n=n||{},this.texture=new er(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:xe,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}rr.prototype.isWebGLRenderTarget=!0;class ir extends rr{constructor(e,t,n){super(e,t,n),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}ir.prototype.isWebGLMultisampleRenderTarget=!0;class or{constructor(e=0,t=0,n=0,r=1){this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}static slerpFlat(e,t,n,r,i,o,a){let s=n[r+0],c=n[r+1],u=n[r+2],l=n[r+3];const f=i[o+0],h=i[o+1],v=i[o+2],d=i[o+3];if(0===a)return e[t+0]=s,e[t+1]=c,e[t+2]=u,void(e[t+3]=l);if(1===a)return e[t+0]=f,e[t+1]=h,e[t+2]=v,void(e[t+3]=d);if(l!==d||s!==f||c!==h||u!==v){let e=1-a;const t=s*f+c*h+u*v+l*d,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,t*n);e=Math.sin(e*o)/i,a=Math.sin(a*o)/i}const i=a*n;if(s=s*e+f*i,c=c*e+h*i,u=u*e+v*i,l=l*e+d*i,e===1-a){const e=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=e,c*=e,u*=e,l*=e}}e[t]=s,e[t+1]=c,e[t+2]=u,e[t+3]=l}static multiplyQuaternionsFlat(e,t,n,r,i,o){const a=n[r],s=n[r+1],c=n[r+2],u=n[r+3],l=i[o],f=i[o+1],h=i[o+2],v=i[o+3];return e[t]=a*v+u*l+s*h-c*f,e[t+1]=s*v+u*f+c*l-a*h,e[t+2]=c*v+u*h+a*f-s*l,e[t+3]=u*v-a*l-s*f-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,c=a(n/2),u=a(r/2),l=a(i/2),f=s(n/2),h=s(r/2),v=s(i/2);switch(o){case"XYZ":this._x=f*u*l+c*h*v,this._y=c*h*l-f*u*v,this._z=c*u*v+f*h*l,this._w=c*u*l-f*h*v;break;case"YXZ":this._x=f*u*l+c*h*v,this._y=c*h*l-f*u*v,this._z=c*u*v-f*h*l,this._w=c*u*l+f*h*v;break;case"ZXY":this._x=f*u*l-c*h*v,this._y=c*h*l+f*u*v,this._z=c*u*v+f*h*l,this._w=c*u*l-f*h*v;break;case"ZYX":this._x=f*u*l-c*h*v,this._y=c*h*l+f*u*v,this._z=c*u*v-f*h*l,this._w=c*u*l+f*h*v;break;case"YZX":this._x=f*u*l+c*h*v,this._y=c*h*l+f*u*v,this._z=c*u*v-f*h*l,this._w=c*u*l-f*h*v;break;case"XZY":this._x=f*u*l-c*h*v,this._y=c*h*l-f*u*v,this._z=c*u*v+f*h*l,this._w=c*u*l+f*h*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],c=t[2],u=t[6],l=t[10],f=n+a+l;if(f>0){const e=.5/Math.sqrt(f+1);this._w=.25/e,this._x=(u-s)*e,this._y=(i-c)*e,this._z=(o-r)*e}else if(n>a&&n>l){const e=2*Math.sqrt(1+n-a-l);this._w=(u-s)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(i+c)/e}else if(a>l){const e=2*Math.sqrt(1+a-n-l);this._w=(i-c)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(s+u)/e}else{const e=2*Math.sqrt(1+l-n-a);this._w=(o-r)/e,this._x=(i+c)/e,this._y=(s+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Nn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+r*c-i*s,this._y=r*u+o*s+i*a-n*c,this._z=i*u+o*c+n*s-r*a,this._w=o*u-n*a-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,o=this._w;let a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const s=1-a*a;if(s<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(s),u=Math.atan2(c,a),l=Math.sin((1-t)*u)/c,f=Math.sin(t*u)/c;return this._w=o*l+this._w*f,this._x=n*l+this._x*f,this._y=r*l+this._y*f,this._z=i*l+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}or.prototype.isQuaternion=!0;class ar{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(cr.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(cr.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*n,u=s*n+a*t-i*r,l=s*r+i*n-o*t,f=-i*t-o*n-a*r;return this.x=c*s+f*-i+u*-a-l*-o,this.y=u*s+f*-o+l*-i-c*-a,this.z=l*s+f*-a+c*-o-u*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return sr.copy(this).projectOnVector(e),this.sub(sr)}reflect(e){return this.sub(sr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Nn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}ar.prototype.isVector3=!0;const sr=new ar,cr=new or;class ur{constructor(e=new ar(1/0,1/0,1/0),t=new ar(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,c=e.length;s<c;s+=3){const c=e[s],u=e[s+1],l=e[s+2];c<t&&(t=c),u<n&&(n=u),l<r&&(r=l),c>i&&(i=c),u>o&&(o=u),l>a&&(a=l)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,c=e.count;s<c;s++){const c=e.getX(s),u=e.getY(s),l=e.getZ(s);c<t&&(t=c),u<n&&(n=u),l<r&&(r=l),c>i&&(i=c),u>o&&(o=u),l>a&&(a=l)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=fr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new ar),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new ar),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);const t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),hr.copy(t.boundingBox),hr.applyMatrix4(e.matrixWorld),this.union(hr));const n=e.children;for(let e=0,t=n.length;e<t;e++)this.expandByObject(n[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new ar),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,fr),fr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(xr),br.subVectors(this.max,xr),vr.subVectors(e.a,xr),dr.subVectors(e.b,xr),pr.subVectors(e.c,xr),mr.subVectors(dr,vr),yr.subVectors(pr,dr),gr.subVectors(vr,pr);let t=[0,-mr.z,mr.y,0,-yr.z,yr.y,0,-gr.z,gr.y,mr.z,0,-mr.x,yr.z,0,-yr.x,gr.z,0,-gr.x,-mr.y,mr.x,0,-yr.y,yr.x,0,-gr.y,gr.x,0];return!!_r(t,vr,dr,pr,br)&&(t=[1,0,0,0,1,0,0,0,1],!!_r(t,vr,dr,pr,br)&&(wr.crossVectors(mr,yr),t=[wr.x,wr.y,wr.z],_r(t,vr,dr,pr,br)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new ar),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return fr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(fr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(lr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),lr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),lr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),lr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),lr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),lr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),lr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),lr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(lr)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}ur.prototype.isBox3=!0;const lr=[new ar,new ar,new ar,new ar,new ar,new ar,new ar,new ar],fr=new ar,hr=new ur,vr=new ar,dr=new ar,pr=new ar,mr=new ar,yr=new ar,gr=new ar,xr=new ar,br=new ar,wr=new ar,Mr=new ar;function _r(e,t,n,r,i){for(let o=0,a=e.length-3;o<=a;o+=3){Mr.fromArray(e,o);const a=i.x*Math.abs(Mr.x)+i.y*Math.abs(Mr.y)+i.z*Math.abs(Mr.z),s=t.dot(Mr),c=n.dot(Mr),u=r.dot(Mr);if(Math.max(-Math.max(s,c,u),Math.min(s,c,u))>a)return!1}return!0}const Sr=new ur,Pr=new ar,Tr=new ar,Rr=new ar;class Er{constructor(e=new ar,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Sr.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new ar),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new ur),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Rr.subVectors(e,this.center);const t=Rr.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.add(Rr.multiplyScalar(n/e)),this.radius+=n}return this}union(e){return Tr.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Pr.copy(e.center).add(Tr)),this.expandByPoint(Pr.copy(e.center).sub(Tr)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const zr=new ar,Lr=new ar,Cr=new ar,Ar=new ar,Or=new ar,Dr=new ar,Ir=new ar;class kr{constructor(e=new ar,t=new ar(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new ar),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,zr)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new ar),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=zr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(zr.copy(this.direction).multiplyScalar(t).add(this.origin),zr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Lr.copy(e).add(t).multiplyScalar(.5),Cr.copy(t).sub(e).normalize(),Ar.copy(this.origin).sub(Lr);const i=.5*e.distanceTo(t),o=-this.direction.dot(Cr),a=Ar.dot(this.direction),s=-Ar.dot(Cr),c=Ar.lengthSq(),u=Math.abs(1-o*o);let l,f,h,v;if(u>0)if(l=o*s-a,f=o*a-s,v=i*u,l>=0)if(f>=-v)if(f<=v){const e=1/u;l*=e,f*=e,h=l*(l+o*f+2*a)+f*(o*l+f+2*s)+c}else f=i,l=Math.max(0,-(o*f+a)),h=-l*l+f*(f+2*s)+c;else f=-i,l=Math.max(0,-(o*f+a)),h=-l*l+f*(f+2*s)+c;else f<=-v?(l=Math.max(0,-(-o*i+a)),f=l>0?-i:Math.min(Math.max(-i,-s),i),h=-l*l+f*(f+2*s)+c):f<=v?(l=0,f=Math.min(Math.max(-i,-s),i),h=f*(f+2*s)+c):(l=Math.max(0,-(o*i+a)),f=l>0?i:Math.min(Math.max(-i,-s),i),h=-l*l+f*(f+2*s)+c);else f=o>0?-i:i,l=Math.max(0,-(o*f+a)),h=-l*l+f*(f+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(l).add(this.origin),r&&r.copy(Cr).multiplyScalar(f).add(Lr),h}intersectSphere(e,t){zr.subVectors(e.center,this.origin);const n=zr.dot(this.direction),r=zr.dot(zr)-n*n,i=e.radius*e.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,o,a,s;const c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(i=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(i=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),l>=0?(a=(e.min.z-f.z)*l,s=(e.max.z-f.z)*l):(a=(e.max.z-f.z)*l,s=(e.min.z-f.z)*l),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,zr)}intersectTriangle(e,t,n,r,i){Or.subVectors(t,e),Dr.subVectors(n,e),Ir.crossVectors(Or,Dr);let o,a=this.direction.dot(Ir);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Ar.subVectors(this.origin,e);const s=o*this.direction.dot(Dr.crossVectors(Ar,Dr));if(s<0)return null;const c=o*this.direction.dot(Or.cross(Ar));if(c<0)return null;if(s+c>a)return null;const u=-o*Ar.dot(Ir);return u<0?null:this.at(u/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Fr{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,o,a,s,c,u,l,f,h,v,d,p){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=c,m[6]=u,m[10]=l,m[14]=f,m[3]=h,m[7]=v,m[11]=d,m[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Fr).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/jr.setFromMatrixColumn(e,0).length(),i=1/jr.setFromMatrixColumn(e,1).length(),o=1/jr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){const e=o*u,n=o*l,r=a*u,i=a*l;t[0]=s*u,t[4]=-s*l,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-a*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=o*s}else if("YXZ"===e.order){const e=s*u,n=s*l,r=c*u,i=c*l;t[0]=e+i*a,t[4]=r*a-n,t[8]=o*c,t[1]=o*l,t[5]=o*u,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=o*s}else if("ZXY"===e.order){const e=s*u,n=s*l,r=c*u,i=c*l;t[0]=e-i*a,t[4]=-o*l,t[8]=r+n*a,t[1]=n+r*a,t[5]=o*u,t[9]=i-e*a,t[2]=-o*c,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){const e=o*u,n=o*l,r=a*u,i=a*l;t[0]=s*u,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*l,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){const e=o*s,n=o*c,r=a*s,i=a*c;t[0]=s*u,t[4]=i-e*l,t[8]=r*l+n,t[1]=l,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=n*l+r,t[10]=e-i*l}else if("XZY"===e.order){const e=o*s,n=o*c,r=a*s,i=a*c;t[0]=s*u,t[4]=-l,t[8]=c*u,t[1]=e*l+i,t[5]=o*u,t[9]=n*l-r,t[2]=r*l-n,t[6]=a*u,t[10]=i*l+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Br,e,Gr)}lookAt(e,t,n){const r=this.elements;return Vr.subVectors(e,t),0===Vr.lengthSq()&&(Vr.z=1),Vr.normalize(),Nr.crossVectors(n,Vr),0===Nr.lengthSq()&&(1===Math.abs(n.z)?Vr.x+=1e-4:Vr.z+=1e-4,Vr.normalize(),Nr.crossVectors(n,Vr)),Nr.normalize(),Hr.crossVectors(Vr,Nr),r[0]=Nr.x,r[4]=Hr.x,r[8]=Vr.x,r[1]=Nr.y,r[5]=Hr.y,r[9]=Vr.y,r[2]=Nr.z,r[6]=Hr.z,r[10]=Vr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],u=n[1],l=n[5],f=n[9],h=n[13],v=n[2],d=n[6],p=n[10],m=n[14],y=n[3],g=n[7],x=n[11],b=n[15],w=r[0],M=r[4],_=r[8],S=r[12],P=r[1],T=r[5],R=r[9],E=r[13],z=r[2],L=r[6],C=r[10],A=r[14],O=r[3],D=r[7],I=r[11],k=r[15];return i[0]=o*w+a*P+s*z+c*O,i[4]=o*M+a*T+s*L+c*D,i[8]=o*_+a*R+s*C+c*I,i[12]=o*S+a*E+s*A+c*k,i[1]=u*w+l*P+f*z+h*O,i[5]=u*M+l*T+f*L+h*D,i[9]=u*_+l*R+f*C+h*I,i[13]=u*S+l*E+f*A+h*k,i[2]=v*w+d*P+p*z+m*O,i[6]=v*M+d*T+p*L+m*D,i[10]=v*_+d*R+p*C+m*I,i[14]=v*S+d*E+p*A+m*k,i[3]=y*w+g*P+x*z+b*O,i[7]=y*M+g*T+x*L+b*D,i[11]=y*_+g*R+x*C+b*I,i[15]=y*S+g*E+x*A+b*k,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],c=e[13],u=e[2],l=e[6],f=e[10],h=e[14];return e[3]*(+i*s*l-r*c*l-i*a*f+n*c*f+r*a*h-n*s*h)+e[7]*(+t*s*h-t*c*f+i*o*f-r*o*h+r*c*u-i*s*u)+e[11]*(+t*c*l-t*a*h-i*o*l+n*o*h+i*a*u-n*c*u)+e[15]*(-r*a*u-t*s*l+t*a*f+r*o*l-n*o*f+n*s*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8],l=e[9],f=e[10],h=e[11],v=e[12],d=e[13],p=e[14],m=e[15],y=l*p*c-d*f*c+d*s*h-a*p*h-l*s*m+a*f*m,g=v*f*c-u*p*c-v*s*h+o*p*h+u*s*m-o*f*m,x=u*d*c-v*l*c+v*a*h-o*d*h-u*a*m+o*l*m,b=v*l*s-u*d*s-v*a*f+o*d*f+u*a*p-o*l*p,w=t*y+n*g+r*x+i*b;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/w;return e[0]=y*M,e[1]=(d*f*i-l*p*i-d*r*h+n*p*h+l*r*m-n*f*m)*M,e[2]=(a*p*i-d*s*i+d*r*c-n*p*c-a*r*m+n*s*m)*M,e[3]=(l*s*i-a*f*i-l*r*c+n*f*c+a*r*h-n*s*h)*M,e[4]=g*M,e[5]=(u*p*i-v*f*i+v*r*h-t*p*h-u*r*m+t*f*m)*M,e[6]=(v*s*i-o*p*i-v*r*c+t*p*c+o*r*m-t*s*m)*M,e[7]=(o*f*i-u*s*i+u*r*c-t*f*c-o*r*h+t*s*h)*M,e[8]=x*M,e[9]=(v*l*i-u*d*i-v*n*h+t*d*h+u*n*m-t*l*m)*M,e[10]=(o*d*i-v*a*i+v*n*c-t*d*c-o*n*m+t*a*m)*M,e[11]=(u*a*i-o*l*i-u*n*c+t*l*c+o*n*h-t*a*h)*M,e[12]=b*M,e[13]=(u*d*r-v*l*r+v*n*f-t*d*f-u*n*p+t*l*p)*M,e[14]=(v*a*r-o*d*r-v*n*s+t*d*s+o*n*p-t*a*p)*M,e[15]=(o*l*r-u*a*r+u*n*s-t*l*s-o*n*f+t*a*f)*M,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,c=i*o,u=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+n,u*s-r*o,0,c*s-r*a,u*s+r*o,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,c=i+i,u=o+o,l=a+a,f=i*c,h=i*u,v=i*l,d=o*u,p=o*l,m=a*l,y=s*c,g=s*u,x=s*l,b=n.x,w=n.y,M=n.z;return r[0]=(1-(d+m))*b,r[1]=(h+x)*b,r[2]=(v-g)*b,r[3]=0,r[4]=(h-x)*w,r[5]=(1-(f+m))*w,r[6]=(p+y)*w,r[7]=0,r[8]=(v+g)*M,r[9]=(p-y)*M,r[10]=(1-(f+d))*M,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=jr.set(r[0],r[1],r[2]).length();const o=jr.set(r[4],r[5],r[6]).length(),a=jr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Ur.copy(this);const s=1/i,c=1/o,u=1/a;return Ur.elements[0]*=s,Ur.elements[1]*=s,Ur.elements[2]*=s,Ur.elements[4]*=c,Ur.elements[5]*=c,Ur.elements[6]*=c,Ur.elements[8]*=u,Ur.elements[9]*=u,Ur.elements[10]*=u,t.setFromRotationMatrix(Ur),n.x=i,n.y=o,n.z=a,this}makePerspective(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,s=2*i/(t-e),c=2*i/(n-r),u=(t+e)/(t-e),l=(n+r)/(n-r),f=-(o+i)/(o-i),h=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=f,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,o){const a=this.elements,s=1/(t-e),c=1/(n-r),u=1/(o-i),l=(t+e)*s,f=(n+r)*c,h=(o+i)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-f,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}Fr.prototype.isMatrix4=!0;const jr=new ar,Ur=new Fr,Br=new ar(0,0,0),Gr=new ar(1,1,1),Nr=new ar,Hr=new ar,Vr=new ar,Wr=new Fr,Zr=new or;class qr{constructor(e=0,t=0,n=0,r=qr.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const r=e.elements,i=r[0],o=r[4],a=r[8],s=r[1],c=r[5],u=r[9],l=r[2],f=r[6],h=r[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(Nn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Nn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-l,i),this._z=0);break;case"ZXY":this._x=Math.asin(Nn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-l,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Nn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Nn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-l,i)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Nn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Wr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Wr,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return Zr.setFromEuler(this),this.setFromQuaternion(Zr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new ar(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}qr.prototype.isEuler=!0,qr.DefaultOrder="XYZ",qr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Yr{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}}let Xr=0;const Kr=new ar,Qr=new or,Jr=new Fr,$r=new ar,ei=new ar,ti=new ar,ni=new or,ri=new ar(1,0,0),ii=new ar(0,1,0),oi=new ar(0,0,1),ai={type:"added"},si={type:"removed"};class ci extends kn{constructor(){super(),Object.defineProperty(this,"id",{value:Xr++}),this.uuid=Gn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ci.DefaultUp.clone();const e=new ar,t=new qr,n=new or,r=new ar(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Fr},normalMatrix:{value:new Kn}}),this.matrix=new Fr,this.matrixWorld=new Fr,this.matrixAutoUpdate=ci.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Yr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Qr.setFromAxisAngle(e,t),this.quaternion.multiply(Qr),this}rotateOnWorldAxis(e,t){return Qr.setFromAxisAngle(e,t),this.quaternion.premultiply(Qr),this}rotateX(e){return this.rotateOnAxis(ri,e)}rotateY(e){return this.rotateOnAxis(ii,e)}rotateZ(e){return this.rotateOnAxis(oi,e)}translateOnAxis(e,t){return Kr.copy(e).applyQuaternion(this.quaternion),this.position.add(Kr.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ri,e)}translateY(e){return this.translateOnAxis(ii,e)}translateZ(e){return this.translateOnAxis(oi,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Jr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?$r.copy(e):$r.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),ei.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Jr.lookAt(ei,$r,this.up):Jr.lookAt($r,ei,this.up),this.quaternion.setFromRotationMatrix(Jr),r&&(Jr.extractRotation(r.matrixWorld),Qr.setFromRotationMatrix(Jr),this.quaternion.premultiply(Qr.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(ai)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(si)),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(si)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Jr.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Jr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Jr),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getWorldPosition(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new ar),this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new or),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ei,e,ti),e}getWorldScale(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new ar),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ei,ni,e),e}getWorldDirection(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new ar),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=o(e.geometries),r=o(e.materials),i=o(e.textures),a=o(e.images),s=o(e.shapes),c=o(e.skeletons),u=o(e.animations);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),u.length>0&&(n.animations=u)}return n.object=r,n;function o(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}ci.DefaultUp=new ar(0,1,0),ci.DefaultMatrixAutoUpdate=!0,ci.prototype.isObject3D=!0;const ui=new ar,li=new ar,fi=new Kn;class hi{constructor(e=new ar(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=ui.subVectors(n,t).cross(li.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new ar),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new ar);const n=e.delta(ui),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new ar),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||fi.getNormalMatrix(e),r=this.coplanarPoint(ui).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}hi.prototype.isPlane=!0;const vi=new ar,di=new ar,pi=new ar,mi=new ar,yi=new ar,gi=new ar,xi=new ar,bi=new ar,wi=new ar,Mi=new ar;class _i{constructor(e=new ar,t=new ar,n=new ar){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new ar),r.subVectors(n,t),vi.subVectors(e,t),r.cross(vi);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){vi.subVectors(r,t),di.subVectors(n,t),pi.subVectors(e,t);const o=vi.dot(vi),a=vi.dot(di),s=vi.dot(pi),c=di.dot(di),u=di.dot(pi),l=o*c-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new ar),0===l)return i.set(-2,-1,-1);const f=1/l,h=(c*s-a*u)*f,v=(o*u-a*s)*f;return i.set(1-h-v,v,h)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,mi),mi.x>=0&&mi.y>=0&&mi.x+mi.y<=1}static getUV(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,mi),s.set(0,0),s.addScaledVector(i,mi.x),s.addScaledVector(o,mi.y),s.addScaledVector(a,mi.z),s}static isFrontFacing(e,t,n,r){return vi.subVectors(n,t),di.subVectors(e,t),vi.cross(di).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return vi.subVectors(this.c,this.b),di.subVectors(this.a,this.b),.5*vi.cross(di).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new ar),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return _i.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new hi),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return _i.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return _i.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return _i.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return _i.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new ar);const n=this.a,r=this.b,i=this.c;let o,a;yi.subVectors(r,n),gi.subVectors(i,n),bi.subVectors(e,n);const s=yi.dot(bi),c=gi.dot(bi);if(s<=0&&c<=0)return t.copy(n);wi.subVectors(e,r);const u=yi.dot(wi),l=gi.dot(wi);if(u>=0&&l<=u)return t.copy(r);const f=s*l-u*c;if(f<=0&&s>=0&&u<=0)return o=s/(s-u),t.copy(n).addScaledVector(yi,o);Mi.subVectors(e,i);const h=yi.dot(Mi),v=gi.dot(Mi);if(v>=0&&h<=v)return t.copy(i);const d=h*c-s*v;if(d<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(n).addScaledVector(gi,a);const p=u*v-h*l;if(p<=0&&l-u>=0&&h-v>=0)return xi.subVectors(i,r),a=(l-u)/(l-u+(h-v)),t.copy(r).addScaledVector(xi,a);const m=1/(p+d+f);return o=d*m,a=f*m,t.copy(n).addScaledVector(yi,o).addScaledVector(gi,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Si=0;function Pi(){Object.defineProperty(this,"id",{value:Si++}),this.uuid=Gn(),this.name="",this.type="Material",this.fog=!0,this.blending=b,this.side=d,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=D,this.blendDst=I,this.blendEquation=P,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=V,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Sn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ln,this.stencilZFail=ln,this.stencilZPass=ln,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}Pi.prototype=Object.assign(Object.create(kn.prototype),{constructor:Pi,isMaterial:!0,onBuild:function(){},onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===y;continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}},toJSON:function(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==b&&(n.blending=this.blending),this.side!==d&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Pi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});const Ti={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ri={h:0,s:0,l:0},Ei={h:0,s:0,l:0};function zi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Li(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Ci(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class Ai{constructor(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Hn(e,1),t=Nn(t,0,1),n=Nn(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=zi(i,r,e+1/3),this.g=zi(i,r,e),this.b=zi(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Ti[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=Li(e.r),this.g=Li(e.g),this.b=Li(e.b),this}copyLinearToSRGB(e){return this.r=Ci(e.r),this.g=Ci(e.g),this.b=Ci(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),o=Math.min(t,n,r);let a,s;const c=(o+i)/2;if(o===i)a=0,s=0;else{const e=i-o;switch(s=c<=.5?e/(i+o):e/(2-i-o),i){case t:a=(n-r)/e+(n<r?6:0);break;case n:a=(r-t)/e+2;break;case r:a=(t-n)/e+4}a/=6}return e.h=a,e.s=s,e.l=c,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,n){return this.getHSL(Ri),Ri.h+=e,Ri.s+=t,Ri.l+=n,this.setHSL(Ri.h,Ri.s,Ri.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ri),e.getHSL(Ei);const n=Vn(Ri.h,Ei.h,t),r=Vn(Ri.s,Ei.s,t),i=Vn(Ri.l,Ei.l,t);return this.setHSL(n,r,i),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Ai.NAMES=Ti,Ai.prototype.isColor=!0,Ai.prototype.r=1,Ai.prototype.g=1,Ai.prototype.b=1;class Oi extends Pi{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Ai(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this}}Oi.prototype.isMeshBasicMaterial=!0;const Di=new ar,Ii=new Xn;class ki{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Pn,this.updateRange={offset:0,count:-1},this.version=0,this.onUploadCallback=function(){}}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),i=new Ai),t[n++]=i.r,t[n++]=i.g,t[n++]=i.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),i=new Xn),t[n++]=i.x,t[n++]=i.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new ar),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),i=new nr),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n++]=i.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)Ii.fromBufferAttribute(this,t),Ii.applyMatrix3(e),this.setXY(t,Ii.x,Ii.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Di.fromBufferAttribute(this,t),Di.applyMatrix3(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Di.x=this.getX(t),Di.y=this.getY(t),Di.z=this.getZ(t),Di.applyMatrix4(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Di.x=this.getX(t),Di.y=this.getY(t),Di.z=this.getZ(t),Di.applyNormalMatrix(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Di.x=this.getX(t),Di.y=this.getY(t),Di.z=this.getZ(t),Di.transformDirection(e),this.setXYZ(t,Di.x,Di.y,Di.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==Pn&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}ki.prototype.isBufferAttribute=!0;class Fi extends ki{constructor(e,t,n){super(new Int8Array(e),t,n)}}class ji extends ki{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class Ui extends ki{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class Bi extends ki{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Gi extends ki{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Ni extends ki{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Hi extends ki{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Vi extends ki{constructor(e,t,n){super(new Uint16Array(e),t,n)}}Vi.prototype.isFloat16BufferAttribute=!0;class Wi extends ki{constructor(e,t,n){super(new Float32Array(e),t,n)}}class Zi extends ki{constructor(e,t,n){super(new Float64Array(e),t,n)}}function qi(e){if(0===e.length)return-1/0;let t=e[0];for(let n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}const Yi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Xi(e,t){return new Yi[e](t)}let Ki=0;const Qi=new Fr,Ji=new ci,$i=new ar,eo=new ur,to=new ur,no=new ar;class ro extends kn{constructor(){super(),Object.defineProperty(this,"id",{value:Ki++}),this.uuid=Gn(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(qi(e)>65535?Hi:Gi)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Kn).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}rotateX(e){return Qi.makeRotationX(e),this.applyMatrix4(Qi),this}rotateY(e){return Qi.makeRotationY(e),this.applyMatrix4(Qi),this}rotateZ(e){return Qi.makeRotationZ(e),this.applyMatrix4(Qi),this}translate(e,t,n){return Qi.makeTranslation(e,t,n),this.applyMatrix4(Qi),this}scale(e,t,n){return Qi.makeScale(e,t,n),this.applyMatrix4(Qi),this}lookAt(e){return Ji.lookAt(e),Ji.updateMatrix(),this.applyMatrix4(Ji.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($i).negate(),this.translate($i.x,$i.y,$i.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Wi(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ur);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new ar(-1/0,-1/0,-1/0),new ar(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];eo.setFromBufferAttribute(n),this.morphTargetsRelative?(no.addVectors(this.boundingBox.min,eo.min),this.boundingBox.expandByPoint(no),no.addVectors(this.boundingBox.max,eo.max),this.boundingBox.expandByPoint(no)):(this.boundingBox.expandByPoint(eo.min),this.boundingBox.expandByPoint(eo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Er);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new ar,1/0);if(e){const n=this.boundingSphere.center;if(eo.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];to.setFromBufferAttribute(n),this.morphTargetsRelative?(no.addVectors(eo.min,to.min),eo.expandByPoint(no),no.addVectors(eo.max,to.max),eo.expandByPoint(no)):(eo.expandByPoint(to.min),eo.expandByPoint(to.max))}eo.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)no.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(no));if(t)for(let i=0,o=t.length;i<o;i++){const o=t[i],a=this.morphTargetsRelative;for(let t=0,i=o.count;t<i;t++)no.fromBufferAttribute(o,t),a&&($i.fromBufferAttribute(e,t),no.add($i)),r=Math.max(r,n.distanceToSquared(no))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeFaceNormals(){}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,o=t.uv.array,a=r.length/3;void 0===t.tangent&&this.setAttribute("tangent",new ki(new Float32Array(4*a),4));const s=t.tangent.array,c=[],u=[];for(let e=0;e<a;e++)c[e]=new ar,u[e]=new ar;const l=new ar,f=new ar,h=new ar,v=new Xn,d=new Xn,p=new Xn,m=new ar,y=new ar;function g(e,t,n){l.fromArray(r,3*e),f.fromArray(r,3*t),h.fromArray(r,3*n),v.fromArray(o,2*e),d.fromArray(o,2*t),p.fromArray(o,2*n),f.sub(l),h.sub(l),d.sub(v),p.sub(v);const i=1/(d.x*p.y-p.x*d.y);isFinite(i)&&(m.copy(f).multiplyScalar(p.y).addScaledVector(h,-d.y).multiplyScalar(i),y.copy(h).multiplyScalar(d.x).addScaledVector(f,-p.x).multiplyScalar(i),c[e].add(m),c[t].add(m),c[n].add(m),u[e].add(y),u[t].add(y),u[n].add(y))}let x=this.groups;0===x.length&&(x=[{start:0,count:n.length}]);for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)g(n[e+0],n[e+1],n[e+2])}const b=new ar,w=new ar,M=new ar,_=new ar;function S(e){M.fromArray(i,3*e),_.copy(M);const t=c[e];b.copy(t),b.sub(M.multiplyScalar(M.dot(t))).normalize(),w.crossVectors(_,t);const n=w.dot(u[e])<0?-1:1;s[4*e]=b.x,s[4*e+1]=b.y,s[4*e+2]=b.z,s[4*e+3]=n}for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)S(n[e+0]),S(n[e+1]),S(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new ki(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new ar,i=new ar,o=new ar,a=new ar,s=new ar,c=new ar,u=new ar,l=new ar;if(e)for(let f=0,h=e.count;f<h;f+=3){const h=e.getX(f+0),v=e.getX(f+1),d=e.getX(f+2);r.fromBufferAttribute(t,h),i.fromBufferAttribute(t,v),o.fromBufferAttribute(t,d),u.subVectors(o,i),l.subVectors(r,i),u.cross(l),a.fromBufferAttribute(n,h),s.fromBufferAttribute(n,v),c.fromBufferAttribute(n,d),a.add(u),s.add(u),c.add(u),n.setXYZ(h,a.x,a.y,a.z),n.setXYZ(v,s.x,s.y,s.z),n.setXYZ(d,c.x,c.y,c.z)}else for(let e=0,a=t.count;e<a;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),o.fromBufferAttribute(t,e+2),u.subVectors(o,i),l.subVectors(r,i),u.cross(l),n.setXYZ(e+0,u.x,u.y,u.z),n.setXYZ(e+1,u.x,u.y,u.z),n.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(void 0===e.attributes[r])continue;const i=n[r].array,o=e.attributes[r],a=o.array,s=o.itemSize*t,c=Math.min(a.length,i.length-s);for(let e=0,t=s;e<c;e++,t++)i[t]=a[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)no.fromBufferAttribute(e,t),no.normalize(),e.setXYZ(t,no.x,no.y,no.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,o=new n.constructor(t.length*r);let a=0,s=0;for(let e=0,i=t.length;e<i;e++){a=t[e]*r;for(let e=0;e<r;e++)o[s++]=n[a++]}return new ki(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ro,n=this.index.array,r=this.attributes;for(const i in r){const o=e(r[i],n);t.setAttribute(i,o)}const i=this.morphAttributes;for(const r in i){const o=[],a=i[r];for(let t=0,r=a.length;t<r;t++){const r=e(a[t],n);o.push(r)}t.morphAttributes[r]=o}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let e=0,n=o.length;e<n;e++){const n=o[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],o=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];o.push(r.toJSON(e.data))}o.length>0&&(r[t]=o,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new ro).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let e=0,t=o.length;e<t;e++){const t=o[e];this.addGroup(t.start,t.count,t.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const s=e.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}ro.prototype.isBufferGeometry=!0;const io=new Fr,oo=new kr,ao=new Er,so=new ar,co=new ar,uo=new ar,lo=new ar,fo=new ar,ho=new ar,vo=new ar,po=new ar,mo=new ar,yo=new Xn,go=new Xn,xo=new Xn,bo=new ar,wo=new ar;class Mo extends ci{constructor(e=new ro,t=new Oi){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),ao.copy(n.boundingSphere),ao.applyMatrix4(i),!1===e.ray.intersectsSphere(ao))return;if(io.copy(i).invert(),oo.copy(e.ray).applyMatrix4(io),null!==n.boundingBox&&!1===oo.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position,s=n.morphAttributes.position,c=n.morphTargetsRelative,u=n.attributes.uv,l=n.attributes.uv2,f=n.groups,h=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,v=f.length;n<v;n++){const v=f[n],d=r[v.materialIndex];for(let n=Math.max(v.start,h.start),r=Math.min(v.start+v.count,h.start+h.count);n<r;n+=3){const r=i.getX(n),f=i.getX(n+1),h=i.getX(n+2);o=_o(this,d,e,oo,a,s,c,u,l,r,f,h),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=v.materialIndex,t.push(o))}}else for(let n=Math.max(0,h.start),f=Math.min(i.count,h.start+h.count);n<f;n+=3){const f=i.getX(n),h=i.getX(n+1),v=i.getX(n+2);o=_o(this,r,e,oo,a,s,c,u,l,f,h,v),o&&(o.faceIndex=Math.floor(n/3),t.push(o))}else if(void 0!==a)if(Array.isArray(r))for(let n=0,i=f.length;n<i;n++){const i=f[n],v=r[i.materialIndex];for(let n=Math.max(i.start,h.start),r=Math.min(i.start+i.count,h.start+h.count);n<r;n+=3)o=_o(this,v,e,oo,a,s,c,u,l,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=i.materialIndex,t.push(o))}else for(let n=Math.max(0,h.start),i=Math.min(a.count,h.start+h.count);n<i;n+=3)o=_o(this,r,e,oo,a,s,c,u,l,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),t.push(o))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function _o(e,t,n,r,i,o,a,s,c,u,l,f){so.fromBufferAttribute(i,u),co.fromBufferAttribute(i,l),uo.fromBufferAttribute(i,f);const h=e.morphTargetInfluences;if(t.morphTargets&&o&&h){vo.set(0,0,0),po.set(0,0,0),mo.set(0,0,0);for(let e=0,t=o.length;e<t;e++){const t=h[e],n=o[e];0!==t&&(lo.fromBufferAttribute(n,u),fo.fromBufferAttribute(n,l),ho.fromBufferAttribute(n,f),a?(vo.addScaledVector(lo,t),po.addScaledVector(fo,t),mo.addScaledVector(ho,t)):(vo.addScaledVector(lo.sub(so),t),po.addScaledVector(fo.sub(co),t),mo.addScaledVector(ho.sub(uo),t)))}so.add(vo),co.add(po),uo.add(mo)}e.isSkinnedMesh&&t.skinning&&(e.boneTransform(u,so),e.boneTransform(l,co),e.boneTransform(f,uo));const v=function(e,t,n,r,i,o,a,s){let c;if(c=t.side===p?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,t.side!==m,s),null===c)return null;wo.copy(s),wo.applyMatrix4(e.matrixWorld);const u=n.ray.origin.distanceTo(wo);return u<n.near||u>n.far?null:{distance:u,point:wo.clone(),object:e}}(e,t,n,r,so,co,uo,bo);if(v){s&&(yo.fromBufferAttribute(s,u),go.fromBufferAttribute(s,l),xo.fromBufferAttribute(s,f),v.uv=_i.getUV(bo,so,co,uo,yo,go,xo,new Xn)),c&&(yo.fromBufferAttribute(c,u),go.fromBufferAttribute(c,l),xo.fromBufferAttribute(c,f),v.uv2=_i.getUV(bo,so,co,uo,yo,go,xo,new Xn));const e={a:u,b:l,c:f,normal:new ar,materialIndex:0};_i.getNormal(so,co,uo,e.normal),v.face=e}return v}Mo.prototype.isMesh=!0;class So extends ro{constructor(e=1,t=1,n=1,r=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const s=[],c=[],u=[],l=[];let f=0,h=0;function v(e,t,n,r,i,o,v,d,p,m,y){const g=o/p,x=v/m,b=o/2,w=v/2,M=d/2,_=p+1,S=m+1;let P=0,T=0;const R=new ar;for(let o=0;o<S;o++){const a=o*x-w;for(let s=0;s<_;s++){const f=s*g-b;R[e]=f*r,R[t]=a*i,R[n]=M,c.push(R.x,R.y,R.z),R[e]=0,R[t]=0,R[n]=d>0?1:-1,u.push(R.x,R.y,R.z),l.push(s/p),l.push(1-o/m),P+=1}}for(let e=0;e<m;e++)for(let t=0;t<p;t++){const n=f+t+_*e,r=f+t+_*(e+1),i=f+(t+1)+_*(e+1),o=f+(t+1)+_*e;s.push(n,r,o),s.push(r,i,o),T+=6}a.addGroup(h,T,y),h+=T,f+=P}v("z","y","x",-1,-1,n,t,e,o,i,0),v("z","y","x",1,-1,n,t,-e,o,i,1),v("x","z","y",1,1,e,n,t,r,o,2),v("x","z","y",1,-1,e,n,-t,r,o,3),v("x","y","z",1,-1,e,t,n,r,i,4),v("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new Wi(c,3)),this.setAttribute("normal",new Wi(u,3)),this.setAttribute("uv",new Wi(l,2))}}function Po(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function To(e){const t={};for(let n=0;n<e.length;n++){const r=Po(e[n]);for(const e in r)t[e]=r[e]}return t}const Ro={clone:Po,merge:To};class Eo extends Pi{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Po(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}Eo.prototype.isShaderMaterial=!0;class zo extends ci{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Fr,this.projectionMatrix=new Fr,this.projectionMatrixInverse=new Fr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new ar),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}zo.prototype.isCamera=!0;class Lo extends zo{constructor(e=50,t=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Bn*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Un*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Bn*Math.atan(Math.tan(.5*Un*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Un*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,a=o.fullHeight;i+=o.offsetX*r/e,t-=o.offsetY*n/a,r*=o.width/e,n*=o.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}Lo.prototype.isPerspectiveCamera=!0;const Co=90;class Ao extends ci{constructor(e,t,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new Lo(Co,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new ar(1,0,0)),this.add(r);const i=new Lo(Co,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new ar(-1,0,0)),this.add(i);const o=new Lo(Co,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new ar(0,1,0)),this.add(o);const a=new Lo(Co,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new ar(0,-1,0)),this.add(a);const s=new Lo(Co,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new ar(0,0,1)),this.add(s);const c=new Lo(Co,1,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new ar(0,0,-1)),this.add(c)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,o,a,s,c]=this.children,u=e.xr.enabled,l=e.getRenderTarget();e.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=f,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(l),e.xr.enabled=u}}class Oo extends er{constructor(e,t,n,r,i,o,a,s,c,u){super(e=void 0!==e?e:[],t=void 0!==t?t:oe,n,r,i,o,a=void 0!==a?a:Fe,s,c,u),this._needsFlipEnvMap=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Oo.prototype.isCubeTexture=!0;class Do extends rr{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),t=t||{},this.texture=new Oo(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:xe,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=je,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new So(5,5,5),a=new Eo({name:"CubemapFromEquirect",uniforms:Po(n),vertexShader:r,fragmentShader:i,side:p,blending:x});a.uniforms.tEquirect.value=t;const s=new Mo(o,a),c=t.minFilter;return t.minFilter===Me&&(t.minFilter=xe),new Ao(1,10,this).update(e,s),t.minFilter=c,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}Do.prototype.isWebGLCubeRenderTarget=!0;class Io extends er{constructor(e,t,n,r,i,o,a,s,c,u,l,f){super(null,o,a,s,c,u,r,i,l,f),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==c?c:de,this.minFilter=void 0!==u?u:de,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Io.prototype.isDataTexture=!0;const ko=new Er,Fo=new ar;class jo{constructor(e=new hi,t=new hi,n=new hi,r=new hi,i=new hi,o=new hi){this.planes=[e,t,n,r,i,o]}set(e,t,n,r,i,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],u=n[6],l=n[7],f=n[8],h=n[9],v=n[10],d=n[11],p=n[12],m=n[13],y=n[14],g=n[15];return t[0].setComponents(a-r,l-s,d-f,g-p).normalize(),t[1].setComponents(a+r,l+s,d+f,g+p).normalize(),t[2].setComponents(a+i,l+c,d+h,g+m).normalize(),t[3].setComponents(a-i,l-c,d-h,g-m).normalize(),t[4].setComponents(a-o,l-u,d-v,g-y).normalize(),t[5].setComponents(a+o,l+u,d+v,g+y).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),ko.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(ko)}intersectsSprite(e){return ko.center.set(0,0,0),ko.radius=.7071067811865476,ko.applyMatrix4(e.matrixWorld),this.intersectsSphere(ko)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(Fo.x=r.normal.x>0?e.max.x:e.min.x,Fo.y=r.normal.y>0?e.max.y:e.min.y,Fo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Fo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Uo(){let e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Bo(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const o=r.get(t);void 0===o?r.set(t,function(t,r){const i=t.array,o=t.usage,a=e.createBuffer();e.bindBuffer(r,a),e.bufferData(r,i,o),t.onUploadCallback();let s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?t.isFloat16BufferAttribute?n?s=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:i instanceof Uint8Array&&(s=5121),{buffer:a,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):o.version<t.version&&(function(t,r,i){const o=r.array,a=r.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,o):(n?e.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):e.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(o.buffer,t,i),o.version=t.version)}}}class Go extends ro{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,o=t/2,a=Math.floor(n),s=Math.floor(r),c=a+1,u=s+1,l=e/a,f=t/s,h=[],v=[],d=[],p=[];for(let e=0;e<u;e++){const t=e*f-o;for(let n=0;n<c;n++){const r=n*l-i;v.push(r,-t,0),d.push(0,0,1),p.push(n/a),p.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<a;t++){const n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),o=t+1+c*e;h.push(n,r,o),h.push(r,i,o)}this.setIndex(h),this.setAttribute("position",new Wi(v,3)),this.setAttribute("normal",new Wi(d,3)),this.setAttribute("uv",new Wi(p,2))}}const No={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Ho={common:{diffuse:{value:new Ai(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Kn},uv2Transform:{value:new Kn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Xn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ai(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ai(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Kn}},sprite:{diffuse:{value:new Ai(15658734)},opacity:{value:1},center:{value:new Xn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Kn}}},Vo={basic:{uniforms:To([Ho.common,Ho.specularmap,Ho.envmap,Ho.aomap,Ho.lightmap,Ho.fog]),vertexShader:No.meshbasic_vert,fragmentShader:No.meshbasic_frag},lambert:{uniforms:To([Ho.common,Ho.specularmap,Ho.envmap,Ho.aomap,Ho.lightmap,Ho.emissivemap,Ho.fog,Ho.lights,{emissive:{value:new Ai(0)}}]),vertexShader:No.meshlambert_vert,fragmentShader:No.meshlambert_frag},phong:{uniforms:To([Ho.common,Ho.specularmap,Ho.envmap,Ho.aomap,Ho.lightmap,Ho.emissivemap,Ho.bumpmap,Ho.normalmap,Ho.displacementmap,Ho.fog,Ho.lights,{emissive:{value:new Ai(0)},specular:{value:new Ai(1118481)},shininess:{value:30}}]),vertexShader:No.meshphong_vert,fragmentShader:No.meshphong_frag},standard:{uniforms:To([Ho.common,Ho.envmap,Ho.aomap,Ho.lightmap,Ho.emissivemap,Ho.bumpmap,Ho.normalmap,Ho.displacementmap,Ho.roughnessmap,Ho.metalnessmap,Ho.fog,Ho.lights,{emissive:{value:new Ai(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:No.meshphysical_vert,fragmentShader:No.meshphysical_frag},toon:{uniforms:To([Ho.common,Ho.aomap,Ho.lightmap,Ho.emissivemap,Ho.bumpmap,Ho.normalmap,Ho.displacementmap,Ho.gradientmap,Ho.fog,Ho.lights,{emissive:{value:new Ai(0)}}]),vertexShader:No.meshtoon_vert,fragmentShader:No.meshtoon_frag},matcap:{uniforms:To([Ho.common,Ho.bumpmap,Ho.normalmap,Ho.displacementmap,Ho.fog,{matcap:{value:null}}]),vertexShader:No.meshmatcap_vert,fragmentShader:No.meshmatcap_frag},points:{uniforms:To([Ho.points,Ho.fog]),vertexShader:No.points_vert,fragmentShader:No.points_frag},dashed:{uniforms:To([Ho.common,Ho.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:No.linedashed_vert,fragmentShader:No.linedashed_frag},depth:{uniforms:To([Ho.common,Ho.displacementmap]),vertexShader:No.depth_vert,fragmentShader:No.depth_frag},normal:{uniforms:To([Ho.common,Ho.bumpmap,Ho.normalmap,Ho.displacementmap,{opacity:{value:1}}]),vertexShader:No.normal_vert,fragmentShader:No.normal_frag},sprite:{uniforms:To([Ho.sprite,Ho.fog]),vertexShader:No.sprite_vert,fragmentShader:No.sprite_frag},background:{uniforms:{uvTransform:{value:new Kn},t2D:{value:null}},vertexShader:No.background_vert,fragmentShader:No.background_frag},cube:{uniforms:To([Ho.envmap,{opacity:{value:1}}]),vertexShader:No.cube_vert,fragmentShader:No.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:No.equirect_vert,fragmentShader:No.equirect_frag},distanceRGBA:{uniforms:To([Ho.common,Ho.displacementmap,{referencePosition:{value:new ar},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:No.distanceRGBA_vert,fragmentShader:No.distanceRGBA_frag},shadow:{uniforms:To([Ho.lights,Ho.fog,{color:{value:new Ai(0)},opacity:{value:1}}]),vertexShader:No.shadow_vert,fragmentShader:No.shadow_frag}};function Wo(e,t,n,r,i){const o=new Ai(0);let a,s,c=0,u=null,l=0,f=null;function h(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),c=t,h(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,h(o,c)},render:function(n,i,v,m){let y=!0===i.isScene?i.background:null;y&&y.isTexture&&(y=t.get(y));const g=e.xr,x=g.getSession&&g.getSession();x&&"additive"===x.environmentBlendMode&&(y=null),null===y?h(o,c):y&&y.isColor&&(h(y,1),m=!0),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),y&&(y.isCubeTexture||y.mapping===ue)?(void 0===s&&(s=new Mo(new So(1,1,1),new Eo({name:"BackgroundCubeMaterial",uniforms:Po(Vo.cube.uniforms),vertexShader:Vo.cube.vertexShader,fragmentShader:Vo.cube.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(s)),s.material.uniforms.envMap.value=y,s.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y._needsFlipEnvMap?-1:1,u===y&&l===y.version&&f===e.toneMapping||(s.material.needsUpdate=!0,u=y,l=y.version,f=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):y&&y.isTexture&&(void 0===a&&(a=new Mo(new Go(2,2),new Eo({name:"BackgroundMaterial",uniforms:Po(Vo.background.uniforms),vertexShader:Vo.background.vertexShader,fragmentShader:Vo.background.fragmentShader,side:d,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(a)),a.material.uniforms.t2D.value=y,!0===y.matrixAutoUpdate&&y.updateMatrix(),a.material.uniforms.uvTransform.value.copy(y.matrix),u===y&&l===y.version&&f===e.toneMapping||(a.material.needsUpdate=!0,u=y,l=y.version,f=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function Zo(e,t,n,r){const i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},c=h(null);let u=c;function l(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function f(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function h(e){const t=[],n=[],r=[];for(let e=0;e<i;e++)t[e]=0,n[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function v(){const e=u.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function d(e){p(e,0)}function p(n,i){const o=u.newAttributes,a=u.enabledAttributes,s=u.attributeDivisors;o[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),s[n]!==i&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i)}function m(){const t=u.newAttributes,n=u.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,i,o,a,s){!0!==r.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,n,i,o,a,s):e.vertexAttribIPointer(t,n,i,a,s)}function g(){x(),u!==c&&(u=c,l(u.object))}function x(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:function(i,c,f,g,x){let b=!1;if(a){const t=function(t,n,i){const a=!0===i.wireframe;let c=s[t.id];void 0===c&&(c={},s[t.id]=c);let u=c[n.id];void 0===u&&(u={},c[n.id]=u);let l=u[a];return void 0===l&&(l=h(r.isWebGL2?e.createVertexArray():o.createVertexArrayOES()),u[a]=l),l}(g,f,c);u!==t&&(u=t,l(u.object)),b=function(e,t){const n=u.attributes,r=e.attributes;let i=0;for(const e in r){const t=n[e],o=r[e];if(void 0===t)return!0;if(t.attribute!==o)return!0;if(t.data!==o.data)return!0;i++}return u.attributesNum!==i||u.index!==t}(g,x),b&&function(e,t){const n={},r=e.attributes;let i=0;for(const e in r){const t=r[e],o={};o.attribute=t,t.data&&(o.data=t.data),n[e]=o,i++}u.attributes=n,u.attributesNum=i,u.index=t}(g,x)}else{const e=!0===c.wireframe;u.geometry===g.id&&u.program===f.id&&u.wireframe===e||(u.geometry=g.id,u.program=f.id,u.wireframe=e,b=!0)}!0===i.isInstancedMesh&&(b=!0),null!==x&&n.update(x,34963),b&&(function(i,o,a,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;v();const c=s.attributes,u=a.getAttributes(),l=o.defaultAttributeValues;for(const t in u){const r=u[t];if(r>=0){const o=c[t];if(void 0!==o){const t=o.normalized,i=o.itemSize,a=n.get(o);if(void 0===a)continue;const c=a.buffer,u=a.type,l=a.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,a=n.stride,f=o.offset;n&&n.isInstancedInterleavedBuffer?(p(r,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):d(r),e.bindBuffer(34962,c),y(r,i,u,t,a*l,f*l)}else o.isInstancedBufferAttribute?(p(r,o.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)):d(r),e.bindBuffer(34962,c),y(r,i,u,t,0,0)}else if("instanceMatrix"===t){const t=n.get(i.instanceMatrix);if(void 0===t)continue;const o=t.buffer,a=t.type;p(r+0,1),p(r+1,1),p(r+2,1),p(r+3,1),e.bindBuffer(34962,o),e.vertexAttribPointer(r+0,4,a,!1,64,0),e.vertexAttribPointer(r+1,4,a,!1,64,16),e.vertexAttribPointer(r+2,4,a,!1,64,32),e.vertexAttribPointer(r+3,4,a,!1,64,48)}else if("instanceColor"===t){const t=n.get(i.instanceColor);if(void 0===t)continue;const o=t.buffer,a=t.type;p(r,1),e.bindBuffer(34962,o),e.vertexAttribPointer(r,3,a,!1,12,0)}else if(void 0!==l){const n=l[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r,n);break;case 3:e.vertexAttrib3fv(r,n);break;case 4:e.vertexAttrib4fv(r,n);break;default:e.vertexAttrib1fv(r,n)}}}}m()}(i,c,f,g),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:g,resetDefaultState:x,dispose:function(){g();for(const e in s){const t=s[e];for(const e in t){const n=t[e];for(const e in n)f(n[e].object),delete n[e];delete t[e]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0===s[e.id])return;const t=s[e.id];for(const e in t){const n=t[e];for(const e in n)f(n[e].object),delete n[e];delete t[e]}delete s[e.id]},releaseStatesOfProgram:function(e){for(const t in s){const n=s[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)f(r[e].object),delete r[e];delete n[e.id]}},initAttributes:v,enableAttribute:d,disableUnusedAttributes:m}}function qo(e,t,n,r){const i=r.isWebGL2;let o;this.setMode=function(e){o=e},this.render=function(t,r){e.drawArrays(o,t,r),n.update(r,o,1)},this.renderInstances=function(r,a,s){if(0===s)return;let c,u;if(i)c=e,u="drawArraysInstanced";else if(c=t.get("ANGLE_instanced_arrays"),u="drawArraysInstancedANGLE",null===c)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](o,r,a,s),n.update(a,o,s)}}function Yo(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);const c=!0===n.logarithmicDepthBuffer,u=e.getParameter(34930),l=e.getParameter(35660),f=e.getParameter(3379),h=e.getParameter(34076),v=e.getParameter(34921),d=e.getParameter(36347),p=e.getParameter(36348),m=e.getParameter(36349),y=l>0,g=o||t.has("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:l,maxTextureSize:f,maxCubemapSize:h,maxAttributes:v,maxVertexUniforms:d,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:y,floatFragmentTextures:g,floatVertexTextures:y&&g,maxSamples:o?e.getParameter(36183):0}}function Xo(e){const t=this;let n=null,r=0,i=!1,o=!1;const a=new hi,s=new Kn,c={value:null,needsUpdate:!1};function u(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function l(e,n,r,i){const o=null!==e?e.length:0;let u=null;if(0!==o){if(u=c.value,!0!==i||null===u){const t=r+4*o,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===u||u.length<t)&&(u=new Float32Array(t));for(let t=0,n=r;t!==o;++t,n+=4)a.copy(e[t]).applyMatrix4(i,s),a.normal.toArray(u,n),u[n+3]=a.constant}c.value=u,c.needsUpdate=!0}return t.numPlanes=o,t.numIntersection=0,u}this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,o){const a=0!==e.length||t||0!==r||i;return i=t,n=l(e,o,0),r=e.length,a},this.beginShadows=function(){o=!0,l(null)},this.endShadows=function(){o=!1,u()},this.setState=function(t,a,s){const f=t.clippingPlanes,h=t.clipIntersection,v=t.clipShadows,d=e.get(t);if(!i||null===f||0===f.length||o&&!v)o?l(null):u();else{const e=o?0:r,t=4*e;let i=d.clippingState||null;c.value=i,i=l(f,a,t,s);for(let e=0;e!==t;++e)i[e]=n[e];d.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=e}}}function Ko(e){let t=new WeakMap;function n(e,t){return t===se?e.mapping=oe:t===ce&&(e.mapping=ae),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping;if(o===se||o===ce){if(t.has(i))return n(t.get(i).texture,i.mapping);{const o=i.image;if(o&&o.height>0){const a=e.getRenderTarget(),s=new Do(o.height/2);return s.fromEquirectangularTexture(e,i),t.set(i,s),e.setRenderTarget(a),i.addEventListener("dispose",r),n(s.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function Qo(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Jo(e,t,n,r){const i={},o=new WeakMap;function a(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener("dispose",a),delete i[s.id];const c=o.get(s);c&&(t.remove(c),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],o=e[t+2];n.push(r,i,i,o,o,r)}}else{const e=i.array;a=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}const s=new(qi(n)>65535?Hi:Gi)(n,1);s.version=a;const c=o.get(e);c&&t.remove(c),o.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e<r;e++)t.update(n[e],34962)}},getWireframeAttribute:function(e){const t=o.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return o.get(e)}}}function $o(e,t,n,r){const i=r.isWebGL2;let o,a,s;this.setMode=function(e){o=e},this.setIndex=function(e){a=e.type,s=e.bytesPerElement},this.render=function(t,r){e.drawElements(o,r,a,t*s),n.update(r,o,1)},this.renderInstances=function(r,c,u){if(0===u)return;let l,f;if(i)l=e,f="drawElementsInstanced";else if(l=t.get("ANGLE_instanced_arrays"),f="drawElementsInstancedANGLE",null===l)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[f](o,c,a,r*s,u),n.update(c,o,u)}}function ea(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function ta(e,t){return e[0]-t[0]}function na(e,t){return Math.abs(t[1])-Math.abs(e[1])}function ra(e){const t={},n=new Float32Array(8),r=[];for(let e=0;e<8;e++)r[e]=[e,0];return{update:function(i,o,a,s){const c=i.morphTargetInfluences,u=void 0===c?0:c.length;let l=t[o.id];if(void 0===l){l=[];for(let e=0;e<u;e++)l[e]=[e,0];t[o.id]=l}for(let e=0;e<u;e++){const t=l[e];t[0]=e,t[1]=c[e]}l.sort(na);for(let e=0;e<8;e++)e<u&&l[e][1]?(r[e][0]=l[e][0],r[e][1]=l[e][1]):(r[e][0]=Number.MAX_SAFE_INTEGER,r[e][1]=0);r.sort(ta);const f=a.morphTargets&&o.morphAttributes.position,h=a.morphNormals&&o.morphAttributes.normal;let v=0;for(let e=0;e<8;e++){const t=r[e],i=t[0],a=t[1];i!==Number.MAX_SAFE_INTEGER&&a?(f&&o.getAttribute("morphTarget"+e)!==f[i]&&o.setAttribute("morphTarget"+e,f[i]),h&&o.getAttribute("morphNormal"+e)!==h[i]&&o.setAttribute("morphNormal"+e,h[i]),n[e]=a,v+=a):(f&&!0===o.hasAttribute("morphTarget"+e)&&o.deleteAttribute("morphTarget"+e),h&&!0===o.hasAttribute("morphNormal"+e)&&o.deleteAttribute("morphNormal"+e),n[e]=0)}const d=o.morphTargetsRelative?1:1-v;s.getUniforms().setValue(e,"morphTargetBaseInfluence",d),s.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function ia(e,t,n,r){let i=new WeakMap;function o(e){const t=e.target;t.removeEventListener("dispose",o),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(e){const a=r.render.frame,s=e.geometry,c=t.get(e,s);return i.get(c)!==a&&(t.update(c),i.set(c,a)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",o)&&e.addEventListener("dispose",o),n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),c},dispose:function(){i=new WeakMap}}}Vo.physical={uniforms:To([Vo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Xn(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Ai(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:No.meshphysical_vert,fragmentShader:No.meshphysical_frag};class oa extends er{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=de,this.minFilter=de,this.wrapR=he,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}oa.prototype.isDataTexture2DArray=!0;class aa extends er{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=de,this.minFilter=de,this.wrapR=he,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}aa.prototype.isDataTexture3D=!0;const sa=new er,ca=new oa,ua=new aa,la=new Oo,fa=[],ha=[],va=new Float32Array(16),da=new Float32Array(9),pa=new Float32Array(4);function ma(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let o=fa[i];if(void 0===o&&(o=new Float32Array(i),fa[i]=o),0!==t){r.toArray(o,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(o,i)}return o}function ya(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function ga(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function xa(e,t){let n=ha[t];void 0===n&&(n=new Int32Array(t),ha[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function ba(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function wa(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(ya(n,t))return;e.uniform2fv(this.addr,t),ga(n,t)}}function Ma(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(ya(n,t))return;e.uniform3fv(this.addr,t),ga(n,t)}}function _a(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(ya(n,t))return;e.uniform4fv(this.addr,t),ga(n,t)}}function Sa(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(ya(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),ga(n,t)}else{if(ya(n,r))return;pa.set(r),e.uniformMatrix2fv(this.addr,!1,pa),ga(n,r)}}function Pa(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(ya(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),ga(n,t)}else{if(ya(n,r))return;da.set(r),e.uniformMatrix3fv(this.addr,!1,da),ga(n,r)}}function Ta(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(ya(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),ga(n,t)}else{if(ya(n,r))return;va.set(r),e.uniformMatrix4fv(this.addr,!1,va),ga(n,r)}}function Ra(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ea(e,t){const n=this.cache;ya(n,t)||(e.uniform2iv(this.addr,t),ga(n,t))}function za(e,t){const n=this.cache;ya(n,t)||(e.uniform3iv(this.addr,t),ga(n,t))}function La(e,t){const n=this.cache;ya(n,t)||(e.uniform4iv(this.addr,t),ga(n,t))}function Ca(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Aa(e,t){const n=this.cache;ya(n,t)||(e.uniform2uiv(this.addr,t),ga(n,t))}function Oa(e,t){const n=this.cache;ya(n,t)||(e.uniform3uiv(this.addr,t),ga(n,t))}function Da(e,t){const n=this.cache;ya(n,t)||(e.uniform4uiv(this.addr,t),ga(n,t))}function Ia(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||sa,i)}function ka(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||ua,i)}function Fa(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||la,i)}function ja(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||ca,i)}function Ua(e,t){e.uniform1fv(this.addr,t)}function Ba(e,t){const n=ma(t,this.size,2);e.uniform2fv(this.addr,n)}function Ga(e,t){const n=ma(t,this.size,3);e.uniform3fv(this.addr,n)}function Na(e,t){const n=ma(t,this.size,4);e.uniform4fv(this.addr,n)}function Ha(e,t){const n=ma(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Va(e,t){const n=ma(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Wa(e,t){const n=ma(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Za(e,t){e.uniform1iv(this.addr,t)}function qa(e,t){e.uniform2iv(this.addr,t)}function Ya(e,t){e.uniform3iv(this.addr,t)}function Xa(e,t){e.uniform4iv(this.addr,t)}function Ka(e,t){e.uniform1uiv(this.addr,t)}function Qa(e,t){e.uniform2uiv(this.addr,t)}function Ja(e,t){e.uniform3uiv(this.addr,t)}function $a(e,t){e.uniform4uiv(this.addr,t)}function es(e,t,n){const r=t.length,i=xa(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.safeSetTexture2D(t[e]||sa,i[e])}function ts(e,t,n){const r=t.length,i=xa(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.safeSetTextureCube(t[e]||la,i[e])}function ns(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return ba;case 35664:return wa;case 35665:return Ma;case 35666:return _a;case 35674:return Sa;case 35675:return Pa;case 35676:return Ta;case 5124:case 35670:return Ra;case 35667:case 35671:return Ea;case 35668:case 35672:return za;case 35669:case 35673:return La;case 5125:return Ca;case 36294:return Aa;case 36295:return Oa;case 36296:return Da;case 35678:case 36198:case 36298:case 36306:case 35682:return Ia;case 35679:case 36299:case 36307:return ka;case 35680:case 36300:case 36308:case 36293:return Fa;case 36289:case 36303:case 36311:case 36292:return ja}}(t.type)}function rs(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Ua;case 35664:return Ba;case 35665:return Ga;case 35666:return Na;case 35674:return Ha;case 35675:return Va;case 35676:return Wa;case 5124:case 35670:return Za;case 35667:case 35671:return qa;case 35668:case 35672:return Ya;case 35669:case 35673:return Xa;case 5125:return Ka;case 36294:return Qa;case 36295:return Ja;case 36296:return $a;case 35678:case 36198:case 36298:case 36306:case 35682:return es;case 35680:case 36300:case 36308:case 36293:return ts}}(t.type)}function is(e){this.id=e,this.seq=[],this.map={}}rs.prototype.updateCache=function(e){const t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),ga(t,e)},is.prototype.setValue=function(e,t,n){const r=this.seq;for(let i=0,o=r.length;i!==o;++i){const o=r[i];o.setValue(e,t[o.id],n)}};const os=/(\w+)(\])?(\[|\.)?/g;function as(e,t){e.seq.push(t),e.map[t.id]=t}function ss(e,t,n){const r=e.name,i=r.length;for(os.lastIndex=0;;){const o=os.exec(r),a=os.lastIndex;let s=o[1];const c="]"===o[2],u=o[3];if(c&&(s|=0),void 0===u||"["===u&&a+2===i){as(n,void 0===u?new ns(s,e,t):new rs(s,e,t));break}{let e=n.map[s];void 0===e&&(e=new is(s),as(n,e)),n=e}}}function cs(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,35718);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);ss(n,e.getUniformLocation(t,n.name),this)}}function us(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}cs.prototype.setValue=function(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)},cs.prototype.setOptional=function(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)},cs.upload=function(e,t,n,r){for(let i=0,o=t.length;i!==o;++i){const o=t[i],a=n[o.id];!1!==a.needsUpdate&&o.setValue(e,a.value,r)}},cs.seqWithValue=function(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n};let ls=0;function fs(e){switch(e){case Kt:return["Linear","( value )"];case Qt:return["sRGB","( value )"];case $t:return["RGBE","( value )"];case tn:return["RGBM","( value, 7.0 )"];case nn:return["RGBM","( value, 16.0 )"];case rn:return["RGBD","( value, 256.0 )"];case Jt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case en:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function hs(e,t,n){const r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(e){const t=e.split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}(e.getShaderSource(t))}function vs(e,t){const n=fs(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ds(e,t){const n=fs(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function ps(e,t){let n;switch(t){case $:n="Linear";break;case ee:n="Reinhard";break;case te:n="OptimizedCineon";break;case ne:n="ACESFilmic";break;case re:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function ms(e){return""!==e}function ys(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function gs(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const xs=/^[ \t]*#include +<([\w\d./]+)>/gm;function bs(e){return e.replace(xs,ws)}function ws(e,t){const n=No[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return bs(n)}const Ms=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,_s=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ss(e){return e.replace(_s,Ts).replace(Ms,Ps)}function Ps(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ts(0,t,n,r)}function Ts(e,t,n,r){let i="";for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function Rs(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Es(e,t,n,r){const i=e.getContext(),o=n.defines;let a=n.vertexShader,s=n.fragmentShader;const c=function(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===f?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===h?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===v&&(t="SHADOWMAP_TYPE_VSM"),t}(n),u=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case oe:case ae:t="ENVMAP_TYPE_CUBE";break;case ue:case le:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),l=function(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case ae:case le:t="ENVMAP_MODE_REFRACTION"}return t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case X:t="ENVMAP_BLENDING_MULTIPLY";break;case K:t="ENVMAP_BLENDING_MIX";break;case Q:t="ENVMAP_BLENDING_ADD"}return t}(n),p=e.gammaFactor>0?e.gammaFactor:1,m=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ms).join("\n")}(n),y=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(o),g=i.createProgram();let x,b,w=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(x=[y].filter(ms).join("\n"),x.length>0&&(x+="\n"),b=[m,y].filter(ms).join("\n"),b.length>0&&(b+="\n")):(x=[Rs(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ms).join("\n"),b=[m,Rs(n),"#define SHADER_NAME "+n.shaderName,y,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+l:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==J?"#define TONE_MAPPING":"",n.toneMapping!==J?No.tonemapping_pars_fragment:"",n.toneMapping!==J?ps("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",No.encodings_pars_fragment,n.map?vs("mapTexelToLinear",n.mapEncoding):"",n.matcap?vs("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?vs("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?vs("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?vs("lightMapTexelToLinear",n.lightMapEncoding):"",ds("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(ms).join("\n")),a=bs(a),a=ys(a,n),a=gs(a,n),s=bs(s),s=ys(s,n),s=gs(s,n),a=Ss(a),s=Ss(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(w="#version 300 es\n",x=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+x,b=["#define varying in",n.glslVersion===In?"":"out highp vec4 pc_fragColor;",n.glslVersion===In?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+b);const M=w+b+s,_=us(i,35633,w+x+a),S=us(i,35632,M);if(i.attachShader(g,_),i.attachShader(g,S),void 0!==n.index0AttributeName?i.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(g).trim(),t=i.getShaderInfoLog(_).trim(),n=i.getShaderInfoLog(S).trim();let r=!0,o=!0;if(!1===i.getProgramParameter(g,35714)){r=!1;const t=hs(i,_,"vertex"),n=hs(i,S,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(g,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(o=!1);o&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:x},fragmentShader:{log:n,prefix:b}})}let P,T;return i.deleteShader(_),i.deleteShader(S),this.getUniforms=function(){return void 0===P&&(P=new cs(i,g)),P},this.getAttributes=function(){return void 0===T&&(T=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i).name;n[r]=e.getAttribLocation(t,r)}return n}(i,g)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=ls++,this.cacheKey=t,this.usedTimes=1,this.program=g,this.vertexShader=_,this.fragmentShader=S,this}function zs(e,t,n,r,i,o){const a=[],s=r.isWebGL2,c=r.logarithmicDepthBuffer,u=r.floatVertexTextures,l=r.maxVertexUniforms,f=r.vertexTextures;let h=r.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},d=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function y(e){let t;return e&&e.isTexture?t=e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=Kt,t}return{getParameters:function(i,a,d,g,x){const b=g.fog,w=i.isMeshStandardMaterial?g.environment:null,M=t.get(i.envMap||w),_=v[i.type],S=x.isSkinnedMesh?function(e){const t=e.skeleton.bones;if(u)return 1024;{const e=l,n=Math.floor((e-20)/4),r=Math.min(n,t.length);return r<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}}(x):0;let P,T;if(null!==i.precision&&(h=r.getMaxPrecision(i.precision),h!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",h,"instead.")),_){const e=Vo[_];P=e.vertexShader,T=e.fragmentShader}else P=i.vertexShader,T=i.fragmentShader;const R=e.getRenderTarget();return{isWebGL2:s,shaderID:_,shaderName:i.type,vertexShader:P,fragmentShader:T,defines:i.defines,isRawShaderMaterial:!0===i.isRawShaderMaterial,glslVersion:i.glslVersion,precision:h,instancing:!0===x.isInstancedMesh,instancingColor:!0===x.isInstancedMesh&&null!==x.instanceColor,supportsVertexTextures:f,outputEncoding:null!==R?y(R.texture):e.outputEncoding,map:!!i.map,mapEncoding:y(i.map),matcap:!!i.matcap,matcapEncoding:y(i.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:y(M),envMapCubeUV:!!M&&(M.mapping===ue||M.mapping===le),lightMap:!!i.lightMap,lightMapEncoding:y(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:y(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:i.normalMapType===cn,tangentSpaceNormalMap:i.normalMapType===sn,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,transmissionMap:!!i.transmissionMap,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexAlphas:!0===i.vertexColors&&x.geometry&&x.geometry.attributes.color&&4===x.geometry.attributes.color.itemSize,vertexUvs:!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatMap||i.clearcoatRoughnessMap||i.clearcoatNormalMap||i.displacementMap||i.transmissionMap),uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.transmissionMap||!i.displacementMap),fog:!!b,useFog:i.fog,fogExp2:b&&b.isFogExp2,flatShading:!!i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:c,skinning:i.skinning&&S>0,maxBones:S,useVertexTexture:u,morphTargets:i.morphTargets,morphNormals:i.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:J,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===m,flipSided:i.side===p,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e<d.length;e++)n.push(t[d[e]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=v[e.type];let n;if(t){const e=Vo[t];n=Ro.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=a.length;e<t;e++){const t=a[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new Es(e,n,t,i),a.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},programs:a}}function Ls(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function Cs(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function As(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Os(e){const t=[];let n=0;const r=[],i=[],o={id:-1};function a(r,i,a,s,c,u){let l=t[n];const f=e.get(a);return void 0===l?(l={id:r.id,object:r,geometry:i,material:a,program:f.program||o,groupOrder:s,renderOrder:r.renderOrder,z:c,group:u},t[n]=l):(l.id=r.id,l.object=r,l.geometry=i,l.material=a,l.program=f.program||o,l.groupOrder=s,l.renderOrder=r.renderOrder,l.z=c,l.group=u),n++,l}return{opaque:r,transparent:i,init:function(){n=0,r.length=0,i.length=0},push:function(e,t,n,o,s,c){const u=a(e,t,n,o,s,c);(!0===n.transparent?i:r).push(u)},unshift:function(e,t,n,o,s,c){const u=a(e,t,n,o,s,c);(!0===n.transparent?i:r).unshift(u)},finish:function(){for(let e=n,r=t.length;e<r;e++){const n=t[e];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}},sort:function(e,t){r.length>1&&r.sort(e||Cs),i.length>1&&i.sort(t||As)}}}function Ds(e){let t=new WeakMap;return{get:function(n,r){let i;return!1===t.has(n)?(i=new Os(e),t.set(n,[i])):r>=t.get(n).length?(i=new Os(e),t.get(n).push(i)):i=t.get(n)[r],i},dispose:function(){t=new WeakMap}}}function Is(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new ar,color:new Ai};break;case"SpotLight":n={position:new ar,direction:new ar,color:new Ai,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ar,color:new Ai,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ar,skyColor:new Ai,groundColor:new Ai};break;case"RectAreaLight":n={color:new Ai,position:new ar,halfWidth:new ar,halfHeight:new ar}}return e[t.id]=n,n}}}let ks=0;function Fs(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function js(e,t){const n=new Is,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new ar);const o=new ar,a=new Fr,s=new Fr;return{setup:function(o){let a=0,s=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let u=0,l=0,f=0,h=0,v=0,d=0,p=0,m=0;o.sort(Fs);for(let e=0,t=o.length;e<t;e++){const t=o[e],y=t.color,g=t.intensity,x=t.distance,b=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=y.r*g,s+=y.g*g,c+=y.b*g;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],g);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[u]=n,i.directionalShadowMap[u]=b,i.directionalShadowMatrix[u]=t.shadow.matrix,d++}i.directional[u]=e,u++}else if(t.isSpotLight){const e=n.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(y).multiplyScalar(g),e.distance=x,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.spotShadow[f]=n,i.spotShadowMap[f]=b,i.spotShadowMatrix[f]=t.shadow.matrix,m++}i.spot[f]=e,f++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(y).multiplyScalar(g),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[h]=e,h++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[l]=n,i.pointShadowMap[l]=b,i.pointShadowMatrix[l]=t.shadow.matrix,p++}i.point[l]=e,l++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(g),e.groundColor.copy(t.groundColor).multiplyScalar(g),i.hemi[v]=e,v++}}h>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Ho.LTC_FLOAT_1,i.rectAreaLTC2=Ho.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Ho.LTC_HALF_1,i.rectAreaLTC2=Ho.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=c;const y=i.hash;y.directionalLength===u&&y.pointLength===l&&y.spotLength===f&&y.rectAreaLength===h&&y.hemiLength===v&&y.numDirectionalShadows===d&&y.numPointShadows===p&&y.numSpotShadows===m||(i.directional.length=u,i.spot.length=f,i.rectArea.length=h,i.point.length=l,i.hemi.length=v,i.directionalShadow.length=d,i.directionalShadowMap.length=d,i.pointShadow.length=p,i.pointShadowMap.length=p,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=d,i.pointShadowMatrix.length=p,i.spotShadowMatrix.length=m,y.directionalLength=u,y.pointLength=l,y.spotLength=f,y.rectAreaLength=h,y.hemiLength=v,y.numDirectionalShadows=d,y.numPointShadows=p,y.numSpotShadows=m,i.version=ks++)},setupView:function(e,t){let n=0,r=0,c=0,u=0,l=0;const f=t.matrixWorldInverse;for(let t=0,h=e.length;t<h;t++){const h=e[t];if(h.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(h.matrixWorld),o.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(f),n++}else if(h.isSpotLight){const e=i.spot[c];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(f),e.direction.setFromMatrixPosition(h.matrixWorld),o.setFromMatrixPosition(h.target.matrixWorld),e.direction.sub(o),e.direction.transformDirection(f),c++}else if(h.isRectAreaLight){const e=i.rectArea[u];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(f),s.identity(),a.copy(h.matrixWorld),a.premultiply(f),s.extractRotation(a),e.halfWidth.set(.5*h.width,0,0),e.halfHeight.set(0,.5*h.height,0),e.halfWidth.applyMatrix4(s),e.halfHeight.applyMatrix4(s),u++}else if(h.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(h.matrixWorld),e.position.applyMatrix4(f),r++}else if(h.isHemisphereLight){const e=i.hemi[l];e.direction.setFromMatrixPosition(h.matrixWorld),e.direction.transformDirection(f),e.direction.normalize(),l++}}},state:i}}function Us(e,t){const n=new js(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(){n.setup(r)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Bs(e,t){let n=new WeakMap;return{get:function(r,i=0){let o;return!1===n.has(r)?(o=new Us(e,t),n.set(r,[o])):i>=n.get(r).length?(o=new Us(e,t),n.get(r).push(o)):o=n.get(r)[i],o},dispose:function(){n=new WeakMap}}}class Gs extends Pi{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=on,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}Gs.prototype.isMeshDepthMaterial=!0;class Ns extends Pi{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new ar,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Hs(e,t,n){let r=new jo;const i=new Xn,o=new Xn,a=new nr,s=[],c=[],u={},l=n.maxTextureSize,h={0:p,1:d,2:m},y=new Eo({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),g=y.clone();g.defines.HORIZONTAL_PASS=1;const b=new ro;b.setAttribute("position",new ki(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new Mo(b,y),M=this;function _(n,r){const i=t.update(w);y.uniforms.shadow_pass.value=n.map.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,y,w,null),g.uniforms.shadow_pass.value=n.mapPass.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,g,w,null)}function S(e,t,n){const r=e<<0|t<<1|n<<2;let i=s[r];return void 0===i&&(i=new Gs({depthPacking:an,morphTargets:e,skinning:t}),s[r]=i),i}function P(e,t,n){const r=e<<0|t<<1|n<<2;let i=c[r];return void 0===i&&(i=new Ns({morphTargets:e,skinning:t}),c[r]=i),i}function T(t,n,r,i,o,a,s){let c=null,l=S,f=t.customDepthMaterial;if(!0===i.isPointLight&&(l=P,f=t.customDistanceMaterial),void 0===f){let e=!1;!0===r.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c=l(e,i,!0===t.isInstancedMesh)}else c=f;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const e=c.uuid,t=r.uuid;let n=u[e];void 0===n&&(n={},u[e]=n);let i=n[t];void 0===i&&(i=c.clone(),n[t]=i),c=i}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=s===v?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=o,c.farDistance=a),c}function R(n,i,o,a,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===v)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],l=i[u.materialIndex];if(l&&l.visible){const t=T(n,r,l,a,o.near,o.far,s);e.renderBufferDirect(o,null,r,t,n,u)}}}else if(i.visible){const t=T(n,r,i,a,o.near,o.far,s);e.renderBufferDirect(o,null,r,t,n,null)}}const c=n.children;for(let e=0,t=c.length;e<t;e++)R(c[e],i,o,a,s)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=f,this.render=function(t,n,s){if(!1===M.enabled)return;if(!1===M.autoUpdate&&!1===M.needsUpdate)return;if(0===t.length)return;const c=e.getRenderTarget(),u=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),h=e.state;h.setBlending(x),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);for(let c=0,u=t.length;c<u;c++){const u=t[c],f=u.shadow;if(void 0===f){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===f.autoUpdate&&!1===f.needsUpdate)continue;i.copy(f.mapSize);const d=f.getFrameExtents();if(i.multiply(d),o.copy(f.mapSize),(i.x>l||i.y>l)&&(i.x>l&&(o.x=Math.floor(l/d.x),i.x=o.x*d.x,f.mapSize.x=o.x),i.y>l&&(o.y=Math.floor(l/d.y),i.y=o.y*d.y,f.mapSize.y=o.y)),null===f.map&&!f.isPointLightShadow&&this.type===v){const e={minFilter:xe,magFilter:xe,format:je};f.map=new rr(i.x,i.y,e),f.map.texture.name=u.name+".shadowMap",f.mapPass=new rr(i.x,i.y,e),f.camera.updateProjectionMatrix()}if(null===f.map){const e={minFilter:de,magFilter:de,format:je};f.map=new rr(i.x,i.y,e),f.map.texture.name=u.name+".shadowMap",f.camera.updateProjectionMatrix()}e.setRenderTarget(f.map),e.clear();const p=f.getViewportCount();for(let e=0;e<p;e++){const t=f.getViewport(e);a.set(o.x*t.x,o.y*t.y,o.x*t.z,o.y*t.w),h.viewport(a),f.updateMatrices(u,e),r=f.getFrustum(),R(n,s,f.camera,u,this.type)}f.isPointLightShadow||this.type!==v||_(f,s),f.needsUpdate=!1}M.needsUpdate=!1,e.setRenderTarget(c,u,f)}}function Vs(e,t,n){const r=n.isWebGL2,i=new function(){let t=!1;const n=new nr;let r=null;const i=new nr(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,o,a,s){!0===s&&(t*=a,r*=a,o*=a),n.set(t,r,o,a),!1===i.equals(n)&&(e.clearColor(t,r,o,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},o=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(e){e?me(2929):ye(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case G:e.depthFunc(512);break;case N:e.depthFunc(519);break;case H:e.depthFunc(513);break;case V:e.depthFunc(515);break;case W:e.depthFunc(514);break;case Z:e.depthFunc(518);break;case q:e.depthFunc(516);break;case Y:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},u=new function(){let t=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(e){t||(e?me(2960):ye(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&o===a||(e.stencilFunc(t,n,a),r=t,i=n,o=a)},setOp:function(t,n,r){a===t&&s===n&&c===r||(e.stencilOp(t,n,r),a=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null}}};let l={},f=null,h={},v=null,d=!1,y=null,g=null,X=null,K=null,Q=null,J=null,$=null,ee=!1,te=null,ne=null,re=null,ie=null,oe=null;const ae=e.getParameter(35661);let se=!1,ce=0;const ue=e.getParameter(7938);-1!==ue.indexOf("WebGL")?(ce=parseFloat(/^WebGL (\d)/.exec(ue)[1]),se=ce>=1):-1!==ue.indexOf("OpenGL ES")&&(ce=parseFloat(/^OpenGL ES (\d)/.exec(ue)[1]),se=ce>=2);let le=null,fe={};const he=new nr(0,0,e.canvas.width,e.canvas.height),ve=new nr(0,0,e.canvas.width,e.canvas.height);function de(t,n,r){const i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<r;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,i);return o}const pe={};function me(t){!0!==l[t]&&(e.enable(t),l[t]=!0)}function ye(t){!1!==l[t]&&(e.disable(t),l[t]=!1)}pe[3553]=de(3553,3553,1),pe[34067]=de(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),u.setClear(0),me(2929),o.setFunc(V),we(!1),Me(s),me(2884),be(x);const ge={[P]:32774,[T]:32778,[R]:32779};if(r)ge[E]=32775,ge[z]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(ge[E]=e.MIN_EXT,ge[z]=e.MAX_EXT)}const xe={[L]:0,[C]:1,[A]:768,[D]:770,[B]:776,[j]:774,[k]:772,[O]:769,[I]:771,[U]:775,[F]:773};function be(t,n,r,i,o,a,s,c){if(t!==x){if(!1===d&&(me(3042),d=!0),t===S)o=o||n,a=a||r,s=s||i,n===g&&o===Q||(e.blendEquationSeparate(ge[n],ge[o]),g=n,Q=o),r===X&&i===K&&a===J&&s===$||(e.blendFuncSeparate(xe[r],xe[i],xe[a],xe[s]),X=r,K=i,J=a,$=s),y=t,ee=null;else if(t!==y||c!==ee){if(g===P&&Q===P||(e.blendEquation(32774),g=P,Q=P),c)switch(t){case b:e.blendFuncSeparate(1,771,1,771);break;case w:e.blendFunc(1,1);break;case M:e.blendFuncSeparate(0,0,769,771);break;case _:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case b:e.blendFuncSeparate(770,771,1,771);break;case w:e.blendFunc(770,1);break;case M:e.blendFunc(0,769);break;case _:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}X=null,K=null,J=null,$=null,y=t,ee=c}}else!0===d&&(ye(3042),d=!1)}function we(t){te!==t&&(t?e.frontFace(2304):e.frontFace(2305),te=t)}function Me(t){t!==a?(me(2884),t!==ne&&(t===s?e.cullFace(1029):t===c?e.cullFace(1028):e.cullFace(1032))):ye(2884),ne=t}function _e(t,n,r){t?(me(32823),ie===n&&oe===r||(e.polygonOffset(n,r),ie=n,oe=r)):ye(32823)}function Se(t){void 0===t&&(t=33984+ae-1),le!==t&&(e.activeTexture(t),le=t)}return{buffers:{color:i,depth:o,stencil:u},enable:me,disable:ye,bindFramebuffer:function(t,n){null===n&&null!==f&&(n=f),h[t]!==n&&(e.bindFramebuffer(t,n),h[t]=n,r&&(36009===t&&(h[36160]=n),36160===t&&(h[36009]=n)))},bindXRFramebuffer:function(t){t!==f&&(e.bindFramebuffer(36160,t),f=t)},useProgram:function(t){return v!==t&&(e.useProgram(t),v=t,!0)},setBlending:be,setMaterial:function(e,t){e.side===m?ye(2884):me(2884);let n=e.side===p;t&&(n=!n),we(n),e.blending===b&&!1===e.transparent?be(x):be(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),i.setMask(e.colorWrite);const r=e.stencilWrite;u.setTest(r),r&&(u.setMask(e.stencilWriteMask),u.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),u.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),_e(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?me(32926):ye(32926)},setFlipSided:we,setCullFace:Me,setLineWidth:function(t){t!==re&&(se&&e.lineWidth(t),re=t)},setPolygonOffset:_e,setScissorTest:function(e){e?me(3089):ye(3089)},activeTexture:Se,bindTexture:function(t,n){null===le&&Se();let r=fe[le];void 0===r&&(r={type:void 0,texture:void 0},fe[le]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||pe[t]),r.type=t,r.texture=n)},unbindTexture:function(){const t=fe[le];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===he.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),he.copy(t))},viewport:function(t){!1===ve.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),ve.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===r&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},le=null,fe={},f=null,h={},v=null,d=!1,y=null,g=null,X=null,K=null,Q=null,J=null,$=null,ee=!1,te=null,ne=null,re=null,ie=null,oe=null,he.set(0,0,e.canvas.width,e.canvas.height),ve.set(0,0,e.canvas.width,e.canvas.height),i.reset(),o.reset(),u.reset()}}}function Ws(e,t,n,r,i,o,a){const s=i.isWebGL2,c=i.maxTextures,u=i.maxCubemapSize,l=i.maxTextureSize,f=i.maxSamples,h=new WeakMap;let v,d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function p(e,t){return d?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function m(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?qn:Math.floor,o=r(i*e.width),a=r(i*e.height);void 0===v&&(v=p(o,a));const s=n?p(o,a):v;return s.width=o,s.height=a,s.getContext("2d").drawImage(e,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+a+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function y(e){return Wn(e.width)&&Wn(e.height)}function g(e,t){return e.generateMipmaps&&t&&e.minFilter!==de&&e.minFilter!==xe}function x(t,n,i,o){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log2(Math.max(i,o))}function b(n,r,i){if(!1===s)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function w(e){return e===de||e===pe||e===ye?9728:9729}function M(t){const n=t.target;n.removeEventListener("dispose",M),function(t){const n=r.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),r.remove(t))}(n),n.isVideoTexture&&h.delete(n),a.memory.textures--}function _(t){const n=t.target;n.removeEventListener("dispose",_),function(t){const n=t.texture,i=r.get(t),o=r.get(n);if(t){if(void 0!==o.__webglTexture&&e.deleteTexture(o.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);r.remove(n),r.remove(t)}}(n),a.memory.textures--}let S=0;function P(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=a.render.frame;h.get(e)!==t&&(h.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void C(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function T(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;L(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),c=r.image[0]&&r.image[0].isDataTexture,l=[];for(let e=0;e<6;e++)l[e]=a||c?c?r.image[e].image:r.image[e]:m(r.image[e],!1,!0,u);const f=l[0],h=y(f)||s,v=o.convert(r.format),d=o.convert(r.type),p=b(r.internalFormat,v,d);let w;if(z(34067,r,h),a){for(let e=0;e<6;e++){w=l[e].mipmaps;for(let t=0;t<w.length;t++){const i=w[t];r.format!==je&&r.format!==Fe?null!==v?n.compressedTexImage2D(34069+e,t,p,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+e,t,p,i.width,i.height,0,v,d,i.data)}}t.__maxMipLevel=w.length-1}else{w=r.mipmaps;for(let e=0;e<6;e++)if(c){n.texImage2D(34069+e,0,p,l[e].width,l[e].height,0,v,d,l[e].data);for(let t=0;t<w.length;t++){const r=w[t].image[e].image;n.texImage2D(34069+e,t+1,p,r.width,r.height,0,v,d,r.data)}}else{n.texImage2D(34069+e,0,p,v,d,l[e]);for(let t=0;t<w.length;t++){const r=w[t];n.texImage2D(34069+e,t+1,p,v,d,r.image[e])}}t.__maxMipLevel=w.length}g(r,h)&&x(34067,r,f.width,f.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(a,t,i):(n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture))}const R={[fe]:10497,[he]:33071,[ve]:33648},E={[de]:9728,[pe]:9984,[ye]:9986,[xe]:9729,[be]:9985,[Me]:9987};function z(n,o,a){if(a?(e.texParameteri(n,10242,R[o.wrapS]),e.texParameteri(n,10243,R[o.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,R[o.wrapR]),e.texParameteri(n,10240,E[o.magFilter]),e.texParameteri(n,10241,E[o.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),o.wrapS===he&&o.wrapT===he||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,w(o.magFilter)),e.texParameteri(n,10241,w(o.minFilter)),o.minFilter!==de&&o.minFilter!==xe&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const a=t.get("EXT_texture_filter_anisotropic");if(o.type===Le&&!1===t.has("OES_texture_float_linear"))return;if(!1===s&&o.type===Ce&&!1===t.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function L(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",M),t.__webglTexture=e.createTexture(),a.memory.textures++)}function C(t,r,i){let a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),L(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const c=function(e){return!s&&(e.wrapS!==he||e.wrapT!==he||e.minFilter!==de&&e.minFilter!==xe)}(r)&&!1===y(r.image),u=m(r.image,c,!1,l),f=y(u)||s,h=o.convert(r.format);let v,d=o.convert(r.type),p=b(r.internalFormat,h,d);z(a,r,f);const w=r.mipmaps;if(r.isDepthTexture)p=6402,s?p=r.type===Le?36012:r.type===ze?33190:r.type===Ie?35056:33189:r.type===Le&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===Ne&&6402===p&&r.type!==Re&&r.type!==ze&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Re,d=o.convert(r.type)),r.format===He&&6402===p&&(p=34041,r.type!==Ie&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ie,d=o.convert(r.type))),n.texImage2D(3553,0,p,u.width,u.height,0,h,d,null);else if(r.isDataTexture)if(w.length>0&&f){for(let e=0,t=w.length;e<t;e++)v=w[e],n.texImage2D(3553,e,p,v.width,v.height,0,h,d,v.data);r.generateMipmaps=!1,t.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,p,u.width,u.height,0,h,d,u.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(let e=0,t=w.length;e<t;e++)v=w[e],r.format!==je&&r.format!==Fe?null!==h?n.compressedTexImage2D(3553,e,p,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,e,p,v.width,v.height,0,h,d,v.data);t.__maxMipLevel=w.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,p,u.width,u.height,u.depth,0,h,d,u.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,p,u.width,u.height,u.depth,0,h,d,u.data),t.__maxMipLevel=0;else if(w.length>0&&f){for(let e=0,t=w.length;e<t;e++)v=w[e],n.texImage2D(3553,e,p,h,d,v);r.generateMipmaps=!1,t.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,p,h,d,u),t.__maxMipLevel=0;g(r,f)&&x(a,r,u.width,u.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function A(t,i,a,s){const c=i.texture,u=o.convert(c.format),l=o.convert(c.type),f=b(c.internalFormat,u,l);32879===s||35866===s?n.texImage3D(s,0,f,i.width,i.height,i.depth,0,u,l,null):n.texImage2D(s,0,f,i.width,i.height,0,u,l,null),n.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,a,s,r.get(c).__webglTexture,0),n.bindFramebuffer(36160,null)}function O(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){let i=33189;if(r){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===Le?i=36012:t.type===ze&&(i=33190));const r=D(n);e.renderbufferStorageMultisample(36161,r,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){if(r){const t=D(n);e.renderbufferStorageMultisample(36161,t,35056,n.width,n.height)}else e.renderbufferStorage(36161,34041,n.width,n.height);e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=n.texture,i=o.convert(t.format),a=o.convert(t.type),s=b(t.internalFormat,i,a);if(r){const t=D(n);e.renderbufferStorageMultisample(36161,t,s,n.width,n.height)}else e.renderbufferStorage(36161,s,n.width,n.height)}e.bindRenderbuffer(36161,null)}function D(e){return s&&e.isWebGLMultisampleRenderTarget?Math.min(f,e.samples):0}let I=!1,k=!1;this.allocateTextureUnit=function(){const e=S;return e>=c&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+c),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=P,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?C(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?C(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=T,this.setupRenderTarget=function(t){const i=t.texture,c=r.get(t),u=r.get(i);t.addEventListener("dispose",_),u.__webglTexture=e.createTexture(),u.__version=i.version,a.memory.textures++;const l=!0===t.isWebGLCubeRenderTarget,f=!0===t.isWebGLMultisampleRenderTarget,h=i.isDataTexture3D||i.isDataTexture2DArray,v=y(t)||s;if(!s||i.format!==Fe||i.type!==Le&&i.type!==Ce||(i.format=je,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else if(c.__webglFramebuffer=e.createFramebuffer(),f)if(s){c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer);const r=o.convert(i.format),a=o.convert(i.type),s=b(i.internalFormat,r,a),u=D(t);e.renderbufferStorageMultisample(36161,u,s,t.width,t.height),n.bindFramebuffer(36160,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,c.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),O(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){n.bindTexture(34067,u.__webglTexture),z(34067,i,v);for(let e=0;e<6;e++)A(c.__webglFramebuffer[e],t,36064,34069+e);g(i,v)&&x(34067,i,t.width,t.height),n.bindTexture(34067,null)}else{let e=3553;h&&(s?e=i.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),n.bindTexture(e,u.__webglTexture),z(e,i,v),A(c.__webglFramebuffer,t,36064,e),g(i,v)&&x(3553,i,t.width,t.height),n.bindTexture(3553,null)}t.depthBuffer&&function(t){const i=r.get(t),o=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),P(i.depthTexture,0);const o=r.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Ne)e.framebufferTexture2D(36160,36096,3553,o,0);else{if(i.depthTexture.format!==He)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,o,0)}}(i.__webglFramebuffer,t)}else if(o){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(36160,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),O(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),O(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(g(t,y(e)||s)){const i=e.isWebGLCubeRenderTarget?34067:3553,o=r.get(t).__webglTexture;n.bindTexture(i,o),x(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(s){const i=t.width,o=t.height;let a=16384;t.depthBuffer&&(a|=256),t.stencilBuffer&&(a|=1024);const s=r.get(t);n.bindFramebuffer(36008,s.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,s.__webglFramebuffer),e.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,s.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),e=e.texture),P(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),k=!0),e=e.texture),T(e,t)}}function Zs(e,t,n){const r=n.isWebGL2;return{convert:function(e){let n;if(e===Se)return 5121;if(e===Ae)return 32819;if(e===Oe)return 32820;if(e===De)return 33635;if(e===Pe)return 5120;if(e===Te)return 5122;if(e===Re)return 5123;if(e===Ee)return 5124;if(e===ze)return 5125;if(e===Le)return 5126;if(e===Ce)return r?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(e===ke)return 6406;if(e===Fe)return 6407;if(e===je)return 6408;if(e===Ue)return 6409;if(e===Be)return 6410;if(e===Ne)return 6402;if(e===He)return 34041;if(e===Ve)return 6403;if(e===We)return 36244;if(e===Ze)return 33319;if(e===qe)return 33320;if(e===Ye)return 36248;if(e===Xe)return 36249;if(e===Ke||e===Qe||e===Je||e===$e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(e===Ke)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Qe)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Je)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===$e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===et||e===tt||e===nt||e===rt){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(e===et)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===tt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===nt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===rt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===it)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===ot||e===at)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(e===ot)return n.COMPRESSED_RGB8_ETC2;if(e===at)return n.COMPRESSED_RGBA8_ETC2_EAC}return e===st||e===ct||e===ut||e===lt||e===ft||e===ht||e===vt||e===dt||e===pt||e===mt||e===yt||e===gt||e===xt||e===bt||e===Mt||e===_t||e===St||e===Pt||e===Tt||e===Rt||e===Et||e===zt||e===Lt||e===Ct||e===At||e===Ot||e===Dt||e===It?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):e===wt?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):e===Ie?r?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}Ns.prototype.isMeshDistanceMaterial=!0;class qs extends Lo{constructor(e=[]){super(),this.cameras=e}}qs.prototype.isArrayCamera=!0;class Ys extends ci{constructor(){super(),this.type="Group"}}Ys.prototype.isGroup=!0;const Xs={type:"move"};class Ks{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Ys,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Ys,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ar,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ar),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Ys,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ar,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ar),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,o=null;const a=this._targetRay,s=this._grip,c=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==a&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Xs))),c&&e.hand){o=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n);if(void 0===c.joints[r.jointName]){const e=new Ys;e.matrixAutoUpdate=!1,e.visible=!1,c.joints[r.jointName]=e,c.add(e)}const i=c.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=c.joints["index-finger-tip"],i=c.joints["thumb-tip"],a=r.position.distanceTo(i.position),s=.02,u=.005;c.inputState.pinching&&a>s+u?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&a<=s-u&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==c&&(c.visible=null!==o),this}}class Qs extends kn{constructor(e,t){super();const n=this,r=e.state;let i=null,o=1,a=null,s="local-floor",c=null;const u=[],l=new Map,f=new Lo;f.layers.enable(1),f.viewport=new nr;const h=new Lo;h.layers.enable(2),h.viewport=new nr;const v=[f,h],d=new qs;d.layers.enable(1),d.layers.enable(2);let p=null,m=null;function y(e){const t=l.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function g(){l.forEach((function(e,t){e.disconnect(t)})),l.clear(),p=null,m=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function x(e){const t=i.inputSources;for(let e=0;e<u.length;e++)l.set(t[e],u[e]);for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=l.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),l.delete(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t],r=l.get(n);r&&r.dispatchEvent({type:"connected",data:n})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=u[e];return void 0===t&&(t=new Ks,u[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=u[e];return void 0===t&&(t=new Ks,u[e]=t),t.getGripSpace()},this.getHand=function(e){let t=u[e];return void 0===t&&(t=new Ks,u[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return i},this.setSession=async function(e){if(i=e,null!==i){i.addEventListener("select",y),i.addEventListener("selectstart",y),i.addEventListener("selectend",y),i.addEventListener("squeeze",y),i.addEventListener("squeezestart",y),i.addEventListener("squeezeend",y),i.addEventListener("end",g),i.addEventListener("inputsourceschange",x);const e=t.getContextAttributes();!0!==e.xrCompatible&&await t.makeXRCompatible();const r={antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:o},c=new XRWebGLLayer(i,t,r);i.updateRenderState({baseLayer:c}),a=await i.requestReferenceSpace(s),S.setContext(i),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const b=new ar,w=new ar;function M(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.getCamera=function(e){d.near=h.near=f.near=e.near,d.far=h.far=f.far=e.far,p===d.near&&m===d.far||(i.updateRenderState({depthNear:d.near,depthFar:d.far}),p=d.near,m=d.far);const t=e.parent,n=d.cameras;M(d,t);for(let e=0;e<n.length;e++)M(n[e],t);e.matrixWorld.copy(d.matrixWorld),e.matrix.copy(d.matrix),e.matrix.decompose(e.position,e.quaternion,e.scale);const r=e.children;for(let e=0,t=r.length;e<t;e++)r[e].updateMatrixWorld(!0);return 2===n.length?function(e,t,n){b.setFromMatrixPosition(t.matrixWorld),w.setFromMatrixPosition(n.matrixWorld);const r=b.distanceTo(w),i=t.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],u=(i[9]-1)/i[5],l=(i[8]-1)/i[0],f=(o[8]+1)/o[0],h=a*l,v=a*f,d=r/(-l+f),p=d*-l;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(p),e.translateZ(d),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const m=a+d,y=s+d,g=h-p,x=v+(r-p),M=c*s/y*m,_=u*s/y*m;e.projectionMatrix.makePerspective(g,x,M,_,m,y)}(d,f,h):d.projectionMatrix.copy(f.projectionMatrix),d};let _=null;const S=new Uo;S.setAnimationLoop((function(e,t){if(c=t.getViewerPose(a),null!==c){const e=c.views,t=i.renderState.baseLayer;r.bindXRFramebuffer(t.framebuffer);let n=!1;e.length!==d.cameras.length&&(d.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const i=e[r],o=t.getViewport(i),a=v[r];a.matrix.fromArray(i.transform.matrix),a.projectionMatrix.fromArray(i.projectionMatrix),a.viewport.set(o.x,o.y,o.width,o.height),0===r&&d.matrix.copy(a.matrix),!0===n&&d.cameras.push(a)}}const n=i.inputSources;for(let e=0;e<u.length;e++){const r=u[e],i=n[e];r.update(i,t,a)}_&&_(e,t)})),this.setAnimationLoop=function(e){_=e},this.dispose=function(){}}}function Js(e){function t(t,n){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);const r=e.get(n).envMap;if(r){t.envMap.value=r,t.flipEnvMap.value=r.isCubeTexture&&r._needsFlipEnvMap?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio;const i=e.get(r).__maxMipLevel;void 0!==i&&(t.maxMipLevel.value=i)}let i,o;n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap?i=n.emissiveMap:n.clearcoatMap?i=n.clearcoatMap:n.clearcoatNormalMap?i=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(i=n.clearcoatRoughnessMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),t.uv2Transform.value.copy(o.matrix))}function n(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===p&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===p&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),e.get(n).envMap&&(t.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,i,o){r.isMeshBasicMaterial?t(e,r):r.isMeshLambertMaterial?(t(e,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,r)):r.isMeshToonMaterial?(t(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===p&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===p&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshPhongMaterial?(t(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===p&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===p&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshStandardMaterial?(t(e,r),r.isMeshPhysicalMaterial?function(e,t){n(e,t),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===p&&e.clearcoatNormalScale.value.negate()),e.transmission.value=t.transmission,t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap)}(e,r):n(e,r)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===p&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===p&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===p&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===p&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){let i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,o):r.isSpriteMaterial?function(e,t){let n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function $s(e){const t=void 0!==(e=e||{}).canvas?e.canvas:function(){const e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.powerPreference?e.powerPreference:"default",l=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let f=null,h=null;const v=[],d=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Kt,this.physicallyCorrectLights=!1,this.toneMapping=J,this.toneMappingExposure=1;const p=this;let m=!1,y=0,g=0,x=null,b=-1,w=null;const M=new nr,_=new nr;let S=null,P=t.width,T=t.height,R=1,E=null,z=null;const L=new nr(0,0,P,T),C=new nr(0,0,P,T);let A=!1;const O=new jo;let D=!1,I=!1;const k=new Fr,F=new ar,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function U(){return null===x?R:1}let B,G,N,H,V,W,Z,q,Y,X,K,Q,$,ee,te,ne,re,ie,oe,ae,se,ce,ue=n;function le(e,n){for(let r=0;r<e.length;r++){const i=e[r],o=t.getContext(i,n);if(null!==o)return o}return null}try{const e={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:l};if(t.addEventListener("webglcontextlost",ve,!1),t.addEventListener("webglcontextrestored",de,!1),null===ue){const t=["webgl2","webgl","experimental-webgl"];if(!0===p.isWebGL1Renderer&&t.shift(),ue=le(t,e),null===ue)throw le(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ue.getShaderPrecisionFormat&&(ue.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function fe(){B=new Qo(ue),G=new Yo(ue,B,e),B.init(G),se=new Zs(ue,B,G),N=new Vs(ue,B,G),H=new ea(ue),V=new Ls,W=new Ws(ue,B,N,V,G,se,H),Z=new Ko(p),q=new Bo(ue,G),ce=new Zo(ue,B,q,G),Y=new Jo(ue,q,H,ce),X=new ia(ue,Y,q,H),ie=new ra(ue),te=new Xo(V),K=new zs(p,Z,B,G,ce,te),Q=new Js(V),$=new Ds(V),ee=new Bs(B,G),re=new Wo(p,Z,N,X,s),ne=new Hs(p,X,G),oe=new qo(ue,B,H,G),ae=new $o(ue,B,H,G),H.programs=K.programs,p.capabilities=G,p.extensions=B,p.properties=V,p.renderLists=$,p.shadowMap=ne,p.state=N,p.info=H}fe();const he=new Qs(p,ue);function ve(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function de(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1;const e=H.autoReset,t=ne.enabled,n=ne.autoUpdate,r=ne.needsUpdate,i=ne.type;fe(),H.autoReset=e,ne.enabled=t,ne.autoUpdate=n,ne.needsUpdate=r,ne.type=i}function pe(e){const t=e.target;t.removeEventListener("dispose",pe),function(e){(function(e){const t=V.get(e).programs;void 0!==t&&t.forEach((function(e){K.releaseProgram(e)}))})(e),V.remove(e)}(t)}this.xr=he,this.getContext=function(){return ue},this.getContextAttributes=function(){return ue.getContextAttributes()},this.forceContextLoss=function(){const e=B.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=B.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return R},this.setPixelRatio=function(e){void 0!==e&&(R=e,this.setSize(P,T,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new Xn),e.set(P,T)},this.setSize=function(e,n,r){he.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=e,T=n,t.width=Math.floor(e*R),t.height=Math.floor(n*R),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new Xn),e.set(P*R,T*R).floor()},this.setDrawingBufferSize=function(e,n,r){P=e,T=n,R=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new nr),e.copy(M)},this.getViewport=function(e){return e.copy(L)},this.setViewport=function(e,t,n,r){e.isVector4?L.set(e.x,e.y,e.z,e.w):L.set(e,t,n,r),N.viewport(M.copy(L).multiplyScalar(R).floor())},this.getScissor=function(e){return e.copy(C)},this.setScissor=function(e,t,n,r){e.isVector4?C.set(e.x,e.y,e.z,e.w):C.set(e,t,n,r),N.scissor(_.copy(C).multiplyScalar(R).floor())},this.getScissorTest=function(){return A},this.setScissorTest=function(e){N.setScissorTest(A=e)},this.setOpaqueSort=function(e){E=e},this.setTransparentSort=function(e){z=e},this.getClearColor=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getClearColor() now requires a Color as an argument"),e=new Ai),e.copy(re.getClearColor())},this.setClearColor=function(){re.setClearColor.apply(re,arguments)},this.getClearAlpha=function(){return re.getClearAlpha()},this.setClearAlpha=function(){re.setClearAlpha.apply(re,arguments)},this.clear=function(e,t,n){let r=0;(void 0===e||e)&&(r|=16384),(void 0===t||t)&&(r|=256),(void 0===n||n)&&(r|=1024),ue.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ve,!1),t.removeEventListener("webglcontextrestored",de,!1),$.dispose(),ee.dispose(),V.dispose(),Z.dispose(),X.dispose(),ce.dispose(),he.dispose(),he.removeEventListener("sessionstart",ye),he.removeEventListener("sessionend",ge),xe.stop()},this.renderBufferImmediate=function(e,t){ce.initAttributes();const n=V.get(e);e.hasPositions&&!n.position&&(n.position=ue.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=ue.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=ue.createBuffer()),e.hasColors&&!n.color&&(n.color=ue.createBuffer());const r=t.getAttributes();e.hasPositions&&(ue.bindBuffer(34962,n.position),ue.bufferData(34962,e.positionArray,35048),ce.enableAttribute(r.position),ue.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(ue.bindBuffer(34962,n.normal),ue.bufferData(34962,e.normalArray,35048),ce.enableAttribute(r.normal),ue.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(ue.bindBuffer(34962,n.uv),ue.bufferData(34962,e.uvArray,35048),ce.enableAttribute(r.uv),ue.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(ue.bindBuffer(34962,n.color),ue.bufferData(34962,e.colorArray,35048),ce.enableAttribute(r.color),ue.vertexAttribPointer(r.color,3,5126,!1,0,0)),ce.disableUnusedAttributes(),ue.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,o){null===t&&(t=j);const a=i.isMesh&&i.matrixWorld.determinant()<0,s=Te(e,t,r,i);N.setMaterial(r,a);let c=n.index;const u=n.attributes.position;if(null===c){if(void 0===u||0===u.count)return}else if(0===c.count)return;let l,f=1;!0===r.wireframe&&(c=Y.getWireframeAttribute(n),f=2),(r.morphTargets||r.morphNormals)&&ie.update(i,n,r,s),ce.setup(i,r,s,n,c);let h=oe;null!==c&&(l=q.get(c),h=ae,h.setIndex(l));const v=null!==c?c.count:u.count,d=n.drawRange.start*f,p=n.drawRange.count*f,m=null!==o?o.start*f:0,y=null!==o?o.count*f:1/0,g=Math.max(d,m),x=Math.min(v,d+p,m+y)-1,b=Math.max(0,x-g+1);if(0!==b){if(i.isMesh)!0===r.wireframe?(N.setLineWidth(r.wireframeLinewidth*U()),h.setMode(1)):h.setMode(4);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),N.setLineWidth(e*U()),i.isLineSegments?h.setMode(1):i.isLineLoop?h.setMode(2):h.setMode(3)}else i.isPoints?h.setMode(0):i.isSprite&&h.setMode(4);if(i.isInstancedMesh)h.renderInstances(g,b,i.count);else if(n.isInstancedBufferGeometry){const e=Math.min(n.instanceCount,n._maxInstanceCount);h.renderInstances(g,b,e)}else h.render(g,b)}},this.compile=function(e,t){h=ee.get(e),h.init(),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(h.pushLight(e),e.castShadow&&h.pushShadow(e))})),h.setupLights(),e.traverse((function(t){const n=t.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++)_e(n[r],e,t);else _e(n,e,t)}))};let me=null;function ye(){xe.stop()}function ge(){xe.start()}const xe=new Uo;function be(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)h.pushLight(e),e.castShadow&&h.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||O.intersectsSprite(e)){r&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=X.update(e),i=e.material;i.visible&&f.push(e,t,i,n,F.z,null)}}else if(e.isImmediateRenderObject)r&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k),f.push(e,null,e.material,n,F.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==H.render.frame&&(e.skeleton.update(),e.skeleton.frame=H.render.frame),!e.frustumCulled||O.intersectsObject(e))){r&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=X.update(e),i=e.material;if(Array.isArray(i)){const r=t.groups;for(let o=0,a=r.length;o<a;o++){const a=r[o],s=i[a.materialIndex];s&&s.visible&&f.push(e,t,s,n,F.z,a)}}else i.visible&&f.push(e,t,i,n,F.z,null)}const i=e.children;for(let e=0,o=i.length;e<o;e++)be(i[e],t,n,r)}function we(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,o=e.length;i<o;i++){const o=e[i],a=o.object,s=o.geometry,c=null===r?o.material:r,u=o.group;if(n.isArrayCamera){const e=n.cameras;for(let n=0,r=e.length;n<r;n++){const r=e[n];a.layers.test(r.layers)&&(N.viewport(M.copy(r.viewport)),h.setupLightsView(r),Me(a,t,r,s,c,u))}}else Me(a,t,n,s,c,u)}}function Me(e,t,n,r,i,o){if(e.onBeforeRender(p,t,n,r,i,o),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){const r=Te(n,t,i,e);N.setMaterial(i),ce.reset(),function(e,t){e.render((function(e){p.renderBufferImmediate(e,t)}))}(e,r)}else p.renderBufferDirect(n,t,r,i,e,o);e.onAfterRender(p,t,n,r,i,o)}function _e(e,t,n){!0!==t.isScene&&(t=j);const r=V.get(e),i=h.state.lights,o=h.state.shadowsArray,a=i.state.version,s=K.getParameters(e,i.state,o,t,n),c=K.getProgramCacheKey(s);let u=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=Z.get(e.envMap||r.environment),void 0===u&&(e.addEventListener("dispose",pe),u=new Map,r.programs=u);let l=u.get(c);if(void 0!==l){if(r.currentProgram===l&&r.lightsStateVersion===a)return Pe(e,s),l}else s.uniforms=K.getUniforms(e),e.onBuild(s,p),e.onBeforeCompile(s,p),l=K.acquireProgram(s,c),u.set(c,l),r.uniforms=s.uniforms;const f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(f.clippingPlanes=te.uniform),Pe(e,s),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);const v=l.getUniforms(),d=cs.seqWithValue(v.seq,f);return r.currentProgram=l,r.uniformsList=d,l}function Pe(e,t){const n=V.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas}function Te(e,t,n,r){!0!==t.isScene&&(t=j),W.resetTextureUnits();const i=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=null===x?p.outputEncoding:x.texture.encoding,s=Z.get(n.envMap||o),c=!0===n.vertexColors&&r.geometry&&r.geometry.attributes.color&&4===r.geometry.attributes.color.itemSize,u=V.get(n),l=h.state.lights;if(!0===D&&(!0===I||e!==w)){const t=e===w&&n.id===b;te.setState(n,e,t)}let f=!1;n.version===u.__version?u.needsLights&&u.lightsStateVersion!==l.state.version||u.outputEncoding!==a||r.isInstancedMesh&&!1===u.instancing?f=!0:r.isInstancedMesh||!0!==u.instancing?u.envMap!==s||n.fog&&u.fog!==i?f=!0:void 0===u.numClippingPlanes||u.numClippingPlanes===te.numPlanes&&u.numIntersection===te.numIntersection?u.vertexAlphas!==c&&(f=!0):f=!0:f=!0:(f=!0,u.__version=n.version);let v=u.currentProgram;!0===f&&(v=_e(n,t,r));let d=!1,m=!1,y=!1;const g=v.getUniforms(),M=u.uniforms;if(N.useProgram(v.program)&&(d=!0,m=!0,y=!0),n.id!==b&&(b=n.id,m=!0),d||w!==e){if(g.setValue(ue,"projectionMatrix",e.projectionMatrix),G.logarithmicDepthBuffer&&g.setValue(ue,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),w!==e&&(w=e,m=!0,y=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const t=g.map.cameraPosition;void 0!==t&&t.setValue(ue,F.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&g.setValue(ue,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&g.setValue(ue,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){g.setOptional(ue,r,"bindMatrix"),g.setOptional(ue,r,"bindMatrixInverse");const e=r.skeleton;if(e){const t=e.bones;if(G.floatVertexTextures){if(null===e.boneTexture){let n=Math.sqrt(4*t.length);n=Zn(n),n=Math.max(n,4);const r=new Float32Array(n*n*4);r.set(e.boneMatrices);const i=new Io(r,n,n,je,Le);e.boneMatrices=r,e.boneTexture=i,e.boneTextureSize=n}g.setValue(ue,"boneTexture",e.boneTexture,W),g.setValue(ue,"boneTextureSize",e.boneTextureSize)}else g.setOptional(ue,e,"boneMatrices")}}var _,S;return(m||u.receiveShadow!==r.receiveShadow)&&(u.receiveShadow=r.receiveShadow,g.setValue(ue,"receiveShadow",r.receiveShadow)),m&&(g.setValue(ue,"toneMappingExposure",p.toneMappingExposure),u.needsLights&&(S=y,(_=M).ambientLightColor.needsUpdate=S,_.lightProbe.needsUpdate=S,_.directionalLights.needsUpdate=S,_.directionalLightShadows.needsUpdate=S,_.pointLights.needsUpdate=S,_.pointLightShadows.needsUpdate=S,_.spotLights.needsUpdate=S,_.spotLightShadows.needsUpdate=S,_.rectAreaLights.needsUpdate=S,_.hemisphereLights.needsUpdate=S),i&&n.fog&&Q.refreshFogUniforms(M,i),Q.refreshMaterialUniforms(M,n,R,T),cs.upload(ue,u.uniformsList,M,W)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(cs.upload(ue,u.uniformsList,M,W),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&g.setValue(ue,"center",r.center),g.setValue(ue,"modelViewMatrix",r.modelViewMatrix),g.setValue(ue,"normalMatrix",r.normalMatrix),g.setValue(ue,"modelMatrix",r.matrixWorld),v}xe.setAnimationLoop((function(e){me&&me(e)})),"undefined"!=typeof window&&xe.setContext(window),this.setAnimationLoop=function(e){me=e,he.setAnimationLoop(e),null===e?xe.stop():xe.start()},he.addEventListener("sessionstart",ye),he.addEventListener("sessionend",ge),this.render=function(e,t){let n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===m)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===he.enabled&&!0===he.isPresenting&&(t=he.getCamera(t)),!0===e.isScene&&e.onBeforeRender(p,e,t,n||x),h=ee.get(e,d.length),h.init(),d.push(h),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),O.setFromProjectionMatrix(k),I=this.localClippingEnabled,D=te.init(this.clippingPlanes,I,t),f=$.get(e,v.length),f.init(),v.push(f),be(e,t,0,p.sortObjects),f.finish(),!0===p.sortObjects&&f.sort(E,z),!0===D&&te.beginShadows();const i=h.state.shadowsArray;ne.render(i,e,t),h.setupLights(),h.setupLightsView(t),!0===D&&te.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),re.render(f,e,t,r);const o=f.opaque,a=f.transparent;o.length>0&&we(o,e,t),a.length>0&&we(a,e,t),null!==x&&(W.updateRenderTargetMipmap(x),W.updateMultisampleRenderTarget(x)),!0===e.isScene&&e.onAfterRender(p,e,t),N.buffers.depth.setTest(!0),N.buffers.depth.setMask(!0),N.buffers.color.setMask(!0),N.setPolygonOffset(!1),ce.resetDefaultState(),b=-1,w=null,d.pop(),h=d.length>0?d[d.length-1]:null,v.pop(),f=v.length>0?v[v.length-1]:null},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return x},this.setRenderTarget=function(e,t=0,n=0){x=e,y=t,g=n,e&&void 0===V.get(e).__webglFramebuffer&&W.setupRenderTarget(e);let r=null,i=!1,o=!1;if(e){const n=e.texture;(n.isDataTexture3D||n.isDataTexture2DArray)&&(o=!0);const a=V.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t],i=!0):r=e.isWebGLMultisampleRenderTarget?V.get(e).__webglMultisampledFramebuffer:a,M.copy(e.viewport),_.copy(e.scissor),S=e.scissorTest}else M.copy(L).multiplyScalar(R).floor(),_.copy(C).multiplyScalar(R).floor(),S=A;if(N.bindFramebuffer(36160,r),N.viewport(M),N.scissor(_),N.setScissorTest(S),i){const r=V.get(e.texture);ue.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}else if(o){const r=V.get(e.texture),i=t||0;ue.framebufferTextureLayer(36160,36064,r.__webglTexture,n||0,i)}},this.readRenderTargetPixels=function(e,t,n,r,i,o,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=V.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){N.bindFramebuffer(36160,s);try{const a=e.texture,s=a.format,c=a.type;if(s!==je&&se.convert(s)!==ue.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=c===Ce&&(B.has("EXT_color_buffer_half_float")||G.isWebGL2&&B.has("EXT_color_buffer_float"));if(!(c===Se||se.convert(c)===ue.getParameter(35738)||c===Le&&(G.isWebGL2||B.has("OES_texture_float")||B.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ue.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ue.readPixels(t,n,r,i,se.convert(s),se.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const e=null!==x?V.get(x).__webglFramebuffer:null;N.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=se.convert(t.format);W.setTexture2D(t,0),ue.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),N.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,o=t.image.height,a=se.convert(n.format),s=se.convert(n.type);W.setTexture2D(n,0),ue.pixelStorei(37440,n.flipY),ue.pixelStorei(37441,n.premultiplyAlpha),ue.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ue.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?ue.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):ue.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&ue.generateMipmap(3553),N.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(p.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const{width:o,height:a,data:s}=n.image,c=se.convert(r.format),u=se.convert(r.type);let l;if(r.isDataTexture3D)W.setTexture3D(r,0),l=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");W.setTexture2DArray(r,0),l=35866}ue.pixelStorei(37440,r.flipY),ue.pixelStorei(37441,r.premultiplyAlpha),ue.pixelStorei(3317,r.unpackAlignment);const f=ue.getParameter(3314),h=ue.getParameter(32878),v=ue.getParameter(3316),d=ue.getParameter(3315),m=ue.getParameter(32877);ue.pixelStorei(3314,o),ue.pixelStorei(32878,a),ue.pixelStorei(3316,e.min.x),ue.pixelStorei(3315,e.min.y),ue.pixelStorei(32877,e.min.z),ue.texSubImage3D(l,i,t.x,t.y,t.z,e.max.x-e.min.x+1,e.max.y-e.min.y+1,e.max.z-e.min.z+1,c,u,s),ue.pixelStorei(3314,f),ue.pixelStorei(32878,h),ue.pixelStorei(3316,v),ue.pixelStorei(3315,d),ue.pixelStorei(32877,m),0===i&&r.generateMipmaps&&ue.generateMipmap(l),N.unbindTexture()},this.initTexture=function(e){W.setTexture2D(e,0),N.unbindTexture()},this.resetState=function(){y=0,g=0,x=null,N.reset(),ce.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class ec extends $s{}ec.prototype.isWebGL1Renderer=!0;class tc{constructor(e,t=25e-5){this.name="",this.color=new Ai(e),this.density=t}clone(){return new tc(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}tc.prototype.isFogExp2=!0;class nc{constructor(e,t=1,n=1e3){this.name="",this.color=new Ai(e),this.near=t,this.far=n}clone(){return new nc(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}nc.prototype.isFog=!0;class rc extends ci{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}rc.prototype.isScene=!0;class ic{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Pn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Gn(),this.onUploadCallback=function(){}}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Gn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new ic(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Gn()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}ic.prototype.isInterleavedBuffer=!0;const oc=new ar;class ac{constructor(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)oc.x=this.getX(t),oc.y=this.getY(t),oc.z=this.getZ(t),oc.applyMatrix4(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)oc.x=this.getX(t),oc.y=this.getY(t),oc.z=this.getZ(t),oc.applyNormalMatrix(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)oc.x=this.getX(t),oc.y=this.getY(t),oc.z=this.getZ(t),oc.transformDirection(e),this.setXYZ(t,oc.x,oc.y,oc.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new ki(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ac(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}ac.prototype.isInterleavedBufferAttribute=!0;class sc extends Pi{constructor(e){super(),this.type="SpriteMaterial",this.color=new Ai(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let cc;sc.prototype.isSpriteMaterial=!0;const uc=new ar,lc=new ar,fc=new ar,hc=new Xn,vc=new Xn,dc=new Fr,pc=new ar,mc=new ar,yc=new ar,gc=new Xn,xc=new Xn,bc=new Xn;class wc extends ci{constructor(e){if(super(),this.type="Sprite",void 0===cc){cc=new ro;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new ic(e,5);cc.setIndex([0,1,2,0,2,3]),cc.setAttribute("position",new ac(t,3,0,!1)),cc.setAttribute("uv",new ac(t,2,3,!1))}this.geometry=cc,this.material=void 0!==e?e:new sc,this.center=new Xn(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),lc.setFromMatrixScale(this.matrixWorld),dc.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),fc.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&lc.multiplyScalar(-fc.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const o=this.center;Mc(pc.set(-.5,-.5,0),fc,o,lc,r,i),Mc(mc.set(.5,-.5,0),fc,o,lc,r,i),Mc(yc.set(.5,.5,0),fc,o,lc,r,i),gc.set(0,0),xc.set(1,0),bc.set(1,1);let a=e.ray.intersectTriangle(pc,mc,yc,!1,uc);if(null===a&&(Mc(mc.set(-.5,.5,0),fc,o,lc,r,i),xc.set(0,1),a=e.ray.intersectTriangle(pc,yc,mc,!1,uc),null===a))return;const s=e.ray.origin.distanceTo(uc);s<e.near||s>e.far||t.push({distance:s,point:uc.clone(),uv:_i.getUV(uc,pc,mc,yc,gc,xc,bc,new Xn),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function Mc(e,t,n,r,i,o){hc.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(vc.x=o*hc.x-i*hc.y,vc.y=i*hc.x+o*hc.y):vc.copy(hc),e.copy(t),e.x+=vc.x,e.y+=vc.y,e.applyMatrix4(dc)}wc.prototype.isSprite=!0;const _c=new ar,Sc=new ar;class Pc extends ci{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,n=t.length;e<n;e++){const n=t[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let r;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){_c.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(_c);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){_c.setFromMatrixPosition(e.matrixWorld),Sc.setFromMatrixPosition(this.matrixWorld);const n=_c.distanceTo(Sc)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let e=0,r=n.length;e<r;e++){const r=n[e];t.object.levels.push({object:r.object.uuid,distance:r.distance})}return t}}const Tc=new ar,Rc=new nr,Ec=new nr,zc=new ar,Lc=new Fr;class Cc extends Mo{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Fr,this.bindMatrixInverse=new Fr}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new nr,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,r=this.geometry;Rc.fromBufferAttribute(r.attributes.skinIndex,e),Ec.fromBufferAttribute(r.attributes.skinWeight,e),Tc.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const r=Ec.getComponent(e);if(0!==r){const i=Rc.getComponent(e);Lc.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(zc.copy(Tc).applyMatrix4(Lc),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}Cc.prototype.isSkinnedMesh=!0;class Ac extends ci{constructor(){super(),this.type="Bone"}}Ac.prototype.isBone=!0;const Oc=new Fr,Dc=new Fr;class Ic{constructor(e=[],t=[]){this.uuid=Gn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Fr)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new Fr;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){const i=e[r]?e[r].matrixWorld:Dc;Oc.multiplyMatrices(i,t[r]),Oc.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new Ic(this.bones,this.boneInverses)}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new Ac),this.bones.push(i),this.boneInverses.push((new Fr).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const o=n[r];e.boneInverses.push(o.toArray())}return e}}const kc=new Fr,Fc=new Fr,jc=[],Uc=new Mo;class Bc extends Mo{constructor(e,t,n){super(e,t),this.instanceMatrix=new ki(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(Uc.geometry=this.geometry,Uc.material=this.material,void 0!==Uc.material)for(let i=0;i<r;i++){this.getMatrixAt(i,kc),Fc.multiplyMatrices(n,kc),Uc.matrixWorld=Fc,Uc.raycast(e,jc);for(let e=0,n=jc.length;e<n;e++){const n=jc[e];n.instanceId=i,n.object=this,t.push(n)}jc.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new ki(new Float32Array(3*this.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Bc.prototype.isInstancedMesh=!0;class Gc extends Pi{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Ai(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Gc.prototype.isLineBasicMaterial=!0;const Nc=new ar,Hc=new ar,Vc=new Fr,Wc=new kr,Zc=new Er;class qc extends ci{constructor(e=new ro,t=new Gc){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)Nc.fromBufferAttribute(t,e-1),Hc.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Nc.distanceTo(Hc);e.setAttribute("lineDistance",new Wi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zc.copy(n.boundingSphere),Zc.applyMatrix4(r),Zc.radius+=i,!1===e.ray.intersectsSphere(Zc))return;Vc.copy(r).invert(),Wc.copy(e.ray).applyMatrix4(Vc);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a,c=new ar,u=new ar,l=new ar,f=new ar,h=this.isLineSegments?2:1;if(n.isBufferGeometry){const r=n.index,i=n.attributes.position;if(null!==r)for(let n=Math.max(0,o.start),a=Math.min(r.count,o.start+o.count)-1;n<a;n+=h){const o=r.getX(n),a=r.getX(n+1);if(c.fromBufferAttribute(i,o),u.fromBufferAttribute(i,a),Wc.distanceSqToSegment(c,u,f,l)>s)continue;f.applyMatrix4(this.matrixWorld);const h=e.ray.origin.distanceTo(f);h<e.near||h>e.far||t.push({distance:h,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}else for(let n=Math.max(0,o.start),r=Math.min(i.count,o.start+o.count)-1;n<r;n+=h){if(c.fromBufferAttribute(i,n),u.fromBufferAttribute(i,n+1),Wc.distanceSqToSegment(c,u,f,l)>s)continue;f.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(f);r<e.near||r>e.far||t.push({distance:r,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}qc.prototype.isLine=!0;const Yc=new ar,Xc=new ar;class Kc extends qc{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)Yc.fromBufferAttribute(t,e),Xc.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+Yc.distanceTo(Xc);e.setAttribute("lineDistance",new Wi(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Kc.prototype.isLineSegments=!0;class Qc extends qc{constructor(e,t){super(e,t),this.type="LineLoop"}}Qc.prototype.isLineLoop=!0;class Jc extends Pi{constructor(e){super(),this.type="PointsMaterial",this.color=new Ai(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}Jc.prototype.isPointsMaterial=!0;const $c=new Fr,eu=new kr,tu=new Er,nu=new ar;class ru extends ci{constructor(e=new ro,t=new Jc){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),tu.copy(n.boundingSphere),tu.applyMatrix4(r),tu.radius+=i,!1===e.ray.intersectsSphere(tu))return;$c.copy(r).invert(),eu.copy(e.ray).applyMatrix4($c);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position;if(null!==i)for(let n=Math.max(0,o.start),c=Math.min(i.count,o.start+o.count);n<c;n++){const o=i.getX(n);nu.fromBufferAttribute(a,o),iu(nu,o,s,r,e,t,this)}else for(let n=Math.max(0,o.start),i=Math.min(a.count,o.start+o.count);n<i;n++)nu.fromBufferAttribute(a,n),iu(nu,n,s,r,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function iu(e,t,n,r,i,o,a){const s=eu.distanceSqToPoint(e);if(s<n){const n=new ar;eu.closestPointToPoint(e,n),n.applyMatrix4(r);const c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:a})}}ru.prototype.isPoints=!0;class ou extends er{constructor(e,t,n,r,i,o,a,s,c){super(e,t,n,r,i,o,a,s,c),this.format=void 0!==a?a:Fe,this.minFilter=void 0!==o?o:xe,this.magFilter=void 0!==i?i:xe,this.generateMipmaps=!1;const u=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){u.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}ou.prototype.isVideoTexture=!0;class au extends er{constructor(e,t,n,r,i,o,a,s,c,u,l,f){super(null,o,a,s,c,u,r,i,l,f),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}au.prototype.isCompressedTexture=!0;class su extends er{constructor(e,t,n,r,i,o,a,s,c){super(e,t,n,r,i,o,a,s,c),this.needsUpdate=!0}}su.prototype.isCanvasTexture=!0;class cu extends er{constructor(e,t,n,r,i,o,a,s,c,u){if((u=void 0!==u?u:Ne)!==Ne&&u!==He)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Ne&&(n=Re),void 0===n&&u===He&&(n=Ie),super(null,r,i,o,a,s,u,n,c),this.image={width:e,height:t},this.magFilter=void 0!==a?a:de,this.minFilter=void 0!==s?s:de,this.flipY=!1,this.generateMipmaps=!1}}cu.prototype.isDepthTexture=!0;class uu extends ro{constructor(e=1,t=8,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],o=[],a=[],s=[],c=new ar,u=new Xn;o.push(0,0,0),a.push(0,0,1),s.push(.5,.5);for(let i=0,l=3;i<=t;i++,l+=3){const f=n+i/t*r;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[l]/e+1)/2,u.y=(o[l+1]/e+1)/2,s.push(u.x,u.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new Wi(o,3)),this.setAttribute("normal",new Wi(a,3)),this.setAttribute("uv",new Wi(s,2))}}class lu extends ro{constructor(e=1,t=1,n=1,r=8,i=1,o=!1,a=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};const c=this;r=Math.floor(r),i=Math.floor(i);const u=[],l=[],f=[],h=[];let v=0;const d=[],p=n/2;let m=0;function y(n){const i=v,o=new Xn,d=new ar;let y=0;const g=!0===n?e:t,x=!0===n?1:-1;for(let e=1;e<=r;e++)l.push(0,p*x,0),f.push(0,x,0),h.push(.5,.5),v++;const b=v;for(let e=0;e<=r;e++){const t=e/r*s+a,n=Math.cos(t),i=Math.sin(t);d.x=g*i,d.y=p*x,d.z=g*n,l.push(d.x,d.y,d.z),f.push(0,x,0),o.x=.5*n+.5,o.y=.5*i*x+.5,h.push(o.x,o.y),v++}for(let e=0;e<r;e++){const t=i+e,r=b+e;!0===n?u.push(r,r+1,t):u.push(r+1,r,t),y+=3}c.addGroup(m,y,!0===n?1:2),m+=y}!function(){const o=new ar,y=new ar;let g=0;const x=(t-e)/n;for(let c=0;c<=i;c++){const u=[],m=c/i,g=m*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*s+a,c=Math.sin(i),d=Math.cos(i);y.x=g*c,y.y=-m*n+p,y.z=g*d,l.push(y.x,y.y,y.z),o.set(c,x,d).normalize(),f.push(o.x,o.y,o.z),h.push(t,1-m),u.push(v++)}d.push(u)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=d[t][e],r=d[t+1][e],i=d[t+1][e+1],o=d[t][e+1];u.push(n,r,o),u.push(r,i,o),g+=6}c.addGroup(m,g,0),m+=g}(),!1===o&&(e>0&&y(!0),t>0&&y(!1)),this.setIndex(u),this.setAttribute("position",new Wi(l,3)),this.setAttribute("normal",new Wi(f,3)),this.setAttribute("uv",new Wi(h,2))}}class fu extends lu{constructor(e=1,t=1,n=8,r=1,i=!1,o=0,a=2*Math.PI){super(0,e,t,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}}class hu extends ro{constructor(e,t,n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],o=[];function a(e,t,n,r){const i=r+1,o=[];for(let r=0;r<=i;r++){o[r]=[];const a=e.clone().lerp(n,r/i),s=t.clone().lerp(n,r/i),c=i-r;for(let e=0;e<=c;e++)o[r][e]=0===e&&r===i?a:a.clone().lerp(s,e/c)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){const n=Math.floor(t/2);t%2==0?(s(o[e][n+1]),s(o[e+1][n]),s(o[e][n])):(s(o[e][n+1]),s(o[e+1][n+1]),s(o[e+1][n]))}}function s(e){i.push(e.x,e.y,e.z)}function c(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function u(e,t,n,r){r<0&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=r/2/Math.PI+.5)}function l(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new ar,r=new ar,i=new ar;for(let o=0;o<t.length;o+=3)c(t[o+0],n),c(t[o+1],r),c(t[o+2],i),a(n,r,i,e)}(r),function(e){const t=new ar;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new ar;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=l(e)/2/Math.PI+.5,a=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);o.push(r,1-a)}var t;(function(){const e=new ar,t=new ar,n=new ar,r=new ar,a=new Xn,s=new Xn,c=new Xn;for(let f=0,h=0;f<i.length;f+=9,h+=6){e.set(i[f+0],i[f+1],i[f+2]),t.set(i[f+3],i[f+4],i[f+5]),n.set(i[f+6],i[f+7],i[f+8]),a.set(o[h+0],o[h+1]),s.set(o[h+2],o[h+3]),c.set(o[h+4],o[h+5]),r.copy(e).add(t).add(n).divideScalar(3);const v=l(r);u(a,h+0,e,v),u(s,h+2,t,v),u(c,h+4,n,v)}})(),function(){for(let e=0;e<o.length;e+=6){const t=o[e+0],n=o[e+2],r=o[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);i>.9&&a<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),r<.2&&(o[e+4]+=1))}}()}(),this.setAttribute("position",new Wi(i,3)),this.setAttribute("normal",new Wi(i.slice(),3)),this.setAttribute("uv",new Wi(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}}class vu extends hu{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}}const du=new ar,pu=new ar,mu=new ar,yu=new _i;class gu extends ro{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1,!0===e.isGeometry)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const n=Math.pow(10,4),r=Math.cos(Un*t),i=e.getIndex(),o=e.getAttribute("position"),a=i?i.count:o.count,s=[0,0,0],c=["a","b","c"],u=new Array(3),l={},f=[];for(let e=0;e<a;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);const{a:t,b:a,c:h}=yu;if(t.fromBufferAttribute(o,s[0]),a.fromBufferAttribute(o,s[1]),h.fromBufferAttribute(o,s[2]),yu.getNormal(mu),u[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,u[1]=`${Math.round(a.x*n)},${Math.round(a.y*n)},${Math.round(a.z*n)}`,u[2]=`${Math.round(h.x*n)},${Math.round(h.y*n)},${Math.round(h.z*n)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],i=u[t],o=yu[c[e]],a=yu[c[t]],h=`${n}_${i}`,v=`${i}_${n}`;v in l&&l[v]?(mu.dot(l[v].normal)<=r&&(f.push(o.x,o.y,o.z),f.push(a.x,a.y,a.z)),l[v]=null):h in l||(l[h]={index0:s[e],index1:s[t],normal:mu.clone()})}}for(const e in l)if(l[e]){const{index0:t,index1:n}=l[e];du.fromBufferAttribute(o,t),pu.fromBufferAttribute(o,n),f.push(du.x,du.y,du.z),f.push(pu.x,pu.y,pu.z)}this.setAttribute("position",new Wi(f,3))}}function xu(e,t,n,r,i){let o,a;if(i===function(e,t,n,r){let i=0;for(let o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}(e,t,n,r)>0)for(o=t;o<n;o+=r)a=Bu(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=Bu(o,e[o],e[o+1],a);return a&&Du(a,a.next)&&(Gu(a),a=a.next),a}function bu(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Du(r,r.next)&&0!==Ou(r.prev,r,r.next))r=r.next;else{if(Gu(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function wu(e,t,n,r,i,o,a){if(!e)return;!a&&o&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=zu(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,o,a,s,c,u=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(c=u;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(e,r,i,o);let s,c,u=e;for(;e.prev!==e.next;)if(s=e.prev,c=e.next,o?_u(e,r,i,o):Mu(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Gu(e),e=c.next,u=c.next;else if((e=c)===u){a?1===a?wu(e=Su(bu(e),t,n),t,n,r,i,o,2):2===a&&Pu(e,t,n,r,i,o):wu(bu(e),t,n,r,i,o,1);break}}function Mu(e){const t=e.prev,n=e,r=e.next;if(Ou(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(Cu(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ou(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function _u(e,t,n,r){const i=e.prev,o=e,a=e.next;if(Ou(i,o,a)>=0)return!1;const s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,c=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=zu(s,c,t,n,r),h=zu(u,l,t,n,r);let v=e.prevZ,d=e.nextZ;for(;v&&v.z>=f&&d&&d.z<=h;){if(v!==e.prev&&v!==e.next&&Cu(i.x,i.y,o.x,o.y,a.x,a.y,v.x,v.y)&&Ou(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,d!==e.prev&&d!==e.next&&Cu(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ou(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&Cu(i.x,i.y,o.x,o.y,a.x,a.y,v.x,v.y)&&Ou(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&Cu(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ou(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Su(e,t,n){let r=e;do{const i=r.prev,o=r.next.next;!Du(i,o)&&Iu(i,r,r.next,o)&&ju(i,o)&&ju(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Gu(r),Gu(r.next),r=e=o),r=r.next}while(r!==e);return bu(r)}function Pu(e,t,n,r,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Au(a,e)){let s=Uu(a,e);return a=bu(a,a.next),s=bu(s,s.next),wu(a,t,n,r,i,o),void wu(s,t,n,r,i,o)}e=e.next}a=a.next}while(a!==e)}function Tu(e,t){return e.x-t.x}function Ru(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a){if(a=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(r===a)return o;const s=o,c=o.x,u=o.y;let l,f=1/0;n=o;do{r>=n.x&&n.x>=c&&r!==n.x&&Cu(i<u?r:a,i,c,u,i<u?a:r,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(r-n.x),ju(n,e)&&(l<f||l===f&&(n.x>o.x||n.x===o.x&&Eu(o,n)))&&(o=n,f=l)),n=n.next}while(n!==s);return o}(e,t)){const n=Uu(t,e);bu(t,t.next),bu(n,n.next)}}function Eu(e,t){return Ou(e.prev,e,t.prev)<0&&Ou(t.next,e,e.next)<0}function zu(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Lu(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Cu(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Au(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Iu(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ju(e,t)&&ju(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Ou(e.prev,e,t.prev)||Ou(e,t.prev,t))||Du(e,t)&&Ou(e.prev,e,e.next)>0&&Ou(t.prev,t,t.next)>0)}function Ou(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Du(e,t){return e.x===t.x&&e.y===t.y}function Iu(e,t,n,r){const i=Fu(Ou(e,t,n)),o=Fu(Ou(e,t,r)),a=Fu(Ou(n,r,e)),s=Fu(Ou(n,r,t));return i!==o&&a!==s||!(0!==i||!ku(e,n,t))||!(0!==o||!ku(e,r,t))||!(0!==a||!ku(n,e,r))||!(0!==s||!ku(n,t,r))}function ku(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Fu(e){return e>0?1:e<0?-1:0}function ju(e,t){return Ou(e.prev,e,e.next)<0?Ou(e,t,e.next)>=0&&Ou(e,e.prev,t)>=0:Ou(e,t,e.prev)<0||Ou(e,e.next,t)<0}function Uu(e,t){const n=new Nu(e.i,e.x,e.y),r=new Nu(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Bu(e,t,n,r){const i=new Nu(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Gu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Nu(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Hu{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return Hu.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];Vu(e),Wu(n,e);let o=e.length;t.forEach(Vu);for(let e=0;e<t.length;e++)r.push(o),o+=t[e].length,Wu(n,t[e]);const a=function(e,t,n){n=n||2;const r=t&&t.length,i=r?t[0]*n:e.length;let o=xu(e,0,i,n,!0);const a=[];if(!o||o.next===o.prev)return a;let s,c,u,l,f,h,v;if(r&&(o=function(e,t,n,r){const i=[];let o,a,s,c,u;for(o=0,a=t.length;o<a;o++)s=t[o]*r,c=o<a-1?t[o+1]*r:e.length,u=xu(e,s,c,r,!1),u===u.next&&(u.steiner=!0),i.push(Lu(u));for(i.sort(Tu),o=0;o<i.length;o++)Ru(i[o],n),n=bu(n,n.next);return n}(e,t,o,n)),e.length>80*n){s=u=e[0],c=l=e[1];for(let t=n;t<i;t+=n)f=e[t],h=e[t+1],f<s&&(s=f),h<c&&(c=h),f>u&&(u=f),h>l&&(l=h);v=Math.max(u-s,l-c),v=0!==v?1/v:0}return wu(o,a,n,s,c,v),a}(n,r);for(let e=0;e<a.length;e+=3)i.push(a.slice(e,e+3));return i}}function Vu(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Wu(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class Zu extends ro{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++)o(e[t]);function o(e){const o=[],a=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1;let c=void 0!==t.depth?t.depth:100,u=void 0===t.bevelEnabled||t.bevelEnabled,l=void 0!==t.bevelThickness?t.bevelThickness:6,f=void 0!==t.bevelSize?t.bevelSize:l-2,h=void 0!==t.bevelOffset?t.bevelOffset:0,v=void 0!==t.bevelSegments?t.bevelSegments:3;const d=t.extrudePath,p=void 0!==t.UVGenerator?t.UVGenerator:qu;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=t.amount);let m,y,g,x,b,w=!1;d&&(m=d.getSpacedPoints(s),w=!0,u=!1,y=d.computeFrenetFrames(s,!1),g=new ar,x=new ar,b=new ar),u||(v=0,l=0,f=0,h=0);const M=e.extractPoints(a);let _=M.shape;const S=M.holes;if(!Hu.isClockWise(_)){_=_.reverse();for(let e=0,t=S.length;e<t;e++){const t=S[e];Hu.isClockWise(t)&&(S[e]=t.reverse())}}const P=Hu.triangulateShape(_,S),T=_;for(let e=0,t=S.length;e<t;e++){const t=S[e];_=_.concat(t)}function R(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}const E=_.length,z=P.length;function L(e,t,n){let r,i,o;const a=e.x-t.x,s=e.y-t.y,c=n.x-e.x,u=n.y-e.y,l=a*a+s*s,f=a*u-s*c;if(Math.abs(f)>Number.EPSILON){const f=Math.sqrt(l),h=Math.sqrt(c*c+u*u),v=t.x-s/f,d=t.y+a/f,p=((n.x-u/h-v)*u-(n.y+c/h-d)*c)/(a*u-s*c);r=v+a*p-e.x,i=d+s*p-e.y;const m=r*r+i*i;if(m<=2)return new Xn(r,i);o=Math.sqrt(m/2)}else{let e=!1;a>Number.EPSILON?c>Number.EPSILON&&(e=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(u)&&(e=!0),e?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new Xn(r/o,i/o)}const C=[];for(let e=0,t=T.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),C[e]=L(T[e],T[n],T[r]);const A=[];let O,D=C.concat();for(let e=0,t=S.length;e<t;e++){const t=S[e];O=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[e]=L(t[e],t[r],t[i]);A.push(O),D=D.concat(O)}for(let e=0;e<v;e++){const t=e/v,n=l*Math.cos(t*Math.PI/2),r=f*Math.sin(t*Math.PI/2)+h;for(let e=0,t=T.length;e<t;e++){const t=R(T[e],C[e],r);F(t.x,t.y,-n)}for(let e=0,t=S.length;e<t;e++){const t=S[e];O=A[e];for(let e=0,i=t.length;e<i;e++){const i=R(t[e],O[e],r);F(i.x,i.y,-n)}}}const I=f+h;for(let e=0;e<E;e++){const t=u?R(_[e],D[e],I):_[e];w?(x.copy(y.normals[0]).multiplyScalar(t.x),g.copy(y.binormals[0]).multiplyScalar(t.y),b.copy(m[0]).add(x).add(g),F(b.x,b.y,b.z)):F(t.x,t.y,0)}for(let e=1;e<=s;e++)for(let t=0;t<E;t++){const n=u?R(_[t],D[t],I):_[t];w?(x.copy(y.normals[e]).multiplyScalar(n.x),g.copy(y.binormals[e]).multiplyScalar(n.y),b.copy(m[e]).add(x).add(g),F(b.x,b.y,b.z)):F(n.x,n.y,c/s*e)}for(let e=v-1;e>=0;e--){const t=e/v,n=l*Math.cos(t*Math.PI/2),r=f*Math.sin(t*Math.PI/2)+h;for(let e=0,t=T.length;e<t;e++){const t=R(T[e],C[e],r);F(t.x,t.y,c+n)}for(let e=0,t=S.length;e<t;e++){const t=S[e];O=A[e];for(let e=0,i=t.length;e<i;e++){const i=R(t[e],O[e],r);w?F(i.x,i.y+m[s-1].y,m[s-1].x+n):F(i.x,i.y,c+n)}}}function k(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*v;e<n;e++){const n=E*e,o=E*(e+1);U(t+r+n,t+i+n,t+i+o,t+r+o)}}}function F(e,t,n){o.push(e),o.push(t),o.push(n)}function j(e,t,i){B(e),B(t),B(i);const o=r.length/3,a=p.generateTopUV(n,r,o-3,o-2,o-1);G(a[0]),G(a[1]),G(a[2])}function U(e,t,i,o){B(e),B(t),B(o),B(t),B(i),B(o);const a=r.length/3,s=p.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);G(s[0]),G(s[1]),G(s[3]),G(s[1]),G(s[2]),G(s[3])}function B(e){r.push(o[3*e+0]),r.push(o[3*e+1]),r.push(o[3*e+2])}function G(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(u){let e=0,t=E*e;for(let e=0;e<z;e++){const n=P[e];j(n[2]+t,n[1]+t,n[0]+t)}e=s+2*v,t=E*e;for(let e=0;e<z;e++){const n=P[e];j(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<z;e++){const t=P[e];j(t[2],t[1],t[0])}for(let e=0;e<z;e++){const t=P[e];j(t[0]+E*s,t[1]+E*s,t[2]+E*s)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;k(T,t),t+=T.length;for(let e=0,n=S.length;e<n;e++){const n=S[e];k(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new Wi(r,3)),this.setAttribute("uv",new Wi(i,2)),this.computeVertexNormals()}toJSON(){const e=ro.prototype.toJSON.call(this);return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,e)}}const qu={generateTopUV:function(e,t,n,r,i){const o=t[3*n],a=t[3*n+1],s=t[3*r],c=t[3*r+1],u=t[3*i],l=t[3*i+1];return[new Xn(o,a),new Xn(s,c),new Xn(u,l)]},generateSideWallUV:function(e,t,n,r,i,o){const a=t[3*n],s=t[3*n+1],c=t[3*n+2],u=t[3*r],l=t[3*r+1],f=t[3*r+2],h=t[3*i],v=t[3*i+1],d=t[3*i+2],p=t[3*o],m=t[3*o+1],y=t[3*o+2];return Math.abs(s-l)<.01?[new Xn(a,1-c),new Xn(u,1-f),new Xn(h,1-d),new Xn(p,1-y)]:[new Xn(s,1-c),new Xn(l,1-f),new Xn(v,1-d),new Xn(m,1-y)]}};class Yu extends hu{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}}class Xu extends ro{constructor(e,t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Nn(r,0,2*Math.PI);const i=[],o=[],a=[],s=1/t,c=new ar,u=new Xn;for(let i=0;i<=t;i++){const l=n+i*s*r,f=Math.sin(l),h=Math.cos(l);for(let n=0;n<=e.length-1;n++)c.x=e[n].x*f,c.y=e[n].y,c.z=e[n].x*h,o.push(c.x,c.y,c.z),u.x=i/t,u.y=n/(e.length-1),a.push(u.x,u.y)}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){const r=t+n*e.length,o=r,a=r+e.length,s=r+e.length+1,c=r+1;i.push(o,a,c),i.push(a,s,c)}if(this.setIndex(i),this.setAttribute("position",new Wi(o,3)),this.setAttribute("uv",new Wi(a,2)),this.computeVertexNormals(),r===2*Math.PI){const n=this.attributes.normal.array,r=new ar,i=new ar,o=new ar,a=t*e.length*3;for(let t=0,s=0;t<e.length;t++,s+=3)r.x=n[s+0],r.y=n[s+1],r.z=n[s+2],i.x=n[a+s+0],i.y=n[a+s+1],i.z=n[a+s+2],o.addVectors(r,i).normalize(),n[s+0]=n[a+s+0]=o.x,n[s+1]=n[a+s+1]=o.y,n[s+2]=n[a+s+2]=o.z}}}class Ku extends hu{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}}class Qu extends ro{constructor(e,t,n){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};const r=[],i=[],o=[],a=[],s=1e-5,c=new ar,u=new ar,l=new ar,f=new ar,h=new ar;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const v=t+1;for(let r=0;r<=n;r++){const v=r/n;for(let n=0;n<=t;n++){const r=n/t;e(r,v,u),i.push(u.x,u.y,u.z),r-s>=0?(e(r-s,v,l),f.subVectors(u,l)):(e(r+s,v,l),f.subVectors(l,u)),v-s>=0?(e(r,v-s,l),h.subVectors(u,l)):(e(r,v+s,l),h.subVectors(l,u)),c.crossVectors(f,h).normalize(),o.push(c.x,c.y,c.z),a.push(r,v)}}for(let e=0;e<n;e++)for(let n=0;n<t;n++){const t=e*v+n,i=e*v+n+1,o=(e+1)*v+n+1,a=(e+1)*v+n;r.push(t,i,a),r.push(i,o,a)}this.setIndex(r),this.setAttribute("position",new Wi(i,3)),this.setAttribute("normal",new Wi(o,3)),this.setAttribute("uv",new Wi(a,2))}}class Ju extends ro{constructor(e=.5,t=1,n=8,r=1,i=0,o=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},n=Math.max(3,n);const a=[],s=[],c=[],u=[];let l=e;const f=(t-e)/(r=Math.max(1,r)),h=new ar,v=new Xn;for(let e=0;e<=r;e++){for(let e=0;e<=n;e++){const r=i+e/n*o;h.x=l*Math.cos(r),h.y=l*Math.sin(r),s.push(h.x,h.y,h.z),c.push(0,0,1),v.x=(h.x/t+1)/2,v.y=(h.y/t+1)/2,u.push(v.x,v.y)}l+=f}for(let e=0;e<r;e++){const t=e*(n+1);for(let e=0;e<n;e++){const r=e+t,i=r,o=r+n+1,s=r+n+2,c=r+1;a.push(i,o,c),a.push(o,s,c)}}this.setIndex(a),this.setAttribute("position",new Wi(s,3)),this.setAttribute("normal",new Wi(c,3)),this.setAttribute("uv",new Wi(u,2))}}class $u extends ro{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],o=[];let a=0,s=0;if(!1===Array.isArray(e))c(e);else for(let t=0;t<e.length;t++)c(e[t]),this.addGroup(a,s,t),a+=s,s=0;function c(e){const a=r.length/3,c=e.extractPoints(t);let u=c.shape;const l=c.holes;!1===Hu.isClockWise(u)&&(u=u.reverse());for(let e=0,t=l.length;e<t;e++){const t=l[e];!0===Hu.isClockWise(t)&&(l[e]=t.reverse())}const f=Hu.triangulateShape(u,l);for(let e=0,t=l.length;e<t;e++){const t=l[e];u=u.concat(t)}for(let e=0,t=u.length;e<t;e++){const t=u[e];r.push(t.x,t.y,0),i.push(0,0,1),o.push(t.x,t.y)}for(let e=0,t=f.length;e<t;e++){const t=f[e],r=t[0]+a,i=t[1]+a,o=t[2]+a;n.push(r,i,o),s+=3}}this.setIndex(n),this.setAttribute("position",new Wi(r,3)),this.setAttribute("normal",new Wi(i,3)),this.setAttribute("uv",new Wi(o,2))}toJSON(){const e=ro.prototype.toJSON.call(this);return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}}class el extends ro{constructor(e=1,t=8,n=6,r=0,i=2*Math.PI,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const s=Math.min(o+a,Math.PI);let c=0;const u=[],l=new ar,f=new ar,h=[],v=[],d=[],p=[];for(let h=0;h<=n;h++){const m=[],y=h/n;let g=0;0==h&&0==o?g=.5/t:h==n&&s==Math.PI&&(g=-.5/t);for(let n=0;n<=t;n++){const s=n/t;l.x=-e*Math.cos(r+s*i)*Math.sin(o+y*a),l.y=e*Math.cos(o+y*a),l.z=e*Math.sin(r+s*i)*Math.sin(o+y*a),v.push(l.x,l.y,l.z),f.copy(l).normalize(),d.push(f.x,f.y,f.z),p.push(s+g,1-y),m.push(c++)}u.push(m)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=u[e][r+1],i=u[e][r],a=u[e+1][r],c=u[e+1][r+1];(0!==e||o>0)&&h.push(t,i,c),(e!==n-1||s<Math.PI)&&h.push(i,a,c)}this.setIndex(h),this.setAttribute("position",new Wi(v,3)),this.setAttribute("normal",new Wi(d,3)),this.setAttribute("uv",new Wi(p,2))}}class tl extends hu{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}}class nl extends Zu{constructor(e,t={}){const n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ro;const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class rl extends ro{constructor(e=1,t=.4,n=8,r=6,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const o=[],a=[],s=[],c=[],u=new ar,l=new ar,f=new ar;for(let o=0;o<=n;o++)for(let h=0;h<=r;h++){const v=h/r*i,d=o/n*Math.PI*2;l.x=(e+t*Math.cos(d))*Math.cos(v),l.y=(e+t*Math.cos(d))*Math.sin(v),l.z=t*Math.sin(d),a.push(l.x,l.y,l.z),u.x=e*Math.cos(v),u.y=e*Math.sin(v),f.subVectors(l,u).normalize(),s.push(f.x,f.y,f.z),c.push(h/r),c.push(o/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,a=(r+1)*(e-1)+t,s=(r+1)*e+t;o.push(n,i,s),o.push(i,a,s)}this.setIndex(o),this.setAttribute("position",new Wi(a,3)),this.setAttribute("normal",new Wi(s,3)),this.setAttribute("uv",new Wi(c,2))}}class il extends ro{constructor(e=1,t=.4,n=64,r=8,i=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},n=Math.floor(n),r=Math.floor(r);const a=[],s=[],c=[],u=[],l=new ar,f=new ar,h=new ar,v=new ar,d=new ar,p=new ar,m=new ar;for(let a=0;a<=n;++a){const g=a/n*i*Math.PI*2;y(g,i,o,e,h),y(g+.01,i,o,e,v),p.subVectors(v,h),m.addVectors(v,h),d.crossVectors(p,m),m.crossVectors(d,p),d.normalize(),m.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,o=-t*Math.cos(i),v=t*Math.sin(i);l.x=h.x+(o*m.x+v*d.x),l.y=h.y+(o*m.y+v*d.y),l.z=h.z+(o*m.z+v*d.z),s.push(l.x,l.y,l.z),f.subVectors(l,h).normalize(),c.push(f.x,f.y,f.z),u.push(a/n),u.push(e/r)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),o=(r+1)*e+t,s=(r+1)*(e-1)+t;a.push(n,i,s),a.push(i,o,s)}function y(e,t,n,r,i){const o=Math.cos(e),a=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*o,i.y=r*(2+c)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(a),this.setAttribute("position",new Wi(s,3)),this.setAttribute("normal",new Wi(c,3)),this.setAttribute("uv",new Wi(u,2))}}class ol extends ro{constructor(e,t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new ar,s=new ar,c=new Xn;let u=new ar;const l=[],f=[],h=[],v=[];function d(i){u=e.getPointAt(i/t,u);const c=o.normals[i],h=o.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),o=-Math.cos(t);s.x=o*c.x+i*h.x,s.y=o*c.y+i*h.y,s.z=o*c.z+i*h.z,s.normalize(),f.push(s.x,s.y,s.z),a.x=u.x+n*s.x,a.y=u.y+n*s.y,a.z=u.z+n*s.z,l.push(a.x,a.y,a.z)}}!function(){for(let e=0;e<t;e++)d(e);d(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)c.x=e/t,c.y=n/r,h.push(c.x,c.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),o=(r+1)*e+t,a=(r+1)*(e-1)+t;v.push(n,i,a),v.push(i,o,a)}}()}(),this.setIndex(v),this.setAttribute("position",new Wi(l,3)),this.setAttribute("normal",new Wi(f,3)),this.setAttribute("uv",new Wi(h,2))}toJSON(){const e=ro.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e}}class al extends ro{constructor(e){if(super(),this.type="WireframeGeometry",!0===e.isGeometry)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const t=[],n=[0,0],r={},i=new ar;if(null!==e.index){const o=e.attributes.position,a=e.index;let s=e.groups;0===s.length&&(s=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,t=s.length;e<t;++e){const t=s[e],i=t.start;for(let e=i,o=i+t.count;e<o;e+=3)for(let t=0;t<3;t++){const i=a.getX(e+t),o=a.getX(e+(t+1)%3);n[0]=Math.min(i,o),n[1]=Math.max(i,o);const s=n[0]+","+n[1];void 0===r[s]&&(r[s]={index1:n[0],index2:n[1]})}}for(const e in r){const n=r[e];i.fromBufferAttribute(o,n.index1),t.push(i.x,i.y,i.z),i.fromBufferAttribute(o,n.index2),t.push(i.x,i.y,i.z)}}else{const n=e.attributes.position;for(let e=0,r=n.count/3;e<r;e++)for(let r=0;r<3;r++){const o=3*e+r;i.fromBufferAttribute(n,o),t.push(i.x,i.y,i.z);const a=3*e+(r+1)%3;i.fromBufferAttribute(n,a),t.push(i.x,i.y,i.z)}}this.setAttribute("position",new Wi(t,3))}}var sl=Object.freeze({__proto__:null,BoxGeometry:So,BoxBufferGeometry:So,CircleGeometry:uu,CircleBufferGeometry:uu,ConeGeometry:fu,ConeBufferGeometry:fu,CylinderGeometry:lu,CylinderBufferGeometry:lu,DodecahedronGeometry:vu,DodecahedronBufferGeometry:vu,EdgesGeometry:gu,ExtrudeGeometry:Zu,ExtrudeBufferGeometry:Zu,IcosahedronGeometry:Yu,IcosahedronBufferGeometry:Yu,LatheGeometry:Xu,LatheBufferGeometry:Xu,OctahedronGeometry:Ku,OctahedronBufferGeometry:Ku,ParametricGeometry:Qu,ParametricBufferGeometry:Qu,PlaneGeometry:Go,PlaneBufferGeometry:Go,PolyhedronGeometry:hu,PolyhedronBufferGeometry:hu,RingGeometry:Ju,RingBufferGeometry:Ju,ShapeGeometry:$u,ShapeBufferGeometry:$u,SphereGeometry:el,SphereBufferGeometry:el,TetrahedronGeometry:tl,TetrahedronBufferGeometry:tl,TextGeometry:nl,TextBufferGeometry:nl,TorusGeometry:rl,TorusBufferGeometry:rl,TorusKnotGeometry:il,TorusKnotBufferGeometry:il,TubeGeometry:ol,TubeBufferGeometry:ol,WireframeGeometry:al});class cl extends Pi{constructor(e){super(),this.type="ShadowMaterial",this.color=new Ai(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}cl.prototype.isShadowMaterial=!0;class ul extends Eo{constructor(e){super(e),this.type="RawShaderMaterial"}}ul.prototype.isRawShaderMaterial=!0;class ll extends Pi{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ai(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ai(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=sn,this.normalScale=new Xn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}ll.prototype.isMeshStandardMaterial=!0;class fl extends ll{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Xn(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(e){this.reflectivity=Nn(2.5*(e-1)/(e+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Ai).copy(e.sheen):this.sheen=null,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this}}fl.prototype.isMeshPhysicalMaterial=!0;class hl extends Pi{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ai(16777215),this.specular=new Ai(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ai(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=sn,this.normalScale=new Xn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}hl.prototype.isMeshPhongMaterial=!0;class vl extends Pi{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ai(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ai(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=sn,this.normalScale=new Xn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}vl.prototype.isMeshToonMaterial=!0;class dl extends Pi{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=sn,this.normalScale=new Xn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}dl.prototype.isMeshNormalMaterial=!0;class pl extends Pi{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ai(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ai(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}pl.prototype.isMeshLambertMaterial=!0;class ml extends Pi{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ai(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=sn,this.normalScale=new Xn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}ml.prototype.isMeshMatcapMaterial=!0;class yl extends Gc{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}yl.prototype.isLineDashedMaterial=!0;var gl=Object.freeze({__proto__:null,ShadowMaterial:cl,SpriteMaterial:sc,RawShaderMaterial:ul,ShaderMaterial:Eo,PointsMaterial:Jc,MeshPhysicalMaterial:fl,MeshStandardMaterial:ll,MeshPhongMaterial:hl,MeshToonMaterial:vl,MeshNormalMaterial:dl,MeshLambertMaterial:pl,MeshDepthMaterial:Gs,MeshDistanceMaterial:Ns,MeshBasicMaterial:Oi,MeshMatcapMaterial:ml,LineDashedMaterial:yl,LineBasicMaterial:Gc,Material:Pi});const xl={arraySlice:function(e,t,n){return xl.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){const r=e.length,i=new e.constructor(r);for(let o=0,a=0;a!==r;++o){const r=n[o]*t;for(let n=0;n!==t;++n)i[a++]=e[r+n]}return i},flattenJSON:function(e,t,n,r){let i=1,o=e[0];for(;void 0!==o&&void 0===o[r];)o=e[i++];if(void 0===o)return;let a=o[r];if(void 0!==a)if(Array.isArray(a))do{a=o[r],void 0!==a&&(t.push(o.time),n.push.apply(n,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{a=o[r],void 0!==a&&(t.push(o.time),a.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{a=o[r],void 0!==a&&(t.push(o.time),n.push(a)),o=e[i++]}while(void 0!==o)},subclip:function(e,t,n,r,i=30){const o=e.clone();o.name=t;const a=[];for(let e=0;e<o.tracks.length;++e){const t=o.tracks[e],s=t.getValueSize(),c=[],u=[];for(let e=0;e<t.times.length;++e){const o=t.times[e]*i;if(!(o<n||o>=r)){c.push(t.times[e]);for(let n=0;n<s;++n)u.push(t.values[e*s+n])}}0!==c.length&&(t.times=xl.convertArray(c,t.times.constructor),t.values=xl.convertArray(u,t.values.constructor),a.push(t))}o.tracks=a;let s=1/0;for(let e=0;e<o.tracks.length;++e)s>o.tracks[e].times[0]&&(s=o.tracks[e].times[0]);for(let e=0;e<o.tracks.length;++e)o.tracks[e].shift(-1*s);return o.resetDuration(),o},makeClipAdditive:function(e,t=0,n=e,r=30){r<=0&&(r=30);const i=n.tracks.length,o=t/r;for(let t=0;t<i;++t){const r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)continue;const a=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===a)continue;let s=0;const c=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=c/3);let u=0;const l=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=l/3);const f=r.times.length-1;let h;if(o<=r.times[0]){const e=s,t=c-s;h=xl.arraySlice(r.values,e,t)}else if(o>=r.times[f]){const e=f*c+s,t=e+c-s;h=xl.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=s,n=c-s;e.evaluate(o),h=xl.arraySlice(e.resultBuffer,t,n)}"quaternion"===i&&(new or).fromArray(h).normalize().conjugate().toArray(h);const v=a.times.length;for(let e=0;e<v;++e){const t=e*l+u;if("quaternion"===i)or.multiplyQuaternionsFlat(a.values,t,h,0,a.values,t);else{const e=l-2*u;for(let n=0;n<e;++n)a.values[t+n]-=h[n]}}}return e.blendMode=Zt,e}};class bl{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let o;n:{r:if(!(e<r)){for(let o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,r=t[++n],e<r)break t}o=t.length;break n}if(e>=i)break e;{const a=t[1];e<a&&(n=2,i=a);for(let o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,i=t[--n-1],e>=i)break t}o=n,n=0}}for(;n<o;){const r=n+o>>>1;e<t[r]?o=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}bl.prototype.beforeStart_=bl.prototype.copySampleValue_,bl.prototype.afterEnd_=bl.prototype.copySampleValue_;class wl extends bl{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Nt,endingEnd:Nt}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,o=e+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case Ht:i=e,a=2*t-n;break;case Vt:i=r.length-2,a=t+r[i]-r[i+1];break;default:i=e,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Ht:o=e,s=2*n-t;break;case Vt:o=1,s=n+r[1]-r[0];break;default:o=e-1,s=t}const c=.5*(n-t),u=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(s-n),this._offsetPrev=i*u,this._offsetNext=o*u}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,f=this._weightPrev,h=this._weightNext,v=(n-t)/(r-t),d=v*v,p=d*v,m=-f*p+2*f*d-f*v,y=(1+f)*p+(-1.5-2*f)*d+(-.5+f)*v+1,g=(-1-h)*p+(1.5+h)*d+.5*v,x=h*p-h*d;for(let e=0;e!==a;++e)i[e]=m*o[u+e]+y*o[c+e]+g*o[s+e]+x*o[l+e];return i}}class Ml extends bl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=(n-t)/(r-t),l=1-u;for(let e=0;e!==a;++e)i[e]=o[c+e]*l+o[s+e]*u;return i}}class _l extends bl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Sl{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=xl.convertArray(t,this.TimeBufferType),this.values=xl.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:xl.convertArray(e.times,Array),values:xl.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new _l(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ml(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new wl(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Ut:t=this.InterpolantFactoryMethodDiscrete;break;case Bt:t=this.InterpolantFactoryMethodLinear;break;case Gt:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ut;case this.InterpolantFactoryMethodLinear:return Bt;case this.InterpolantFactoryMethodSmooth:return Gt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,o=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==o&&n[o]>t;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const e=this.getValueSize();this.times=xl.arraySlice(n,i,o),this.values=xl.arraySlice(this.values,i*e,o*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,o),e=!1;break}o=r}if(void 0!==r&&xl.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=xl.arraySlice(this.times),t=xl.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Gt,i=e.length-1;let o=1;for(let a=1;a<i;++a){let i=!1;const s=e[a];if(s!==e[a+1]&&(1!==a||s!==e[0]))if(r)i=!0;else{const e=a*n,r=e-n,o=e+n;for(let a=0;a!==n;++a){const n=t[e+a];if(n!==t[r+a]||n!==t[o+a]){i=!0;break}}}if(i){if(a!==o){e[o]=e[a];const r=a*n,i=o*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++o}}if(i>0){e[o]=e[i];for(let e=i*n,r=o*n,a=0;a!==n;++a)t[r+a]=t[e+a];++o}return o!==e.length?(this.times=xl.arraySlice(e,0,o),this.values=xl.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=xl.arraySlice(this.times,0),t=xl.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Sl.prototype.TimeBufferType=Float32Array,Sl.prototype.ValueBufferType=Float32Array,Sl.prototype.DefaultInterpolation=Bt;class Pl extends Sl{}Pl.prototype.ValueTypeName="bool",Pl.prototype.ValueBufferType=Array,Pl.prototype.DefaultInterpolation=Ut,Pl.prototype.InterpolantFactoryMethodLinear=void 0,Pl.prototype.InterpolantFactoryMethodSmooth=void 0;class Tl extends Sl{}Tl.prototype.ValueTypeName="color";class Rl extends Sl{}Rl.prototype.ValueTypeName="number";class El extends bl{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t);let c=e*a;for(let e=c+a;c!==e;c+=4)or.slerpFlat(i,0,o,c-a,o,c,s);return i}}class zl extends Sl{InterpolantFactoryMethodLinear(e){return new El(this.times,this.values,this.getValueSize(),e)}}zl.prototype.ValueTypeName="quaternion",zl.prototype.DefaultInterpolation=Bt,zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Ll extends Sl{}Ll.prototype.ValueTypeName="string",Ll.prototype.ValueBufferType=Array,Ll.prototype.DefaultInterpolation=Ut,Ll.prototype.InterpolantFactoryMethodLinear=void 0,Ll.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Sl{}Cl.prototype.ValueTypeName="vector";class Al{constructor(e,t=-1,n,r=Wt){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Gn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Ol(n[e]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(Sl.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,o=[];for(let e=0;e<i;e++){let a=[],s=[];a.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);const c=xl.getKeyframeOrder(a);a=xl.sortedArray(a,1,c),s=xl.sortedArray(s,1,c),r||0!==a[0]||(a.push(i),s.push(s[0])),o.push(new Rl(".morphTargetInfluences["+t[e].name+"]",a,s).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],o=n.name.match(i);if(o&&o.length>1){const e=o[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const o=[];for(const e in r)o.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const o=[],a=[];xl.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode;let s=e.length||-1;const c=e.hierarchy||[];for(let e=0;e<c.length;e++){const i=c[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(const n in e){const e=[],o=[];for(let r=0;r!==i[t].morphTargets.length;++r){const r=i[t];e.push(r.time),o.push(r.morphTarget===n?1:0)}r.push(new Rl(".morphTargetInfluence["+n+"]",e,o))}s=e.length*(o||1)}else{const o=".bones["+t[e].name+"]";n(Cl,o+".position",i,"pos",r),n(zl,o+".quaternion",i,"rot",r),n(Cl,o+".scale",i,"scl",r)}}return 0===r.length?null:new this(i,s,r,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Ol(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Rl;case"vector":case"vector2":case"vector3":case"vector4":return Cl;case"color":return Tl;case"quaternion":return zl;case"bool":case"boolean":return Pl;case"string":return Ll}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];xl.flattenJSON(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Dl={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Il{constructor(e,t,n){const r=this;let i,o=!1,a=0,s=0;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){s++,!1===o&&void 0!==r.onStart&&r.onStart(e,a,s),o=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,s),a===s&&(o=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){const t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){const n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const kl=new Il;class Fl{constructor(e){this.manager=void 0!==e?e:kl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const jl={};class Ul extends Fl{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Dl.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;if(void 0!==jl[e])return void jl[e].push({onLoad:t,onProgress:n,onError:r});const a=e.match(/^data:(.*?)(;base64)?,(.*)$/);let s;if(a){const n=a[1],o=!!a[2];let s=a[3];s=decodeURIComponent(s),o&&(s=atob(s));try{let r;const o=(this.responseType||"").toLowerCase();switch(o){case"arraybuffer":case"blob":const e=new Uint8Array(s.length);for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);r="blob"===o?new Blob([e.buffer],{type:n}):e.buffer;break;case"document":const t=new DOMParser;r=t.parseFromString(s,n);break;case"json":r=JSON.parse(s);break;default:r=s}setTimeout((function(){t&&t(r),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{jl[e]=[],jl[e].push({onLoad:t,onProgress:n,onError:r}),s=new XMLHttpRequest,s.open("GET",e,!0),s.addEventListener("load",(function(t){const n=this.response,r=jl[e];if(delete jl[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Dl.add(e,n);for(let e=0,t=r.length;e<t;e++){const t=r[e];t.onLoad&&t.onLoad(n)}i.manager.itemEnd(e)}else{for(let e=0,n=r.length;e<n;e++){const n=r[e];n.onError&&n.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),s.addEventListener("progress",(function(t){const n=jl[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onProgress&&r.onProgress(t)}}),!1),s.addEventListener("error",(function(t){const n=jl[e];delete jl[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),s.addEventListener("abort",(function(t){const n=jl[e];delete jl[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(s.responseType=this.responseType),void 0!==this.withCredentials&&(s.withCredentials=this.withCredentials),s.overrideMimeType&&s.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(const e in this.requestHeader)s.setRequestHeader(e,this.requestHeader[e]);s.send(null)}return i.manager.itemStart(e),s}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Bl extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new Ul(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=Al.parse(e[n]);t.push(r)}return t}}class Gl extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=[],a=new au,s=new Ul(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);let c=0;function u(u){s.load(e[u],(function(e){const n=i.parse(e,!0);o[u]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},c+=1,6===c&&(1===n.mipmapCount&&(a.minFilter=xe),a.image=o,a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,r)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)u(t);else s.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){o[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)o[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),o[t].format=n.format,o[t].width=n.width,o[t].height=n.height}a.image=o}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=xe),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,r);return a}}class Nl extends Fl{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Dl.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),Dl.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(t){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return a.addEventListener("load",s,!1),a.addEventListener("error",c,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class Hl extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=new Oo,o=new Nl(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function s(n){o.load(e[n],(function(e){i.images[n]=e,a++,6===a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let t=0;t<e.length;++t)s(t);return i}}class Vl extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new Io,a=new Ul(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(e,(function(e){const n=i.parse(e);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:he,o.wrapT=void 0!==n.wrapT?n.wrapT:he,o.magFilter=void 0!==n.magFilter?n.magFilter:xe,o.minFilter=void 0!==n.minFilter?n.minFilter:xe,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(o.encoding=n.encoding),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=Me),1===n.mipmapCount&&(o.minFilter=xe),void 0!==n.generateMipmaps&&(o.generateMipmaps=n.generateMipmaps),o.needsUpdate=!0,t&&t(o,n))}),n,r),o}}class Wl extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=new er,o=new Nl(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(n){i.image=n;const r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?Fe:je,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class Zl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let o;o=t||e*n[i-1];let a,s=0,c=i-1;for(;s<=c;)if(r=Math.floor(s+(c-s)/2),a=n[r]-o,a<0)s=r+1;else{if(!(a>0)){c=r;break}c=r-1}if(r=c,n[r]===o)return r/(i-1);const u=n[r];return(r+(o-u)/(n[r+1]-u))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const o=this.getPoint(r),a=this.getPoint(i),s=t||(o.isVector2?new Xn:new ar);return s.copy(a).sub(o).normalize(),s}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new ar,r=[],i=[],o=[],a=new ar,s=new Fr;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new ar),r[t].normalize()}i[0]=new ar,o[0]=new ar;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),l=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,n.set(1,0,0)),l<=c&&(c=l,n.set(0,1,0)),f<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),o[t]=o[t-1].clone(),a.crossVectors(r[t-1],r[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(Nn(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(a,e))}o[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(Nn(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ql extends Zl{constructor(e=0,t=0,n=1,r=1,i=0,o=2*Math.PI,a=!1,s=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s}getPoint(e,t){const n=t||new Xn,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);const a=this.aStartAngle+e*i;let s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}ql.prototype.isEllipseCurve=!0;class Yl extends ql{constructor(e,t,n,r,i,o){super(e,t,n,n,r,i,o),this.type="ArcCurve"}}function Xl(){let e=0,t=0,n=0,r=0;function i(i,o,a,s){e=i,t=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(e,t,n,r,o){i(t,n,o*(n-e),o*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,o,a,s){let c=(t-e)/o-(n-e)/(o+a)+(n-t)/a,u=(n-t)/a-(r-t)/(a+s)+(r-n)/s;c*=a,u*=a,i(t,n,c,u)},calc:function(i){const o=i*i;return e+t*i+n*o+r*(o*i)}}}Yl.prototype.isArcCurve=!0;const Kl=new ar,Ql=new Xl,Jl=new Xl,$l=new Xl;class ef extends Zl{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new ar){const n=t,r=this.points,i=r.length,o=(i-(this.closed?0:1))*e;let a,s,c=Math.floor(o),u=o-c;this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/i)+1)*i:0===u&&c===i-1&&(c=i-2,u=1),this.closed||c>0?a=r[(c-1)%i]:(Kl.subVectors(r[0],r[1]).add(r[0]),a=Kl);const l=r[c%i],f=r[(c+1)%i];if(this.closed||c+2<i?s=r[(c+2)%i]:(Kl.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Kl),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(l),e),n=Math.pow(l.distanceToSquared(f),e),r=Math.pow(f.distanceToSquared(s),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),Ql.initNonuniformCatmullRom(a.x,l.x,f.x,s.x,t,n,r),Jl.initNonuniformCatmullRom(a.y,l.y,f.y,s.y,t,n,r),$l.initNonuniformCatmullRom(a.z,l.z,f.z,s.z,t,n,r)}else"catmullrom"===this.curveType&&(Ql.initCatmullRom(a.x,l.x,f.x,s.x,this.tension),Jl.initCatmullRom(a.y,l.y,f.y,s.y,this.tension),$l.initCatmullRom(a.z,l.z,f.z,s.z,this.tension));return n.set(Ql.calc(u),Jl.calc(u),$l.calc(u)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new ar).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function tf(e,t,n,r,i){const o=.5*(r-t),a=.5*(i-n),s=e*e;return(2*n-2*r+o+a)*(e*s)+(-3*n+3*r-2*o-a)*s+o*e+n}function nf(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function rf(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}ef.prototype.isCatmullRomCurve3=!0;class of extends Zl{constructor(e=new Xn,t=new Xn,n=new Xn,r=new Xn){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Xn){const n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(rf(e,r.x,i.x,o.x,a.x),rf(e,r.y,i.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}of.prototype.isCubicBezierCurve=!0;class af extends Zl{constructor(e=new ar,t=new ar,n=new ar,r=new ar){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new ar){const n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(rf(e,r.x,i.x,o.x,a.x),rf(e,r.y,i.y,o.y,a.y),rf(e,r.z,i.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}af.prototype.isCubicBezierCurve3=!0;class sf extends Zl{constructor(e=new Xn,t=new Xn){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Xn){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Xn;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}sf.prototype.isLineCurve=!0;class cf extends Zl{constructor(e=new ar,t=new ar){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new ar){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uf extends Zl{constructor(e=new Xn,t=new Xn,n=new Xn){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Xn){const n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(nf(e,r.x,i.x,o.x),nf(e,r.y,i.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}uf.prototype.isQuadraticBezierCurve=!0;class lf extends Zl{constructor(e=new ar,t=new ar,n=new ar){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new ar){const n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(nf(e,r.x,i.x,o.x),nf(e,r.y,i.y,o.y),nf(e,r.z,i.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}lf.prototype.isQuadraticBezierCurve3=!0;class ff extends Zl{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Xn){const n=t,r=this.points,i=(r.length-1)*e,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],l=r[o>r.length-3?r.length-1:o+2];return n.set(tf(a,s.x,c.x,u.x,l.x),tf(a,s.y,c.y,u.y,l.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Xn).fromArray(n))}return this}}ff.prototype.isSplineCurve=!0;var hf=Object.freeze({__proto__:null,ArcCurve:Yl,CatmullRomCurve3:ef,CubicBezierCurve:of,CubicBezierCurve3:af,EllipseCurve:ql,LineCurve:sf,LineCurve3:cf,QuadraticBezierCurve:uf,QuadraticBezierCurve3:lf,SplineCurve:ff});class vf extends Zl{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new sf(t,e))}getPoint(e){const t=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=t){const e=n[r]-t,i=this.curves[r],o=i.getLength(),a=0===o?0:1-e/o;return i.getPointAt(a)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const o=i[r],a=o&&o.isEllipseCurve?2*e:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,s=o.getPoints(a);for(let e=0;e<s.length;e++){const r=s[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new hf[n.type]).fromJSON(n))}return this}}class df extends vf{constructor(e){super(),this.type="Path",this.currentPoint=new Xn,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new sf(this.currentPoint.clone(),new Xn(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new uf(this.currentPoint.clone(),new Xn(e,t),new Xn(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,o){const a=new of(this.currentPoint.clone(),new Xn(e,t),new Xn(n,r),new Xn(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new ff(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,o){const a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+a,t+s,n,r,i,o),this}absarc(e,t,n,r,i,o){return this.absellipse(e,t,n,n,r,i,o),this}ellipse(e,t,n,r,i,o,a,s){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,t+u,n,r,i,o,a,s),this}absellipse(e,t,n,r,i,o,a,s){const c=new ql(e,t,n,r,i,o,a,s);if(this.curves.length>0){const e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class pf extends df{constructor(e){super(e),this.uuid=Gn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new df).fromJSON(n))}return this}}class mf extends ci{constructor(e,t=1){super(),this.type="Light",this.color=new Ai(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}mf.prototype.isLight=!0;class yf extends mf{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(ci.DefaultUp),this.updateMatrix(),this.groundColor=new Ai(t)}copy(e){return mf.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}yf.prototype.isHemisphereLight=!0;const gf=new Fr,xf=new ar,bf=new ar;class wf{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Xn(512,512),this.map=null,this.mapPass=null,this.matrix=new Fr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new jo,this._frameExtents=new Xn(1,1),this._viewportCount=1,this._viewports=[new nr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;xf.setFromMatrixPosition(e.matrixWorld),t.position.copy(xf),bf.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(bf),t.updateMatrixWorld(),gf.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gf),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Mf extends wf{constructor(){super(new Lo(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*Bn*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}Mf.prototype.isSpotLightShadow=!0;class _f extends mf{constructor(e,t,n=0,r=Math.PI/3,i=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(ci.DefaultUp),this.updateMatrix(),this.target=new ci,this.distance=n,this.angle=r,this.penumbra=i,this.decay=o,this.shadow=new Mf}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}_f.prototype.isSpotLight=!0;const Sf=new Fr,Pf=new ar,Tf=new ar;class Rf extends wf{constructor(){super(new Lo(90,1,.5,500)),this._frameExtents=new Xn(4,2),this._viewportCount=6,this._viewports=[new nr(2,1,1,1),new nr(0,1,1,1),new nr(3,1,1,1),new nr(1,1,1,1),new nr(3,0,1,1),new nr(1,0,1,1)],this._cubeDirections=[new ar(1,0,0),new ar(-1,0,0),new ar(0,0,1),new ar(0,0,-1),new ar(0,1,0),new ar(0,-1,0)],this._cubeUps=[new ar(0,1,0),new ar(0,1,0),new ar(0,1,0),new ar(0,1,0),new ar(0,0,1),new ar(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),Pf.setFromMatrixPosition(e.matrixWorld),n.position.copy(Pf),Tf.copy(n.position),Tf.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Tf),n.updateMatrixWorld(),r.makeTranslation(-Pf.x,-Pf.y,-Pf.z),Sf.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Sf)}}Rf.prototype.isPointLightShadow=!0;class Ef extends mf{constructor(e,t,n=0,r=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Rf}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Ef.prototype.isPointLight=!0;class zf extends zo{constructor(e=-1,t=1,n=1,r=-1,i=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,o=i+e*this.view.width,a-=t*this.view.offsetY,s=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}zf.prototype.isOrthographicCamera=!0;class Lf extends wf{constructor(){super(new zf(-5,5,5,-5,.5,500))}}Lf.prototype.isDirectionalLightShadow=!0;class Cf extends mf{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(ci.DefaultUp),this.updateMatrix(),this.target=new ci,this.shadow=new Lf}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Cf.prototype.isDirectionalLight=!0;class Af extends mf{constructor(e,t){super(e,t),this.type="AmbientLight"}}Af.prototype.isAmbientLight=!0;class Of extends mf{constructor(e,t,n=10,r=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Of.prototype.isRectAreaLight=!0;class Df{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new ar)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*r*1.092548),t.addScaledVector(o[5],r*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],n*i*1.092548),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*r),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*r),t.addScaledVector(o[5],.858086*r*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*n*i),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}Df.prototype.isSphericalHarmonics3=!0;class If extends mf{constructor(e=new Df,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}If.prototype.isLightProbe=!0;class kf extends Fl{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,o=new Ul(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=new gl[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Ai).setHex(e.sheen)),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new Ai).setHex(i.value);break;case"v2":r.uniforms[t].value=(new Xn).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new ar).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new nr).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new Kn).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new Fr).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new Xn).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Xn).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r}setTextures(e){return this.textures=e,this}}class Ff{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}}class jf extends ro{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}jf.prototype.isInstancedBufferGeometry=!0;class Uf extends ki{constructor(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=r||1}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Uf.prototype.isInstancedBufferAttribute=!0;class Bf extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new Ul(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],o=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),a=Xi(i.type,o),s=new ic(a,i.stride);return s.uuid=i.uuid,t[r]=s,s}const i=e.isInstancedBufferGeometry?new jf:new ro,o=e.data.index;if(void 0!==o){const e=Xi(o.type,o.array);i.setIndex(new ki(e,1))}const a=e.data.attributes;for(const t in a){const n=a[t];let o;if(n.isInterleavedBufferAttribute){const t=r(e.data,n.data);o=new ac(t,n.itemSize,n.offset,n.normalized)}else{const e=Xi(n.type,n.array);o=new(n.isInstancedBufferAttribute?Uf:ki)(e,n.itemSize,n.normalized)}void 0!==n.name&&(o.name=n.name),void 0!==n.usage&&o.setUsage(n.usage),void 0!==n.updateRange&&(o.updateRange.offset=n.updateRange.offset,o.updateRange.count=n.updateRange.count),i.setAttribute(t,o)}const s=e.data.morphAttributes;if(s)for(const t in s){const n=s[t],o=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];let a;if(i.isInterleavedBufferAttribute){const t=r(e.data,i.data);a=new ac(t,i.itemSize,i.offset,i.normalized)}else{const e=Xi(i.type,i.array);a=new ki(e,i.itemSize,i.normalized)}void 0!==i.name&&(a.name=i.name),o.push(a)}i.morphAttributes[t]=o}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const c=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==c)for(let e=0,t=c.length;e!==t;++e){const t=c[e];i.addGroup(t.start,t.count,t.materialIndex)}const u=e.data.boundingSphere;if(void 0!==u){const e=new ar;void 0!==u.center&&e.fromArray(u.center),i.boundingSphere=new Er(e,u.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}class Gf extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=""===this.path?Ff.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Ul(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){let o=null;try{o=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,(function(){void 0!==t&&t(c)})),a=this.parseTextures(e.textures,o),s=this.parseMaterials(e.materials,a),c=this.parseObject(e.object,i,s,n),u=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,u),void 0!==t){let e=!1;for(const t in o)if(o[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(c)}return c}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new pf).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let t=0,i=e.length;t<i;t++){const i=(new Ic).fromJSON(e[t],r);n[i.uuid]=i}return n}parseGeometries(e,t){const n={};let r;if(void 0!==e){const i=new Bf;for(let o=0,a=e.length;o<a;o++){let a;const s=e[o];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new sl[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":a=new sl[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new sl[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new sl[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new sl[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new sl[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new sl[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new sl[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new sl[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new sl[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new sl[s.type]((new hf[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new sl[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new sl[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":r=[];for(let e=0,n=s.shapes.length;e<n;e++){const n=t[s.shapes[e]];r.push(n)}a=new sl[s.type](r,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":r=[];for(let e=0,n=s.shapes.length;e<n;e++){const n=t[s.shapes[e]];r.push(n)}const e=s.options.extrudePath;void 0!==e&&(s.options.extrudePath=(new hf[e.type]).fromJSON(e)),a=new sl[s.type](r,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new kf;i.setTextures(t);for(let t=0,o=e.length;t<o;t++){const o=e[t];if("MultiMaterial"===o.type){const e=[];for(let t=0;t<o.materials.length;t++){const r=o.materials[t];void 0===n[r.uuid]&&(n[r.uuid]=i.parse(r)),e.push(n[r.uuid])}r[o.uuid]=e}else void 0===n[o.uuid]&&(n[o.uuid]=i.parse(o)),r[o.uuid]=n[o.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=Al.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function o(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:Xi(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new Il(t);i=new Nl(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.url;if(Array.isArray(i)){r[n.uuid]=[];for(let e=0,t=i.length;e<t;e++){const t=o(i[e]);null!==t&&(t instanceof HTMLImageElement?r[n.uuid].push(t):r[n.uuid].push(new Io(t.data,t.width,t.height)))}}else{const e=o(n.url);null!==e&&(r[n.uuid]=e)}}}return r}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,o=e.length;i<o;i++){const o=e[i];let a;void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const s=t[o.image];Array.isArray(s)?(a=new Oo(s),6===s.length&&(a.needsUpdate=!0)):(a=s&&s.data?new Io(s.data,s.width,s.height):new er(s),s&&(a.needsUpdate=!0)),a.uuid=o.uuid,void 0!==o.name&&(a.name=o.name),void 0!==o.mapping&&(a.mapping=n(o.mapping,Nf)),void 0!==o.offset&&a.offset.fromArray(o.offset),void 0!==o.repeat&&a.repeat.fromArray(o.repeat),void 0!==o.center&&a.center.fromArray(o.center),void 0!==o.rotation&&(a.rotation=o.rotation),void 0!==o.wrap&&(a.wrapS=n(o.wrap[0],Hf),a.wrapT=n(o.wrap[1],Hf)),void 0!==o.format&&(a.format=o.format),void 0!==o.type&&(a.type=o.type),void 0!==o.encoding&&(a.encoding=o.encoding),void 0!==o.minFilter&&(a.minFilter=n(o.minFilter,Vf)),void 0!==o.magFilter&&(a.magFilter=n(o.magFilter,Vf)),void 0!==o.anisotropy&&(a.anisotropy=o.anisotropy),void 0!==o.flipY&&(a.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(a.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(a.unpackAlignment=o.unpackAlignment),r[o.uuid]=a}return r}parseObject(e,t,n,r){let i,o,a;function s(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":i=new rc,void 0!==e.background&&Number.isInteger(e.background)&&(i.background=new Ai(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new nc(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new tc(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new Lo(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new zf(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"AmbientLight":i=new Af(e.color,e.intensity);break;case"DirectionalLight":i=new Cf(e.color,e.intensity);break;case"PointLight":i=new Ef(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new Of(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new _f(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new yf(e.color,e.groundColor,e.intensity);break;case"LightProbe":i=(new If).fromJSON(e);break;case"SkinnedMesh":o=s(e.geometry),a=c(e.material),i=new Cc(o,a),void 0!==e.bindMode&&(i.bindMode=e.bindMode),void 0!==e.bindMatrix&&i.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(i.skeleton=e.skeleton);break;case"Mesh":o=s(e.geometry),a=c(e.material),i=new Mo(o,a);break;case"InstancedMesh":o=s(e.geometry),a=c(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;i=new Bc(o,a,t),i.instanceMatrix=new ki(new Float32Array(n.array),16),void 0!==r&&(i.instanceColor=new ki(new Float32Array(r.array),r.itemSize));break;case"LOD":i=new Pc;break;case"Line":i=new qc(s(e.geometry),c(e.material));break;case"LineLoop":i=new Qc(s(e.geometry),c(e.material));break;case"LineSegments":i=new Kc(s(e.geometry),c(e.material));break;case"PointCloud":case"Points":i=new ru(s(e.geometry),c(e.material));break;case"Sprite":i=new wc(c(e.material));break;case"Group":i=new Ys;break;case"Bone":i=new Ac;break;default:i=new ci}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(i.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(i.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.frustumCulled&&(i.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(i.renderOrder=e.renderOrder),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.layers&&(i.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)i.add(this.parseObject(o[e],t,n,r))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];i.animations.push(r[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(i.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=i.getObjectByProperty("uuid",n.object);void 0!==r&&i.addLevel(r,n.distance)}}return i}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const Nf={UVMapping:ie,CubeReflectionMapping:oe,CubeRefractionMapping:ae,EquirectangularReflectionMapping:se,EquirectangularRefractionMapping:ce,CubeUVReflectionMapping:ue,CubeUVRefractionMapping:le},Hf={RepeatWrapping:fe,ClampToEdgeWrapping:he,MirroredRepeatWrapping:ve},Vf={NearestFilter:de,NearestMipmapNearestFilter:pe,NearestMipmapLinearFilter:ye,LinearFilter:xe,LinearMipmapNearestFilter:be,LinearMipmapLinearFilter:Me};class Wf extends Fl{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Dl.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){Dl.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}Wf.prototype.isImageBitmapLoader=!0;class Zf{constructor(){this.type="ShapePath",this.color=new Ai,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new df,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,o){return this.currentPath.bezierCurveTo(e,t,n,r,i,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new pf;i.curves=r.curves,t.push(i)}return t}function r(e,t){const n=t.length;let r=!1;for(let i=n-1,o=0;o<n;i=o++){let n=t[i],a=t[o],s=a.x-n.x,c=a.y-n.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(n=t[o],s=-s,a=t[i],c=-c),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=c*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const i=Hu.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);let a,s,c;const u=[];if(1===o.length)return s=o[0],c=new pf,c.curves=s.curves,u.push(c),u;let l=!i(o[0].getPoints());l=e?!l:l;const f=[],h=[];let v,d,p=[],m=0;h[m]=void 0,p[m]=[];for(let t=0,n=o.length;t<n;t++)s=o[t],v=s.getPoints(),a=i(v),a=e?!a:a,a?(!l&&h[m]&&m++,h[m]={s:new pf,p:v},h[m].s.curves=s.curves,l&&m++,p[m]=[]):p[m].push({h:s,p:v[0]});if(!h[0])return n(o);if(h.length>1){let e=!1;const t=[];for(let e=0,t=h.length;e<t;e++)f[e]=[];for(let n=0,i=h.length;n<i;n++){const i=p[n];for(let o=0;o<i.length;o++){const a=i[o];let s=!0;for(let i=0;i<h.length;i++)r(a.p,h[i].p)&&(n!==i&&t.push({froms:n,tos:i,hole:o}),s?(s=!1,f[i].push(a)):e=!0);s&&f[n].push(a)}}t.length>0&&(e||(p=f))}for(let e=0,t=h.length;e<t;e++){c=h[e].s,u.push(c),d=p[e];for(let e=0,t=d.length;e<t;e++)c.holes.push(d[e].h)}return u}}class qf{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(e,t,n){const r=Array.from(e),i=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[];let s=0,c=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)s=0,c-=o;else{const e=Yf(t,i,s,c,n);s+=e.offsetX,a.push(e.path)}}return a}(e,t,this.data);for(let e=0,t=r.length;e<t;e++)Array.prototype.push.apply(n,r[e].toShapes());return n}}function Yf(e,t,n,r,i){const o=i.glyphs[e]||i.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".");const a=new Zf;let s,c,u,l,f,h,v,d;if(o.o){const e=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let i=0,o=e.length;i<o;)switch(e[i++]){case"m":s=e[i++]*t+n,c=e[i++]*t+r,a.moveTo(s,c);break;case"l":s=e[i++]*t+n,c=e[i++]*t+r,a.lineTo(s,c);break;case"q":u=e[i++]*t+n,l=e[i++]*t+r,f=e[i++]*t+n,h=e[i++]*t+r,a.quadraticCurveTo(f,h,u,l);break;case"b":u=e[i++]*t+n,l=e[i++]*t+r,f=e[i++]*t+n,h=e[i++]*t+r,v=e[i++]*t+n,d=e[i++]*t+r,a.bezierCurveTo(f,h,v,d,u,l)}}return{offsetX:o.ha*t,path:a}}qf.prototype.isFont=!0;class Xf extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new Ul(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){let n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}const r=i.parse(n);t&&t(r)}),n,r)}parse(e){return new qf(e)}}let Kf;const Qf={getContext:function(){return void 0===Kf&&(Kf=new(window.AudioContext||window.webkitAudioContext)),Kf},setContext:function(e){Kf=e}};class Jf extends Fl{constructor(e){super(e)}load(e,t,n,r){const i=this,o=new Ul(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{const e=n.slice(0);Qf.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}}class $f extends If{constructor(e,t,n=1){super(void 0,n);const r=(new Ai).set(e),i=(new Ai).set(t),o=new ar(r.r,r.g,r.b),a=new ar(i.r,i.g,i.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}}$f.prototype.isHemisphereLightProbe=!0;class eh extends If{constructor(e,t=1){super(void 0,t);const n=(new Ai).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}eh.prototype.isAmbientLightProbe=!0;const th=new Fr,nh=new Fr;class rh{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Lo,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Lo,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;const n=e.projectionMatrix.clone(),r=t.eyeSep/2,i=r*t.near/t.focus,o=t.near*Math.tan(Un*t.fov*.5)/t.zoom;let a,s;nh.elements[12]=-r,th.elements[12]=r,a=-o*t.aspect+i,s=o*t.aspect+i,n.elements[0]=2*t.near/(s-a),n.elements[8]=(s+a)/(s-a),this.cameraL.projectionMatrix.copy(n),a=-o*t.aspect-i,s=o*t.aspect-i,n.elements[0]=2*t.near/(s-a),n.elements[8]=(s+a)/(s-a),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(nh),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(th)}}class ih{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=oh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=oh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function oh(){return("undefined"==typeof performance?Date:performance).now()}const ah=new ar,sh=new or,ch=new ar,uh=new ar;class lh extends ci{constructor(){super(),this.type="AudioListener",this.context=Qf.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ih}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ah,sh,ch),uh.set(0,0,-1).applyQuaternion(sh),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ah.x,e),t.positionY.linearRampToValueAtTime(ah.y,e),t.positionZ.linearRampToValueAtTime(ah.z,e),t.forwardX.linearRampToValueAtTime(uh.x,e),t.forwardY.linearRampToValueAtTime(uh.y,e),t.forwardZ.linearRampToValueAtTime(uh.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(ah.x,ah.y,ah.z),t.setOrientation(uh.x,uh.y,uh.z,n.x,n.y,n.z)}}class fh extends ci{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const hh=new ar,vh=new or,dh=new ar,ph=new ar;class mh extends fh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(hh,vh,dh),ph.set(0,0,1).applyQuaternion(vh);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(hh.x,e),t.positionY.linearRampToValueAtTime(hh.y,e),t.positionZ.linearRampToValueAtTime(hh.z,e),t.orientationX.linearRampToValueAtTime(ph.x,e),t.orientationY.linearRampToValueAtTime(ph.y,e),t.orientationZ.linearRampToValueAtTime(ph.z,e)}else t.setPosition(hh.x,hh.y,hh.z),t.setOrientation(ph.x,ph.y,ph.z)}}class yh{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class gh{constructor(e,t,n){let r,i,o;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let o=this.cumulativeWeight;if(0===o){for(let e=0;e!==r;++e)n[i+e]=n[e];o=t}else{o+=t;const e=t/o;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){or.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const o=this._workIndex*i;or.multiplyQuaternionsFlat(e,o,e,t,e,n),or.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,n,r,i){const o=1-r;for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]*o+e[n+a]*r}}_lerpAdditive(e,t,n,r,i){for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]+e[n+o]*r}}}const xh=new RegExp("[\\[\\]\\.:\\/]","g"),bh="[^\\[\\]\\.:\\/]",wh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Mh=/((?:WC+[\/:])*)/.source.replace("WC",bh),_h=/(WCOD+)?/.source.replace("WCOD",wh),Sh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",bh),Ph=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",bh),Th=new RegExp("^"+Mh+_h+Sh+Ph+"$"),Rh=["material","materials","bones"];class Eh{constructor(e,t,n){this.path=t,this.parsedPath=n||Eh.parseTrackName(t),this.node=Eh.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Eh.Composite(e,t,n):new Eh(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(xh,"")}static parseTrackName(e){const t=Th.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==Rh.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const o=n(i.children);if(o)return o}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=Eh.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const o=e[r];if(void 0===o){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=i}else void 0!==o.fromArray&&void 0!==o.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(s=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Eh.Composite=class{constructor(e,t,n){const r=n||Eh.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},Eh.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Eh.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Eh.prototype.GetterByBindingType=[Eh.prototype._getValue_direct,Eh.prototype._getValue_array,Eh.prototype._getValue_arrayElement,Eh.prototype._getValue_toArray],Eh.prototype.SetterByBindingTypeAndVersioning=[[Eh.prototype._setValue_direct,Eh.prototype._setValue_direct_setNeedsUpdate,Eh.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Eh.prototype._setValue_array,Eh.prototype._setValue_array_setNeedsUpdate,Eh.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Eh.prototype._setValue_arrayElement,Eh.prototype._setValue_arrayElement_setNeedsUpdate,Eh.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Eh.prototype._setValue_fromArray,Eh.prototype._setValue_fromArray_setNeedsUpdate,Eh.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class zh{constructor(){this.uuid=Gn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,o=i.length;let a,s=e.length,c=this.nCachedObjects_;for(let u=0,l=arguments.length;u!==l;++u){const l=arguments[u],f=l.uuid;let h=t[f];if(void 0===h){h=s++,t[f]=h,e.push(l);for(let e=0,t=o;e!==t;++e)i[e].push(new Eh(l,n[e],r[e]))}else if(h<c){a=e[h];const s=--c,u=e[s];t[u.uuid]=h,e[h]=u,t[f]=s,e[s]=l;for(let e=0,t=o;e!==t;++e){const t=i[e],o=t[s];let a=t[h];t[h]=o,void 0===a&&(a=new Eh(l,n[e],r[e])),t[s]=a}}else e[h]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o],s=a.uuid,c=t[s];if(void 0!==c&&c>=i){const o=i++,u=e[o];t[u.uuid]=c,e[c]=u,t[s]=o,e[o]=a;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[o],i=t[c];t[c]=r,t[o]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,o=e.length;for(let a=0,s=arguments.length;a!==s;++a){const s=arguments[a].uuid,c=t[s];if(void 0!==c)if(delete t[s],c<i){const a=--i,s=e[a],u=--o,l=e[u];t[s.uuid]=c,e[c]=s,t[l.uuid]=a,e[a]=l,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[u];t[c]=r,t[a]=i,t.pop()}}else{const i=--o,a=e[i];i>0&&(t[a.uuid]=c),e[c]=a,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[c]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,l=new Array(c);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(l);for(let n=u,r=s.length;n!==r;++n){const r=s[n];l[n]=new Eh(r,e,t)}return l}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}zh.prototype.isAnimationObjectGroup=!0;class Lh{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,o=i.length,a=new Array(o),s={endingStart:Nt,endingEnd:Nt};for(let e=0;e!==o;++e){const t=i[e].createInterpolant(null);a[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ft,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,o=n/r;e.warp(1,i,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case Zt:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(o),t[n].accumulateAdditive(a);break;case Wt:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(o),t[n].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const o=n===jt;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(n===kt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Ht,r.endingEnd=Ht):(r.endingStart=e?this.zeroSlopeAtStart?Ht:Nt:Vt,r.endingEnd=t?this.zeroSlopeAtEnd?Ht:Nt:Vt)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}class Ch extends kn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName;let u=c[s];void 0===u&&(u={},c[s]=u);for(let e=0;e!==i;++e){const i=r[e],c=i.name;let l=u[c];if(void 0!==l)o[e]=l;else{if(l=o[e],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,s,c));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;l=new gh(Eh.create(n,c,r),i.ValueTypeName,i.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,s,c),o[e]=l}a[e].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let o=i[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=o;else{const t=o.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,c=s[s.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),e._byClipCacheIndex=null,delete a.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let o=r[t];void 0===o&&(o={},r[t]=o),o[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new Ml(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let o="string"==typeof e?Al.findByName(r,e):e;const a=null!==o?o.uuid:e,s=this._actionsByClip[a];let c=null;if(void 0===n&&(n=null!==o?o.blendMode:Wt),void 0!==s){const e=s.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;c=s.knownActions[0],null===o&&(o=c._clip)}if(null===o)return null;const u=new Lh(this,o,t,n);return this._bindAction(u,c),this._addInactiveAction(u,a,i),u}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?Al.findByName(n,e):e,o=i?i.uuid:e,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1;for(let a=0;a!==n;++a)t[a]._update(r,e,i,o);const a=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)a[e].apply(o);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,o=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=i,t[i]=o,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const e in n){const r=n[e].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const e in r){const t=r[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}Ch.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Ah{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Ah(void 0===this.value.clone?this.value:this.value.clone())}}class Oh extends ic{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n||1}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}Oh.prototype.isInstancedInterleavedBuffer=!0;class Dh{constructor(e,t,n,r,i){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}Dh.prototype.isGLBufferAttribute=!0;class Ih{constructor(e,t,n=0,r=1/0){this.ray=new kr(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new Yr,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,n=[]){return Fh(e,this,n,t),n.sort(kh),n}intersectObjects(e,t=!1,n=[]){for(let r=0,i=e.length;r<i;r++)Fh(e[r],this,n,t);return n.sort(kh),n}}function kh(e,t){return e.distance-t.distance}function Fh(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)Fh(r[e],t,n,!0)}}class jh{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Nn(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Uh{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const Bh=new Xn;class Gh{constructor(e=new Xn(1/0,1/0),t=new Xn(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Bh.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new Xn),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new Xn),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Xn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Xn),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Bh.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}Gh.prototype.isBox2=!0;const Nh=new ar,Hh=new ar;class Vh{constructor(e=new ar,t=new ar){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new ar),e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new ar),e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new ar),this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Nh.subVectors(e,this.start),Hh.subVectors(this.end,this.start);const n=Hh.dot(Hh);let r=Hh.dot(Nh)/n;return t&&(r=Nn(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new ar),this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}class Wh extends ci{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}Wh.prototype.isImmediateRenderObject=!0;const Zh=new ar;class qh extends ci{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new ro,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,n=32;e<n;e++,t++){const i=e/n*Math.PI*2,o=t/n*Math.PI*2;r.push(Math.cos(i),Math.sin(i),1,Math.cos(o),Math.sin(o),1)}n.setAttribute("position",new Wi(r,3));const i=new Gc({fog:!1,toneMapped:!1});this.cone=new Kc(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Zh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Zh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Yh=new ar,Xh=new Fr,Kh=new Fr;class Qh extends Kc{constructor(e){const t=Jh(e),n=new ro,r=[],i=[],o=new Ai(0,0,1),a=new Ai(0,1,0);for(let e=0;e<t.length;e++){const n=t[e];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new Wi(r,3)),n.setAttribute("color",new Wi(i,3)),super(n,new Gc({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");Kh.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(Xh.multiplyMatrices(Kh,i.matrixWorld),Yh.setFromMatrixPosition(Xh),r.setXYZ(n,Yh.x,Yh.y,Yh.z),Xh.multiplyMatrices(Kh,i.parent.matrixWorld),Yh.setFromMatrixPosition(Xh),r.setXYZ(n+1,Yh.x,Yh.y,Yh.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function Jh(e){const t=[];e&&e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,Jh(e.children[n]));return t}class $h extends Mo{constructor(e,t,n){super(new el(t,4,2),new Oi({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const ev=new ar,tv=new Ai,nv=new Ai;class rv extends ci{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const r=new Ku(t);r.rotateY(.5*Math.PI),this.material=new Oi({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.setAttribute("color",new ki(o,3)),this.add(new Mo(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");tv.copy(this.light.color),nv.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?tv:nv;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(ev.setFromMatrixPosition(this.light.matrixWorld).negate())}}class iv extends Kc{constructor(e=10,t=10,n=4473924,r=8947848){n=new Ai(n),r=new Ai(r);const i=t/2,o=e/t,a=e/2,s=[],c=[];for(let e=0,u=0,l=-a;e<=t;e++,l+=o){s.push(-a,0,l,a,0,l),s.push(l,0,-a,l,0,a);const t=e===i?n:r;t.toArray(c,u),u+=3,t.toArray(c,u),u+=3,t.toArray(c,u),u+=3,t.toArray(c,u),u+=3}const u=new ro;u.setAttribute("position",new Wi(s,3)),u.setAttribute("color",new Wi(c,3)),super(u,new Gc({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class ov extends Kc{constructor(e=10,t=16,n=8,r=64,i=4473924,o=8947848){i=new Ai(i),o=new Ai(o);const a=[],s=[];for(let n=0;n<=t;n++){const r=n/t*(2*Math.PI),c=Math.sin(r)*e,u=Math.cos(r)*e;a.push(0,0,0),a.push(c,0,u);const l=1&n?i:o;s.push(l.r,l.g,l.b),s.push(l.r,l.g,l.b)}for(let t=0;t<=n;t++){const c=1&t?i:o,u=e-e/n*t;for(let e=0;e<r;e++){let t=e/r*(2*Math.PI),n=Math.sin(t)*u,i=Math.cos(t)*u;a.push(n,0,i),s.push(c.r,c.g,c.b),t=(e+1)/r*(2*Math.PI),n=Math.sin(t)*u,i=Math.cos(t)*u,a.push(n,0,i),s.push(c.r,c.g,c.b)}}const c=new ro;c.setAttribute("position",new Wi(a,3)),c.setAttribute("color",new Wi(s,3)),super(c,new Gc({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const av=new ar,sv=new ar,cv=new ar;class uv extends ci{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);let r=new ro;r.setAttribute("position",new Wi([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new Gc({fog:!1,toneMapped:!1});this.lightPlane=new qc(r,i),this.add(this.lightPlane),r=new ro,r.setAttribute("position",new Wi([0,0,0,0,0,1],3)),this.targetLine=new qc(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){av.setFromMatrixPosition(this.light.matrixWorld),sv.setFromMatrixPosition(this.light.target.matrixWorld),cv.subVectors(sv,av),this.lightPlane.lookAt(sv),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(sv),this.targetLine.scale.z=cv.length()}}const lv=new ar,fv=new zo;class hv extends Kc{constructor(e){const t=new ro,n=new Gc({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],o={},a=new Ai(16755200),s=new Ai(16711680),c=new Ai(43775),u=new Ai(16777215),l=new Ai(3355443);function f(e,t,n){h(e,n),h(t,n)}function h(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(r.length/3-1)}f("n1","n2",a),f("n2","n4",a),f("n4","n3",a),f("n3","n1",a),f("f1","f2",a),f("f2","f4",a),f("f4","f3",a),f("f3","f1",a),f("n1","f1",a),f("n2","f2",a),f("n3","f3",a),f("n4","f4",a),f("p","n1",s),f("p","n2",s),f("p","n3",s),f("p","n4",s),f("u1","u2",c),f("u2","u3",c),f("u3","u1",c),f("c","t",u),f("p","c",l),f("cn1","cn2",l),f("cn3","cn4",l),f("cf1","cf2",l),f("cf3","cf4",l),t.setAttribute("position",new Wi(r,3)),t.setAttribute("color",new Wi(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap;fv.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),vv("c",t,e,fv,0,0,-1),vv("t",t,e,fv,0,0,1),vv("n1",t,e,fv,-1,-1,-1),vv("n2",t,e,fv,1,-1,-1),vv("n3",t,e,fv,-1,1,-1),vv("n4",t,e,fv,1,1,-1),vv("f1",t,e,fv,-1,-1,1),vv("f2",t,e,fv,1,-1,1),vv("f3",t,e,fv,-1,1,1),vv("f4",t,e,fv,1,1,1),vv("u1",t,e,fv,.7,1.1,-1),vv("u2",t,e,fv,-.7,1.1,-1),vv("u3",t,e,fv,0,2,-1),vv("cf1",t,e,fv,-1,0,1),vv("cf2",t,e,fv,1,0,1),vv("cf3",t,e,fv,0,-1,1),vv("cf4",t,e,fv,0,1,1),vv("cn1",t,e,fv,-1,0,-1),vv("cn2",t,e,fv,1,0,-1),vv("cn3",t,e,fv,0,-1,-1),vv("cn4",t,e,fv,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function vv(e,t,n,r,i,o,a){lv.set(i,o,a).unproject(r);const s=t[e];if(void 0!==s){const e=n.getAttribute("position");for(let t=0,n=s.length;t<n;t++)e.setXYZ(s[t],lv.x,lv.y,lv.z)}}const dv=new ur;class pv extends Kc{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new ro;i.setIndex(new ki(n,1)),i.setAttribute("position",new ki(r,3)),super(i,new Gc({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&dv.setFromObject(this.object),dv.isEmpty())return;const t=dv.min,n=dv.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Kc.prototype.copy.call(this,e),this.object=e.object,this}}class mv extends Kc{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new ro;r.setIndex(new ki(n,1)),r.setAttribute("position",new Wi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new Gc({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class yv extends qc{constructor(e,t=1,n=16776960){const r=n,i=new ro;i.setAttribute("position",new Wi([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),super(i,new Gc({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const o=new ro;o.setAttribute("position",new Wi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Mo(o,new Oi({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?p:d,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const gv=new ar;let xv,bv;class wv extends ci{constructor(e=new ar(0,0,1),t=new ar(0,0,0),n=1,r=16776960,i=.2*n,o=.2*i){super(),this.type="ArrowHelper",void 0===xv&&(xv=new ro,xv.setAttribute("position",new Wi([0,0,0,0,1,0],3)),bv=new lu(0,.5,1,5,1),bv.translate(0,-.5,0)),this.position.copy(t),this.line=new qc(xv,new Gc({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mo(bv,new Oi({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{gv.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(gv,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class Mv extends Kc{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new ro;n.setAttribute("position",new Wi(t,3)),n.setAttribute("color",new Wi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new Gc({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const _v=new Float32Array(1),Sv=new Int32Array(_v.buffer);class Pv{static toHalfFloat(e){_v[0]=e;const t=Sv[0];let n=t>>16&32768,r=t>>12&2047;const i=t>>23&255;return i<103?n:i>142?(n|=31744,n|=(255==i?0:1)&&8388607&t,n):i<113?(r|=2048,n|=(r>>114-i)+(r>>113-i&1),n):(n|=i-112<<10|r>>1,n+=1&r,n)}}const Tv=Math.pow(2,8),Rv=[.125,.215,.35,.446,.526,.582],Ev=5+Rv.length,zv={[Kt]:0,[Qt]:1,[$t]:2,[tn]:3,[nn]:4,[rn]:5,[Jt]:6},Lv=new Oi({side:p,depthWrite:!1,depthTest:!1}),Cv=new Mo(new So,Lv),Av=new zf,{_lodPlanes:Ov,_sizeLods:Dv,_sigmas:Iv}=Vv(),kv=new Ai;let Fv=null;const jv=(1+Math.sqrt(5))/2,Uv=1/jv,Bv=[new ar(1,1,1),new ar(-1,1,1),new ar(1,1,-1),new ar(-1,1,-1),new ar(0,jv,Uv),new ar(0,jv,-Uv),new ar(Uv,0,jv),new ar(-Uv,0,jv),new ar(jv,Uv,0),new ar(-jv,Uv,0)];function Gv(e){const t=Math.max(e.r,e.g,e.b),n=Math.min(Math.max(Math.ceil(Math.log2(t)),-128),127);return e.multiplyScalar(Math.pow(2,-n)),(n+128)/255}class Nv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(e){const t=new Float32Array(20),n=new ar(0,1,0);return new ul({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:zv[Kt]},outputEncoding:{value:zv[Kt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:x,depthTest:!1,depthWrite:!1})}(),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){Fv=this._renderer.getRenderTarget();const i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Yv(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=qv(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e<Ov.length;e++)Ov[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Fv),e.scissorTest=!1,Zv(e,0,0,e.width,e.height)}_fromTexture(e){Fv=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:de,minFilter:de,generateMipmaps:!1,type:Se,format:Ge,encoding:Hv(e)?e.encoding:$t,depthBuffer:!1},n=Wv(t);return n.depthBuffer=!e,this._pingPongRenderTarget=Wv(t),n}_compileMaterial(e){const t=new Mo(Ov[0],e);this._renderer.compile(t,Av)}_sceneToCubeUV(e,t,n,r){const i=new Lo(90,1,t,n),o=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],s=this._renderer,c=s.autoClear,u=s.outputEncoding,l=s.toneMapping;s.getClearColor(kv),s.toneMapping=J,s.outputEncoding=Kt,s.autoClear=!1;let f=!1;const h=e.background;if(h){if(h.isColor){Lv.color.copy(h).convertSRGBToLinear(),e.background=null;const t=Gv(Lv.color);Lv.opacity=t,f=!0}}else{Lv.color.copy(kv).convertSRGBToLinear();const e=Gv(Lv.color);Lv.opacity=e,f=!0}for(let t=0;t<6;t++){const n=t%3;0==n?(i.up.set(0,o[t],0),i.lookAt(a[t],0,0)):1==n?(i.up.set(0,0,o[t]),i.lookAt(0,a[t],0)):(i.up.set(0,o[t],0),i.lookAt(0,0,a[t])),Zv(r,n*Tv,t>2?Tv:0,Tv,Tv),s.setRenderTarget(r),f&&s.render(Cv,i),s.render(e,i)}s.toneMapping=l,s.outputEncoding=u,s.autoClear=c}_textureToCubeUV(e,t){const n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Yv()):null==this._equirectShader&&(this._equirectShader=qv());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Mo(Ov[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=zv[e.encoding],o.outputEncoding.value=zv[t.texture.encoding],Zv(t,0,0,3*Tv,2*Tv),n.setRenderTarget(t),n.render(i,Av)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<Ev;t++){const n=Math.sqrt(Iv[t]*Iv[t]-Iv[t-1]*Iv[t-1]),r=Bv[(t-1)%Bv.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,r,i){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,r,"latitudinal",i),this._halfBlur(o,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,o,a){const s=this._renderer,c=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const u=new Mo(Ov[r],c),l=c.uniforms,f=Dv[n]-1,h=isFinite(i)?Math.PI/(2*f):2*Math.PI/39,v=i/h,d=isFinite(i)?1+Math.floor(3*v):20;d>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${d} samples when the maximum is set to 20`);const p=[];let m=0;for(let e=0;e<20;++e){const t=e/v,n=Math.exp(-t*t/2);p.push(n),0==e?m+=n:e<d&&(m+=2*n)}for(let e=0;e<p.length;e++)p[e]=p[e]/m;l.envMap.value=e.texture,l.samples.value=d,l.weights.value=p,l.latitudinal.value="latitudinal"===o,a&&(l.poleAxis.value=a),l.dTheta.value=h,l.mipInt.value=8-n,l.inputEncoding.value=zv[e.texture.encoding],l.outputEncoding.value=zv[e.texture.encoding];const y=Dv[r];Zv(t,3*Math.max(0,Tv-2*y),(0===r?0:2*Tv)+2*y*(r>4?r-8+4:0),3*y,2*y),s.setRenderTarget(t),s.render(u,Av)}}function Hv(e){return void 0!==e&&e.type===Se&&(e.encoding===Kt||e.encoding===Qt||e.encoding===Jt)}function Vv(){const e=[],t=[],n=[];let r=8;for(let i=0;i<Ev;i++){const o=Math.pow(2,r);t.push(o);let a=1/o;i>4?a=Rv[i-8+4-1]:0==i&&(a=0),n.push(a);const s=1/(o-1),c=-s/2,u=1+s/2,l=[c,c,u,c,u,u,c,c,u,u,c,u],f=6,h=6,v=3,d=2,p=1,m=new Float32Array(v*h*f),y=new Float32Array(d*h*f),g=new Float32Array(p*h*f);for(let e=0;e<f;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];m.set(r,v*h*e),y.set(l,d*h*e);const i=[e,e,e,e,e,e];g.set(i,p*h*e)}const x=new ro;x.setAttribute("position",new ki(m,v)),x.setAttribute("uv",new ki(y,d)),x.setAttribute("faceIndex",new ki(g,p)),e.push(x),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Wv(e){const t=new rr(3*Tv,3*Tv,e);return t.texture.mapping=ue,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Zv(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function qv(){const e=new Xn(1,1);return new ul({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:zv[Kt]},outputEncoding:{value:zv[Kt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:x,depthTest:!1,depthWrite:!1})}function Yv(){return new ul({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:zv[Kt]},outputEncoding:{value:zv[Kt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:x,depthTest:!1,depthWrite:!1})}const Xv=0,Kv=1,Qv=0,Jv=1,$v=2;function ed(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function td(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function nd(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ru(e,t)}function rd(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new wc(e)}function id(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ru(e,t)}function od(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Jc(e)}function ad(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Jc(e)}function sd(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Jc(e)}function cd(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new ar(e,t,n)}function ud(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new ki(e,t).setUsage(Tn)}function ld(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Fi(e,t)}function fd(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new ji(e,t)}function hd(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Ui(e,t)}function vd(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Bi(e,t)}function dd(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Gi(e,t)}function pd(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Ni(e,t)}function md(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Hi(e,t)}function yd(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Wi(e,t)}function gd(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Zi(e,t)}function xd(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Mv(e)}function bd(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new pv(e,t)}function wd(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Kc(new gu(e.geometry),new Gc({color:void 0!==t?t:16777215}))}function Md(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Kc(new al(e.geometry),new Gc({color:void 0!==t?t:16777215}))}function _d(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ul(e)}function Sd(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Vl(e)}function Pd(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Do(e,n)}function Td(){console.error("THREE.CanvasRenderer has been removed")}function Rd(){console.error("THREE.JSONLoader has been removed.")}Zl.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Zl.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},df.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},iv.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Qh.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Fl.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ff.extractUrlBase(e)},Fl.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Gh.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},Gh.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Gh.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Gh.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},ur.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},ur.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},ur.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},ur.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},ur.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},Er.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},jo.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Vh.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Kn.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Kn.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Kn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Kn.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},Kn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Kn.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},Fr.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},Fr.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},Fr.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new ar).setFromMatrixColumn(this,3)},Fr.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},Fr.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Fr.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Fr.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Fr.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Fr.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},Fr.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Fr.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Fr.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Fr.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Fr.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Fr.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Fr.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},Fr.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Fr.prototype.makeFrustum=function(e,t,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,o)},Fr.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},hi.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},or.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},or.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},kr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},kr.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},kr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},_i.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},_i.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},_i.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},_i.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},_i.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},_i.barycoordFromPoint=function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),_i.getBarycoord(e,t,n,r,i)},_i.normal=function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),_i.getNormal(e,t,n,r)},pf.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},pf.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Zu(this,e)},pf.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new $u(this,e)},Xn.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},Xn.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},Xn.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ar.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},ar.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},ar.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},ar.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},ar.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},ar.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},ar.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},ar.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},ar.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},nr.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},nr.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},ci.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},ci.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},ci.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},ci.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},ci.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(ci.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Mo.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Mo.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),qt},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Cc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Lo.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(mf.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(ki.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Tn},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Tn)}}}),ki.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Tn:Pn),this},ki.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},ki.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},ro.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},ro.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new ki(arguments[1],arguments[2])))},ro.prototype.addDrawCall=function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},ro.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},ro.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},ro.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},ro.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(ro.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),ic.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Tn:Pn),this},ic.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Zu.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Zu.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Zu.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},rc.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Ah.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Pi.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ai}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===y}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Eo.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),$s.prototype.clearTarget=function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},$s.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},$s.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},$s.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},$s.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},$s.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},$s.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},$s.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},$s.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},$s.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},$s.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},$s.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},$s.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},$s.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},$s.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},$s.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},$s.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},$s.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},$s.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},$s.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},$s.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},$s.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},$s.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},$s.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},$s.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties($s.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?Qt:Kt}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Hs.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(rr.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),fh.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new Jf).load(e,(function(e){t.setBuffer(e)})),this},yh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ao.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Ao.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)},Jn.crossOrigin=void 0,Jn.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new Wl;i.setCrossOrigin(this.crossOrigin);const o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},Jn.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new Hl;i.setCrossOrigin(this.crossOrigin);const o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},Jn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Jn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const Ed={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function zd(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:r}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=r)},52886:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var r=n(2212);const i={type:"change"},o={type:"start"},a={type:"end"};class s extends r.EventDispatcher{constructor(e,t){super(),void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.target=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.listenToKeyEvents=function(e){e.addEventListener("keydown",V),this._domElementKeyEvents=e},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(i),n.update(),c=s.NONE},this.update=function(){const t=new r.Vector3,o=(new r.Quaternion).setFromUnitVectors(e.up,new r.Vector3(0,1,0)),a=o.clone().invert(),p=new r.Vector3,m=new r.Quaternion,y=2*Math.PI;return function(){const e=n.object.position;t.copy(e).sub(n.target),t.applyQuaternion(o),l.setFromVector3(t),n.autoRotate&&c===s.NONE&&P(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(l.theta+=f.theta*n.dampingFactor,l.phi+=f.phi*n.dampingFactor):(l.theta+=f.theta,l.phi+=f.phi);let r=n.minAzimuthAngle,g=n.maxAzimuthAngle;return isFinite(r)&&isFinite(g)&&(r<-Math.PI?r+=y:r>Math.PI&&(r-=y),g<-Math.PI?g+=y:g>Math.PI&&(g-=y),l.theta=r<=g?Math.max(r,Math.min(g,l.theta)):l.theta>(r+g)/2?Math.max(r,l.theta):Math.min(g,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=h,l.radius=Math.max(n.minDistance,Math.min(n.maxDistance,l.radius)),!0===n.enableDamping?n.target.addScaledVector(v,n.dampingFactor):n.target.add(v),t.setFromSpherical(l),t.applyQuaternion(a),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(f.theta*=1-n.dampingFactor,f.phi*=1-n.dampingFactor,v.multiplyScalar(1-n.dampingFactor)):(f.set(0,0,0),v.set(0,0,0)),h=1,!!(d||p.distanceToSquared(n.object.position)>u||8*(1-m.dot(n.object.quaternion))>u)&&(n.dispatchEvent(i),p.copy(n.object.position),m.copy(n.object.quaternion),d=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Y),n.domElement.removeEventListener("pointerdown",B),n.domElement.removeEventListener("wheel",H),n.domElement.removeEventListener("touchstart",W),n.domElement.removeEventListener("touchend",q),n.domElement.removeEventListener("touchmove",Z),n.domElement.ownerDocument.removeEventListener("pointermove",G),n.domElement.ownerDocument.removeEventListener("pointerup",N),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",V)};const n=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=s.NONE;const u=1e-6,l=new r.Spherical,f=new r.Spherical;let h=1;const v=new r.Vector3;let d=!1;const p=new r.Vector2,m=new r.Vector2,y=new r.Vector2,g=new r.Vector2,x=new r.Vector2,b=new r.Vector2,w=new r.Vector2,M=new r.Vector2,_=new r.Vector2;function S(){return Math.pow(.95,n.zoomSpeed)}function P(e){f.theta-=e}function T(e){f.phi-=e}const R=function(){const e=new r.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),v.add(e)}}(),E=function(){const e=new r.Vector3;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),v.add(e)}}(),z=function(){const e=new r.Vector3;return function(t,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const o=n.object.position;e.copy(o).sub(n.target);let a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),R(2*t*a/i.clientHeight,n.object.matrix),E(2*r*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(R(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),E(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function L(e){n.object.isPerspectiveCamera?h/=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function C(e){n.object.isPerspectiveCamera?h*=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function A(e){p.set(e.clientX,e.clientY)}function O(e){g.set(e.clientX,e.clientY)}function D(e){if(1==e.touches.length)p.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);p.set(t,n)}}function I(e){if(1==e.touches.length)g.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);g.set(t,n)}}function k(e){const t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);w.set(0,r)}function F(e){if(1==e.touches.length)m.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);m.set(t,n)}y.subVectors(m,p).multiplyScalar(n.rotateSpeed);const t=n.domElement;P(2*Math.PI*y.x/t.clientHeight),T(2*Math.PI*y.y/t.clientHeight),p.copy(m)}function j(e){if(1==e.touches.length)x.set(e.touches[0].pageX,e.touches[0].pageY);else{const t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);x.set(t,n)}b.subVectors(x,g).multiplyScalar(n.panSpeed),z(b.x,b.y),g.copy(x)}function U(e){const t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+r*r);M.set(0,i),_.set(0,Math.pow(M.y/w.y,n.zoomSpeed)),L(_.y),w.copy(M)}function B(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){let t;switch(e.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus(),e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case r.MOUSE.DOLLY:if(!1===n.enableZoom)return;!function(e){w.set(e.clientX,e.clientY)}(e),c=s.DOLLY;break;case r.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;O(e),c=s.PAN}else{if(!1===n.enableRotate)return;A(e),c=s.ROTATE}break;case r.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;A(e),c=s.ROTATE}else{if(!1===n.enablePan)return;O(e),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&(n.domElement.ownerDocument.addEventListener("pointermove",G),n.domElement.ownerDocument.addEventListener("pointerup",N),n.dispatchEvent(o))}(e)}}function G(e){if(!1!==n.enabled)switch(e.pointerType){case"mouse":case"pen":!function(e){if(!1!==n.enabled)switch(e.preventDefault(),c){case s.ROTATE:if(!1===n.enableRotate)return;!function(e){m.set(e.clientX,e.clientY),y.subVectors(m,p).multiplyScalar(n.rotateSpeed);const t=n.domElement;P(2*Math.PI*y.x/t.clientHeight),T(2*Math.PI*y.y/t.clientHeight),p.copy(m),n.update()}(e);break;case s.DOLLY:if(!1===n.enableZoom)return;!function(e){M.set(e.clientX,e.clientY),_.subVectors(M,w),_.y>0?L(S()):_.y<0&&C(S()),w.copy(M),n.update()}(e);break;case s.PAN:if(!1===n.enablePan)return;!function(e){x.set(e.clientX,e.clientY),b.subVectors(x,g).multiplyScalar(n.panSpeed),z(b.x,b.y),g.copy(x),n.update()}(e)}}(e)}}function N(e){switch(e.pointerType){case"mouse":case"pen":n.domElement.ownerDocument.removeEventListener("pointermove",G),n.domElement.ownerDocument.removeEventListener("pointerup",N),!1!==n.enabled&&(n.dispatchEvent(a),c=s.NONE)}}function H(e){!1===n.enabled||!1===n.enableZoom||c!==s.NONE&&c!==s.ROTATE||(e.preventDefault(),n.dispatchEvent(o),function(e){e.deltaY<0?C(S()):e.deltaY>0&&L(S()),n.update()}(e),n.dispatchEvent(a))}function V(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case n.keys.UP:z(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:z(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:z(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:z(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function W(e){if(!1!==n.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(n.touches.ONE){case r.TOUCH.ROTATE:if(!1===n.enableRotate)return;D(e),c=s.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(!1===n.enablePan)return;I(e),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(n.touches.TWO){case r.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&k(e),n.enablePan&&I(e)}(e),c=s.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&k(e),n.enableRotate&&D(e)}(e),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}}function Z(e){if(!1!==n.enabled)switch(e.preventDefault(),c){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;F(e),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;j(e),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&U(e),n.enablePan&&j(e)}(e),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&U(e),n.enableRotate&&F(e)}(e),n.update();break;default:c=s.NONE}}function q(e){!1!==n.enabled&&(n.dispatchEvent(a),c=s.NONE)}function Y(e){!1!==n.enabled&&e.preventDefault()}n.domElement.addEventListener("contextmenu",Y),n.domElement.addEventListener("pointerdown",B),n.domElement.addEventListener("wheel",H,{passive:!1}),n.domElement.addEventListener("touchstart",W,{passive:!1}),n.domElement.addEventListener("touchend",q),n.domElement.addEventListener("touchmove",Z,{passive:!1}),this.update()}}},48840:function(e,t,n){"use strict";n.d(t,{L:function(){return d}});var r=n(2212);const i=/^[og]\s*(.+)?/,o=/^mtllib /,a=/^usemtl /,s=/^usemap /,c=new r.Vector3,u=new r.Vector3,l=new r.Vector3,f=new r.Vector3,h=new r.Vector3;function v(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const r={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){const e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){const n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){const r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){const r=this.vertices,i=this.object.geometry.normals;c.fromArray(r,e),u.fromArray(r,t),l.fromArray(r,n),h.subVectors(l,u),f.subVectors(c,u),h.cross(f),h.normalize(),i.push(h.x,h.y,h.z),i.push(h.x,h.y,h.z),i.push(h.x,h.y,h.z)},addColor:function(e,t,n){const r=this.colors,i=this.object.geometry.colors;void 0!==r[e]&&i.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&i.push(r[t+0],r[t+1],r[t+2]),void 0!==r[n]&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){const r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,o,a,s,c){const u=this.vertices.length;let l=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),h=this.parseVertexIndex(n,u);if(this.addVertex(l,f,h),this.addColor(l,f,h),void 0!==a&&""!==a){const e=this.normals.length;l=this.parseNormalIndex(a,e),f=this.parseNormalIndex(s,e),h=this.parseNormalIndex(c,e),this.addNormal(l,f,h)}else this.addFaceNormal(l,f,h);if(void 0!==r&&""!==r){const e=this.uvs.length;l=this.parseUVIndex(r,e),f=this.parseUVIndex(i,e),h=this.parseUVIndex(o,e),this.addUV(l,f,h),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,r=this.uvs.length;for(let t=0,r=e.length;t<r;t++)this.addVertexLine(this.parseVertexIndex(e[t],n));for(let e=0,n=t.length;e<n;e++)this.addUVLine(this.parseUVIndex(t[e],r))}};return e.startObject("",!1),e}class d extends r.Loader{constructor(e){super(e),this.materials=null}load(e,t,n,i){const o=this,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(o.parse(n))}catch(t){i?i(t):console.error(t),o.manager.itemError(e)}}),n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new v;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));const n=e.split("\n");let c="",u="",l=0,f=[];const h="function"==typeof"".trimLeft;for(let e=0,r=n.length;e<r;e++)if(c=n[e],c=h?c.trimLeft():c.trim(),l=c.length,0!==l&&(u=c.charAt(0),"#"!==u))if("v"===u){const e=c.split(/\s+/);switch(e[0]){case"v":t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?t.colors.push(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===u){const e=c.substr(1).trim().split(/\s+/),n=[];for(let t=0,r=e.length;t<r;t++){const r=e[t];if(r.length>0){const e=r.split("/");n.push(e)}}const r=n[0];for(let e=1,i=n.length-1;e<i;e++){const i=n[e],o=n[e+1];t.addFace(r[0],i[0],o[0],r[1],i[1],o[1],r[2],i[2],o[2])}}else if("l"===u){const e=c.substring(1).trim().split(" ");let n=[];const r=[];if(-1===c.indexOf("/"))n=e;else for(let t=0,i=e.length;t<i;t++){const i=e[t].split("/");""!==i[0]&&n.push(i[0]),""!==i[1]&&r.push(i[1])}t.addLineGeometry(n,r)}else if("p"===u){const e=c.substr(1).trim().split(" ");t.addPointGeometry(e)}else if(null!==(f=i.exec(c))){const e=(" "+f[0].substr(1).trim()).substr(1);t.startObject(e)}else if(a.test(c))t.object.startMaterial(c.substring(7).trim(),t.materialLibraries);else if(o.test(c))t.materialLibraries.push(c.substring(7).trim());else if(s.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===u){if(f=c.split(" "),f.length>1){const e=f[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===c)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}t.finalize();const d=new r.Group;if(d.materialLibraries=[].concat(t.materialLibraries),!0==!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let e=0,n=t.objects.length;e<n;e++){const n=t.objects[e],i=n.geometry,o=n.materials,a="Line"===i.type,s="Points"===i.type;let c=!1;if(0===i.vertices.length)continue;const u=new r.BufferGeometry;u.setAttribute("position",new r.Float32BufferAttribute(i.vertices,3)),i.normals.length>0&&u.setAttribute("normal",new r.Float32BufferAttribute(i.normals,3)),i.colors.length>0&&(c=!0,u.setAttribute("color",new r.Float32BufferAttribute(i.colors,3))),!0===i.hasUVIndices&&u.setAttribute("uv",new r.Float32BufferAttribute(i.uvs,2));const l=[];for(let e=0,n=o.length;e<n;e++){const n=o[e],i=n.name+"_"+n.smooth+"_"+c;let u=t.materials[i];if(null!==this.materials)if(u=this.materials.create(n.name),!a||!u||u instanceof r.LineBasicMaterial){if(s&&u&&!(u instanceof r.PointsMaterial)){const e=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(e,u),e.color.copy(u.color),e.map=u.map,u=e}}else{const e=new r.LineBasicMaterial;r.Material.prototype.copy.call(e,u),e.color.copy(u.color),u=e}void 0===u&&(u=a?new r.LineBasicMaterial:s?new r.PointsMaterial({size:1,sizeAttenuation:!1}):new r.MeshPhongMaterial,u.name=n.name,u.flatShading=!n.smooth,u.vertexColors=c,t.materials[i]=u),l.push(u)}let f;if(l.length>1){for(let e=0,t=o.length;e<t;e++){const t=o[e];u.addGroup(t.groupStart,t.groupCount,e)}f=a?new r.LineSegments(u,l):s?new r.Points(u,l):new r.Mesh(u,l)}else f=a?new r.LineSegments(u,l[0]):s?new r.Points(u,l[0]):new r.Mesh(u,l[0]);f.name=n.name,d.add(f)}else if(t.vertices.length>0){const e=new r.PointsMaterial({size:1,sizeAttenuation:!1}),n=new r.BufferGeometry;n.setAttribute("position",new r.Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(n.setAttribute("color",new r.Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);const i=new r.Points(n,e);d.add(i)}return d}}},42238:function(e,t,n){var r;!function(i,o){"use strict";var a="function",s="undefined",c="object",u="string",l="model",f="name",h="type",v="vendor",d="version",p="architecture",m="console",y="mobile",g="tablet",x="smarttv",b="wearable",w={extend:function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return typeof e===u&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===u?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e,t){return e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof t===s?e:e.substring(0,255)}},M={rgx:function(e,t){for(var n,r,i,s,u,l,f=0;f<t.length&&!u;){var h=t[f],v=t[f+1];for(n=r=0;n<h.length&&!u;)if(u=h[n++].exec(e))for(i=0;i<v.length;i++)l=u[++r],typeof(s=v[i])===c&&s.length>0?2==s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):o:this[s[0]]=l?s[1].call(this,l,s[2]):o:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):o):this[s]=l||o;f+=2}},str:function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(w.has(t[n][r],e))return"?"===n?o:n}else if(w.has(t[n],e))return"?"===n?o:n;return e}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},S={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[f,"Chrome"]],[/(?:edgios|edga|edg)\/([\w\.]+)/i],[d,[f,"Edge"]],[/edge\/([\w\.]+)/i],[[d,M.str,_.browser.oldEdge.version],[f,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[f,d],[/opios[\/\s]+([\w\.]+)/i],[d,[f,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[f,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|instagram)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[f,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[f,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[f,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[f,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[f,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[f,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[f,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[f,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[f,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[f,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[f,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[f,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],d],[/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[f,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[f],[/;fbav\/([\w\.]+);/i],[d,[f,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[f,"Facebook"]],[/\s(electron)\/([\w\.]+)\ssafari/i,/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i],[f,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[f,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[f,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[f,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[f,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[f,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[f,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,f],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[f,[d,M.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[f,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[f,"Netscape"],d],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[f,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[p,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,w.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-p(?:605|610|587)|sm-t\w+|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus\s10)/i],[l,[v,"Samsung"],[h,g]],[/(s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[v,"Samsung"],[h,y]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[v,"Apple"],[h,y]],[/\((ipad);[\w\s\),;-]+(apple)/i],[l,v,[h,g]],[/applecoremedia\/[\w\.]+\s\((ipad)/i],[l,[v,"Apple"],[h,g]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[v,"Huawei"],[h,y]],[/\b(bah2?-a?[lw]\d{2})/i],[l,[v,"Huawei"],[h,g]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\s+build\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[v,"Xiaomi"],[h,y]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[v,"Xiaomi"],[h,g]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[v,"OPPO"],[h,y]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[v,"Vivo"],[h,y]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[v,"Realme"],[h,y]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot[\s-](\w*)/i,/(moto[\s\w\(\)]+(?=\sbuild|\)))/i,/(xt\d{3,4})\sbuild\//i,/(nexus\s6)/i],[l,[v,"Motorola"],[h,y]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[v,"Motorola"],[h,g]],[/((?=lg)?[vl]k\-?\d{3})\s+build|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[v,"LG"],[h,g]],[/(nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\s+build/i],[l,[v,"LG"],[h,y]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|[\w-]+)/i],[l,[v,"Lenovo"],[h,g]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[l,[v,"Nokia"],[h,y]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[v,"Google"],[h,g]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[v,"Google"],[h,y]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[v,"Sony"],[h,y]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[v,"Sony"],[h,g]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\s+build/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[v,"OnePlus"],[h,y]],[/(alexa)webm/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[v,"Amazon"],[h,g]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[v,"Amazon"],[h,y]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,v,[h,g]],[/\(bb10;\s(\w+)/i],[l,[v,"BlackBerry"],[h,y]],[/\b(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00c)/i],[l,[v,"ASUS"],[h,g]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[v,"ASUS"],[h,y]],[/(nexus\s9)/i],[l,[v,"HTC"],[h,g]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[v,[l,/_/g," "],[h,y]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[v,"Acer"],[h,g]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[v,"Meizu"],[h,y]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[v,l,[h,y]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[v,l,[h,g]],[/\s(surface\sduo)\s/i],[l,[v,"Microsoft"],[h,g]],[/\s(u304aa)\sbuild/i],[l,[v,"AT&T"],[h,y]],[/sie-(\w*)/i],[l,[v,"Siemens"],[h,y]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[v,"RCA"],[h,g]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[v,"Dell"],[h,g]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[v,"Verizon"],[h,g]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[v,"Barnes & Noble"],[h,g]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[v,"NuVision"],[h,g]],[/;\s(k88)\sbuild/i],[l,[v,"ZTE"],[h,g]],[/;\s(nx\d{3}j)\sbuild/i],[l,[v,"ZTE"],[h,y]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[v,"Swiss"],[h,y]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[v,"Swiss"],[h,g]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[v,"Zeki"],[h,g]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[v,"Dragon Touch"],l,[h,g]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[v,"Insignia"],[h,g]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[v,"NextBook"],[h,g]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[v,"Voice"],l,[h,y]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[v,"LvTel"],l,[h,y]],[/;\s(ph-1)\s/i],[l,[v,"Essential"],[h,y]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[v,"Envizen"],[h,g]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[v,"MachSpeed"],[h,g]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[v,"Rotor"],[h,g]],[/(shield[\w\s]+)\sbuild/i],[l,[v,"Nvidia"],[h,g]],[/(sprint)\s(\w+)/i],[v,l,[h,y]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[v,"Microsoft"],[h,y]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[v,"Zebra"],[h,g]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[v,"Zebra"],[h,y]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[v,l,[h,m]],[/droid.+;\s(shield)\sbuild/i],[l,[v,"Nvidia"],[h,m]],[/(playstation\s[345portablevi]+)/i],[l,[v,"Sony"],[h,m]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[v,"Microsoft"],[h,m]],[/smart-tv.+(samsung)/i],[v,[h,x],l],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[v,"Samsung"],[h,x]],[/linux;\snetcast.+smarttv/i,/lg\snetcast\.tv-201\d/i],[[v,"LG"],l,[h,x]],[/(apple)\s?tv/i],[v,[l,"Apple TV"],[h,x]],[/crkey/i],[[l,"Chromecast"],[v,"Google"],[h,x]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[v,"Amazon"],[h,x]],[/\(dtv[\);].+(aquos)/i],[l,[v,"Sharp"],[h,x]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[v,w.trim],[l,w.trim],[h,x]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,x]],[/((pebble))app\/[\d\.]+\s/i],[v,l,[h,b]],[/droid.+;\s(glass)\s\d/i],[l,[v,"Google"],[h,b]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[v,"Zebra"],[h,b]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[h,y]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[h,g]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,w.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[v,"Generic"]],[/(phone)/i],[[h,y]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[f,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,f]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[f,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[f,[d,M.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[f,"Windows"],[d,M.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[f,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[f,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i],[f,d],[/\(bb(10);/i],[d,[f,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[f,"Symbian"]],[/\((series40);/i],[f],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[f,"Firefox OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[f,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[f,"Chromecast"]],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[f,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[f,"Chromium OS"],d],[/(sunos)\s?([\w\.\d]*)/i],[[f,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i],[f,d],[/(haiku)\s(\w+)/i],[f,d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[f,d]]},P=function(e,t){if("object"==typeof e&&(t=e,e=o),!(this instanceof P))return new P(e,t).getResult();var n=e||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=t?w.extend(S,t):S;return this.getBrowser=function(){var e={name:o,version:o};return M.rgx.call(e,n,r.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:o};return M.rgx.call(e,n,r.cpu),e},this.getDevice=function(){var e={vendor:o,model:o,type:o};return M.rgx.call(e,n,r.device),e},this.getEngine=function(){var e={name:o,version:o};return M.rgx.call(e,n,r.engine),e},this.getOS=function(){var e={name:o,version:o};return M.rgx.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e.length>255?w.trim(e,255):e,this},this.setUA(n),this};P.VERSION="0.7.26",P.BROWSER={NAME:f,MAJOR:"major",VERSION:d},P.CPU={ARCHITECTURE:p},P.DEVICE={MODEL:l,VENDOR:v,TYPE:h,CONSOLE:m,MOBILE:y,SMARTTV:x,TABLET:g,WEARABLE:b,EMBEDDED:"embedded"},P.ENGINE={NAME:f,VERSION:d},P.OS={NAME:f,VERSION:d},typeof t!==s?(e.exports&&(t=e.exports=P),t.UAParser=P):(r=function(){return P}.call(t,n,t,e))===o||(e.exports=r);var T=void 0!==i&&(i.jQuery||i.Zepto);if(T&&!T.ua){var R=new P;T.ua=R.getResult(),T.ua.get=function(){return R.getUA()},T.ua.set=function(e){R.setUA(e);var t=R.getResult();for(var n in t)T.ua[n]=t[n]}}}("object"==typeof window?window:this)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){n(26981);var e=n(60287).Z,t=document.querySelector(".l-page").dataset.id;if("index"==t)n(78948).Z();else{var r=document.getElementById("canvas-webgl");switch(r.addEventListener("contextmenu",(function(e){e.preventDefault()})),r.addEventListener("selectstart",(function(e){e.preventDefault()})),t){case"water":n(31547).Z();break;case"glass":n(77010).Z();break;case"fire_ball_2":n(14449).Z();break;case"flow_field_5":n(53312).Z();break;case"flow_field_4":n(87389).Z();break;case"flow_field_3":n(76837).Z();break;case"flow_field_2":n(86139).Z();break;case"flow_field":n(95185).Z();break;case"skull":n(29355).Z();break;case"aura":n(88811).Z();break;case"shadow":n(68993).Z();break;case"splash":n(17194).Z();break;case"burn":n(97018).Z();break;case"crystal":n(44428).Z();break;case"node":n(87420).Z();break;case"sun":n(4055).Z();break;case"easy_glitch":n(61954).Z();break;case"dissolve":n(37175).Z();break;case"dna":n(67687).Z();break;case"newyear2019":n(56600).Z();break;case"buddha":n(54614).Z();break;case"planet":n(13532).Z();break;case"land":n(1867).Z();break;case"webcam":n(89643).Z();break;case"fog":n(27751).Z();break;case"node_text":n(49363).Z();break;case"repel":n(8141).Z();break;case"flame":n(86918).Z();break;case"cyberspace":n(57262).Z();break;case"beam":n(45032).Z();break;case"blink":n(75255).Z();break;case"transform":n(82158).Z();break;case"egg":n(59895).Z();break;case"butterfly":n(58238).Z();break;case"puddle":n(18388).Z();break;case"reel":n(39990).Z();break;case"glitch":n(49275).Z();break;case"instancing":n(15758).Z();break;case"particle":n(73552).Z();break;case"attract":n(22732).Z();break;case"hole":n(97531).Z();break;case"metal_cube":n(73262).Z();break;case"distort":n(19963).Z();break;case"image_data":n(91614).Z();break;case"gallery":n(95432).Z();break;case"comet":n(87848).Z();break;case"hyper_space":n(4625).Z();break;case"fire_ball":n(56160).Z()}}e()}()}(); |
| New file |
| | |
| | | var hexcase = 0; |
| | | var b64pad = ""; |
| | | var chrsz = 8; |
| | | function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} |
| | | /* |
| | | * Perform a simple self-test to see if the VM is working |
| | | */ |
| | | function md5_vm_test() |
| | | { |
| | | return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; |
| | | } |
| | | /* |
| | | * Calculate the MD5 of an array of little-endian words, and a bit length |
| | | */ |
| | | function core_md5(x, len) |
| | | { |
| | | /* append padding */ |
| | | x[len >> 5] |= 0x80 << ((len) % 32); |
| | | x[(((len + 64) >>> 9) << 4) + 14] = len; |
| | | var a = 1732584193; |
| | | var b = -271733879; |
| | | var c = -1732584194; |
| | | var d = 271733878; |
| | | for(var i = 0; i < x.length; i += 16) |
| | | { |
| | | var olda = a; |
| | | var oldb = b; |
| | | var oldc = c; |
| | | var oldd = d; |
| | | a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); |
| | | d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); |
| | | c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); |
| | | b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); |
| | | a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); |
| | | d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); |
| | | c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); |
| | | b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); |
| | | a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); |
| | | d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); |
| | | c = md5_ff(c, d, a, b, x[i+10], 17, -42063); |
| | | b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); |
| | | a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); |
| | | d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); |
| | | c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); |
| | | b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); |
| | | a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); |
| | | d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); |
| | | c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); |
| | | b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); |
| | | a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); |
| | | d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); |
| | | c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); |
| | | b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); |
| | | a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); |
| | | d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); |
| | | c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); |
| | | b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); |
| | | a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); |
| | | d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); |
| | | c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); |
| | | b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); |
| | | a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); |
| | | d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); |
| | | c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); |
| | | b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); |
| | | a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); |
| | | d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); |
| | | c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); |
| | | b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); |
| | | a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); |
| | | d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); |
| | | c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); |
| | | b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); |
| | | a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); |
| | | d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); |
| | | c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); |
| | | b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); |
| | | a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); |
| | | d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); |
| | | c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); |
| | | b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); |
| | | a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); |
| | | d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); |
| | | c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); |
| | | b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); |
| | | a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); |
| | | d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); |
| | | c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); |
| | | b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); |
| | | a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); |
| | | d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); |
| | | c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); |
| | | b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); |
| | | a = safe_add(a, olda); |
| | | b = safe_add(b, oldb); |
| | | c = safe_add(c, oldc); |
| | | d = safe_add(d, oldd); |
| | | } |
| | | return Array(a, b, c, d); |
| | | } |
| | | /* |
| | | * These functions implement the four basic operations the algorithm uses. |
| | | */ |
| | | function md5_cmn(q, a, b, x, s, t) |
| | | { |
| | | return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); |
| | | } |
| | | function md5_ff(a, b, c, d, x, s, t) |
| | | { |
| | | return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); |
| | | } |
| | | function md5_gg(a, b, c, d, x, s, t) |
| | | { |
| | | return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); |
| | | } |
| | | function md5_hh(a, b, c, d, x, s, t) |
| | | { |
| | | return md5_cmn(b ^ c ^ d, a, b, x, s, t); |
| | | } |
| | | function md5_ii(a, b, c, d, x, s, t) |
| | | { |
| | | return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); |
| | | } |
| | | /* |
| | | * Calculate the HMAC-MD5, of a key and some data |
| | | */ |
| | | function core_hmac_md5(key, data) |
| | | { |
| | | var bkey = str2binl(key); |
| | | if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); |
| | | var ipad = Array(16), opad = Array(16); |
| | | for(var i = 0; i < 16; i++) |
| | | { |
| | | ipad[i] = bkey[i] ^ 0x36363636; |
| | | opad[i] = bkey[i] ^ 0x5C5C5C5C; |
| | | } |
| | | var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); |
| | | return core_md5(opad.concat(hash), 512 + 128); |
| | | } |
| | | /* |
| | | * Add integers, wrapping at 2^32. This uses 16-bit operations internally |
| | | * to work around bugs in some JS interpreters. |
| | | */ |
| | | function safe_add(x, y) |
| | | { |
| | | var lsw = (x & 0xFFFF) + (y & 0xFFFF); |
| | | var msw = (x >> 16) + (y >> 16) + (lsw >> 16); |
| | | return (msw << 16) | (lsw & 0xFFFF); |
| | | } |
| | | /* |
| | | * Bitwise rotate a 32-bit number to the left. |
| | | */ |
| | | function bit_rol(num, cnt) |
| | | { |
| | | return (num << cnt) | (num >>> (32 - cnt)); |
| | | } |
| | | /* |
| | | * Convert a string to an array of little-endian words |
| | | * If chrsz is ASCII, characters >255 have their hi-byte silently ignored. |
| | | */ |
| | | function str2binl(str) |
| | | { |
| | | var bin = Array(); |
| | | var mask = (1 << chrsz) - 1; |
| | | for(var i = 0; i < str.length * chrsz; i += chrsz) |
| | | bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); |
| | | return bin; |
| | | } |
| | | /* |
| | | * Convert an array of little-endian words to a string |
| | | */ |
| | | function binl2str(bin) |
| | | { |
| | | var str = ""; |
| | | var mask = (1 << chrsz) - 1; |
| | | for(var i = 0; i < bin.length * 32; i += chrsz) |
| | | str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); |
| | | return str; |
| | | } |
| | | /* |
| | | * Convert an array of little-endian words to a hex string. |
| | | */ |
| | | function binl2hex(binarray) |
| | | { |
| | | var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; |
| | | var str = ""; |
| | | for(var i = 0; i < binarray.length * 4; i++) |
| | | { |
| | | str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + |
| | | hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); |
| | | } |
| | | return str; |
| | | } |
| | | /* |
| | | * Convert an array of little-endian words to a base-64 string |
| | | */ |
| | | function binl2b64(binarray) |
| | | { |
| | | var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
| | | var str = ""; |
| | | for(var i = 0; i < binarray.length * 4; i += 3) |
| | | { |
| | | var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) |
| | | | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) |
| | | | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); |
| | | for(var j = 0; j < 4; j++) |
| | | { |
| | | if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; |
| | | else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); |
| | | } |
| | | } |
| | | return str; |
| | | } |
| New file |
| | |
| | | var pageCurr; |
| | | var tableData; |
| | | var insTb2; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'util', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var util = layui.util; |
| | | |
| | | insTb2 = table.render({ |
| | | elem: '#userTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/user/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#userToolbar', |
| | | height: 'full-100', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | // ,{field: 'hostName', align: 'center',title: '授权商户', templet: '#hostTpl', width: 140} |
| | | // ,{field: 'nickname', align: 'center',title: '用户名'} |
| | | ,{field: 'username', align: 'center',title: '登录账户'} |
| | | ,{field: 'mobile', align: 'center',title: '手机号'} |
| | | // ,{field: 'deptName', align: 'center',title: '所属部门'} |
| | | ,{field: 'roleName', align: 'center',title: '角色'} |
| | | ,{field: 'email', align: 'center',title: '邮箱'} |
| | | // ,{field: 'sex$', align: 'center',title: '性别'} |
| | | ,{field: 'createTime$', align: 'center',title: '注册时间', hide: true} |
| | | ,{field: 'status$', align: 'center',title: '状态', templet: '#statusTpl', width: 120, unresize: true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:170} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | tableData = table.cache.userTable; |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | /* 表格2搜索 */ |
| | | form.on('submit(userTbSearch)', function (data) { |
| | | insTb2.reload({where: data.field, page: {curr: 1}}); |
| | | return false; |
| | | }); |
| | | |
| | | /* 表格2头工具栏点击事件 */ |
| | | table.on('toolbar(userTable)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | if (obj.event === 'add') { // 添加 |
| | | showEditModel() |
| | | } else if (obj.event === 'del') { // 删除 |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | } |
| | | }); |
| | | |
| | | // 修改状态 |
| | | form.on('switch(statusSwitch)', function (obj) { |
| | | var index = obj.othis.parents('tr').attr("data-index"); |
| | | var data = tableData[index]; |
| | | data[this.name] = obj.elem.checked?1:0; |
| | | http.post(baseUrl+"/user/edit/auth", {id: data.id, status: data[this.name]}, function (res) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | }) |
| | | }) |
| | | |
| | | /* 表格2工具条点击事件 */ |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 编辑 |
| | | case 'edit': |
| | | showEditModel(data) |
| | | break; |
| | | // 删除 |
| | | case 'del': |
| | | del([data.id]); |
| | | break; |
| | | // 重置密码 |
| | | case 'resetPwd': |
| | | admin.open({ |
| | | type: 1, |
| | | title: '重置密码', |
| | | offset: '150px', |
| | | area: ['360px'], |
| | | shade: 0.1, |
| | | shadeClose: true, |
| | | content: $("#resetpwd-window").html(), |
| | | success: function(layero, index){ |
| | | layer.iframeAuto(index); |
| | | $('#resetUserId').val(data.id); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 显示表单弹窗 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '用户', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | // 回显表单数据 |
| | | form.val('detail', mData); |
| | | // 表单提交事件 |
| | | form.on('submit(editSubmit)', function (data) { |
| | | if (isEmpty(data.field.roleId)) { |
| | | layer.msg('请选择角色', {icon: 2}); |
| | | return false; |
| | | } |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/user/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /* 删除订单 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/user/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 重置密码 |
| | | form.on('submit(savePwd)', function (data) { |
| | | $.ajax({ |
| | | url: baseUrl+"/user/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | id: data.field.resetUserId, |
| | | password: hex_md5(data.field.resetPassword) |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | layer.msg("重置密码成功", {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }) |
| | | |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | } |
| | | |
| New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#userLogin', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/userLogin/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'userUsername', align: 'center',title: '员工',event: 'User', style: 'text-decoration: underline;cursor:pointer'} |
| | | ,{field: 'token', align: 'center',title: '凭证值'} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(userLogin)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(userLogin)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'userLogin_detail.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | break; |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | var ids=[]; |
| | | data.map(function (track) { |
| | | ids.push(track.id); |
| | | }); |
| | | if (ids.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(ids.length===1?'此':ids.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/userLogin/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function() { |
| | | var titles = []; |
| | | var fields = []; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'userLogin': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/userLogin/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles, res.data, 'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(userLogin)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'userLogin_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'userLogin_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | case 'User': |
| | | var param = top.reObject(data).userId; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailHeight, top.detailWidth], |
| | | shadeClose: false, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | id: $('#id').val(), |
| | | userId: $('#userId').val(), |
| | | token: $('#token').val(), |
| | | createTime: top.strToDate($('#createTime\\$').val()), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/userLogin/edit/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | tableReload(true); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data) { |
| | | for (var val in data) { |
| | | el.find(":input[id='" + val + "']").val(data[val]); |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | } |
| | | layer.style(index, { |
| | | top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | $(".layui-layer-shade").remove(); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |